<?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: Usman Asim</title>
    <description>The latest articles on DEV Community by Usman Asim (@usmanasim).</description>
    <link>https://dev.to/usmanasim</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%2F1854032%2Ffc8f9c66-5a92-45dc-a84c-a23e7856309a.jpg</url>
      <title>DEV Community: Usman Asim</title>
      <link>https://dev.to/usmanasim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/usmanasim"/>
    <language>en</language>
    <item>
      <title>An Introduction to Leo: Crafting Privacy-Preserving Blockchain Applications</title>
      <dc:creator>Usman Asim</dc:creator>
      <pubDate>Mon, 29 Jul 2024 12:47:02 +0000</pubDate>
      <link>https://dev.to/usmanasim/an-introduction-to-leo-crafting-privacy-preserving-blockchain-applications-4b58</link>
      <guid>https://dev.to/usmanasim/an-introduction-to-leo-crafting-privacy-preserving-blockchain-applications-4b58</guid>
      <description>&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%2Fez5on2befznuylebq161.png" 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%2Fez5on2befznuylebq161.png" alt="Image description" width="449" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Privacy vs. Transparency in Blockchain&lt;/li&gt;
&lt;li&gt;Core Concepts of Leo Programming&lt;/li&gt;
&lt;li&gt;Advanced Features and Techniques&lt;/li&gt;
&lt;li&gt;Real-World Applications and Use Cases&lt;/li&gt;
&lt;li&gt;Deploying Your First Leo Program&lt;/li&gt;
&lt;li&gt;Next Steps&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Privacy vs. Transparency in Blockchain &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Traditional blockchains offer transparency but sacrifice privacy, exposing sensitive data and limiting adoption for many real-world applications leaving developers to face a significant challenge: how to build applications that maintain the integrity and transparency of blockchain while preserving user privacy.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Leo Programming Language
&lt;/h2&gt;

&lt;p&gt;Enter Leo. Leo is a statically-typed programming language specifically designed for writing zero-knowledge applications; it combines the expressiveness needed for complex computations with the ability to generate zero-knowledge proofs, making it a powerful tool for developers looking to build privacy-focused blockchain applications giving devs the ability to build applications that maintain the integrity and transparency of blockchain while preserving user privacy.&lt;/p&gt;

&lt;p&gt;Zero-knowledge proofs allow one party (the prover) to prove to another party (the verifier) that a statement is true, without revealing any information beyond the validity of the statement itself. Think of a "ZK Proof" like proving you know the password to an account without actually saying the password. Imagine proving you have enough money in your bank account to buy a car, without revealing your exact balance or any transaction history. You demonstrate you meet the financial requirement without exposing any private financial details.&lt;/p&gt;

&lt;p&gt;In the context of blockchain applications, this enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Private transactions and computations&lt;/li&gt;
&lt;li&gt;Scalable off-chain computations with on-chain verification&lt;/li&gt;
&lt;li&gt;Enhanced privacy for users while maintaining the integrity of the blockchain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Leo, as a programming language, abstracts much of the complexity involved in creating zero-knowledge proofs, allowing developers to focus on building innovative applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Leo Works: Bridging High-Level Code and Zero-Knowledge Circuits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Intuitive Syntax:&lt;/em&gt; Leo's syntax is familiar to developers coming from languages like Rust or TypeScript, lowering the barrier to entry for zero-knowledge programming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Zero-Knowledge Abstraction:&lt;/em&gt; Leo abstracts the complexities of zero-knowledge proof systems, allowing developers to focus on application logic rather than cryptographic intricacies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Efficient Compilation:&lt;/em&gt; The Leo compiler transforms high-level code into optimized arithmetic circuits suitable for generating zero-knowledge proofs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Privacy by Design:&lt;/em&gt; Leo's type system and built-in primitives encourage developers to think in terms of privacy from the ground up.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Core Concepts of Leo Programming &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Program Structure
&lt;/h3&gt;

