<?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>DEV Community: DappaDan</title>
    <description>The latest articles on DEV Community by DappaDan (@dappadandev).</description>
    <link>https://dev.to/dappadandev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F745043%2Fad24bda9-6f51-4d42-a08a-bd933858226e.jpg</url>
      <title>DEV Community: DappaDan</title>
      <link>https://dev.to/dappadandev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dappadandev"/>
    <language>en</language>
    <item>
      <title>Mask On: A Code Journey into ID-Mask and Mina</title>
      <dc:creator>DappaDan</dc:creator>
      <pubDate>Mon, 29 Jul 2024 14:55:03 +0000</pubDate>
      <link>https://dev.to/dappadandev/mask-on-a-code-journey-into-id-mask-and-mina-c34</link>
      <guid>https://dev.to/dappadandev/mask-on-a-code-journey-into-id-mask-and-mina-c34</guid>
      <description>&lt;p&gt;Launching a mainnet is like that awkward moment when hosting a party.&lt;/p&gt;

&lt;p&gt;You know the one. &lt;/p&gt;

&lt;p&gt;At the start of the party when no one has come exactly on time you start to worry. &lt;/p&gt;

&lt;p&gt;Are people fashionable late? Are they coming? Did I send the wrong date? &lt;/p&gt;

&lt;p&gt;Of course, those worries go out the window once the first guest arrives. &lt;/p&gt;

&lt;p&gt;In the case of the &lt;a href="https://minaprotocol.com/about" rel="noopener noreferrer"&gt;Mina Mainnet&lt;/a&gt;, &lt;a href="https://idmask.xyz/" rel="noopener noreferrer"&gt;ID-Mask&lt;/a&gt; is the first guest. &lt;/p&gt;

&lt;p&gt;In this article, we will take a technical dive into ID-Mask and what it shows about the future of building ZKApps. &lt;/p&gt;

&lt;p&gt;By the end of this article, you should feel inspired to start building your own ZKApps after realizing how accessible it is to develop on Mina.&lt;/p&gt;

&lt;p&gt;So let's get this party started! &lt;/p&gt;

&lt;h2&gt;
  
  
  What is ID-Mask?
&lt;/h2&gt;

&lt;p&gt;Proving your identity is something we do almost every day. Whether you're handing over a plastic ID card to get a nice beverage or a passport to enter a country.  This requires us to carry these documents around and hand them over to people we may or may not trust.&lt;/p&gt;

&lt;p&gt;Don't get me started on trying to port over my physical ids to the "digital world". The amount of times I have tried to take photos of my passport at the right angle for the OCR to work is countless. &lt;/p&gt;

&lt;p&gt;ID-Mask aims to solve these problems. It's a service that allows users to generate Zero-Knowledge proofs to verify they are an adult, have no sanctions against them, and are a unique human. Users can now use the generated proof for identification purposes.  &lt;/p&gt;

&lt;p&gt;Goodbye plastic cards, hello ZK proofs! &lt;/p&gt;

&lt;h3&gt;
  
  
  How Does it Work?
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Step 1: User Signature
&lt;/h3&gt;

&lt;p&gt;Currently, the team has created an integration with a service called &lt;a href="https://www.smart-id.com/" rel="noopener noreferrer"&gt;Smart-ID&lt;/a&gt;.  This identification service lets users create digital, verifiable signatures through an application.  The user's identification is stored on the Smart-ID platform, and any service integrating with it can create a signature request from the user.&lt;/p&gt;

&lt;p&gt;These signatures can be used for a variety of different use cases. For example, when performing a large bank transaction, signing a contract, or approving new terms, integrating services can obtain data verification from the client side. This is because the user has approved the signature, confirming the data's validity.&lt;/p&gt;

&lt;p&gt;ID-Mask uses this personal data as private inputs to respect the privacy of users:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;
&lt;span class="nx"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;proveUniqueHuman&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;privateInputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="nx"&gt;PersonalData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// zkOracle data signature&lt;/span&gt;
        &lt;span class="nx"&gt;CircuitString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// unique secret value&lt;/span&gt;
        &lt;span class="nx"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// signature of unique secret value&lt;/span&gt;
        &lt;span class="nx"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// creator wallet signature&lt;/span&gt;
        &lt;span class="nx"&gt;PublicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// creator wallet public key&lt;/span&gt;
      &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2:  Consuming the Data and Creating  Proofs
&lt;/h3&gt;

&lt;p&gt;After receiving personal data from Smart-ID, a proof needs to be generated for that information.&lt;/p&gt;

