<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Garvit Khatri</title>
        <link>https://paragraph.com/@garvit-khatri</link>
        <description>Web3 and coffee enthusiast.</description>
        <lastBuildDate>Sat, 11 Apr 2026 23:00:50 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Garvit Khatri</title>
            <url>https://storage.googleapis.com/papyrus_images/ce8953bb237e27fc0ae9e6931742fb77d87dd57cb9127f2c4d29fb61b21b1c6f.jpg</url>
            <link>https://paragraph.com/@garvit-khatri</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[My mirror address stolen]]></title>
            <link>https://paragraph.com/@garvit-khatri/my-mirror-address-stolen</link>
            <guid>HOygNe2j9YeiNrujyf07</guid>
            <pubDate>Fri, 18 Nov 2022 08:37:39 GMT</pubDate>
            <description><![CDATA[Hey Everyone, My this mirror address has been compromised, though you can still read all my previously written blogs here. https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db Since I still had my ENS and they were not compromised, I have created this new blog where I will be writing my future blogs. https://mirror.xyz/plusminushalf.eth Thank you to everyone who subscribed to the mirror, it will super helpful if you could subscribe again here, apologies for the inconvenience but ther...]]></description>
            <content:encoded><![CDATA[<p>Hey Everyone,</p><p>My this mirror address has been compromised, though you can still read all my previously written blogs here.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db">https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db</a></p><p>Since I still had my ENS and they were not compromised, I have created this new blog where I will be writing my future blogs.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/plusminushalf.eth">https://mirror.xyz/plusminushalf.eth</a></p><p>Thank you to everyone who subscribed to the mirror, it will super helpful if you could subscribe again here, apologies for the inconvenience but there is no way to change ownership of my previous mirror account :(</p><p>I am waiting for the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-3074">EIP-3074</a> or some variant of it that will allow me to deploy an SCW at this address and get my blog back. If you want to know more about how can that be done, read my previous blog</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db/r_4LxC3wuyliCPERSoAcSyLfKA0Y9oZzvr1L_j9s1Tk">https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db/r_4LxC3wuyliCPERSoAcSyLfKA0Y9oZzvr1L_j9s1Tk</a></p><hr><p>Banner credits: Photo by <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://unsplash.com/@mishalibrahim?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mishal Ibrahim</a> on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://unsplash.com/s/photos/lost?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/34759510b12e1deb73743f661cb1d842fcac8a7d553d57dd91c6923b0b3d48ea.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[How to store private keys securely in local storage?]]></title>
            <link>https://paragraph.com/@garvit-khatri/how-to-store-private-keys-securely-in-local-storage</link>
            <guid>bktRppAMEGBdXWabbm1t</guid>
            <pubDate>Mon, 14 Nov 2022 08:36:50 GMT</pubDate>
            <description><![CDATA[I recently started working on a chrome-extension wallet compatible with 4337, you can read more about it here. One of the challenges in creating a wallet is how to store private keys securely in the local storage of the browser. In this blog, I will be exploring how Metamask & Tally-ho wallet stores their private keys. I hope you and I both will learn during this exploration. If we want the data to be encrypted with a password & then stored, the best standard to use is AES-FCM. The crypto API...]]></description>
            <content:encoded><![CDATA[<p>I recently started working on a chrome-extension wallet compatible with 4337, you can read more about it <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/plusminushalf.eth/btUxNscEudcQGBWM11M9Cg4M9D7d5ce90_h0uOvsZOs">here</a>. One of the challenges in creating a wallet is how to store private keys securely in the local storage of the browser.</p><p>In this blog, I will be exploring how Metamask &amp; Tally-ho wallet stores their private keys. I hope you and I both will learn during this exploration.</p><p>If we want the data to be encrypted with a password &amp; then stored, the best standard to use is <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt#aes-gcm">AES-FCM</a>. The crypto API provided by the browsers support this by default.</p><p>To encrypt a message using <code>AES-FCM</code> we need two things, a <code>key</code> which will be used to encrypt the messages and an <code>initializationVector</code> to add randomness.</p><h2 id="h-how-to-create-a-key" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">How to create a key?</h2><p>We can use crypto API <code>importkey</code> to generate our master key and then derive the key to encrypt messages for <code>AES-GCM</code> from the master key using <code>deriveKey</code> function. While creating the key we will also generate random bytes <code>salt</code>, the salt must be saved and is needed along with the <code>password</code> to recover the key. Below is the code which generates a new Key if the salt is not passed &amp; recovers the key if the salt is passed.</p><pre data-type="codeBlock" text="type SaltedKey = {
  salt: string
  key: CryptoKey
}

async function generateSalt(): Promise&lt;string&gt; {
  const saltBuffer = crypto.getRandomValues(new Uint8Array(64))
  return bufferToBase64(saltBuffer)
}

async function generateOrRecoverKey(
  password: string,
  existingSalt?: string
): Promise&lt;SaltedKey&gt; {
  const { crypto } = global;

  const salt = existingSalt || (await generateSalt())

  const encoder = new TextEncoder();

  const derivationKey = await crypto.subtle.importKey(
    &quot;raw&quot;,
    encoder.encode(password),
    { name: &quot;PBKDF2&quot; },
    false,
    [&quot;deriveKey&quot;]
  )

  const key = await crypto.subtle.deriveKey(
    {
      name: &quot;PBKDF2&quot;,
      salt: encoder.encode(salt),
      iterations: 1000000,
      hash: &quot;SHA-256&quot;,
    },
    derivationKey,
    { name: &quot;AES-GCM&quot;, length: 256 },
    false,
    [&quot;encrypt&quot;, &quot;decrypt&quot;]
  )

  return {
    key,
    salt,
  }
}
"><code><span class="hljs-keyword">type</span> SaltedKey <span class="hljs-operator">=</span> {
  <span class="hljs-built_in">salt</span>: <span class="hljs-keyword">string</span>
  key: CryptoKey
}

async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">generateSalt</span>(<span class="hljs-params"></span>): <span class="hljs-title">Promise</span>&#x3C;<span class="hljs-title"><span class="hljs-keyword">string</span></span>> </span>{
  const saltBuffer <span class="hljs-operator">=</span> crypto.getRandomValues(<span class="hljs-keyword">new</span> Uint8Array(<span class="hljs-number">64</span>))
  <span class="hljs-keyword">return</span> bufferToBase64(saltBuffer)
}

async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">generateOrRecoverKey</span>(<span class="hljs-params">
  password: <span class="hljs-keyword">string</span>,
  existingSalt?: <span class="hljs-keyword">string</span>
</span>): <span class="hljs-title">Promise</span>&#x3C;<span class="hljs-title">SaltedKey</span>> </span>{
  const { crypto } <span class="hljs-operator">=</span> <span class="hljs-keyword">global</span>;

  const salt <span class="hljs-operator">=</span> existingSalt <span class="hljs-operator">|</span><span class="hljs-operator">|</span> (await generateSalt())

  const encoder <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> TextEncoder();

  const derivationKey <span class="hljs-operator">=</span> await crypto.subtle.importKey(
    <span class="hljs-string">"raw"</span>,
    encoder.encode(password),
    { name: <span class="hljs-string">"PBKDF2"</span> },
    <span class="hljs-literal">false</span>,
    [<span class="hljs-string">"deriveKey"</span>]
  )

  const key <span class="hljs-operator">=</span> await crypto.subtle.deriveKey(
    {
      name: <span class="hljs-string">"PBKDF2"</span>,
      <span class="hljs-built_in">salt</span>: encoder.encode(salt),
      iterations: <span class="hljs-number">1000000</span>,
      hash: <span class="hljs-string">"SHA-256"</span>,
    },
    derivationKey,
    { name: <span class="hljs-string">"AES-GCM"</span>, length: <span class="hljs-number">256</span> },
    <span class="hljs-literal">false</span>,
    [<span class="hljs-string">"encrypt"</span>, <span class="hljs-string">"decrypt"</span>]
  )

  <span class="hljs-keyword">return</span> {
    key,
    salt,
  }
}
</code></pre><h2 id="h-how-to-create-an-initialization-vector" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">How to create an initialization vector?</h2><p>To create our <code>initializationVector</code> we can use the <code>crypto</code> API provided by the browsers.</p><pre data-type="codeBlock" text="const initializationVector = crypto.getRandomValues(new Uint8Array(16))
"><code>const initializationVector <span class="hljs-operator">=</span> crypto.getRandomValues(<span class="hljs-keyword">new</span> Uint8Array(<span class="hljs-number">16</span>))
</code></pre><h2 id="h-encrypting-text" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Encrypting text</h2><p>Now we have generated the <code>key</code> &amp; also <code>initializationVector</code>. We are ready to encrypt our messages. Before encrypting our message, we must encode it using<code> TextEncoder</code>. It takes in the string &amp; emits a stream of UTF-8 bytes.</p><pre data-type="codeBlock" text="type EncryptedVault = {
    salt: string
    initializationVector: string
    cipherText: string
}

async function encryptMessage(
    message: string,
    password: string
): Promise&lt;Vault&gt; {
  const encoder = new TextEncoder()
  const encodedPlaintext = encoder.encode(message)

  const { key, salt } = await generateOrRecoverKey(password)
  const initializationVector = crypto.getRandomValues(
      new Uint8Array(16)
  )

  const cipherText = await crypto.subtle.encrypt(
    { name: &quot;AES-GCM&quot;, iv: initializationVector },
    key,
    encodedPlaintext
  )
  
  return {
    salt,
    initializationVector: bufferToBase64(initializationVector),
    cipherText: bufferToBase64(cipherText),
  }
}
"><code><span class="hljs-keyword">type</span> EncryptedVault <span class="hljs-operator">=</span> {
    <span class="hljs-built_in">salt</span>: <span class="hljs-keyword">string</span>
    initializationVector: <span class="hljs-keyword">string</span>
    cipherText: <span class="hljs-keyword">string</span>
}