&lt;p&gt;A Leo program typically consists of the following components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;program token.aleo {
    // Record definitions
    // Mapping definitions
    // Transition functions
    // Helper functions
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Records: Private Data Structures
&lt;/h3&gt;

&lt;p&gt;Records in Leo represent private data that only the owner can decrypt and use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;record Token {
    owner: address,
    amount: u64,
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Transitions: Entry Points for Interaction
&lt;/h3&gt;

&lt;p&gt;Transitions are public functions that serve as entry points for interacting with your program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;transition transfer(sender: Token, receiver: address, amount: u64) -&amp;gt; (Token, Token) {
    assert(sender.amount &amp;gt;= amount);

    let remaining: Token = Token {
        owner: sender.owner,
        amount: sender.amount - amount,
    };

    let transferred: Token = Token {
        owner: receiver,
        amount: amount,
    };

    return (remaining, transferred);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mappings: Public State Management
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Mappings in Leo are used to store public state:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mapping balances: address =&amp;gt; u64;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Visibility and Privacy
&lt;/h3&gt;

&lt;p&gt;Leo provides fine-grained control over data visibility:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;private&lt;/code&gt;: The default, visible only to the owner&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;public&lt;/code&gt;: Visible on-chain&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;constant&lt;/code&gt;: Immutable and publicly visible&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Advanced Features and Techniques &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Leo provides built-in functions for common cryptographic operations:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Efficient Leo programs minimize the number of constraints generated:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For sensitive computations, use constant-time operations to prevent timing attacks:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Real-World Applications and Use Cases &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Having ease of developing using zero knowledge proofs like this opens up a new paradigm to building new types of applications that you could not build before. A few interesting possible implementations of what a few different sectors affected by this tech could look like: &lt;/p&gt;

&lt;h3&gt;
  
  
  Anonymous Credentials
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A system for proving credential ownership without revealing identity:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Define a record to represent a credential

record Credential {
    owner: address,        // The address of the credential owner
    credential_type: u8,   // The type of credential (e.g., 1 for driver's license, 2 for passport)
    expiration: u32,       // The expiration date of the credential
}

// This transition proves ownership of a valid credential without revealing the owner's identity
transition prove_credential(
    credential: Credential,  // The credential to be proven
    challenge: field         // A challenge provided by the verifier
) -&amp;gt; bool {
    // Ensure the credential hasn't expired
    assert(credential.expiration &amp;gt; block.height);

    // Create a proof by hashing the owner's address with the challenge
    // This proves ownership without revealing the address
    let proof: field = hash(credential.owner, challenge);

    // Return the proof
    return proof;
}

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Privacy-Preserving Supply Chain
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Tracking products through a supply chain while maintaining privacy:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Define a record to represent the status of a product in the supply chain
record ProductStatus {
    product_id: field,     // Unique identifier for the product
    current_owner: address, // Current owner of the product
    status: u8,            // Current status of the product (e.g., 1 for manufactured, 2 for shipped, 3 for delivered)
}

// This transition updates the status of a product in the supply chain
transition update_status(
    product: ProductStatus,  // The current status of the product
    new_status: u8,          // The new status to update to
    new_owner: address       // The new owner of the product
) -&amp;gt; ProductStatus {
    // Return a new ProductStatus record with updated information
    return ProductStatus {
        product_id: product.product_id,  // Keep the same product ID
        current_owner: new_owner,        // Update the owner
        status: new_status,              // Update the status
    };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Deploying Your First Leo Program &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Project Setup
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Ensure you have &lt;a href="https://www.rust-lang.org/" rel="noopener noreferrer"&gt;Rust&lt;/a&gt; 1.76.0 or above installed before running Leo programs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Leo
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone the Leo repository:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/ProvableHQ/leo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Navigate to the Leo directory and build from source:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd &lt;/span&gt;leo
   cargo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--path&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Verify the installation by running the &lt;code&gt;leo&lt;/code&gt; command. You should see output similar to:&lt;/li&gt;
&lt;/ol&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%2F04qm5a6ws9gf0sxaalvy.png" 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%2F04qm5a6ws9gf0sxaalvy.png" alt="Leo CLI output" width="752" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take some time to explore the various CLI commands and familiarize yourself with the available options.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Your First Leo Project
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a new Leo project:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   leo new hello
   &lt;span class="nb"&gt;cd &lt;/span&gt;hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;This command creates a new directory with the following structure:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   hello/
   ├── settings.json
   ├── .gitignore
   ├── .env
   ├── program.json
   └── src/
       └── main.leo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding the Project Files
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.gitignore&lt;/code&gt;: Default Git ignore file for Leo projects&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.env&lt;/code&gt;: Contains environment variables (e.g., &lt;code&gt;NETWORK&lt;/code&gt;, &lt;code&gt;PRIVATE_KEY&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;program.json&lt;/code&gt;: The manifest file for the Leo project&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;build/&lt;/code&gt;: Directory for compiled code&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/main.leo&lt;/code&gt;: The main Leo source code file&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Examining the Code
&lt;/h3&gt;

&lt;p&gt;Open &lt;code&gt;src/main.leo&lt;/code&gt;. You'll see the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// The 'hello' program.
program hello.aleo {
    transition main(public a: u32, b: u32) -&amp;gt; u32 {
        let c: u32 = a + b;
        return c;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple program:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defines a program named &lt;code&gt;hello.aleo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Creates a &lt;code&gt;transition&lt;/code&gt; function named &lt;code&gt;main&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Takes two &lt;code&gt;u32&lt;/code&gt; (32-bit unsigned integer) inputs, &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Adds these inputs and returns the result&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Running the Program
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Execute the program:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   leo run main 1u32 2u32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;You should see output similar to:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   Leo Compiled 'main.leo' into Aleo instructions
   ⛓  Constraints
    •  'hello.aleo/main' - 33 constraints (called 1 time)
   ➡️  Output
    • 3u32

   Leo ✅ Finished 'hello.aleo/main' (in "/hello/build")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's what it looks like in a VS Code terminal:&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%2Fyvfn9p4eeb8ghml2t0k6.png" 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%2Fyvfn9p4eeb8ghml2t0k6.png" alt="Leo run output in VS Code" width="800" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! You've just run your first zero-knowledge program in the Leo language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Leo CLI Commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Clean the build directory:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  leo clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Update Leo to the latest version:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  leo update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Execute the program and output a transaction object:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  leo execute main 1u32 2u32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Next Steps &lt;a&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that you've created and run your first Leo program, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exploring building out more complex apps - there's some really unique stuff that can be built here&lt;/li&gt;
&lt;li&gt;Modifying the &lt;code&gt;main&lt;/code&gt; function to perform different operations that are unique and out of the box &lt;/li&gt;
&lt;li&gt;Adding new functions to your program that have some application level logic &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember, Leo is designed for creating privacy-preserving applications on the blockchain, so as you become more comfortable with the basics, start exploring how to leverage Leo's features for building secure and private decentralized applications.&lt;/p&gt;

&lt;p&gt;Heres some additional resources as you continue to go down the rabbit hole: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/AleoHQ/workshop" rel="noopener noreferrer"&gt;The Aleo Workshop Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/howardwu/awesome-aleo" rel="noopener noreferrer"&gt;The Awesome Aleo Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.aleo.org/testnet/getting_started/developer_toolkit" rel="noopener noreferrer"&gt;The Leo Developer ToolKit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.aleo.org/sdk/create-aleo-app/tutorial" rel="noopener noreferrer"&gt;Create a Full Stack Aleo App with Leo, React, and Javascript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=ABPCr2TwrgE" rel="noopener noreferrer"&gt;Aleo Developer Workshop Video&lt;/a&gt;
Some great resources to dive deeper down the rabbit hole: &lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>rust</category>
      <category>zeroknowledge</category>
      <category>zk</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>Deploying a Distributed EVM Layer 1 Blockchain using Avalanche, Docker, and GitHub Codespaces</title>
      <dc:creator>Usman Asim</dc:creator>
      <pubDate>Mon, 29 Jul 2024 10:14:34 +0000</pubDate>
      <link>https://dev.to/usmanasim/deploying-a-distributed-evm-layer-1-blockchain-using-avalanche-docker-and-github-codespaces-5eo6</link>
      <guid>https://dev.to/usmanasim/deploying-a-distributed-evm-layer-1-blockchain-using-avalanche-docker-and-github-codespaces-5eo6</guid>
      <description>&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%2Fkqq5i2iyiaa5zp6q2ak8.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%2Fkqq5i2iyiaa5zp6q2ak8.jpeg" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the last few years, as developers we've witnessed a surge in platforms offering diverse execution environments for smart contracts across the blockchain landscape. Lots of cool new chains launching with different systems for building blockchain based applications. While there are large numbers of new networks releasing, the current landscape primarily consists of two approaches:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;High performance single shared state environments where multiple applications coexist on the same blockchain.&lt;/li&gt;
&lt;li&gt;Individual layer 2 application-specific blockchains that settle to another blockchain network, typically run using a single sequencer (essentially, one node).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One of the most powerful alternatives to all this, is launching your own high performance blockchain where you own everything from full control of your validators, to what virtual machine, how permissionless or permissioned, etc. This can only be done by deploying your own Layer 1 blockchain network that has very few rules associated with it. &lt;/p&gt;

&lt;p&gt;For the sake of today's tutorial, we will be utilizing Avalanche, which specializes in deploying fully customizable layer 1 blockchain networks running on top of a scalable and fast consensus mechanism (true finality in under 2s). &lt;/p&gt;

&lt;p&gt;We are going to be walking through how to deploy our own test blockchain with 5 nodes, with our own token. We'll also showcase how to deploy a simple smart contract on this newly created blockchain. &lt;/p&gt;

&lt;p&gt;We will be using the Avalanche Start Kit repo, Docker, and Github Codespaces to run this project -- meaning you don't have to install anything :) &lt;/p&gt;

&lt;p&gt;(Of course, you have full ability to install the starter kit on your local machine and execute everything with Docker from there as well. For sake of simple testing, we will be using Codespaces for this tutorial.) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the &lt;a href="https://github.com/ava-labs/avalanche-starter-kit" rel="noopener noreferrer"&gt;Avalanche Starter Kit repository&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Locate the green "Code" button and click "Open with Codespaces"&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This action will open a separate tab that launches the project in a GitHub Codespace and automatically runs Docker&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To verify that everything is working correctly, run the following command in the terminal:&lt;br&gt;
&lt;code&gt;avalanche -h&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
If everything is set up correctly, you should see the Avalanche CLI help output: &lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fihcj46c7xzqzvpixpkp2.png" 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%2Fihcj46c7xzqzvpixpkp2.png" alt="Image description" width="645" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Creating Your Custom Blockchain Network&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that our environment is set up, let's dive into creating our custom blockchain network. We'll use the Avalanche CLI tool to create a layer 1 blockchain network.&lt;/p&gt;

&lt;p&gt;(At the time of writing this tutorial - Avalanche still employs the term "subnet", which is Avalanche's term for a custom blockchain network. Soon this will change to "Layer 1" - Be mindful of this when entering these commands.)&lt;/p&gt;

&lt;p&gt;We're going to start with creating our blockchain network using the 'create' command: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the following command:
&lt;code&gt;avalanche subnet create {blockchainName}&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This command initiates the subnet creation wizard. Let's break down each step:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VM Selection:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;✔ Subnet-EVM&lt;/code&gt;&lt;br&gt;
We're choosing the Subnet-EVM (Ethereum Virtual Machine), which allows our blockchain to be compatible with Ethereum smart contracts and tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VM Version:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;✔ Use latest release version&lt;/code&gt;&lt;br&gt;
This ensures we're using the most up-to-date version of the Subnet-EVM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross Chain Communication:&lt;/strong&gt;&lt;br&gt;
Will also ask if you would like to enable Teleporter. This is Avalanche's EVM-EVM cross chain communication protocol. Highly recommend to run this if you are planning on testing multiple blockchains and sending transactions between them. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chain ID:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;ChainId: {}&lt;/code&gt;&lt;br&gt;
Enter your subnet's ChainId. It can be any positive integer - the Chain ID is a unique identifier for your blockchain. It's crucial for preventing replay attacks and for wallet interactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token Symbol:&lt;/strong&gt;&lt;br&gt;
Select a symbol for your subnet's native token&lt;br&gt;
&lt;code&gt;Token symbol: {}&lt;/code&gt;&lt;br&gt;
This defines the ticker for your blockchain's native token, which will be used for gas fees and transactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gas Configuration:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;✔ Low disk use    / Low Throughput    1.5 mil gas/s (C-Chain's setting)&lt;/code&gt;&lt;br&gt;
This setting determines the computational capacity of your blockchain. We're using the C-Chain's setting for this example, but you can customize this based on your needs. You can also go high usage and bump up the power of your system. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Airdrop:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;✔ Airdrop 1 million tokens to the default ewoq address (do not use in production)&lt;/code&gt;&lt;br&gt;
This allocates initial tokens to a test address for development purposes.&lt;br&gt;
`&lt;br&gt;
After completing these steps, you should see output similar to this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;✓ Successfully created subnet configuration&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here is what my terminal looks like now that we got through the setup process: &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%2Fyvvump0x9rvs675xd75z.png" 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%2Fyvvump0x9rvs675xd75z.png" alt="Image description" width="645" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This process creates two important configuration files:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;genesis.json&lt;/code&gt;: Defines the initial state of your blockchain&lt;br&gt;
&lt;code&gt;sidecar.json&lt;/code&gt;: Contains metadata about your subnet&lt;/p&gt;

&lt;p&gt;These files are stored in &lt;code&gt;~/.avalanche-cli/subnets/&amp;lt;subnetName&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Deploying Your Subnet&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we've created our subnet configuration, it's time to deploy it to a local network. &lt;/p&gt;

&lt;p&gt;Type this command: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;avalanche subnet deploy {blockchainName}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When prompted, select "Local Network" as the deployment target.&lt;/p&gt;

&lt;p&gt;After deployment, you'll see output containing important information about your new blockchain, including RPC URLs, node details, and connection information.&lt;/p&gt;

&lt;p&gt;Here's what a successful deployment looks like: &lt;br&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%2Fzjb8ehxxkyni2xwaiz6i.png" 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%2Fzjb8ehxxkyni2xwaiz6i.png" alt="Image description" width="645" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If yours looks like similarly, congratulations! You just deployed a full cross chain compatible EVM blockchain on Github Codespaces, running a 5 node network. That is no easy feat... but we are not done yet. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Interacting with Your Blockchain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that your blockchain is deployed, lets have some fun and interact with it using various tools... but first: &lt;/p&gt;

&lt;p&gt;Since the Avalanche Network is running in a Github Codespace - the localhost (127.0.0.1) will only be accessible from inside the Codespace. Connecting your wallet using the localhost RPC URL will not work, since your wallet will be running on your computer, and not the local environment where the network is running (the Codespace cloud).&lt;/p&gt;

&lt;p&gt;So, we just need to make a small adjustment and make the RPC-Endpoint publicly accessible. Click on the little antenna icon in the bottom bar of the Codespace:&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%2Fwt0dp47nyapglma0n1k2.png" 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%2Fwt0dp47nyapglma0n1k2.png" alt="Image description" width="750" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There select the row with the port 9650 and right-click to open the port:&lt;/li&gt;
&lt;/ul&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%2Fkfvaj8x1lgfpwmm6woq4.png" 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%2Fkfvaj8x1lgfpwmm6woq4.png" alt="Image description" width="750" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Now that it's publicly avaialble we can add it to a wallet like Core Wallet or MetaMask:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;a href="https://core.app/" rel="noopener noreferrer"&gt;Core Wallet&lt;/a&gt;: &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the networks symbol in the corner and click "manage networks"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once there, click the + symbol. should birng up a screen like this: &lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fe9gelsdvttrd695gbfcc.png" 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%2Fe9gelsdvttrd695gbfcc.png" alt="Image description" width="372" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter in the details from your blockchain deployment:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example&lt;br&gt;
Network Name: PaymentChain&lt;br&gt;
RPC URL: (use the Codespace RPC URL from the deployment output)&lt;br&gt;
Chain ID: 123&lt;br&gt;
Currency Symbol: PAY&lt;/p&gt;

&lt;p&gt;You should then be able to be connected to your newly deployed blockchain! &lt;/p&gt;

&lt;p&gt;Now lets also import the account that we selected to be funded with all the networks token (you can customize how this is done) &lt;/p&gt;

&lt;p&gt;On top of your Core wallet, click the current account and then in the corner there is a + - import from private key. then input the private key provided in your terminal after your blockchain had deployed. This should give you a fully funded account. &lt;/p&gt;

&lt;p&gt;Should look like this when done: &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%2F8bmm2f8wt4rm6txwbli8.png" 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%2F8bmm2f8wt4rm6txwbli8.png" alt="Image description" width="372" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have just deployed our own 5 node blockchain network, deployed a EVM blockchain to it, connected to that network with a wallet, and custodied the network token. &lt;/p&gt;

&lt;p&gt;Now time to deploy a smart contract: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Deploying a Smart Contract to Your New Blockchain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we have our custom blockchain up and running, let's deploy a smart contract to it. We'll create a simple calculator contract with four basic operations: addition, subtraction, multiplication, and division. Then, we'll deploy it using Remix and interact with it on our new blockchain.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. Writing the Smart Contract&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First, let's write our calculator smart contract, using Remix IDE for this. Remix IDE (Integrated Development Environment) is a powerful, open-source tool for developing smart contracts on Ethereum-compatible blockchains.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;a href="https://remix.ethereum.org/" rel="noopener noreferrer"&gt;Remix IDE &lt;/a&gt;in your browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new file by clicking the "+" icon in the file explorer. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Name it &lt;code&gt;SimpleCalculator.sol.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paste the following code into the file:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;

&lt;p&gt;// SPDX-License-Identifier: MIT&lt;br&gt;
pragma solidity ^0.8.0;&lt;/p&gt;

&lt;p&gt;contract SimpleCalculator {&lt;br&gt;
    // Event to log calculations&lt;br&gt;
    event Calculation(string operation, int256 a, int256 b, int256 result);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function add(int256 a, int256 b) public returns (int256) {
    int256 result = a + b;
    emit Calculation("addition", a, b, result);
    return result;
}

function subtract(int256 a, int256 b) public returns (int256) {
    int256 result = a - b;
    emit Calculation("subtraction", a, b, result);
    return result;
}

function multiply(int256 a, int256 b) public returns (int256) {
    int256 result = a * b;
    emit Calculation("multiplication", a, b, result);
    return result;
}

function divide(int256 a, int256 b) public returns (int256) {
    require(b != 0, "Cannot divide by zero");
    int256 result = a / b;
    emit Calculation("division", a, b, result);
    return result;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;br&gt;
This contract includes four functions for basic arithmetic operations, where ach function emits an event logging the operation, inputs, and result, which will be useful for testing and monitoring.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;2. Compiling the Contract&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Remix, navigate to the "Solidity Compiler" tab (it looks like a "S" symbol).&lt;/li&gt;
&lt;li&gt;Ensure that the "Compiler" version is set to 0.8.0 or higher to match our pragma statement.&lt;/li&gt;
&lt;li&gt;Click "Compile SimpleCalculator.sol".&lt;/li&gt;
&lt;li&gt;You should see a green checkmark indicating successful compilation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;3: Deploying the Contract&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, let's deploy our contract to our custom Avalanche blockchain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Switch to the "Deploy &amp;amp; Run Transactions" tab in Remix (it looks like a "&amp;gt;_" symbol).&lt;/li&gt;
&lt;li&gt;In the "Environment" dropdown, select "Injected Web3". This will prompt you to connect your wallet (Core Wallet or MetaMask) that you've set up with your custom blockchain.&lt;/li&gt;
&lt;li&gt;Ensure your wallet is connected to your custom Avalanche blockchain. You should see your account address and balance in Remix.&lt;/li&gt;
&lt;li&gt;Under "Contract", select "SimpleCalculator" from the dropdown.&lt;/li&gt;
&lt;li&gt;Click "Deploy". Your wallet will prompt you to confirm the transaction. Approve it to deploy the contract.&lt;/li&gt;
&lt;li&gt;Once deployed, you'll see the contract appear under "Deployed Contracts" in Remix.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Step 4: Interacting with the Contract&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now that our contract is deployed, let's test each function:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expand the deployed contract in Remix.&lt;/li&gt;
&lt;li&gt;You'll see input fields for each function: add, subtract, multiply, and divide.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's test the add function:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter 5 in the first input field and 3 in the second.&lt;/li&gt;
&lt;li&gt;Click "transact".&lt;/li&gt;
&lt;li&gt;Your wallet will prompt you to confirm the transaction. Approve it.&lt;/li&gt;
&lt;li&gt;Look at the Remix console. You should see the transaction details and the emitted event showing the result (8).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is what a successful operation looks like: &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%2Fezpl6dchxq8mw3e5ml0e.png" 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%2Fezpl6dchxq8mw3e5ml0e.png" alt="Image description" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repeat this process for the other functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subtract: 10 and 4 (should return 6)&lt;/li&gt;
&lt;li&gt;Multiply: 7 and 6 (should return 42)&lt;/li&gt;
&lt;li&gt;Divide: 20 and 5 (should return 4)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try dividing by zero (e.g., 5 and 0) to test the error handling in the divide function.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Understanding the Process&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's break down what's happening here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smart Contract Deployment: When we deploy the contract, we're actually sending a special transaction to our custom blockchain. This transaction includes the bytecode of our compiled contract. The blockchain then allocates an address for this contract, which is where the contract "lives" on the blockchain.&lt;/li&gt;
&lt;li&gt;Function Calls: Each time we call a function (like add or multiply), we're sending a transaction to the contract's address. This transaction includes data that specifies which function to call and what parameters to use.&lt;/li&gt;
&lt;li&gt;Gas Fees: Notice that each transaction requires a small amount of your custom token as a gas fee. This is because each operation on the blockchain requires computational resources, and gas is the mechanism for allocating these resources fairly.&lt;/li&gt;
&lt;li&gt;Events: The Calculation event we defined in the contract is emitted with each function call. These events are stored in the transaction logs and can be easily queried, making them useful for tracking contract activity off-chain.&lt;/li&gt;
&lt;li&gt;State Changes: Although our calculator doesn't store any state, more complex contracts often do. Any state changes would be permanently recorded on the blockchain as part of the transaction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! If you made it to the end, you've now deployed a functional  custom blockchain, running atop a 5 node network. You also deployed a application to that newly created network which demonstrated the basics of smart contract interaction: deploying contracts, calling functions, handling errors, and emitting events.&lt;/p&gt;

&lt;p&gt;Now a door of unlimited possibilites is open; build your own blockchain, however you want. &lt;/p&gt;

&lt;p&gt;If you want to learn more about Avalanche and deep dive into custom blockchain development, check out the &lt;a href="https://academy.avax.network" rel="noopener noreferrer"&gt;Avalanche Academy.&lt;/a&gt; &lt;/p&gt;

</description>
      <category>docker</category>
      <category>blockchain</category>
      <category>programming</category>
      <category>github</category>
    </item>
  </channel>
</rss>