&lt;p&gt;To prevent data tampering during this process, ID Mask uses an oracle connected to the Smart-ID data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;validSignature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oracleSignature&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="nx"&gt;PublicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromBase58&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;B62qmXFNvz2sfYZDuHaY5htPGkx1u2E2Hn3rWuDWkE11mxRmpijYzWN&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
          &lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="nx"&gt;personalData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFields&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;validSignature&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertTrue&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ID-Mask using the ZKProgram interface built into 'o1js' to create the proof. Here is an example for generating a proof of age:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;proofOfAge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ZkProgram&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ZkProofOfAge&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;publicInput&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// ageToProveInYears&lt;/span&gt;
  &lt;span class="na"&gt;publicOutput&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PublicOutput&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// defined above&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;proveAge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;privateInputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="nx"&gt;PersonalData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// zkOracle data signature&lt;/span&gt;
        &lt;span class="nx"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// creator wallet signature&lt;/span&gt;
        &lt;span class="nx"&gt;PublicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// creator wallet public key&lt;/span&gt;
      &lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;method&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="na"&gt;ageToProveInYears&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;personalData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PersonalData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;oracleSignature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;creatorSignature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;creatorPublicKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PublicKey&lt;/span&gt;
      &lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;PublicOutput&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Using the Proof
&lt;/h3&gt;

&lt;p&gt;Now that you have created the proof, the question is what to do with it.&lt;/p&gt;

&lt;p&gt;In the case of ID Mask, the proof is attached to a Mina address. This gives the ability for the user to also prove their identity by proving they are the owner of the address. Anyone can then send a confirmation message to that address, allowing the user to prove their ownership:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;validSignature_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;creatorSignature&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="nx"&gt;creatorPublicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nx"&gt;personalData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFields&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;validSignature_&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertTrue&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Verifying the Personal Data
&lt;/h3&gt;

&lt;p&gt;To prove that the data meets a certain requirement, it needs to be processed.  For example, to prove "Proof of Age," ID Mask extracts the date of birth from the personal identification number and compares it to the specified &lt;code&gt;olderThanAgeToProve&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dateOfBirth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseDateFromPNO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;personalData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pno&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;       &lt;span class="nx"&gt;personalData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentDate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;greaterThan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dateOfBirth&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;assertTrue&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="c1"&gt;// verify that (current date - age to prove) &amp;gt; date of birth&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;olderThanAgeToProve&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;personalData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentDate&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ageToProveInYears&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mul&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;greaterThan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dateOfBirth&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;olderThanAgeToProve&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertTrue&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the age is higher than the age to prove, a proof is created. If not, sorry kid...time to grow up. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffre333es1tv2e5mljt0b.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffre333es1tv2e5mljt0b.jpeg" alt="Image description" width="451" height="611"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Emitting the Event
&lt;/h3&gt;

&lt;p&gt;The final step is to create a smart contract that handles putting the proof on chain. This shows a major benefit of using a network like Mina: other applications can also use this proof.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ProofOfAge&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;SmartContract&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;events&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;provided-valid-proof&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PublicOutput&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// https://docs.minaprotocol.com/zkapps/o1js/permissions#types-of-permissions&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;account&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;Permissions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;method&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;verifyProof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;proof&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ProofOfAgeProof&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// if the proof is invalid, this will fail&lt;/span&gt;
    &lt;span class="c1"&gt;// its impossible to run past this without a valid proof&lt;/span&gt;
    &lt;span class="nx"&gt;proof&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// the above is enough to be able to check if an address has a proof&lt;/span&gt;
    &lt;span class="c1"&gt;// but there needs to be a way to save the number of years that are proved&lt;/span&gt;
    &lt;span class="c1"&gt;// emit an event with number of years to be able to query it via archive nodes&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emitEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;provided-valid-proof&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;proof&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;publicOutput&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The future of ID-Mask and ZKApps
&lt;/h2&gt;

&lt;p&gt;The team at ID-Mask has some great ambitions to grow the use of this service. There is also a feature for storing these proofs in a mobile wallet like Apple or Google wallet. This brings this ability to more consumers who don't have a crypto wallet themselves. &lt;/p&gt;

&lt;p&gt;Currently, Smart ID solution is limited to Baltic countries and Belgium. Other countries, such as Sweden and Switzerland, offer similar services, but they come with high costs.  As &lt;a href="https://github.com/id-Mask" rel="noopener noreferrer"&gt;the code is open source&lt;/a&gt;, more developers can start contributing to the expansion. &lt;/p&gt;

&lt;p&gt;As consumer adoption grows for the use of ZK apps, so must the speed of proving. Especially if we are competing against systems that are more performant, even though they are less private. The team at Mina is aiming to make proving 8x faster soon. &lt;/p&gt;

&lt;p&gt;If that is the case, I will leave you with one question, what are you going to build? &lt;/p&gt;

</description>
      <category>web3</category>
      <category>zeroknowledge</category>
      <category>blockchain</category>
      <category>typescript</category>
    </item>
    <item>
      <title>The Confused Developers Guide to Sidechains</title>
      <dc:creator>DappaDan</dc:creator>
      <pubDate>Fri, 01 Mar 2024 19:10:28 +0000</pubDate>
      <link>https://dev.to/dappadandev/the-confused-developers-guide-to-sidechains-4kjl</link>
      <guid>https://dev.to/dappadandev/the-confused-developers-guide-to-sidechains-4kjl</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Have you noticed how many scaling solutions there are nowadays? There are several categories like L2s, modular blockchains, and sidechains. The growing number of choices within Layer 2 solutions, modular blockchains, and sidechains can make any level of developer feel overwhelmed. &lt;/p&gt;