async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">encryptMessage</span>(<span class="hljs-params">
    message: <span class="hljs-keyword">string</span>,
    password: <span class="hljs-keyword">string</span>
</span>): <span class="hljs-title">Promise</span>&#x3C;<span class="hljs-title">Vault</span>> </span>{
  const encoder <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> TextEncoder()
  const encodedPlaintext <span class="hljs-operator">=</span> encoder.encode(message)

  const { key, salt } <span class="hljs-operator">=</span> await generateOrRecoverKey(password)
  const initializationVector <span class="hljs-operator">=</span> crypto.getRandomValues(
      <span class="hljs-keyword">new</span> Uint8Array(<span class="hljs-number">16</span>)
  )

  const cipherText <span class="hljs-operator">=</span> await crypto.subtle.encrypt(
    { name: <span class="hljs-string">"AES-GCM"</span>, iv: initializationVector },
    key,
    encodedPlaintext
  )
  
  <span class="hljs-keyword">return</span> {
    salt,
    initializationVector: bufferToBase64(initializationVector),
    cipherText: bufferToBase64(cipherText),
  }
}
</code></pre><p>When we call the above function, <code>encryptMessage</code>, we get three things in return <code>salt</code>, <code>initializationVector</code>, <code>cipherText</code>. We can store all these three values in the browser&apos;s <code>localStorage</code>. These values along with the user&apos;s <code>password</code> can be used to decrypt the <code>cipherText</code>.</p><h2 id="h-how-to-decrypt-cipher-text" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">How to decrypt cipher text?</h2><p>To decrypt the <code>cipherText</code>, we need the three values we stored above along with the user&apos;s password. We will first recover the encryption key using the <code>password</code> &amp; <code>salt</code>. After that, we will use the <code>key</code> &amp; <code>initializationVector</code> to decrypt the <code>cipherText</code>. The code below can be used to decrypt</p><pre data-type="codeBlock" text="
type EncryptedVault = {
    salt: string
    initializationVector: string
    cipherText: string
}

async function decryptCipherText(
  vault: EncryptedVault,
  password: string
): Promise&lt;V&gt; {
  
  const { crypto } = global

  const { initializationVector, salt, cipherText } = vault

  const { key } = await generateOrRecoverKey(password, salt)

  const plaintext = await crypto.subtle.decrypt(
    { name: &quot;AES-GCM&quot;, iv: base64ToBuffer(initializationVector) },
    key,
    base64ToBuffer(cipherText)
  )

  return new TextDecoder().decode(plaintext)
}
"><code>
<span class="hljs-keyword">type</span> EncryptedVault <span class="hljs-operator">=</span> {
    <span class="hljs-built_in">salt</span>: <span class="hljs-keyword">string</span>
    initializationVector: <span class="hljs-keyword">string</span>
    cipherText: <span class="hljs-keyword">string</span>
}

async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">decryptCipherText</span>(<span class="hljs-params">
  vault: EncryptedVault,
  password: <span class="hljs-keyword">string</span>
</span>): <span class="hljs-title">Promise</span>&#x3C;<span class="hljs-title">V</span>> </span>{
  
  const { crypto } <span class="hljs-operator">=</span> <span class="hljs-keyword">global</span>

  const { initializationVector, salt, cipherText } <span class="hljs-operator">=</span> vault

  const { key } <span class="hljs-operator">=</span> await generateOrRecoverKey(password, salt)

  const plaintext <span class="hljs-operator">=</span> await crypto.subtle.decrypt(
    { name: <span class="hljs-string">"AES-GCM"</span>, iv: base64ToBuffer(initializationVector) },
    key,
    base64ToBuffer(cipherText)
  )

  <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> TextDecoder().decode(plaintext)
}
</code></pre><h1 id="h-usage" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Usage</h1><p>Let&apos;s round up with the usage of functions we have created above to encyrpt &amp; decrypt a message.</p><pre data-type="codeBlock" text="// Encrypting message
const password = &quot;&lt;Some-Strong-User-Password&gt;&quot;

const messageToEncrypt = &quot;Hello, world&quot;

// We can save this vault directly in localstorage &amp; retrieve later when we need to decrypt the stored message
const vault = encryptMessage(messageToEncrypt, password)


// Decrypting message
const descryptedMessage = decryptCipherText(vault, password);

