<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Interledger Community 🌱: Project Insulate</title>
    <description>The latest articles on The Interledger Community 🌱 by Project Insulate (@projectinsulate).</description>
    <link>https://community.interledger.org/projectinsulate</link>
    <image>
      <url>https://community.interledger.org/images/wT_-bvAeOAk4M7LZbSxHxO0M7ad6LKndfTZzep2C1lM/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkuaW50ZXJs/ZWRnZXIub3JnL3Jl/bW90ZWltYWdlcy91/cGxvYWRzL29yZ2Fu/aXphdGlvbi9wcm9m/aWxlX2ltYWdlLzc4/LzM0NzFlMWI0LTE1/ODQtNDI3Zi05Mjlj/LTI3NmZjNjM5MGIz/Ni5wbmc</url>
      <title>The Interledger Community 🌱: Project Insulate</title>
      <link>https://community.interledger.org/projectinsulate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.interledger.org/feed/projectinsulate"/>
    <language>en</language>
    <item>
      <title>Project Insulate — Grant Report #1 (Final)</title>
      <dc:creator>Abhinav Chawla</dc:creator>
      <pubDate>Tue, 02 Mar 2021 04:19:25 +0000</pubDate>
      <link>https://community.interledger.org/projectinsulate/project-insulate-grant-report-1-final-4hji</link>
      <guid>https://community.interledger.org/projectinsulate/project-insulate-grant-report-1-final-4hji</guid>
      <description>&lt;p&gt;&lt;a href="https://community.webmonetization.org/images/WvbwiarSe37tVMstVGCOECmX5BvxdxH0EJ-tP-fC6EE/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9SNTdi/VU1rLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.webmonetization.org/images/WvbwiarSe37tVMstVGCOECmX5BvxdxH0EJ-tP-fC6EE/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9SNTdi/VU1rLnBuZw" alt="main image" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Update
&lt;/h2&gt;

&lt;p&gt;I can proudly say that the Project Insulate work has been completed. I have documented it deeply in my &lt;a href="https://community.webmonetization.org/projectinsulate/so-why-project-insulate-16d2"&gt;3-part series&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Progress on objectives
&lt;/h2&gt;

&lt;p&gt;The Chrome Extension is available at &lt;a href="https://chrome.google.com/webstore/detail/project-insulate/cjadajociaammcjggipgndckjbjadnig"&gt;Chrome Web Store&lt;/a&gt;&lt;br&gt;
Source Code: &lt;a href="https://github.com/project-insulate/insulate-extension"&gt;Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The backend is deployed at &lt;a href="https://project-insulate.herokuapp.com"&gt;Heroku&lt;/a&gt;&lt;br&gt;
Source Code: &lt;a href="https://github.com/project-insulate/insulate-api"&gt;Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The source code is overall packed in the &lt;a href="https://github.com/project-insulate"&gt;project-insulate&lt;/a&gt; organization&lt;/p&gt;

&lt;h2&gt;
  
  
  Key activities
&lt;/h2&gt;

&lt;p&gt;At the core, I wanted to build an architectural solution to solve the issue of protecting data fetched from a backend server - insulating the data, hence Project Insulate. This involved various different steps including:&lt;/p&gt;

&lt;p&gt;Step 1: Coming up with an architectural overview and a wireframe. This was probably the hardest part since it involved coming up with a solution to not only protect the data, but also the identity of the user. I explained this step in detail &lt;a href="https://community.webmonetization.org/projectinsulate/how-does-it-work-bin"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Step 2: Getting access for Coil SSO and establish Coil OAuth to log in users. &lt;/p&gt;

&lt;p&gt;Step 3: Build the Chrome extension which end users can use to complement the current Coil extension.&lt;/p&gt;

&lt;p&gt;Step 4: Develop the backend server for Project Insulate which the provider can connect to verify users on their website before providing protected data. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.webmonetization.org/projectinsulate/let-s-see-it-working-21c2"&gt;This blog&lt;/a&gt; shows the final product, and how it works! &lt;/p&gt;

&lt;h2&gt;
  
  
  Communications and marketing
&lt;/h2&gt;

&lt;p&gt;I have shared the work with my friends and shared the web monetization technology with colleagues. I didn't include marketing in my budget. &lt;/p&gt;

&lt;h2&gt;
  
  
  What’s next?
&lt;/h2&gt;

