<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ahmad Saeed on Medium]]></title>
        <description><![CDATA[Stories by Ahmad Saeed on Medium]]></description>
        <link>https://medium.com/@saieee?source=rss-ceebfb520c69------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LpG6Pz7vICiNqnkuivbUjA.jpeg</url>
            <title>Stories by Ahmad Saeed on Medium</title>
            <link>https://medium.com/@saieee?source=rss-ceebfb520c69------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 13:53:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saieee/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[EIP 2535 aka ‘the Diamond Standard’]]></title>
            <link>https://saieee.medium.com/eip-2535-aka-the-diamond-standard-41a062a1471c?source=rss-ceebfb520c69------2</link>
            <guid isPermaLink="false">https://medium.com/p/41a062a1471c</guid>
            <category><![CDATA[eip-2535]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Ahmad Saeed]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 12:00:30 GMT</pubDate>
            <atom:updated>2022-07-25T12:21:56.853Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever heard about EIP 2535? Many projects are using it under the hood these days. Surprised right? I have had my fair share of time spent on projects where I made use of this idea for granted, as I have scaled applications on this very idea of “proxified” approach. Many still scratch their heads when they hear the word ‘Diamond standard’. Why would you even need this Diamond Standard? What are the few best possible scenarios where <em>diamonds</em> really help you scale up the architecture? Let’s put it into super simple words. Fewer jargons, more intuition. let’s get into it!</p><p>So what is EIP 2535? In short, it’s a way to organize large and very complex solidity smart contracts. It’s organized and kind of a <a href="https://blog.openzeppelin.com/proxy-patterns/">proxy pattern</a> with one single contract, proxying calls to several different contracts behind. <strong>So basically, you have a smart contract living at one single address that can make calls to various different contracts at different addresses.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*L2ljFNNMozq22Xm3.jpeg" /><figcaption>Simple isn’t it?</figcaption></figure><p>In practice, in a large decentralized application, you would organize similar logic into various smart contracts. And these contracts can be deployed separately from each other and don’t even have to talk to each other. Cool right? But super weird! Let’s talk a bit more about the specifics here.</p><p>Each of these smaller contracts behind the main proxy contract are called <em>facets</em>. They’re called <em>facets</em> because, in a diamond, each edge of a diamond or side of a diamond is called the diamond’s facet. Diamond contracts are also upgradable. What makes diamond contracts different from other proxy patterns is that the upgrades are very granular. Instead of adding and removing a single implementation contract. You can add, remove and upgrade individual functions from different contracts as you see fit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*DuwSCDXH76P3F33zXPvaXg.gif" /><figcaption>Confused a bit?</figcaption></figure><p>Confused a bit? Yea, I know. I said no jargons. Let’s simplify further.</p><p>So how does a diamond work? First, every diamond has a main diamond contract. This contract doesn’t have a lot of functionality code. Ideally, a diamond contract should just have a fallback function and a way to map and look up functions from other contracts. If you’re not familiar with solidity <a href="https://docs.soliditylang.org/en/v0.8.12/contracts.html#fallback-function]">fallback</a> functions, these are the functions that are called when you’re calling a contract with a function name that doesn’t actually exist on the contract. The diamond takes advantage of this feature in solidity.</p><p>Say, for example, you call the function <em>A</em> on your diamond. The diamond contract itself does not have a function <em>A</em>. Instead it is going to take the signature of the function that you just called, look it up in a mapping and figure out which contract actually has function <em>A. </em>The contract will then use <a href="https://medium.com/coinmonks/delegatecall-calling-another-contract-function-in-solidity-b579f804178c">delegate call</a>, which essentially loads the code from another contract and uses it in the context of the diamond contract. So using delegate call, the diamond will forward all of your arguments and parameters to the function <em>A</em> in the contract that it found in its mapping and then update the state or return as needed.</p><p>Diamonds are upgraded by using a special method called “diamond cut”. Depending on the arguments you pass to this method, you could add, remove, or even replace functions within your diamond. This method will update the internal mapping of the diamond contract. So it knows where to look for specific functions in specific contracts. In practice, the diamond cut method actually lives in a separate contract from the main diamond. This is important because there’s one downside to using a diamond, but I’ll write about in the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*1G3i4rvbttaYvlivFuk74w.jpeg" /><figcaption>Let’s read the real value part of the story</figcaption></figure><p>So what are the benefits of using a diamond? It makes it very easy to code and organize large and complex and smart contract projects. It helps you to avoid size limits when coding your smart contracts. For example, ethereum has a 24 kilobytes size limit for smart contracts. If your contract is large and complex, you may be prevented from even deploying this contract. A diamond lets you break this contract up into smaller contracts so you can deploy the entire application.</p><p>Another benefit to using a diamond is it allows you to build your application fast. In the web3 world, things are changing at a very fast pace. In order to succeed, you need to be able to build fast, break things, and then iterate on those ideas quickly. <strong>Diamond allows you to do this by upgrading only parts of your contract without having to change the address of the overall contract</strong>.</p><p>Now, what are some of the cons of using a diamond? Because a diamond is upgradeable requires the user to inherently trust you as the smart contract developer. This is fine in the beginning, if you have the trust of your community and you have a good reputation, but there’s always the idea of lingering that you could “rug pull” with some malicious code at any time.</p><p>Remember when I wrote above about the upgradability method, being a separate contract to the diamond, the fact that it’s in a separate contract means that you can actually use this method for upgrading, removing and adding functions in your contract to remove the upgradability itself. In essence, when you’re ready, you can make your diamond contract immutable, so no longer upgradable. This is a great way to make your contract trustless after around, uh, iterating and fixing bugs and getting your smart contract into a state that is ready and secure for users to use long-term.</p><p>And that’s basically it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*SMpMNtqGOWR4lrcC6z0EHA.gif" /><figcaption>voilaa!</figcaption></figure><p>Imma grab my lunch now! I hope this article intrigues you to explore the Ethereum diamond standard or EIP 2535. What do you think? Is it a good standard? Have you tried it already, or are you looking forward to trying it?</p><p>I’ll be happy to collaborate, discuss or answer any of your questions. Ping me on Discord @dapper_saeed. <br>Peace out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41a062a1471c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a private Quorum network on Raspberry Pi]]></title>
            <link>https://saieee.medium.com/creating-a-private-quorum-network-on-raspberry-pi-a6f1e912cce9?source=rss-ceebfb520c69------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6f1e912cce9</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[quorum-blockchain]]></category>
            <category><![CDATA[quorum]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <dc:creator><![CDATA[Ahmad Saeed]]></dc:creator>
            <pubDate>Fri, 15 Jan 2021 21:07:58 GMT</pubDate>
            <atom:updated>2021-01-15T21:07:58.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/891/0*RvumBGdMJbQf0t0G.jpeg" /></figure><p>Working with cutting-edge tech is exciting but sometimes it can become a cumbersome task when getting started with it. Recently, I got my hands on a bunch of Raspberry pi’s for a research project of my own and I was trying to setup a network using a lightweight consensus blockchain. (PS: I had my eyes on Quorum for soo long and really wanted to put it to work)</p><p>Talking a bit more about microprocessors and blockchain, we have to acknowledge that we have been through a decade of blockchain development and innovation. Every day we find new solutions that are more secure, robust, and efficient. We need to add more to it, exploring more blockchain applications out there so that people can get inspiration to innovate. We have now less computationally expensive distributed algorithms and many powerful microprocessors. Now is the best time to put out some applications of it.</p><p>For this project, I used 3 raspberry pi’s (<strong><em>Raspberry pi 3 Model B</em></strong>) and a laptop running Ubuntu 16.04 (for some reason I had to use a laptop which I’ll explain later). Let’s get started!</p><p><strong>Quorum on Laptop:</strong></p><p>Before installing it on our raspberry pi’s we need to get one node working on our laptop (Don’t worry this will help us later in the process). For installing a node on your laptop, you can use the official Quorum docs from <a href="https://docs.goquorum.com/en/latest/Getting%20Started/Creating-A-Network-From-Scratch/">here</a>.</p><p><strong>Quorum on Raspberry Pi:</strong></p><p>First clone the Quorum directory from <a href="https://github.com/jpmorganchase/quorum">github</a> and make its build. The building process can take a very long time on Raspberry Pi (In some cases you might not be able to make a build on a raspberry pi, due to a limited amount of memory and CPU power), I <strong>recommend</strong> using a laptop to perform the following tasks and zip the folder and paste it on your raspberry pi.</p><pre>$ git clone <a href="https://github.com/jpmorganchase/quorum.git">https://github.com/jpmorganchase/quorum.git</a><br>$ cd quorum<br>$ make geth-linux-arm-7</pre><p><strong>NOTE:</strong> Previously, there was no way to directly use <a href="https://geth.ethereum.org/">Geth</a> binaries on ARM-based chips like Raspberry Pi (You had to cross-compile it) but luckily now all the instructions have been added in the makefile and now you can cross-build via make geth-&lt;os&gt;-&lt;platform&gt; without needing to know any of these details.</p><p>Type the following in your terminal in order to let the Operating system know where is your quorum installed. This will let the shell terminal be aware of geth-linux-arm-7 path.</p><pre>$ export PATH=$(pwd)/quorum/build/bin:$PATH</pre><p>To proceed further make some separate folders for some organization.</p><pre>$ mkdir fromscratch$ cd fromscratch$ mkdir new-node</pre><p>Now, make a new account:</p><pre>$ geth-linux-arm-7 --datadir new-node account new</pre><p>Every node in the Quorum network has an enode id. It is a way to describe a node in the form of a URL, so that other nodes can recognize it and connect with it. We already have a running node on our Laptop, so we can have its enode id to connect our Raspberry Pi with it (You must be wondering why can’t we just have another Raspberry Pi and get its enode and connect them together. You are right, but node key generation method doesn’t simply work on a raspberry pi as it is a different architecture chip and some commands don’t work directly on it. But we can still generate it with other methods but it is much easier to get a laptop in the network and find the enode of the raspberry pi node)</p><p>We had created a <strong><em>static-nodes.json</em></strong><em> </em>file while deploying a node on our laptop. Copy that file and paste it in the <strong>fromscratch </strong>and <strong>new-node </strong>folder on your Raspberry Pi. Here is how my <strong><em>static-nodes.json</em></strong> file looks like:</p><pre>[<br>&quot;enode://1e64506cbbccaf5504f6626bec5e93495eabae8069782b077b72014b826f31264c8c9ef25400884c7a7c36f25af1d1e09a7af0dd1f05c67b8d22161054c4993b@192.168.1.135:21000?discport=0&amp;raftport=50000&quot;<br>]</pre><p>192.168.1.135 is the IP address (HostName) of my laptop, 50000 is my raft port and 21000 is my p2pPort and “1e64506cbbccaf5504f6626bec5e93495eabae8069782b077b72014b826f31264c8c9ef25400884c7a7c36f25af1d1e09a7af0dd1f05c67b8d22161054c4993b” is my node id.</p><p>Now let’s Initialize geth on our Raspberry pi.</p><p><strong>Important:</strong> In order to initialize geth, use the same <strong><em>genesis.json</em></strong> used for running the node on your laptop and then use the following command.</p><pre>$ geth-linux-arm-7 --datadir new-node init genesis.json</pre><p>Generate a start node script, similar to the node on your laptop but with the following command. Make a startnode.sh file and paste the following command in it.</p><pre>#!/bin/bashPRIVATE_CONFIG=ignore nohup geth-linux-arm-7 --datadir new-node --nodiscover --verbosity 5 --networkid 31337 --raft --raftport 50000 --raftjoinexisting 2 --rpc --rpcaddr 0.0.0.0 --rpcport 22000 --rpccorsdomain &quot;*&quot; --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,raft --emitcheckpoints --port 21000 2&gt;&gt;node2.log &amp;</pre><p>Run the script.</p><pre>$ chmod +x startnode.sh<br>$ ./startnode.sh</pre><p>Attach to the geth node</p><pre>$ geth-linux-arm-7 attach new-node/geth.ipc</pre><p>In the geth console, get the enode id for this node by running:</p><pre>&gt; admin.nodeInfo.enode[<br>&quot;enode://1b338092d5f454838f2b44f80a48c1cce53201c9898476e6bd9e1c2b93688a77106650c761b9bd1fa261e4966da85c63c890662a2103e407a580c774b6f6a1df7@192.168.1.146:21000?discport=0&amp;raftport=50000&quot;<br>]</pre><p>In some cases, you might not get the “&amp;raftport=50000” at the end so you can add it by yourself. Now we have our enode id of our first Raspberry pi we can use our geth terminal on our laptop and add it to the network.</p><pre>&gt; raft.addPeer(&quot;enode://b338092d5f454838f2b44f80a48c1cce53201c9898476e6bd9e1c2b93688a77106650c761b9bd1fa261e4966da85c63c890662a2103e407a580c774b6f6a1df7@192.168.1.146:21001?discport=0&amp;raftport=50001&quot;)2</pre><p>2 is the result returned and it represents the raftId number of the node in the network. In order to find the complete network cluster do the following:</p><pre>&gt; raft.cluster[{<br>    hostname: &quot;192.168.1.146&quot;,<br>    nodeId: &quot;b338092d5f454838f2b44f80a48c1cce53201c9898476e6bd9e1c2b93688a77106650c761b9bd1fa261e4966da85c63c890662a2103e407a580c774b6f6a1df7&quot;,<br>    p2pPort: 21001,<br>    raftId: 2,<br>    raftPort: 50001,<br>    role: &quot;verifier&quot;<br>}, {<br>    hostname: &quot;192.168.1.135&quot;,<br>    nodeId: &quot;1e64506cbbccaf5504f6626bec5e93495eabae8069782b077b72014b826f31264c8c9ef25400884c7a7c36f25af1d1e09a7af0dd1f05c67b8d22161054c4993b&quot;,<br>    p2pPort: 21000,<br>    raftId: 1,<br>    raftPort: 50000,<br>    role: &quot;minter&quot;<br>}]</pre><p>You can find both your nodes connected here with each other.</p><p><strong>CONGRATULATIONS!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*cEYrl5rbMw8w-X4G.gif" /></figure><p>Now you can add as many raspberry pi’s you want to your network using the same procedure.</p><h3>Execute a Transaction:</h3><p>You need to find your wallet address to which you have assigned some initial balance in the genesis file. You can find your attached wallet address in geth from the following command:</p><pre>&gt; eth.accounts</pre><p>The basic way of sending a simple transaction of ether with the geth console is as follows:</p><pre>&gt; eth.sendTransaction({from:sender, to:receiver, value: amount})</pre><p><strong>Example:</strong></p><p>eth.sendTransaction({from:eth.accounts[0], to:”0x1ce34b5b3e00f57e3a4c6c2e8083cae71cd1306d”, value: 200000000});</p><p>To check your balance you can do the following:</p><pre>web3.fromWei(eth.getBalance(eth.coinbase), &quot;ether&quot;)</pre><h3>Future Announcements:</h3><p>In this article, we followed instructions to setup a simple Quorum network on 2 Raspberry Pi’s. Next, I will be adding some smart contracts to build some meaningful applications. Also, there will an article on Quorum bugs/issues and troubleshooting the network problems.</p><p>Stay Tuned! Do give your feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6f1e912cce9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>