&lt;p&gt;Within each of those categories, there feels like an ever-growing list of options that is enough to make a developer's head spin. &lt;/p&gt;

&lt;p&gt;It's easy to go for the solution with the largest hackathon prize (totally understandable), but when it comes to deploying a dApp in the real world, the decision is much harder. &lt;/p&gt;

&lt;p&gt;Let's explore what makes sidechains a unique pick for developers, and how they compare with the rest of the pack. Following that, we're going deep into the &lt;a href="https://eon.horizen.io/"&gt;Horizen EON EVM sidechain&lt;/a&gt;, highlighting the developer experience—what changes and what remains the same. &lt;/p&gt;

&lt;p&gt;This will provide some clarity to confused developers. Let's get started: &lt;/p&gt;

&lt;h2&gt;
  
  
  Sidechains - A Story of Relationships
&lt;/h2&gt;

&lt;p&gt;Blockchains are all about relationships. Relationships can be between addresses, contracts and even other blockchains. We see the relationships between addresses and contracts mostly when using blockchain explorers. A less visible type of relationship exists between different blockchains.&lt;/p&gt;

&lt;p&gt;Why do blockchains need to create connections with other blockchains? Because life as a blockchain is hard. It is especially hard if you are a mainchain. You need to consider &lt;strong&gt;security&lt;/strong&gt; (stopping attackers from hijacking the network), &lt;strong&gt;scalability&lt;/strong&gt; (managing and settling all transactions), and &lt;strong&gt;decentralization&lt;/strong&gt; (ensuring control is shared fairly among participants). Managing all three of these well is so important that it has been given its own name called &lt;a href="https://www.theblock.co/learn/249536/what-is-the-blockchain-trilemma"&gt;"The Blockchain Trilemma"&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;To make life easier, a mainchain can recruit friends to help with this trilemma. Friends in this case can be supporting chains like sidechains. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Work alongside the mainchain, enabling assets to move back and forth through a two-way peg system.&lt;/li&gt;
&lt;li&gt;Maintain independence in security and consensus, offering the flexibility to test various rules and scenarios for enhanced scalability.&lt;/li&gt;
&lt;li&gt;Use the same computing system, like the Ethereum Virtual Machine (EVM), as the mainchain, so developers can work with familiar tools and languages that can coexist with the Ethereum ecosystem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Layer 2s - The Other BFF
&lt;/h2&gt;

&lt;p&gt;Scalability is so important that mainchains need  multiple solutions to address it. Another option is Layer 2 blockchains (L2s). If sidechains are the friends of mainchain, L2s are the siblings. The key difference between L2s and sidechains is that L2s usually rely on the mainchain's security. &lt;/p&gt;

&lt;p&gt;Their goal is to enhance scalability, utilizing optimistic rollups and zero-knowledge proofs for quicker transaction handling compared to the mainchain. These transactions still get settled on the mainchain eventually. &lt;/p&gt;

&lt;h2&gt;
  
  
  Sidechains on the Horizen
&lt;/h2&gt;

&lt;p&gt;To help our understanding of sidechains, let's look at the Horizen EON EVM sidechain as an example. There are two main relationships in the Horizen ecosystem: &lt;/p&gt;

&lt;h3&gt;
  
  
  Horizen to EON
&lt;/h3&gt;

&lt;p&gt;The first relationship is between &lt;a href="https://www.horizen.io/"&gt;Horizen&lt;/a&gt; and Horizen EON. Horizen acts as a 'blockchain of blockchains,' offering support for creating fully customizable sidechains optimized for speed, privacy, or consensus. It has its own native token called $&lt;a href="https://coinmarketcap.com/currencies/horizen/"&gt;ZEN&lt;/a&gt; and uses a Proof-of-Work consensus model. Created for particular applications, these sidechains communicate with the mainchain and achieve interoperability with one another through the &lt;a href="https://www.horizen.io/academy/zendoo/"&gt;Cross-Chain Transfer Protocol (CCTP).&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EON, designed as an EVM-compatible sidechain, links the EVM with the Horizen network. It allows assets to be sent from Horizen to EON through &lt;a href="https://docs.horizen.io/horizen_eon/connect/forward_transfer"&gt;forward transfers&lt;/a&gt;, and assets can be moved back to Horizen using &lt;a href="https://docs.horizen.io/horizen_eon/connect/backward_transfer"&gt;backward transfers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This means that they execute smart contracts like the EVM with little to no extra changes. From a developer perspective, this means that the same tools that would be used directly deploying a contract to the Ethereum network can still be used. &lt;/p&gt;

&lt;h3&gt;
  
  
  EON to Ethereum
&lt;/h3&gt;

&lt;p&gt;For EVM compatibility, EON adopts Ethereum's account-based transaction system to handle assets. This system has two kinds of accounts: &lt;strong&gt;Externally-Owned Accounts (EOAs)&lt;/strong&gt; and &lt;strong&gt;Contract Accounts&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Externally-Owned Accounts (EOAs) come with private keys, giving the owners the ability to carry out transactions with the assets stored in these accounts. Contract accounts don't have a private key. They are also required to run the code that is attached to the account. &lt;/p&gt;