&lt;p&gt;I aim the process could be eventually integrated with &lt;a href="http://coil.com/"&gt;Coil&lt;/a&gt; extension itself. It wouldn't be feasible in the long run for encouraging people to install two extensions, so I wanted this project to serve as a working prototype of how such integration could work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What community support would benefit your project?
&lt;/h2&gt;

&lt;p&gt;I would love to see what the community feels about the project and work on it. It would be great if it could be shared further in the web monetization community. It would also be interesting to learn other developers' feedback on alternate ways to resolve the issue of protecting data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional comments
&lt;/h2&gt;

&lt;p&gt;It was a great experience to present my project and be a part of this growing web standard and community. Always looking forward to talking with like-minded people, so if any one has any concerns or just wants to say hi, feel free to reach out :)&lt;/p&gt;

&lt;p&gt;Lastly, thanks to the Grant for the Web initiative for letting me an active participant. &lt;/p&gt;

</description>
      <category>grantreports</category>
    </item>
    <item>
      <title>Let's see it working!</title>
      <dc:creator>Abhinav Chawla</dc:creator>
      <pubDate>Tue, 16 Feb 2021 19:25:36 +0000</pubDate>
      <link>https://community.interledger.org/projectinsulate/let-s-see-it-working-21c2</link>
      <guid>https://community.interledger.org/projectinsulate/let-s-see-it-working-21c2</guid>
      <description>&lt;p&gt;Firstly, an apology. This blog demonstrating the demo was supposed to be published a month or so ago, but things just kept getting delayed. Nonetheless, here were are!&lt;/p&gt;

&lt;p&gt;As looking into the architectural diagrams in the previous &lt;a href="https://community.webmonetization.org/projectinsulate/how-does-it-work-bin"&gt;post&lt;/a&gt;, let's divide the usage by three different personas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provider - Someone who is providing protected content&lt;/li&gt;
&lt;li&gt;User - Consumer of the content via a Browser&lt;/li&gt;
&lt;li&gt;Insulate - The core of this project managing the flow&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's break it into smaller segments to show different steps involved with the project and which user persona it targetted to. &lt;/p&gt;

&lt;h3&gt;
  
  
  Step A: Provider - Register with Insulate
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--request&lt;/span&gt; POST &lt;span class="s1"&gt;'https://project-insulate.herokuapp.com/api/provider'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nt"&gt;--data-urlencode&lt;/span&gt; &lt;span class="s1"&gt;'email=changeme@test.com'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Running this command will give a &lt;code&gt;client_id&lt;/code&gt; and a &lt;code&gt;client_secret&lt;/code&gt; which should be stored by the provider. &lt;code&gt;client_id&lt;/code&gt; is a public value, but &lt;code&gt;client_secret&lt;/code&gt; should be, well, kept as a secret!&lt;/p&gt;
&lt;h3&gt;
  
  
  Step B: Provider - Update meta tags on their website
&lt;/h3&gt;

&lt;p&gt;On the UI side, ensure that you have the following two &lt;code&gt;meta&lt;/code&gt; tags:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;monetization&lt;/code&gt;: Put your wallet pointer id&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;insulate-id&lt;/code&gt;: Put the &lt;code&gt;client_id&lt;/code&gt; collected in Step A&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's a &lt;a href="https://github.com/project-insulate/insulate-extension/blob/master/demo.html"&gt;demo file&lt;/a&gt;, and would like like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"monetization"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"$ilp.uphold.com/H3NqAwkm9g3W"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"insulate-id"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"16ebdcd5b3067e95fe7146e5b15052dd27618615fb2296b5"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We will come back to make a minor update to this file but in a later step.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step C: User - Install the extension
&lt;/h3&gt;

&lt;p&gt;The user (on a Chrome browser) needs to have the Project Insulate extension installed. It is available on &lt;a href="https://chrome.google.com/webstore/detail/project-insulate/cjadajociaammcjggipgndckjbjadnig"&gt;Chrome Web Store&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once the user installs it, it needs to sign in with Coil. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.interledger.org/images/fQ5T1VUsW1-X82YBRGj4YT_AOC6Vqf6-n5PIpTc9D9o/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9IMjI1/MTFsLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.interledger.org/images/fQ5T1VUsW1-X82YBRGj4YT_AOC6Vqf6-n5PIpTc9D9o/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9IMjI1/MTFsLnBuZw" alt="sign in with coil" width="525" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's it for the user! Quick and easy, hopefully, something like this can be directly integrated into the Coil extension itself.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step D: Provider - Verify the user view
&lt;/h3&gt;