// Validate the messages are equal :)
assert(descryptedMessage === messageToEncrypt)
"><code><span class="hljs-comment">// Encrypting message</span>
const password <span class="hljs-operator">=</span> <span class="hljs-string">"&#x3C;Some-Strong-User-Password>"</span>

const messageToEncrypt <span class="hljs-operator">=</span> <span class="hljs-string">"Hello, world"</span>

<span class="hljs-comment">// We can save this vault directly in localstorage &#x26; retrieve later when we need to decrypt the stored message</span>
const vault <span class="hljs-operator">=</span> encryptMessage(messageToEncrypt, password)


<span class="hljs-comment">// Decrypting message</span>
const descryptedMessage <span class="hljs-operator">=</span> decryptCipherText(vault, password);

<span class="hljs-comment">// Validate the messages are equal :)</span>
<span class="hljs-built_in">assert</span>(descryptedMessage <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> messageToEncrypt)
</code></pre><h2 id="h-reference" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Reference</h2><p>Metamask has also released a module which will do all these stuff for you &amp; give you simpler API, check out their module <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/MetaMask/browser-passworder">browser-passworder</a></p><p><strong>Usage:</strong></p><pre data-type="codeBlock" text="const { strict: assert } = require(&apos;assert&apos;);
const passworder = require(&apos;browser-passworder&apos;);

const secrets = { coolStuff: &apos;all&apos;, ssn: &apos;livin large&apos; };
const password = &apos;hunter55&apos;;

passworder
  .encrypt(password, secrets)
  .then(function (blob) {
    return passworder.decrypt(password, blob);
  })
  .then(function (result) {
    assert.deepEqual(result, secrets);
  });
"><code>const { strict: <span class="hljs-built_in">assert</span> } <span class="hljs-operator">=</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'assert'</span>);
const passworder <span class="hljs-operator">=</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'browser-passworder'</span>);

const secrets <span class="hljs-operator">=</span> { coolStuff: <span class="hljs-string">'all'</span>, ssn: <span class="hljs-string">'livin large'</span> };
const password <span class="hljs-operator">=</span> <span class="hljs-string">'hunter55'</span>;

passworder
  .encrypt(password, secrets)
  .then(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">blob</span>) </span>{
    <span class="hljs-keyword">return</span> passworder.decrypt(password, blob);
  })
  .then(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">result</span>) </span>{
    <span class="hljs-built_in">assert</span>.deepEqual(result, secrets);
  });