&lt;h2&gt;
  
  
  Get Started Building
&lt;/h2&gt;

&lt;p&gt;As we discovered before, a big plus of using an EVM-compatible sidechain is not being required to learn new tools and programming languages.You can use Remix IDE or Hardhat to test and deploy your smart contract. Although it is compatible, you still need to make small modifications to your configuration to access the Gobi testnet (Horizen EON´s testnet). &lt;/p&gt;

&lt;p&gt;Thirdweb makes it simple to deploy smart contracts, allowing you to choose from its library or use your own contracts. After adding the Gobi Testnet to your wallet configuration, you can get TZEN, the testnet  EON token, by using the &lt;a href="https://faucet.horizen.io/"&gt;Horizen Faucet&lt;/a&gt;. Then you can use one of the popular contracts from Thirdweb like NFT Drop or Token. Follow this &lt;a href="https://docs.horizen.io/horizen_eon/tutorials/thirdweb"&gt;developer guide&lt;/a&gt; to complete the deployment. &lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;The variety of options for developers shows how important it is to scale mainchains. With so many options, this can be confusing. Sidechains offer the best of both worlds, giving developers flexibility to improve on what the mainchain misses and connecting back to it when needed. &lt;/p&gt;

&lt;p&gt;The Horizen ecosystem puts Horizen EON in a perfect spot to give developers these benefits. Being a 'blockchain of blockchains' means it can host specialized sidechains while maintaining compatibility with the EVM whenever it's needed.  The aim of this  article was to help developers confused by all these solutions. The best way to stop being confused is to start deploying code on testnet and just experiment with the tools available. Become part of the &lt;a href="https://discord.com/invite/z8eebsj7Sv"&gt;Horizen community today! &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, the  best way to truly understand the power of this technology is to start building on it.  Check out the Horizen EON documentation to start &lt;a href="https://docs.horizen.io/horizen_eon/tutorials/todolist"&gt;deploying your first dApp&lt;/a&gt;! &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Layers of a Blockchain: A Guided Tour</title>
      <dc:creator>DappaDan</dc:creator>
      <pubDate>Fri, 11 Feb 2022 14:28:39 +0000</pubDate>
      <link>https://dev.to/dappadandev/layers-of-a-blockchain-a-guided-tour-46jd</link>
      <guid>https://dev.to/dappadandev/layers-of-a-blockchain-a-guided-tour-46jd</guid>
      <description>&lt;p&gt;The journey of learning about blockchain has many twists and turns along the way but the path always includes a stop at the 'layers of a blockchain' station. Like ogres and onions, blockchains consist of layers that help enable the complex operations required to run smoothly and efficiently. &lt;/p&gt;

&lt;p&gt;It is common to compare the layers of a Blockchain to the layers of the &lt;a href="https://en.wikipedia.org/wiki/Internet_protocol_suite#:~:text=The%20Internet%20protocol%20suite%2C%20commonly,Internet%20and%20similar%20computer%20networks.&amp;amp;text=The%20Internet%20protocol%20suite%20provides,transmitted%2C%20routed%2C%20and%20received."&gt;Internet Protocol suite&lt;/a&gt;(IP) to explain how they work. There are some great parallels between the two and since many hope blockchain technology will reinvent the world much like the internet did, the comparison makes sense. &lt;/p&gt;

&lt;p&gt;If you have a good understanding of IP,  this is of course an effective way to learn this concept. But if you are like most internet users who happily use the internet and don't care about how exactly HTTP is working in the background, this is not so great. &lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qow0OYui--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1487063350483816459/up9NHzfZ_normal.jpg" alt="jeanayala.eth (🧱, 🚀) profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        jeanayala.eth (🧱, 🚀)
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/mrsalitre"&gt;@mrsalitre&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      I wish this but in the other hand people are not used to using the internet and do not know how it works. &lt;a href="https://t.co/3mQTJRJ92T"&gt;twitter.com/DAppaDanDev/st…&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      00:27 AM - 09 Feb 2022
    &lt;/div&gt;

      &lt;div class="ltag__twitter-tweet__quote"&gt;
        &lt;div class="ltag__twitter-tweet__quote__header"&gt;
          &lt;span class="ltag__twitter-tweet__quote__header__name"&gt;
            DappaDan is writing (🧱,🚀)
          &lt;/span&gt;
          &lt;a class="mentioned-user" href="https://dev.to/dappadandev"&gt;@dappadandev&lt;/a&gt;
        &lt;/div&gt;
        There will probably be a time where it's not critical to understand how blockchain technology works like it's not critical to understand how 'the internet works'. 

But that time is not now so educate yourself anon!
      &lt;/div&gt;

    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1491207046687256577" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1491207046687256577" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1491207046687256577" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;For this tour of the layers of a blockchain, let's take something more familiar - a typical company - to explain the function of each layer in a blockchain. But first, what are these layers everyone is talking about and why do we have them?&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Layers?