&lt;p&gt;If your website has both a valid &lt;code&gt;monetization&lt;/code&gt; and &lt;code&gt;insulate-id&lt;/code&gt;, the extension will automatically talk to the Insulate backend, so some maaagiiiccc (details in the previous techie post), and return an &lt;code&gt;insulateTransactionId&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.interledger.org/images/M1XkLpP8k-MMCGzBN_puPlv0rMqcWgPTTamj7McIkGA/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS82YmFI/dVVjLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.interledger.org/images/M1XkLpP8k-MMCGzBN_puPlv0rMqcWgPTTamj7McIkGA/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS82YmFI/dVVjLnBuZw" alt="insulateTransactionId" width="880" height="352"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The provider needs to capture this &lt;code&gt;insulateTransactionId&lt;/code&gt;, and send it back to its backend where it can be verified. &lt;br&gt;
Let's go back to the HTML file and add a listener:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// We only accept messages from ourselves&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;source&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;insulateTransactionId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;transactionId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="c1"&gt;// *** Make call to backend (provider) and send transactionId *** &lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Again, the &lt;a href="https://github.com/project-insulate/insulate-extension/blob/master/demo.html"&gt;demo file&lt;/a&gt; has the above as an example.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step E: Provider - Validate the insulateTransactionId
&lt;/h3&gt;

&lt;p&gt;Now, once the UI gets the &lt;code&gt;insulateTransactionId&lt;/code&gt;, it can be passed to the backend, which can use the &lt;code&gt;client_secret&lt;/code&gt; received in Step A to confirm with Insulate about its validity.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--request&lt;/span&gt; POST &lt;span class="s1"&gt;'https://project-insulate.herokuapp.com/api/block/verify'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--data-raw&lt;/span&gt; &lt;span class="s1"&gt;'{
    "paymentPointer": "$ilp.uphold.com/H3NqAwkm9g3W",
    "clientSecret": "10cc6c3ea96bb3ab525c61af71dfa1e58d11159cfd5de3d6",
    "transactionId": "c3798dce-4893-497e-8b80-f48a52896eda"
}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here ensure the &lt;code&gt;paymentPointer&lt;/code&gt; matches the one on your website and pass in the &lt;code&gt;insulateTransactionId&lt;/code&gt; as the &lt;code&gt;transactionId&lt;/code&gt; in the POST call. &lt;/p&gt;

&lt;p&gt;Insulate backend will return you the following fields:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;recordFound&lt;/code&gt;: If the record with the provided transactionId was registered within last 5 minutes, it will return &lt;code&gt;true&lt;/code&gt;, else &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;visitedBefore&lt;/code&gt;: If (1) is &lt;code&gt;true&lt;/code&gt;, this will return &lt;code&gt;true&lt;/code&gt; if a previous call was made to check its validity.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;oldRecordExisted&lt;/code&gt;: If (1) is &lt;code&gt;false&lt;/code&gt;, this will return &lt;code&gt;true&lt;/code&gt; if the record ever existed before.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Step F: Provider - Return the protected content
&lt;/h3&gt;

&lt;p&gt;Depending on the values returned in Step E, the provider can release its protected content and share it back with the user now safely, and get paid via the Coil extension as it would before. &lt;/p&gt;



&lt;p&gt;&lt;em&gt;Voila!&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;There's more information available on the GitHub Repos:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/project-insulate"&gt;
        project-insulate
      &lt;/a&gt; / &lt;a href="https://github.com/project-insulate/insulate-extension"&gt;
        insulate-extension
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Project Insulate Chrome Extension&lt;/h1&gt;
&lt;p&gt;Project Insulate aims to protect an API call used by a provider to send data when dependent on Web Monetization. Currently, the only way to fetch data is to keep the endpoint public if no paid-user login is present on the UI. Also, this project ensures no user PPI is shared with the provider to maintain the privacy component of the Web Monetization technology.&lt;/p&gt;
&lt;h3&gt;
Follow project at: &lt;a href="https://community.webmonetization.org/projectinsulate" rel="nofollow"&gt;Web Monetization Community: Project Insulate&lt;/a&gt;
&lt;/h3&gt;
&lt;h3&gt;
Published at &lt;a href="https://chrome.google.com/webstore/detail/project-insulate/cjadajociaammcjggipgndckjbjadnig" rel="nofollow"&gt;Chrome Web Store&lt;/a&gt;
&lt;/h3&gt;
&lt;h2&gt;
How does it work?&lt;/h2&gt;
&lt;h3&gt;
Case 1: Provider (any one providing data and trying to secure API call)&lt;/h3&gt;
&lt;p&gt;Firstly, you would need to register with Project Insulate using the instructions given in &lt;a href="https://github.com/project-insulate/insulate-api"&gt;API README&lt;/a&gt; to get a &lt;code&gt;clientId&lt;/code&gt; and &lt;code&gt;clientSecret&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Once register, as you can see in the &lt;a href="https://github.com/project-insulate/insulate-extension/blob/master/demo.html"&gt;demo.html page&lt;/a&gt;, provider needs to add a &lt;code&gt;meta&lt;/code&gt; tag with name as &lt;code&gt;insulate-id&lt;/code&gt; and value being the &lt;code&gt;clientId&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Everytime…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/project-insulate/insulate-extension"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;




