<?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>Forem: sumeet saraf</title>
    <description>The latest articles on Forem by sumeet saraf (@sumeet_ingenuity).</description>
    <link>https://forem.com/sumeet_ingenuity</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%2F3130512%2Fdf6f2f31-807c-432c-a51f-29f8885465cc.png</url>
      <title>Forem: sumeet saraf</title>
      <link>https://forem.com/sumeet_ingenuity</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sumeet_ingenuity"/>
    <language>en</language>
    <item>
      <title>"Building a Lightweight Blockchain in Go from Scratch"</title>
      <dc:creator>sumeet saraf</dc:creator>
      <pubDate>Fri, 09 May 2025 16:52:19 +0000</pubDate>
      <link>https://forem.com/sumeet_ingenuity/building-a-lightweight-blockchain-in-go-from-scratch-4i85</link>
      <guid>https://forem.com/sumeet_ingenuity/building-a-lightweight-blockchain-in-go-from-scratch-4i85</guid>
      <description>&lt;p&gt;Hey Gophers and blockchain enthusiasts! 👋&lt;/p&gt;

&lt;p&gt;I recently built Lite-Blockchain, a minimal yet functional blockchain implementation in Go. The goal was to demystify how blockchains work under the hood while leveraging Go’s simplicity and concurrency features. Let me walk you through what I learned!&lt;/p&gt;

&lt;p&gt;Why Build a Blockchain in Go?&lt;br&gt;
Go’s native support for concurrency (goroutines, channels) and efficient performance makes it a great fit for distributed systems like blockchains. Plus, its simplicity helps keep the codebase clean and educational.&lt;/p&gt;

&lt;p&gt;Key Features&lt;br&gt;
Proof-of-Work (PoW) Consensus: A Simple mining mechanism to secure the chain.&lt;/p&gt;

&lt;p&gt;Transaction System: Create and validate transactions.&lt;/p&gt;

&lt;p&gt;Pure Go: No external dependencies—just the standard library.&lt;/p&gt;

&lt;p&gt;Lightweight: Perfect for learning.&lt;/p&gt;

&lt;p&gt;Code Snippets&lt;br&gt;
Here’s a peek at how blocks are structured:&lt;/p&gt;

&lt;p&gt;go&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type Block struct {  
    Timestamp    int64  
    Transactions []*Transaction  
    PrevHash     []byte  
    Hash         []byte  
    Nonce        int  
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And how transactions are added:&lt;/p&gt;

&lt;p&gt;go&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func (bc *Blockchain) AddTransaction(sender, recipient string, amount int) {  
    tx := NewTransaction(sender, recipient, amount)  
    bc.PendingTransactions = append(bc.PendingTransactions, tx)  
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why Go for Blockchain?&lt;br&gt;
Concurrency: Goroutines make parallel mining or network synchronization easier to model.&lt;/p&gt;

&lt;p&gt;Performance: Faster than interpreted languages like Python.&lt;/p&gt;

&lt;p&gt;Simplicity: Explicit error handling and no inheritance headaches.&lt;/p&gt;

&lt;p&gt;Try It Out!&lt;br&gt;
Clone the repo:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
git clone &lt;a href="https://github.com/sumeetingenuity/Lite-Blockchain.git" rel="noopener noreferrer"&gt;https://github.com/sumeetingenuity/Lite-Blockchain.git&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Run the example:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
go run main.go&lt;br&gt;&lt;br&gt;
Contribute or Learn&lt;br&gt;
This project is open-source and meant to be a learning resource! Feel free to:&lt;br&gt;
⭐ Star the repo if you find it useful.&lt;br&gt;
🐞 Open issues for bugs or feature requests.&lt;br&gt;
🔧 Submit PRs for improvements (e.g., adding a P2P network layer).&lt;/p&gt;

&lt;p&gt;Check out the GitHub repo to dive deeper!&lt;/p&gt;

</description>
      <category>go</category>
      <category>blockchain</category>
      <category>opensource</category>
      <category>distributedsystems</category>
    </item>
    <item>
      <title>I'm looking for some feedback on my project</title>
      <dc:creator>sumeet saraf</dc:creator>
      <pubDate>Wed, 07 May 2025 17:43:45 +0000</pubDate>
      <link>https://forem.com/sumeet_ingenuity/im-looking-for-some-feedback-on-my-project-1n3p</link>
      <guid>https://forem.com/sumeet_ingenuity/im-looking-for-some-feedback-on-my-project-1n3p</guid>
      <description>&lt;p&gt;I'm new to programming and not sure if I'm heading in the right direction. I'd really appreciate any feedback or constructive criticism on my project. Thanks in advance for your help!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sumeetingenuity/Lite-Blockchain.git" rel="noopener noreferrer"&gt;https://github.com/sumeetingenuity/Lite-Blockchain.git&lt;/a&gt;&lt;/p&gt;

</description>
      <category>learning</category>
      <category>beginners</category>
      <category>programming</category>
      <category>github</category>
    </item>
  </channel>
</rss>