&lt;/h2&gt;

&lt;p&gt;A layer is a set of rules or protocols on how internal processes should be handled and how information on those processes should be shared with other layers externally. &lt;/p&gt;

&lt;p&gt;To start our business analogy, a layer would be a specific team in the company. Each team has its own set of goals, its own set of tools to meet these goals, and a way to communicate with other teams about them. Although each team has a different focus area, they all aim to serve the business as a whole. &lt;/p&gt;

&lt;p&gt;In the "blockchain company" the ultimate goal is to balance the decentralization, security, and scalability of the network. Each layer contributes to this goal in its unique way. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why Have Layers?
&lt;/h2&gt;

&lt;p&gt;Operating in a layered architecture provides the benefits of flexibility to be upgraded,  interoperability, and the ability to be designed for and applied to multiple use cases. &lt;/p&gt;

&lt;p&gt;Without layered system design, the internet would not be what it is today. We would be required to upgrade and use specific hardware and software to perform the common functions that we take for granted. Luckily one can access this article on the latest Macbook Pro or the long and forgotten closet PC. &lt;/p&gt;

&lt;p&gt;As a business scales from the 'wear multiple hats' start-up stage to a  larger organization, specialization of roles and teams naturally happens. When a blockchain needs to scale, a similar type of specialization is needed by creating separate but connected layers. &lt;/p&gt;

&lt;p&gt;Like most things in the world of blockchain, the number of layers and naming is up for debate. For the sake of simplicity, let's look at the main three layers: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CYO1E0H4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.getsmarter.com/blog/wp-content/uploads/2019/03/the-blockchain-development-stack-oxford-getsmarter-desktop-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CYO1E0H4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.getsmarter.com/blog/wp-content/uploads/2019/03/the-blockchain-development-stack-oxford-getsmarter-desktop-1.png" alt="Layers of Blockchain" width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
Source GetSmarter&lt;/p&gt;
&lt;h2&gt;
  
  
  Layer 1 - Protocol Layer - *The Accounting/Legal Team *
&lt;/h2&gt;

&lt;p&gt;No, the sacred developer rule of starting with 0 has not been broken. Layer 0 is best described as the 'groundwork layer'. It is made up of physical components like the hardware and infrastructure to support Layer 1. &lt;/p&gt;

&lt;p&gt;Layer 1, the protocol layer, is the base layer of any blockchain network. It supports the architecture as a whole and it is what proceeding layers are built on top of. This is where the familiar names such as Bitcoin and Etheruem 'live'. &lt;/p&gt;

&lt;p&gt;In a business, Layer 1 would be the accounting and legal departments. It performs the slow but necessary work that requires due diligence and attention to detail. The main functions of layer 1 are: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Preventing "double-spend"&lt;/strong&gt;  - using a centralized or decentralized ledger to ensure that the same money promised to one party is not also promised or sent to another. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Building Consensus&lt;/strong&gt;  - using popular algorithms like proof of stake (PoS) or proof of work (PoW) to ensure all participating nodes agreed on the present state of the ledger. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verification of Information&lt;/strong&gt; - like the financial reviews of an accounting department, Layer 1 also acts as the source of truth for settling transactions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a lot of responsibility for one layer to handle. And like the quote goes, "with great responsibility, comes a great amount of time to handle this responsibility".  Since no one likes to wait, more scalable and faster solutions are required.&lt;/p&gt;
&lt;h2&gt;
  
  
  Layer 2 - The Networking Layer - *The Sales Team *
&lt;/h2&gt;

&lt;p&gt;As anyone knows who has worked in any type of sales or commercial fashion, the ABC's of sales is "Always Be Closing". Like a skilled sales team, Layer 2 solutions want to process transactions faster and in an affordable way so that the customer keeps coming back. &lt;/p&gt;

&lt;p&gt;There are many flavors of these types of solutions but at their core, they provide methods to escrow assets so that two or more parties can transact at a faster pace without involving the main chain (Layer 1) settling every time. These methods are growing in popularity as more and more transactions are hitting the popular networks. &lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZFqygTw_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1416093904437448706/POUuuzkZ_normal.jpg" alt="Wesley profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Wesley
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/wslyvh"&gt;@wslyvh&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Skip L1 - Build on L2 🚀
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      14:48 PM - 30 Dec 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1476565952506572801" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1476565952506572801" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1476565952506572801" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;&lt;strong&gt;Rollups&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Rollups allow for computation of non-critical elements to the blockchain like executing the code smart contracts to be done off-chain. Information that is processed by the rollup on a sidechain is then 'rolled up'  on to the main chain. This is done under one signature and added to a block as any normal transaction would. The two most popular approaches to this are Optimistic Rollups (OR ) and Zero-Knowledge Rollups (ZK). Optimistic rollups, like &lt;a href="https://polygon.technology/"&gt;Polygon&lt;/a&gt;, send their final computations "optimistically" without any requiring proof of validation. ZK rollups, like &lt;a href="https://zksync.io/"&gt;zkSync&lt;/a&gt;, uses the cryptographic concept of zero-knowledge proofs which allow for a submitter to prove knowledge of certain information without exposing that information. It is the 'secret handshake to get into the club' of the blockchain world. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sharding&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Sharding achieves scalability by dividing tasks up into more manageable pieces and then spreading those tasks across the entire network. This allows for the necessary tasks of both validating and authenticating transactions to happen in sequential order and at the same time. This is the project manager on the team that lives and breathes on a JIRA board. It makes sure everyone is working dutifully and towards the same goal. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State Channels&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;State channels allow for a larger amount of assets to be committed to a certain transaction with the idea there will be several smaller transactions that are within this amount. In this case, a party can transact multiple times with another in an open state channel that is not committed to the main chain. Only after the parties agree to close the state channel, do the transactions get broadcasted and settled from each account. While there could have been many transactions that took place between the two parties, the main chain only sees two. This saves on compute for the settlement. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kmJ7Nmo_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/media/ExpsB94WYAEu3nN.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kmJ7Nmo_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/media/ExpsB94WYAEu3nN.jpg" alt="Layers of Blockchain" width="880" height="571"&gt;&lt;/a&gt;&lt;br&gt;
Source: @deversifi &lt;/p&gt;