&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/project-insulate"&gt;
        project-insulate
      &lt;/a&gt; / &lt;a href="https://github.com/project-insulate/insulate-api"&gt;
        insulate-api
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      This repository will serve as the backend for Grant for the Web (GftW) project: Project Insulate
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Project Insulate API&lt;/h1&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/cc96d7d28a6ca21ddbb1f2521d751d375230ed840271e6a4c8694cf87cc60c14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e6f64652e6a732532302d2532333433383533442e7376673f267374796c653d666f722d7468652d6261646765266c6f676f3d6e6f64652e6a73266c6f676f436f6c6f723d7768697465"&gt;&lt;img src="https://camo.githubusercontent.com/cc96d7d28a6ca21ddbb1f2521d751d375230ed840271e6a4c8694cf87cc60c14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e6f64652e6a732532302d2532333433383533442e7376673f267374796c653d666f722d7468652d6261646765266c6f676f3d6e6f64652e6a73266c6f676f436f6c6f723d7768697465"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/b38bbb1cba49a754ade66ca1ca45541ed07ab31a3b01166157f513b44fb35f70/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6f6e676f44422d2532333465613934622e7376673f267374796c653d666f722d7468652d6261646765266c6f676f3d6d6f6e676f6462266c6f676f436f6c6f723d7768697465"&gt;&lt;img src="https://camo.githubusercontent.com/b38bbb1cba49a754ade66ca1ca45541ed07ab31a3b01166157f513b44fb35f70/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6f6e676f44422d2532333465613934622e7376673f267374796c653d666f722d7468652d6261646765266c6f676f3d6d6f6e676f6462266c6f676f436f6c6f723d7768697465"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Project Insulate aims to protect an API call used by a provider to send data when dependent on Web Monetization. Currently, the only way to fetch data is to keep the endpoint public if no paid-user login is present on the UI. Also, this project ensures no user PPI is shared with the provider to maintain the privacy component of the Web Monetization technology.&lt;/p&gt;
&lt;h2&gt;
Deployment&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://project-insulate.herokuapp.com/" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/865b9493c6eccbcaedacf295b96adb9acd97e7088bdc982d8d225f3581bb4582/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6865726f6b752532302d2532333433303039382e7376673f267374796c653d666f722d7468652d6261646765266c6f676f3d6865726f6b75266c6f676f436f6c6f723d7768697465"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Heroku pipeline is set to auto deploy &lt;code&gt;master&lt;/code&gt; branch currently.&lt;/p&gt;
&lt;h2&gt;
Main functionality for Providers&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Registration&lt;/strong&gt;: This will return you &lt;code&gt;client_id&lt;/code&gt; and &lt;code&gt;client_secret&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;curl --request POST 'https://project-insulate.herokuapp.com/api/provider' \
    --data-urlencode 'email=hello@test.com'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ol start="2"&gt;