</code></pre>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/ed7891d7d356dae86f5c305db4dd7977e429ec6f784c8715a4c7c19b98018dd8.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[The beginning - EPF #1]]></title>
            <link>https://paragraph.com/@garvit-khatri/the-beginning-epf-1</link>
            <guid>MnScCuk50NCzb63YSzAe</guid>
            <pubDate>Mon, 07 Nov 2022 06:50:40 GMT</pubDate>
            <description><![CDATA[Gm! I am super excited to share that I will be participating in the Ethereum Protocol Fellowship (EPF). This blog is my first update for the fellowship.What will I work on?We are moving closer towards the finalisation of EIP-4337. A lot of effort by the core team has been put into designing the contracts, mempool, DOS protections etc. But the team haven&apos;t had time to properly support UserOps through one of the browser extension wallets. In this cohort, I intend to work on making a user-f...]]></description>
            <content:encoded><![CDATA[<p>Gm!</p><p>I am super excited to share that I will be participating in the Ethereum Protocol Fellowship (EPF). This blog is my first update for the fellowship.</p><h3 id="h-what-will-i-work-on" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">What will I work on?</h3><p>We are moving closer towards the finalisation of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4337">EIP-4337</a>. A lot of effort by the core team has been put into designing the contracts, mempool, DOS protections etc. But the team haven&apos;t had time to properly support UserOps through one of the browser extension wallets.</p><p>In this cohort, I intend to work on making a user-facing wallet which can then pave the way forward for the wallets in the Ethereum ecosystem. The larger goal is to test the eip enough and make it ready for everyday use. Once we get AAs into everyday use we can then easily work towards the depreciation of EOAs from the ecosystem.</p><h3 id="h-update" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Update</h3><ol><li><p>Read <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4337">EIP-4337</a></p></li><li><p>Won a hackathon by building a project on 4337</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://devfolio.co/projects/cupcakes-0027">https://devfolio.co/projects/cupcakes-0027</a></p></li><li><p>Created a repo to showcase the latest Account Abstraction SDK and how anyone can create their own SCW</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/plusminushalf/demo-aa">https://github.com/plusminushalf/demo-aa</a></p></li><li><p>Wrote the onboarding journey of an AA user on a chrome extension wallet</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hackmd.io/@plusminushalf/onboarding-aa-challenges">https://hackmd.io/@plusminushalf/onboarding-aa-challenges</a></p></li><li><p>Finalised the feature list of the chrome extension wallet</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hackmd.io/@plusminushalf/4337-compatible-wallet/edit">https://hackmd.io/@plusminushalf/4337-compatible-wallet/edit</a></p></li></ol><h3 id="h-next-steps" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Next Steps</h3><ol><li><p>Front-end architecture</p></li><li><p>Front-end UI finalisation</p></li><li><p>Bundler that will be used</p></li><li><p>Request ID explorer</p></li></ol>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
        </item>
        <item>
            <title><![CDATA[My Experience with Polygon <> Devfolio Fellowship]]></title>
            <link>https://paragraph.com/@garvit-khatri/my-experience-with-polygon-devfolio-fellowship</link>
            <guid>EAWZMYFyDc54rk9uKqEz</guid>
            <pubDate>Tue, 13 Sep 2022 12:46:41 GMT</pubDate>
            <description><![CDATA[As we know all good things must come to an end, Polygon <> Devfolio Fellowship is also at the turn where we have to bid farewell. I am writing this blog to give you a sneak peek at my Fellowship experience, what to expect, why you should apply and how to apply (If it happens next year).What is Polygon <> Devfolio Fellowship?It is a sponsored 8-week mentor-led program for you to take the next step in your Web3 development journey. You can apply to two tracks based on your experience level in w...]]></description>
            <content:encoded><![CDATA[<p>As we know all good things must come to an end, Polygon &lt;&gt; Devfolio Fellowship is also at the turn where we have to bid farewell. I am writing this blog to give you a sneak peek at my Fellowship experience, what to expect, why you should apply and how to apply (If it happens next year).</p><h2 id="h-what-is-polygon-lessgreater-devfolio-fellowship" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What is Polygon &lt;&gt; Devfolio Fellowship?</h2><p>It is a sponsored 8-week mentor-led program for you to take the next step in your Web3 development journey. You can apply to two tracks based on your experience level in web3, <strong>Beginner Track &amp; Buidler Track</strong>. 25 fellows were selected for both tracks. I was selected for the builder’s track.</p><p><strong>The beginner track</strong> was for students still in college and early in their web3 development journey. The cohort was much more organised and filled with structured coursework, weekly lectures, and tasks. Not only they had a tight schedule, but they also had access to dedicated mentors from the industry.</p><p><strong>Buidler Track</strong> was more on its own in terms of schedule as each one of them had proposed a different project that they wish to work on before getting selected. While we were to plan our day &amp; work, we were connected with mentors from the industry-specific to our project. I was for instance connected with <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/yashasvi_yc7">Yash</a> from <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.biconomy.io/">Biconomy</a>, who was working on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/plusminushalf.eth/LQsNKCDz5vqggOQ1U3uLR6SuJAL8A1wvuqOySGR2ars">EIP-4337</a> as well. The project-related pairing meant I could go as technical as I wanted and also ask as many architecture questions as I wanted. Kudos to the team for finding project-based mentors for all 25 builders.</p><h3 id="h-hacker-house" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Hacker House?</h3><p>Hackers? House? What is that? What is a house doing in the midst of an online fellowship?</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/614491679e28bbe61c847f8c4a0b65d56cae3f34108257b9b47b8946869d9dd6.jpg" alt="Polygon Fellowship Hackhouse" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Polygon Fellowship Hackhouse</figcaption></figure><p>Before I try to explain it in my words, I would suggest you watch this recap video made by the Devfolio team</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/devfolio/status/1569572836871634945">https://twitter.com/devfolio/status/1569572836871634945</a></p><p>Hacker house gave us the opportunity to meet every fellow in person and make bonds that will last forever! We had in-person talks from web3 founders, engineers, community managers, and VCs. We were given a holistic experience to help us launch our product on web3. There were also surprise visits from the <strong>founders</strong> of <strong>Redbus, Dunzo, Builders Tribe, The product house, Router Protocol, Transak</strong>, and many more. After the sleepless nights of the building during hacker house, we got to present our products to <strong>VCs</strong>, including** <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://buidlerstribe.com/">Builderstribe</a>, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://lsvp.com/">Lightspeed</a>, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.accel.com/">Accel Partners</a>** and many more.</p><p>Those 7 days of hacker house have given us access to people a lot of us would only dream of and friendships we will cherish for the life ahead.</p><h2 id="h-how-to-become-a-fellow" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">How to become a Fellow?</h2><p>While I don’t know if Polygon will have another Fellowship program next year or not but if they do, I would recommend every web3 enthusiast who is at the start of their career in web3 to apply for it. It is one of the life-changing experiences that would change your career trajectory completely.</p><p>Everyone who was interested to be a part of the fellowship had to apply on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://pf-2022.devfolio.co/">Devfolio’s website</a>. Upon selection of your application, there was another interview aligned with Devfolio’s team. I have already published my application at <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/plusminushalf.eth/vXB14O5BoxalHgVLbm7iKcbmCGS_2nxwXLpgU95nc6o">mirror.xyz/plusminushalf.eth</a>, feel free to take inspiration.</p><p>What all the fellows had in common was that all had done a lot of research about their projects, had a plan on how to execute them and were looking for the fellowship as a catalyst to 10x their product development through feedback from mentors and industry experts.</p><hr><p>I think it’s time I say goodbye and add this experience to the list of memories I will cherish in future.</p><p>PS: I wanted to share that we recently won the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://unfold.devfolio.co/">Unfold Hackathon</a>, you can see what we built in that hackathon here: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://devfolio.co/projects/cupcakes-0027">https://devfolio.co/projects/cupcakes-0027</a>/</p><p>PPS: EIP-4337 is getting ready to disrupt the Ethereum wallets and coming faster to you than you imagine ;)</p><p>Until next time, WAGMI 🚀</p>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/4d9960beddc80e0f01e038d3c6b59f73abcee0047173c91265b99c3996efaedb.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[The current state of Account Abstraction]]></title>
            <link>https://paragraph.com/@garvit-khatri/the-current-state-of-account-abstraction</link>
            <guid>uFBv8FP4Sh7oRXaslToD</guid>
            <pubDate>Mon, 15 Aug 2022 09:40:56 GMT</pubDate>
            <description><![CDATA[GM Everyone! I have a couple of motivations to write this blog. Firstly, to help you understand what all work is pending for the wide adoption of EIP-4337. Secondly, tell you about how you can help in accelerating the process by contributing.The flow of a userOperation in EIP-4337Above is how EIP-4337 makes smart contract wallets a reality. We can start developing smart contract wallets, paymasters, etc compatible with EIP-4337 with a relayer service today. But for it to become the norm & com...]]></description>
            <content:encoded><![CDATA[<p>GM Everyone!</p><p>I have a couple of motivations to write this blog. Firstly, to help you understand what all work is pending for the wide adoption of EIP-4337. Secondly, tell you about how you can help in accelerating the process by contributing.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6f6b51a8584b84d5ccb194a32aefff5fb4544c3ee48c8cc20ffd662f2a3bf8bf.png" alt="The flow of a userOperation in EIP-4337" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">The flow of a userOperation in EIP-4337</figcaption></figure><p>Above is how <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4337">EIP-4337</a> makes smart contract wallets a reality. We can start developing smart contract wallets, paymasters, etc compatible with EIP-4337 with a relayer service today. But for it to become the norm &amp; completely decentralised there is some work left. Let’s look at all the parts one by one and see where the work is left.</p><h3 id="h-user-erc-4337-web-and-native-client-sdk" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">User: ERC-4337 web &amp; native Client SDK</h3><p>The journey of any <code>userOperation</code> starts with a client. There is no support for <code>eth_sendUserOperation</code> from any wallet and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://walletconnect.com/">Walletconnect</a> also lacks the documentation for the above function as of <em>15th Aug 2022</em>.</p><p>If you have used Walletconnect or are a part of the organisation, I would love to get in touch &amp; understand how I can contribute to add support. This will be one of the biggest blockers in its wide adoption.</p><h3 id="h-bundler-userop-block-builder" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Bundler: UserOp Block Builder</h3><p>Like miners, we have bundlers in EIP-4337. Support for bundling <code>userOperations</code> hence is necessary for the nodes. We also need to have DoS protection, for eg, there should be only ONE <code>userOperation</code> in the mempool at any point in time. Every implementation of the bundler must have the DoS protection module.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nethermind.io/">Nethermind</a> is one of the first organisations to have support. Their c# node is running on Görli for full support as of now, while their Go implementation (forked from MEV-Geth) is in progress.</p><p>We currently lack the implementation for other nodes &amp; L2s. We hence would need help in adding support to Geth, Erigon, Optimism, Arbitrum, Polygon etc.</p><h3 id="h-usage-documentation-and-tutorials" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Usage: Documentation and tutorials</h3><p>One of the major sources of how EIP-4337 work is the official documentation itself, link: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4337">https://eips.ethereum.org/EIPS/eip-4337</a>.</p><p>But it is quite technical and not useful for everyone. This is where the initiative from Infinitism &amp; ERC-4337 Fan Club comes to help us with the launch of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.eip4337.com/">eip4337.com</a>. This though as you can see is almost empty.</p><p>I would suggest beginners start contributing to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.eip4337.com">eip4337.com</a> as this will be the best way to start your journey to Account Abstraction. You can find its repo on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/eth-infinitism/aa-docs">Github</a> and start the conversation in the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://discord.gg/Sbcesn3SqZ">discord server</a>.</p><hr><p>While the above were the essentials, the work for contributions doesn’t stop there. There are still a lot of ways one can contribute and there are many things that are still pending to enhance the EIP. I have listed a few more things that are still either not built are under experiments:</p><ol><li><p>UserOp Standalone MEV Bundler - This will help extract the maximum value even in EIP-4337 with the use of private mempools, such as the ones managed by the Flashbots team.</p></li><li><p>BLS Aggregation Bundler - While <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/eth-infinitism/account-abstraction/pull/94">Infinitism</a> is working on adding support for BLS signatures in smart contract wallets, Bundlers would also need to support these signature types &amp; currently no implementation has been started in this area.</p></li><li><p>Production Grade ERC-4337 Paymasters - <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/eth-infinitism/account-abstraction/">Infinitism</a> has released the first set of paymaster contracts to start with. This is where I have also been personally working &amp; will be releasing something soon.</p></li><li><p>BLS Proxy Wallet Smart Contract - We have our first SCW which is EIP-4337 compatible, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/web3well">web3well</a>, but we would need many more such implementations.</p></li><li><p>More SCWs - EIP-4337 opens up a plethora of things that we can do with our wallets now, think about changing recoverable private keys, pausing accounts, accounts based on username passwords, post-quantum signature supports, changing private keys, gets. The possibilities are endless &amp; I look forward to all the unique implementations the community will come up with.</p></li></ol><p>All the above have been collected from <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hackmd.io/@erc4337/report0">ERC-4337 Progress Report #0</a>. This doc keeps on getting updated so keep an eye on it.</p><p>There is a lot of work still and things are moving fast, and we are ever closer to AA being a reality. That said Ethereum also has so many other things going for it, did you know the merge is also closer than ever before? The time is set, it is now inevitable, we all are waiting for <code>58750000000000000000000</code>. The current ETA is <code>Thu Sep 15 02:32:54 2022 UTC</code>, follow <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://bordel.wtf/">bordel.wtf</a> for the live updates.</p><p>Until next time, WAGMI!!</p>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/4655458283597a508cd2bfe83683e310fbc1f2026c25c85ac2ef2b72d3469ed6.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[How will you transition from Metamask to Smart Contract Wallets?]]></title>
            <link>https://paragraph.com/@garvit-khatri/how-will-you-transition-from-metamask-to-smart-contract-wallets</link>
            <guid>Qbhm9fqlfuT0nzOhURtC</guid>
            <pubDate>Tue, 02 Aug 2022 22:19:31 GMT</pubDate>
            <description><![CDATA[GM Everyone! As I discussed in the last article Future of your Ethereum wallets, wallets of the future will be smart contract wallets. A natural progressive question is: how will you move all your EOA (Externally owned accounts like Metamask) assets to the smart contract wallets (SCW)? Will you have to transfer all the assets one by one? This is not a plausible solution because this requires a transaction per asset (making it extremely expensive). At worst, some powers (like hard-coded owners...]]></description>
            <content:encoded><![CDATA[<p>GM Everyone!</p><p>As I discussed in the last article <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/plusminushalf.eth/LQsNKCDz5vqggOQ1U3uLR6SuJAL8A1wvuqOySGR2ars">Future of your Ethereum wallets</a>, wallets of the future will be smart contract wallets. A natural progressive question is: how will you move all your EOA (Externally owned accounts like Metamask) assets to the smart contract wallets (SCW)?</p><p>Will you have to transfer all the assets one by one? This is not a plausible solution because this requires a transaction per asset (making it extremely expensive). At worst, some powers (like hard-coded owners in a smart contract, or <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-5114">SBTs</a>) might not be transferable at all.</p><p>EIP-4337, as discussed in Future of Ethereum wallets, propose a ton of security benefits. Though, the biggest roadblock to its adoption is the existence of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://bitcoinist.com/ethereum-reaches-new-milestone-as-over-71-million-wallets-hold-eth/">71M EOA Wallets</a>. We can’t leave these wallets that holds the total Ethereum economy as of today. Hence we need a way to help the majority of the Ethereum platform to move away from EOA to SCW.</p><p>Well where there is a problem, there is a solution. Let’s discuss the two ways in which we can make the transition of EOA to SCW possible in an affordable way.</p><ol><li><p><strong>Typed Transaction Envelope</strong></p></li><li><p><strong>Introduction of AUTH_USURP opcode</strong></p></li></ol><p>NOTE: <em>None of the ways listed below has been finalised as of now &amp; we have no clarity as to what will finally be adopted by the Ethereum community.</em></p><p><strong>Typed Transaction Envelope</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-2718">EIP-2718</a> introduces a way for users to define the type of transaction. This allows EVM to run special codes based on the type of transaction. Using this we can introduce a special transaction, let’s call it <em>replace code</em>, that will replace the original account data with the new SCW account call data (SCW’s deployment initdata). This would allow users to migrate their accounts in a single transaction &amp; also sign for a previous public address with newly SCW address.</p><p><strong>Introduction of AUTH_USURP opcode</strong></p><p>Another interesting approach to solving the problem is the use of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum/EIPs/blob/27d9b4cf8ee32de8c7f03f1c3b229bc958ef8760/EIPS/eip-draft_AUTH_USURP.md">EIP-5003</a> &amp; <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-3074">EIP-3074</a>. EIP-5003 builds over the foundation laid by EIP-3074, especially with the introduction of opcode <em>AUTH</em>.</p><p>Let’s understand <em>AUTH</em> opcode and how it functions. It allows users to set authorised addresses. When a user calls AUTH opcode, it set’s a new address to validate &amp; send transactions on behalf of the original address. This allows users to have multiple private keys for the same account. Note, however, that the ultimate account authority is still with the original address. The original address signer can at any point in time change authorised addresses.</p><p>Now that we know that AUTH opcode allows us to set authorised addresses, it still has the problem that the ultimate power is still with the original signer. For our use case, that is to move from EOA to SCW, we need to revoke the ultimate power from the original signer to the new SCW signer. This is where EIP-5003 comes into the picture.</p><p>EIP-5003 introduces a new opcode <em>AUTHUSURP</em>. The user will have to first use the <em>AUTH</em> code to set a new authorised address. Then we will have to call the <em>AUTHUSURP</em> code which will deploy the SCW at the authorised address defined by <em>AUTH</em> opcode above. Upon successful deployment, the opcode would return the newly deployed address. The new address would also be registered as one of the authorised addresses for the original address. Hence allowing the users to use the new signature &amp; public key for all their previous assets and also interact with non-transferable assets (since the new address is listed as the authorised address for the original address)</p><hr><p><strong>How soon?</strong></p><p>The above-pointed methods are still in the idea stages, I read about them from Ethereum’s planned <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://notes.ethereum.org/@vbuterin/account_abstraction_roadmap?utm_source=substack&amp;utm_medium=email">road to account abstraction</a> by Vitalik. The latest changes to the document were made a month ago as of 3rd Aug 2022. A lot of work has been put into making account abstraction a reality &amp; improve the lives of all web3 users.</p><hr><p>My recent search on Account Abstraction has been one of the key motivators for my today’s research. I see this as an opportunity for myself also to learn more about how EVM works, and how its opcodes work.</p><p>While transferring from EOA to SCW is one of the problems, high gas fees in SCW are also an emerging issue. I will also keep you updated on how Ethereum plans to solve that in my future blogs.</p><p>Until then, WAGMI!</p>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
        </item>
        <item>
            <title><![CDATA[Future of your Ethereum wallets]]></title>
            <link>https://paragraph.com/@garvit-khatri/future-of-your-ethereum-wallets</link>
            <guid>lBbnGPLAcrVuYkvu8F3O</guid>
            <pubDate>Thu, 21 Jul 2022 14:09:32 GMT</pubDate>
            <description><![CDATA[GM Everyone! We all want to know what is next in the web3 world. Today we will deep-diving into the future of Ethereum wallets & how it will change the experience for both developers & users. One word answer for what is coming next to Ethereum is Account Abstraction. It will change how we authorize transactions & interact with blockchains. The change will open the possibilities of having recovery wallets, username-passwords wallets, paying gas fees in tokens other than ETH, or getting gas fee...]]></description>
            <content:encoded><![CDATA[<p>GM Everyone!</p><p>We all want to know what is next in the web3 world. Today we will deep-diving into the future of Ethereum wallets &amp; how it will change the experience for both developers &amp; users.</p><p>One word answer for what is coming next to Ethereum is Account Abstraction. It will change how we authorize transactions &amp; interact with blockchains. The change will open the possibilities of having recovery wallets, username-passwords wallets, paying gas fees in tokens other than ETH, or getting gas fees sponsored and having a gassless experience.</p><p>Let us dive into how all of this is possible?</p><h3 id="h-account-abstraction" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Account Abstraction</h3><p>So you might have come across this word already. Vitalik has been asking for it since Feb ’20, you can see its birth <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum-magicians.org/t/implementing-account-abstraction-as-part-of-eth1-x/4020">here.</a></p><p>But Why account abstraction? What is account abstraction? How account abstraction works?</p><blockquote><p><strong>Why account abstraction?</strong></p></blockquote><p>Currently, in Ethereum every transaction has to be signed by an externally owned account (EOA, like metamask, trust wallet, etc.). This signature acts as the authorization mechanism. Miners are looking for transactions in the public mempool. These miners first verify the signature of each and every transaction before picking it up for execution.</p><p>The process of signing every transaction have the following problems:</p><ol><li><p>A single way to verify a transaction’s authenticity. If this is compromised, the whole blockchain is compromised.</p></li><li><p>A single point of failure, your private key/mnemonic. Once this is compromised, all your funds are compromised</p></li><li><p>Stuck with the blockchain’s native token for everything we need to do on the blockchain.</p></li></ol><p>Let&apos;s dive into each one of the above-listed problems in detail.</p><p><strong>A single way to verify a transaction’s authenticity</strong></p><p>One of the biggest problems with the currect architecture of Ethereum is that there is only a single way to verify a transaction’s authenticity. All transactions must be signed with an ECDSA to prove their authenticity. What if we get some vulnerability in the current algorithm (ECDSA) in the future? What about quantum computers, we know <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://pqcrypto.org/index.html">quantum computers are coming and can break ECDSA</a>.</p><p>The problem is that if we ever have to change the algorithm to authorize transactions in the future, we will have to send an update to all the ETH nodes. For context, the current process of pushing updates to ETH nodes is through voting. The majority of the nodes have to vote in favour and pass the change. Once voted on, the change has to be planned and rolled out with proper tests. What if this takes 6 months? If there was a vulnerability in our authorization layer then all our accounts will be exposed to attacks &amp; hacks until the change has been passed, tested &amp; deployed to all the eth nodes.</p><p><strong>A single point of failure, your private key/mnemonic</strong></p><p>Another problem in the current architecture is the single point of failure, i.e EOAs. You get a mnemonic when you create your account. That mnemonic is the access to all your crypto funds forever. There is no way to change the mnemonic, what if you forget the mnemonic? The funds are lost forever!! What if someone steals your mnemonic?? Well, write a script to transfer all your funds ASAP! (ps: the hacker already has that script and your funds are already gone). You see the problem, everything boils down to your mnemonic. Once your mnemonic is compromised, your funds are not secure anymore.</p><p><strong>Stuck with the blockchain’s native token</strong></p><p>The current consensus layer also forces everyone to pay gas fees in ETH. While I love ETH &amp; would love to hodl it for long. I would want some predictability in my wallet &amp; have most of my liquid funds in some sort of stablecoins. There is no way for me to pay gas fees in stable coins with EOAs. The flexibility of paying fees in any other coin or method except for the native blockchain coin is impossible. This inflexibility will lead to problems in scaling Ethereum to billions of people.</p><blockquote><h3 id="h-what-is-account-abstraction" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">What is account abstraction?</h3></blockquote><p>Account abstraction is an initiative toward solving the above problems. The latest initiative is drafted in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4337">EIP-4337</a>. The protocol allows users to have smart contract wallets without any change to the current consensus layer. This will allow users to have their preferred way of authenticity, allow users to recover or change their proof of authenticity, and also allow users to pay gas or let others pay gas on their behalf.</p><blockquote><p><strong>How account abstraction works?</strong></p></blockquote><p>After multiple attempts from the Eth community, they have settled on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4337">EIP 4337</a>. This protocol was the preferred choice because it did not need any change to the current consensus layer.</p><p>I will try and briefly explain how this EIP works and how it will abstract accounts for us. Let us first list down the components of this EIP:</p><ol><li><p>User operation</p></li><li><p>Bundlers</p></li><li><p>Entry Point Contract (EPC)</p></li><li><p>Wallet Contract</p></li><li><p>Paymaster Contract</p></li></ol><p><strong>The journey</strong></p><p>The journey starts with a user’s intention to execute an operation on the chain. The user then will bundle their intention of the execution in an object called, User Operation. A user operation describes the following</p><ol><li><p>User’s execution code</p></li><li><p>User’s operation’s authenticity proof</p></li><li><p>Wallet creation code if the wallet doesn’t exist on the chain as of now</p></li><li><p>The max amount of gas that is allowed to be exhausted for the operation</p></li><li><p>Paymaster information, a paymaster is a contract that is ready to pay the gas fee instead of the user for the above-stated operation</p></li></ol><p>What is the difference between a transaction versus a user operation? Transactions are fully signed (according to ECDSA) instructions from the account (EOA). While user operations are not signed but do contain proof of their authenticity &amp; instructions that are to be executed. The proof though may not be according to ECDSA standards. The proof’s authenticity has to be decided by the smart contract wallet where the account is hosted and the consensus layer has no say on the user operation’s proof.</p><p>Once the user has created the User Operation, they send it to the public network for Bundlers to pick this operation &amp; execute it on the chain. Bundlers are nodes who are ready to process these user operations. Bundlers can sort these user operations based on their gas fees and the reward they can earn by processing the operation successfully.</p><p>How are bundlers different from miners? Miners pick transactions that reward them and execute them, while bundlers pick user operations that reward them and execute them. In theory, a miner could become a bundler as well. But before Account Abstraction becomes mainstream, we expect there to be a smaller set of bundlers in the ecosystem than miners.</p><p>Bundlers then route each and every user’s operations through an Entry Point Contract. The role of the Entry Point Contract is to route the user operation through its wallet’s smart contract and get it authenticated from the contract. Along with the operation’s authenticity, the Entry Point contract also verifies if the wallet has enough balance to pay for the gas fees &amp; reward for the bundler.</p><p>If the wallet’s contract is not deployed Entry Point will also deploy the wallet and then verify the operation.</p><p>Once the operation is verified, it will also verify the paymaster (if specified) &amp; verify if the paymaster has enough balance to pay for the user’s operation.</p><p>In the above verification process itself, either the wallet or the paymaster has to transfer the maximum amount of gas required for the successful execution of the operation.</p><p>Coming back to our verification, upon successful verification of operation &amp; paymaster, the Entry Point will then pass the complete user operation to the Wallet contract for it to execute.</p><p>Post the execution of the operation, Entry Point will refund the extra unutilized gas left back to the wallet/paymaster (depending on who paid earlier). If a paymaster was involved Entry Point will also call its <em>postOp</em> function to inform it about the exact amount of gas used for this operation. This will allow the paymaster to keep a track of the payments it is sponsoring.</p><p>This is how we will be able to in future solve the three problems stated above. The architecture allows users to</p><ol><li><p>Have multiple ways to verify a transaction’s authenticity.</p></li><li><p>Generate a new signature &amp; discard the old one.</p></li><li><p>Stop any transactions from their wallet if their signature has been compromised.</p></li><li><p>Transfer funds to their nominees in case of the death of the owner of the wallet.</p></li><li><p>Pay gas fees in a token different from ETH.</p></li><li><p>A gasless experience if another party (paymaster) is ready to sponsor their transactions.</p></li></ol><p>I did not get a lot of time to go in deep into each and every component of the EIP. Keep an eye out for future blogs for them. I will also be writing soon about how the complete system is secure and DDOS proof!</p><p>Until then, WAGMI!</p>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/596226b8c89d756931f5f46da9a40f5f0dca800afbc7c523ad61b4db2dce2b4c.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Polygon Fellowship Proposal 1 - Paymaster as a service]]></title>
            <link>https://paragraph.com/@garvit-khatri/polygon-fellowship-proposal-1-paymaster-as-a-service</link>
            <guid>UgZlBaBDcZtd4A97Qr8B</guid>
            <pubDate>Fri, 01 Jul 2022 11:45:30 GMT</pubDate>
            <description><![CDATA[Brief Overview With the advent of EIP 4337, I expect on-chain wallets & paymaster services will explode and help a large number of people get onboarded with web3. A lot of DAOs & old age companies would want to sponsor gas fees & want a smoother experience for their users. But deploying a Paymaster, and having a developer code the custom logic would be painful for every other organisation. This is where I feel, a service which would automatically deploy/manage & let organisations monitor the ...]]></description>
            <content:encoded><![CDATA[<p><strong>Brief Overview</strong></p><p>With the advent of EIP 4337, I expect on-chain wallets &amp; paymaster services will explode and help a large number of people get onboarded with web3. A lot of DAOs &amp; old age companies would want to sponsor gas fees &amp; want a smoother experience for their users. But deploying a Paymaster, and having a developer code the custom logic would be painful for every other organisation. This is where I feel, a service which would automatically deploy/manage &amp; let organisations monitor the transactions that they are sponsoring would come in super handy for organisations.</p><p><em>Category</em><strong>:</strong> <em>DAO Tooling</em></p><p><em>Competition</em><strong>:</strong> EIP 4337, is still new and is in the beta phase. While sponsoring gas has been around. People have sponsored gas through meta transactions as well. Though this requires changes to the underlying smart contract people are interacting with. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.biconomy.io/">https://www.biconomy.io/</a> is one such organisation which is helping people sponsor gas although with meta transactions.</p><p><strong>Objectives</strong></p><ol><li><p>Deploy a Paymaster smart contract.</p></li><li><p>Configure basic rules that will govern the type of user operation the organisation is willing to sponsor. I have listed a few below, this list though is not polished:</p><ol><li><p>Sponsor first X transactions by a wallet while interacting with Y contract.</p></li><li><p>Sponsor all gas fees up to $X while interacting with Y contract.</p></li><li><p>Sponsor all the transactions while doing an airdrop - one-time paymaster.</p></li><li><p>Sponsor gas of people who hold a specific NFT.</p></li></ol></li></ol><p><strong>Problem it solves</strong></p><ol><li><p>Onboarding the user is tough, it is super irritating to have the native token of the blockchain at all times. This creates a layer of friction for DAOs when users are interacting with them.</p></li><li><p>Deploying &amp; maintaining your own Paymaster would require all organisations to have a developer at hand.</p></li><li><p>Once the above two problems would be solved, it would also lead to the problem monitor all the transactions they are sponsoring. This will be super helpful to calculate CAC for an organisation &amp; also see the ROI they are getting from these transactions.</p></li></ol><p><strong>Implementation</strong></p><p>I am yet to start working on this project, I have started helping stackup, an on-chain EIP 4337 compatible wallet with developer documentation. This I believe helps me give a better understanding of EIP 4337 &amp; also see things in action. Then I would start building this service.</p><p>Implementation Plan:</p><ol><li><p>There are two ways I can go from here. Create multiple paymaster contracts with configurable values and deploy on demand. Or create a master paymaster which will allow the execution of multiple strategies based on its deployment configuration.</p></li><li><p>I will as of now use <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://stackup.sh">stackup.sh</a> entry point &amp; its wallets for the purpose of this fellowship, though entry point could always be changed through ownerOnly functions</p></li><li><p>I will then create a dashboard which will list all the transactions which will be sponsored and orgs will be able to monitor them. For this, I will be creating a subgraph which will explore the list of transactions that will be routed from the paymaster contract. This is still theoretical as of now and I will have to check its validity.</p></li></ol><p>How would it help Polygon Ecosystem? If we have the capability for organisations to easily sponsor gas and make the web3 experience simpler for users. This would indeed lead to an increase in the transactions that will be helping Polygon’s chain.</p><p><strong>Why this project?</strong></p><p>While I was investing with Defi across chains, I myself have faced issues where I don’t have the native token of the chain and I have to go back and do the whole thing of bringing gas, which is frustrating! Looking for a solution to this problem I stumbled upon EIP 4337, and I loved the idea. Though soon realised it was still in the early stages. I figured out there are a couple of DAOs who are trying to solve the problem of paying gas in the native tokens, namely: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://sequence.xyz/">Sequence</a> &amp; <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://stackup.sh/">Stackup</a>. I have also started working with Stackup &amp; I will be helping them with the developer documentation and contract auditing.</p><p>While the above problems solved my immediate problem I also realised that Paymaster service would play a crucial role in future &amp; I don’t see any such solutions for them as of now.</p>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/a95e0c42e465e93ac56303f5edb32e9aab058ea1b79936653e884af43d2c302d.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Polygon Fellowship Builders Track Application]]></title>
            <link>https://paragraph.com/@garvit-khatri/polygon-fellowship-builders-track-application</link>
            <guid>xuLHrU6qlENtKGehe48I</guid>
            <pubDate>Fri, 01 Jul 2022 11:39:41 GMT</pubDate>
            <description><![CDATA[I recently got selected for batch 2022 for Polygon Fellowship’s Builders Track. Here are my answers & the projects that I submitted in my proposal. Post the application I was invited for a virtual interview, here are the things we discussedMy web2 journey so farWhat motivated me to explore web3What all things I have tried in terms of development in web3Why I proposed the following projects in my proposalsWhat research have I conducted so far while writing the proposals & am I aware of other p...]]></description>
            <content:encoded><![CDATA[<p>I recently got selected for batch 2022 for Polygon Fellowship’s Builders Track. Here are my answers &amp; the projects that I submitted in my proposal.</p><p>Post the application I was invited for a virtual interview, here are the things we discussed</p><ol><li><p>My web2 journey so far</p></li><li><p>What motivated me to explore web3</p></li><li><p>What all things I have tried in terms of development in web3</p></li><li><p>Why I proposed the following projects in my proposals</p></li><li><p>What research have I conducted so far while writing the proposals &amp; am I aware of other people who might be working towards a similar idea</p></li></ol><p>The conversation was mostly fluid and interactive.</p><h2 id="h-questionnaire" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Questionnaire</h2><p><strong>What would you consider to be your standout project? Something which you&apos;re really proud of or had fun building</strong></p><p>It is difficult to choose a single project, I have fun building a lot of things in my past. I feel, there is one project that I enjoyed a lot though, this was 8086 Microprocessor Emulator. Back in college, while studying Engineering Physics in 2014, I was fascinated to study about 8086 processors. It made me wonder if we could emulate the entire processor in a web browser since computers are much faster now. Using this would enable me to write some assembly code and explore the different types of programs with it mimicking the Silicon Valley era of the 1970s. With this goal of mine, using Javascript I started writing the emulator which would run in a sandbox memory (this included runtime memory, registers &amp; segments) environment &amp; allow emulating all the 8086 opcodes. I ensured that architecture was composable for other emulators to be built in future, while 8086 was the first one to be supported. Each emulator would have a command interface, where each command would take arguments as operands and memory. And each command would either set or get a type of memory (runtime, register or segment). Each command state along with the latest memory snapshot was also saved in the backend so that it can be loaded from any previous predefined state. While tinkering and being able to emulate small programs, this project also allowed me to think at the architectural level.</p><p><strong>Why are you applying to the Fellowship and what do you hope to take away from it? [in more than 300 words]</strong></p><p>Open source communities have been one of the major reasons for my growth in the past. Back in 2014, I started my open source journey with KDE’s Season of KDE fellowship program and then was admitted to the Google Summer of Code 2015 fellowship program. These two programs have helped me accelerate my career, and build a deeper understanding of software architecture and I expect the same from Polygon Fellowship.</p><p>Post the acquisition of my last venture, I have been diving deep into Web3 and running experiments to understand it better. Currently, I am exploring opportunities in web3 where I can contribute or build the infrastructure which will help other DAPPS grow faster. Polygon is the most prominent L2 and with a great Defi ecosystem, can definitely help me with the right mentors to accelerate my learnings and goals. I expect to find such mentor(s) who will accelerate my growth &amp; open doors to new technologies/infra that are in the development stage. My goal is to have a successful project at the end of the Fellowship, a deeper understanding of web3, and solve a real problem faced by others.</p><h2 id="h-project-proposals" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Project proposals</h2><p>My first proposal</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db/W-67K1zUgVUcegVar8-2IMhM7y7XL8IlzScFnlwPVQ8">https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db/W-67K1zUgVUcegVar8-2IMhM7y7XL8IlzScFnlwPVQ8</a></p><p>My second proposal</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db/wK5DMmVruWhcojT1MJLq9os2HfoRbmbdGCB0GSMXDfc">https://mirror.xyz/0x6C2265693900a68b9c9CBE2d6Eae3bd9336060db/wK5DMmVruWhcojT1MJLq9os2HfoRbmbdGCB0GSMXDfc</a></p>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/a95e0c42e465e93ac56303f5edb32e9aab058ea1b79936653e884af43d2c302d.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Polygon Fellowship Proposal 2 - Nightfall on Intranet]]></title>
            <link>https://paragraph.com/@garvit-khatri/polygon-fellowship-proposal-2-nightfall-on-intranet</link>
            <guid>m0ovbXgkwUZHqHsVFzUb</guid>
            <pubDate>Fri, 01 Jul 2022 11:39:29 GMT</pubDate>
            <description><![CDATA[Brief Overview Deploying the nightfall wallet on the intranet would add another layer of security for organisations to access their funds deployed on the blockchain. An easy tool for them to deploy, monitor & keep a track of wallets would make a world of difference when it will come to auditing. People may leave or join the team in an organisation handling the on-chain payments. Giving the ability for admins to securely create/update/delete/transfer funds from wallets of people who will be le...]]></description>
            <content:encoded><![CDATA[<p><strong>Brief Overview</strong></p><p>Deploying the nightfall wallet on the intranet would add another layer of security for organisations to access their funds deployed on the blockchain. An easy tool for them to deploy, monitor &amp; keep a track of wallets would make a world of difference when it will come to auditing. People may leave or join the team in an organisation handling the on-chain payments. Giving the ability for admins to securely create/update/delete/transfer funds from wallets of people who will be leaving the company would give another layer of security over nightfall.</p><p><strong>Objectives</strong></p><ol><li><p>Ability to control wallets deployed on an intranet.</p></li><li><p>Deposit, withdraw, and transfer from any of the wallets deployed on the intranet</p></li><li><p>Not revealing the mnemonic directly to the end-user (employee) of the organisation’s wallet.</p></li></ol><p><strong>Problem it solves</strong></p><p>While nightfall allows organisations to have access to private-public blockchains, it is super important for organisations to also be able to manage their wallets efficiently. People join and leave teams all the time in organisations and managing these wallets across all new and previous employees would be an administrative nightmare. This project aims to solve that problem and make the adoption of nightfall easier for organisations</p><p><strong>Implementation</strong></p><p>I am yet to start work on this project. I intend to build over the existing wallet implementation <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/EYBlockchain/nightfall_3/tree/master/wallet">https://github.com/EYBlockchain/nightfall_3/tree/master/wallet</a>. The idea is to deploy the wallet on a server, the organisation can then choose who will have access to this server and how people will be able to connect to this (either via intranet or VPN). Admins will then be able to add, remove and manage the wallets. View the transactions that are happening through these wallets. Now the question is how will employees access these wallets and make transactions? For this, we will have org-based authentication, which will allow users to be able to prove their org identity and login into the portal. Employees then will be able to make transactions from the wallets to that they have been given access by the admins.</p><p><strong>Why this project?</strong></p><p>For nightfall to be successful on the scale, organisations would eventually need administrative services for them to administer the funds smartly. Having the ability to monitor, and manage the wallets and transactions happening through these wallets would an added layer of security and also remove the single point of failure problems if the person who possesses the mnemonic leaves the company. Having this ability of the nightfall will accelerate its growth in the long term and allow for more transparent access to web3 wallets across the organisation.</p>]]></content:encoded>
            <author>garvit-khatri@newsletter.paragraph.com (Garvit Khatri)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/a95e0c42e465e93ac56303f5edb32e9aab058ea1b79936653e884af43d2c302d.png" length="0" type="image/png"/>
        </item>
    </channel>
</rss>