&lt;h2&gt;
  
  
  Layer 3 - Application Layer - The Marketing Team
&lt;/h2&gt;

&lt;p&gt;So we have established a base for the transactions to take place (layer 1) and made sure that these transactions can be done in a scalable fashion (layer 2). Now it's time to tell the world about our accomplishments!  Like any good marketing team inside a company, you want to get your product out in the real world and have customers use it.  This is where Layer 3 or 'the application layer' comes into the mix. &lt;/p&gt;

&lt;p&gt;Like a magician that doesn't reveal its secrets, the goal of Layer 3 is to abstract away all of the work of the earlier layers to allow users direct interaction with applications. Through the creation of DApps (Decentralized Applications) that live on Layer 3, real-world use cases can be addressed to enable the greater expansion of blockchain technology.&lt;/p&gt;

&lt;p&gt;Since the goal of layer 3 is to mask the unique technical and semantic aspects of a given network, this layer is also prime real estate for &lt;a href="https://dappadan.hashnode.dev/blockchain-interoperability-a-gentle-introduction"&gt;interoperability&lt;/a&gt;. As this area of research grows, innovations around layer 3 will be important to deliver a seamless user experience similar to the Internet Protocol. Hopefully one day we can say "Blockchain, it just works!". &lt;/p&gt;




&lt;p&gt;Like any business, teams and structures can and will change. The layered architecture that we have currently may very well do the same. As Web3 continues to embrace new use cases and discover unknown challenges, investment in research and development for solutions will be needed. Luckily, there is a well-beaten path from the Internet Protocol to act as a guide for the future. &lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@chasta03?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Chastagner Thierry&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/tour-guide?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>web3</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Blockchain Interoperability - A Gentle Introduction</title>
      <dc:creator>DappaDan</dc:creator>
      <pubDate>Fri, 04 Feb 2022 13:46:49 +0000</pubDate>
      <link>https://dev.to/dappadandev/blockchain-interoperability-a-gentle-introduction-534</link>
      <guid>https://dev.to/dappadandev/blockchain-interoperability-a-gentle-introduction-534</guid>
      <description>&lt;p&gt;If you were to survey the entire Crypto community on what is needed to make Blockchain technology more mainstream you would probably get the same amount of answers as people you asked. Some would say improvements to onboarding are critical, others might feel that improvements in the UX are the true key. You would probably also get a few people banking on Ethereum moving to Proof of Stake being the silver bullet to the path of glory. We all know those types. &lt;/p&gt;

&lt;p&gt;The correct answer is, of course, blockchain interoperability. Right? &lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Interoperability might be a tricky word to say 5 times fast and even a tricker word to type out over and over again (thank you spell check!). But what does it mean? &lt;/p&gt;

&lt;p&gt;The earliest definition comes from Peter Wenger who defines interoperability as the "ability of two or more software components to cooperate despite differences in language, interface, and execution platform" (Wenger, 1996). &lt;/p&gt;

&lt;p&gt;You might not have known the exact definition of interoperability but you have experienced its benefits as all modern-day communication is built on top of this concept. The fact that you can access this page on the browser of your choice through the series of TCP/IP protocols is a testament to the power of interoperability (Blockchain Interoperability, n.d.). Imagine a world where this article was only available via Microsoft Edge and if you wanted to view it on Brave then I would need to send it through a specific proxy and destination network for any Brave users to access it. That would be a nightmare. &lt;/p&gt;

&lt;p&gt;This is not a world I want to live in but sadly this is the state of affairs when working across different blockchains. Seamlessly and &lt;a href="https://www.forbes.com/sites/jonathanponciano/2022/02/02/solanas-biggest-hack-yet-325-million-in-crypto-allegedly-stolen-from-1-billion-decentralized-finance-platform/?sh=5a1eaed86915"&gt;securely&lt;/a&gt; transferring assets across blockchains for example an NFT on Ethereum to Solana remains a mountain to be conquered.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is it important?
&lt;/h3&gt;