&lt;li&gt;
&lt;strong&gt;Verify transaction&lt;/strong&gt;: This will return you if the transaction was successfully added in last 5 minutes, if so, has it been used (by any previous verification call).&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;curl --request POST 'https://project-insulate.herokuapp.com/api/block/verify' \
--header 'Content-Type: application/json' \
--data-raw '{
    "paymentPointer": "$ilp.uphold.com/H3NqAwkm9g3W",
    "clientSecret": "10cc6c3ea96bb3ab525c61af71dfa1e58d11159cfd5de3d6",
    "transactionId": "c3798dce-4893-497e-8b80-f48a52896eda"
}'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
API Documentation&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://documenter.getpostman.com/view/1085264/TVmS6uzb" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/2ebca10aa314ab2270d22f81347ad13c1c1ec6ee5c762bb5008a7d79644718e9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d504f53544d414e2d6f72616e67653f267374796c653d666f722d7468652d6261646765266c6f676f3d706f73746d616e266c6f676f436f6c6f723d7768697465"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Architectural Diagram&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Current system&lt;/strong&gt;…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/project-insulate/insulate-api"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Feel free to ping me if you have any doubts or suggestions to make the documentation, code, or series overall better. Cheers!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How Does It Work?</title>
      <dc:creator>Abhinav Chawla</dc:creator>
      <pubDate>Tue, 15 Dec 2020 17:46:01 +0000</pubDate>
      <link>https://community.interledger.org/projectinsulate/how-does-it-work-bin</link>
      <guid>https://community.interledger.org/projectinsulate/how-does-it-work-bin</guid>
      <description>&lt;p&gt;&lt;em&gt;FYI: This article is a bit heavy on the technical solution and architectural side explaining the inner workings of the solution&lt;/em&gt; 🤓 . &lt;em&gt;I promise the next article would be more user friendly with a demo.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this post, I would like to describe the architectural flow of the solution I came up with to resolve the problem discussed &lt;a href="https://community.webmonetization.org/projectinsulate/so-why-project-insulate-16d2"&gt;before&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Base Setup
&lt;/h3&gt;

&lt;p&gt;Let's start by looking at the flow chart below (higher quality available &lt;a href="https://i.imgur.com/6vLFYrv.png"&gt;here&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.interledger.org/images/MIHQngYHpM-19Lbd-5oyw1oc9Bh4G4vETftfxmQ257k/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS82dkxG/WXJ2LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.interledger.org/images/MIHQngYHpM-19Lbd-5oyw1oc9Bh4G4vETftfxmQ257k/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS82dkxG/WXJ2LnBuZw" alt="base workflow" width="880" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I built a Chrome extension that will allow a Sign-in with Coil, providing Project Insulate the credential access without releasing any personal identification information (PII). It also creates a user on the Insulate platform using a custom identifiable token on Firebase and keeps the user logged in the extension. Also, the provider (the one providing exclusive data) can easily register with Insulate with an email address to receive a &lt;code&gt;clientId&lt;/code&gt; and corresponding &lt;code&gt;clientSecret&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Main Flow
&lt;/h3&gt;

&lt;p&gt;This section delves deeper into how Insulate helps a provider verify the open unprotected call. The short description would be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When a user opens a webpage, the Insulate Chrome Extension will automatically update the Insulate backend which in turn will verify an active subscription on the Coil account at that very moment. When the webpage makes the &lt;em&gt;open&lt;/em&gt; call to the provider's backend to fetch data, the provider can now check-in with the Insulate backend to verify whether to allow access to the user or not.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The image below (higher quality available &lt;a href="https://i.imgur.com/APNrila.png"&gt;here&lt;/a&gt;) shows the step-by-step calls made to achieve this.&lt;br&gt;
&lt;a href="https://community.interledger.org/images/un55YOsgXt-qIA50-edYN4JKsKprHhawEC8GSMzMEZQ/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9BUE5y/aWxhLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.interledger.org/images/un55YOsgXt-qIA50-edYN4JKsKprHhawEC8GSMzMEZQ/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9BUE5y/aWxhLnBuZw" alt="full workflow" width="880" height="679"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking at the diagram, you will notice that the Insulate extension will look for two particular tags on every webpage: &lt;code&gt;monetization&lt;/code&gt; and &lt;code&gt;insulateId&lt;/code&gt;. The provider needs to add the &lt;code&gt;clientId&lt;/code&gt; they received in the base setup step as the &lt;code&gt;insulateId&lt;/code&gt; meta tag on their webpage. If both the meta tags are found, the extension automatically sends a request to the Insulate backend (protected by Firebase user credentials) which indeed verifies the subscription on the Coil account for the user. &lt;/p&gt;

&lt;p&gt;If valid, it creates and stores a &lt;em&gt;block&lt;/em&gt; by hashing &lt;code&gt;paymentPointer&lt;/code&gt; (passed from the &lt;code&gt;monetization&lt;/code&gt; meta tag), &lt;code&gt;clientSecret&lt;/code&gt; (extracted using &lt;code&gt;clientId&lt;/code&gt;) and a uniquely created &lt;code&gt;transactionId&lt;/code&gt;. This &lt;code&gt;transactionId&lt;/code&gt; is passed on to the Chrome extension which then forwards it to the webpage via &lt;code&gt;insulateTransactionId&lt;/code&gt; event which can be fetched by the webpage as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;insulateTransactionId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;transactionId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;insulateIdElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;transactionId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="c1"&gt;// *** TODO: Make call to backend (provider) and send transactionId *** &lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The provider can now use this &lt;code&gt;transactionId&lt;/code&gt; to be sent to its backend, which in-turn can verify the validity of this transaction by passing in the &lt;code&gt;transactionId&lt;/code&gt;, &lt;code&gt;paymentPointer&lt;/code&gt; used on the webpage, and the &lt;code&gt;clientSecret&lt;/code&gt; received in the base setup.&lt;/p&gt;

&lt;p&gt;The Insulate backend will double-check by recreating the hash, and check if this block was created within the past 5 minutes. If so, it will return positively and mark the block used. If a second call is made within 5 minutes, it will let the provider know that the block exists but has already been used once. &lt;/p&gt;

&lt;p&gt;Using this information, providers can be sure whether to provide the access to the exclusive content or not, while not requiring a user to sign in on their website and still being able to protect the data 💃 💃&lt;/p&gt;

&lt;p&gt;I'll be posting a final post of the series in the coming days showcasing the project with a working demo. &lt;/p&gt;

</description>
      <category>webmonetization</category>
      <category>coil</category>
      <category>how</category>
    </item>
    <item>
      <title>So, Why Project Insulate?</title>
      <dc:creator>Abhinav Chawla</dc:creator>
      <pubDate>Wed, 09 Dec 2020 18:55:23 +0000</pubDate>
      <link>https://community.interledger.org/projectinsulate/so-why-project-insulate-16d2</link>
      <guid>https://community.interledger.org/projectinsulate/so-why-project-insulate-16d2</guid>
      <description>&lt;p&gt;To look into why I started building out Project Insulate, let's first quickly try to understand the current standing of the &lt;a href="https://webmonetization.org/docs/api"&gt;Web Monetization JS API&lt;/a&gt;. Let's take the official &lt;a href="https://webmonetization.org/docs/exclusive-content"&gt;example&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;monetization&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;monetization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;monetizationstart&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Remove/Hide DOM element using JS/CSS&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Imagine a photographer trying to provide exclusive photographs &lt;em&gt;(provider)&lt;/em&gt; to the users paying through a Web Monetization based subscription (for us, Coil). With the current system, he fetches the data through an &lt;strong&gt;open API&lt;/strong&gt; and then hides it on the frontend using JavaScript or CSS. &lt;/p&gt;

&lt;p&gt;While this might seem fine to a few people, developers know how easily the open API call can be figured out (bless developer consoles 😇). To resolve this, we primarily see two options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log-in to the website&lt;/strong&gt;: Well, the whole point of web monetization is to stray away from individual logins, and hence subscriptions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSO via Coil&lt;/strong&gt;: This can technically resolve the problem of protecting the endpoint but poses two big challenges. Firstly, a user will still need to log in with Coil on every website he or she visits. Secondly, more importantly, the provider will have access to the user's Coil account and thus to the user's email address, if approved (but since email is trivial, most users can readily allow it). This defeats the purpose of restoring privacy when paying through Coil.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://community.interledger.org/images/x3V5BHfqNP5xIspa-p9HKioNqjY4Kgd-4Hrw8M923vM/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9aSlpm/eHdlLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.interledger.org/images/x3V5BHfqNP5xIspa-p9HKioNqjY4Kgd-4Hrw8M923vM/w:880/mb:500000/ar:1/aHR0cHM6Ly9pLmlt/Z3VyLmNvbS9aSlpm/eHdlLnBuZw" alt="Current System" width="880" height="716"&gt;&lt;/a&gt;&lt;br&gt;
The above diagram explains the current workflow. The red arrow shows the unprotected open API call made to the backend which can be leveraged by anyone, with or without an active monetization subscription.&lt;/p&gt;

&lt;p&gt;To resolve this issue, I decided to build a workflow that enables providers to secure their exclusive data without requesting users to sign into their websites. How? I'll explain that in the next blog.&lt;/p&gt;

</description>
      <category>webmonetization</category>
      <category>coil</category>
      <category>why</category>
    </item>
  </channel>
</rss>