&lt;p&gt;While we all like to be in team ETH or team SOL on Twitter, in reality, we shouldn't need to be this tribal and this fragmentation is only hurting the crypto community as a whole. &lt;/p&gt;

&lt;p&gt;The reason behind this 'display name warfare' is primarily due to many blockchains being built as silos by design. Freely exchanging data and assets weren't inherently built into the original structures of the most popular blockchains. &lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--EB0g8QgF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1469481930567651332/ssWft9BQ_normal.jpg" alt="Armani Ferrante profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Armani Ferrante
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @armaniferrante
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      It's pretty common to see these types of takes from &lt;a href="https://twitter.com/evan_van_ness"&gt;@evan_van_ness&lt;/a&gt; and others on Solana. Kicking people when they're down. Would be great to see you guys in the arena instead of booing from the stands. &lt;a href="https://t.co/kYmWamYquF"&gt;twitter.com/evan_van_ness/…&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      03:12 AM - 03 Feb 2022
    &lt;/div&gt;

      &lt;div class="ltag__twitter-tweet__quote"&gt;
        &lt;div class="ltag__twitter-tweet__quote__header"&gt;
          &lt;span class="ltag__twitter-tweet__quote__header__name"&gt;
            Evan Van Ness 🐬
          &lt;/span&gt;
          @evan_van_ness
        &lt;/div&gt;
        This bridge that Sqlana hyped as "secure, trustless" a few months ago just got hacked for 80k ETH

About $220m at current ETH price. https://t.co/ADKQEIMwoA
      &lt;/div&gt;

    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1489074283775209473" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1489074283775209473" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1489074283775209473" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;As much as some might not like to admit it, different blockchains have their strengths and weaknesses. Whether it's a priority on decentralization, scalability, or security. Wouldn't it be great if depending on the asset or application being used,  you could leverage certain chains based on their strengths? &lt;/p&gt;

&lt;p&gt;If only asking the question was as easy as implementing the solution. &lt;/p&gt;

&lt;h3&gt;
  
  
  Why is it a challenge?
&lt;/h3&gt;

&lt;p&gt;Blockchain Interoperability is a tricky (and some would say impossible) endeavor due to the very nature of blockchains. For interoperability to be achieved there are a few things that are required in a three-phase procedure (Belchior et al., 2021): &lt;/p&gt;

&lt;p&gt;1) Source Blockchain - this is where the initial transaction will be initiated. &lt;br&gt;
2) Target Blockchain - this is where the transaction will be finally executed. &lt;/p&gt;

&lt;p&gt;Step 1: Locking of the asset on the source Blockchain. This is needed to ensure that the record will not exist twice on the source blockchain and target blockchain. &lt;/p&gt;

&lt;p&gt;Step 2: Committing the Transfer - we will explore later how different solutions handle this. Some may use a 3rd party or protocol to handle the transfer from source to target blockchain. &lt;/p&gt;

&lt;p&gt;Step 3: Create a representation - now that the transfer is completed, that asset now needs to exist on the target blockchain. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6dOJIEet--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s1.coincarp.com/news/20220114/B96FA8ED72DFC82B777E51B7E954C7DC4332..png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6dOJIEet--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s1.coincarp.com/news/20220114/B96FA8ED72DFC82B777E51B7E954C7DC4332..png" alt="Blockchain Interoperability" width="409" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For these steps to be performed, interoperability on both a technical integration level as well as covering any application-specific semantics between the two blockchains needs to be covered (Belchior et al., 2021) These challenges have been met with a few different approaches which have resulted in some interesting projects. &lt;/p&gt;

&lt;h3&gt;
  
  
  Three Different Approaches
&lt;/h3&gt;

&lt;p&gt;There have been many ways to categorize Interoperability solutions, the most modern way is by dividing them into 3 types: &lt;strong&gt;Public Connectors, Blockchain of Blockchains, and Hybrid Connectors.&lt;/strong&gt;(Belchior et al., 2021)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Public Connectors&lt;/strong&gt;&lt;br&gt;
These types of solutions were the earliest attempts at providing blockchain interoperability between cryptocurrency blockchains. An example of this would be the notary schemes that are utilized by both centralized exchanges like Coinbase and decentralized exchanges like Uniswap. These schemes monitor for certain events, like the deployment of a smart contract, taking place on multiple blockchains which then trigger transactions between chains. (Belchior et al., 2021)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Blockchains of Blockchains&lt;/strong&gt;&lt;br&gt;
To achieve interoperability, these solutions allow for the reusability of several layers of the blockchain including the data, network, consensus, incentive, and contract layers. These solutions typically operate with a secondary blockchain that is application-specific and interacts with the main blockchain as sort of a source of truth. (Belchior et al., 2021)&lt;/p&gt;

&lt;p&gt;The two main examples of these are &lt;a href="https://polkadot.network/"&gt;Polkadot&lt;/a&gt; and &lt;a href="https://cosmos.network/"&gt;Cosmos&lt;/a&gt;. Polkadot consists of three levels - 2 infrastructure (Relay chain and Parachain) and a Bridge level. The Relay chain is Polkadot's main network and is where all transactions are finalized. The parachains are customized blockchains that operate independently for specific developer or business use cases. These parachains rely on the Relay chain to ensure the accuracy of transactions. Lastly, the bridge level allows for communication with other networks like Ethereum when needed. (ChangeNOW.io, 2021)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MBM_2nMi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.news.bitcoin.com/wp-content/uploads/2020/09/SKYI5bLN-polkas.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MBM_2nMi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.news.bitcoin.com/wp-content/uploads/2020/09/SKYI5bLN-polkas.jpg" alt="A Deep Dive Into Polkadot and How DOT Became a Top Ten Crypto Contender" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cosmos is similar to Polkadot as it allows for independent blockchains to be running in parallel with each other. These blockchains can communicate with one another through the Inter-Blockchain Communication protocol (IBC). The &lt;a href="https://ibcprotocol.org/"&gt;IBC Protocol&lt;/a&gt; consists of a transport layer for security/authentication and an application layer for how data should be read by source and target blockchains. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hybrid Connectors&lt;/strong&gt;&lt;br&gt;
Hybrid Connectors achieve interoperability through the use of an abstraction layer that exposes a set of operations with which dApps can interact. The two primary approaches are through trusted relays and blockchain-agnostic protocols. (Belchior et al., 2021)&lt;/p&gt;

&lt;p&gt;Trusted Relays are trusted third parties that act as redirectors for transactions from source to target blockchains. By having a complete view of blockchain operations via the abstraction layer, blockchain-agnostic protocols can provide accountability to transacting parties across multiple blockchains. You can think of these as sort of the prison guards watching over the prisoners in the guard tower.&lt;/p&gt;




&lt;p&gt;Outside of these categories, there are exciting projects such as &lt;a href="https://chain.link/"&gt;Chainlink&lt;/a&gt; which recently released the  Cross-Chain Interoperability Protocol (CCIP) that enabled smart contracts across different blockchains to communicate and exchange data. Another is the Universal Passport from &lt;a href="https://www.nervos.org/"&gt;Nervos&lt;/a&gt; which is a suite of tools built on top of the Nervos CKB chain that enables "cross-chain circulation of assets". &lt;/p&gt;

&lt;p&gt;Like most solutions in this space, blockchain interoperability is still an angry baby looking for the right bottle. Each approach offers a series of benefits and there is a body of research being conducted to make improvements. Rather than bashing each other for choosing the right or wrong crypto to maxi, solving the interoperability problem should be a top priority for those in the community. This is a final boss-level challenge on the path to greater blockchain adoption which everyone benefits from. Solving this will open up a never-ending tap of use cases to apply this beloved technology to. Together, forward. &lt;/p&gt;




&lt;p&gt;Belchior, R., Vasconcelos, A., Guerreiro, S., &amp;amp; Correia, M. (2021). A Survey on Blockchain Interoperability: Past, Present, and Future Trends. &lt;em&gt;ArXiv:2005.14282 [Cs]&lt;/em&gt;. &lt;a href="http://arxiv.org/abs/2005.14282"&gt;http://arxiv.org/abs/2005.14282&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Blockchain Interoperability: What Is it and Why Does it Matter?&lt;/em&gt; (n.d.). Retrieved February 3, 2022, from &lt;a href="https://www.algorand.com/resources/blog/blockchain-interoperability-what-is-it-and-why-does/"&gt;https://www.algorand.com/resources/blog/blockchain-interoperability-what-is-it-and-why-does/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ChangeNOW.io. (2021, November 18). Why Is Blockchain Interoperability The Future Of Cryptocurrency? &lt;em&gt;The Capital&lt;/em&gt;. &lt;a href="https://medium.com/the-capital/why-is-blockchain-interoperability-the-future-of-cryptocurrency-dd083374ad5d"&gt;https://medium.com/the-capital/why-is-blockchain-interoperability-the-future-of-cryptocurrency-dd083374ad5d&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gorbunov, S. (2022, February 3). &lt;em&gt;Lessons Learned: The Internet’s Evolution as a Blueprint for Blockchain Interoperability&lt;/em&gt; [Blog]. Lessons Learned: The Internet’s Evolution as a Blueprint for Blockchain Interoperability; Nasdaq. &lt;a href="https://www.nasdaq.com/articles/lessons-learned%3A-the-internets-evolution-as-a-blueprint-for-blockchain-interoperability"&gt;https://www.nasdaq.com/articles/lessons-learned%3A-the-internets-evolution-as-a-blueprint-for-blockchain-interoperability&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wegner, P. (1996). Interoperability. &lt;em&gt;ACM Computing Surveys&lt;/em&gt;, &lt;em&gt;28&lt;/em&gt;(1), 285–287. &lt;a href="https://doi.org/10.1145/234313.234424"&gt;https://doi.org/10.1145/234313.234424&lt;/a&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>web3</category>
      <category>defi</category>
      <category>crypto</category>
    </item>
  </channel>
</rss>
