<?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 David L on Medium]]></title>
        <description><![CDATA[Stories by David L on Medium]]></description>
        <link>https://medium.com/@dsylebee?source=rss-dae1f06b09db------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Fu8I-CQxT_XgkH88</url>
            <title>Stories by David L on Medium</title>
            <link>https://medium.com/@dsylebee?source=rss-dae1f06b09db------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 18:21:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dsylebee/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[Should Ethereum Accounts Have Native Spending Limits?]]></title>
            <link>https://medium.com/@dsylebee/should-ethereum-accounts-have-native-spending-limits-c32a01133090?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/c32a01133090</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Sun, 01 Nov 2026 14:24:18 GMT</pubDate>
            <atom:updated>2026-11-01T14:49:50.140Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cKbc2bTnXMbUy2YRBc1DEw.png" /></figure><p><em>Why basic account security shouldn’t depend entirely on wallet implementations.</em></p><p>One of the most important principles in cryptocurrency is ownership. If you control the private key of an account, you control the funds associated with it. But this also introduces a problem. If someone manages to compromise your private key, they can potentially transfer everything you own in a single transaction.</p><p>Over the years, we’ve introduced many ways to protect private keys, from hardware wallets to multisignature accounts, MPC signing systems, and smart contract wallets. However, most of these solutions push the responsibility for account security onto wallet developers, applications, or users.</p><p>What if Ethereum could provide some basic protections directly at the protocol level?</p><p>I would like to explore a relatively simple proposal: <strong>native spending limits, a compromised-account state, and a preauthorized recovery account</strong>.</p><p>These features would be optional, with additional gas costs applying primarily to accounts that choose to enable them.</p><h3>How Ethereum Accounts Work Today</h3><p>Before going further, let’s briefly explain how a normal Ethereum account works. An Externally Owned Account (EOA) is controlled by a private key. This key allows you to sign transactions that Ethereum validators can verify.</p><p>For example, if you have 10 ETH and sign a transaction to transfer almost all of it, the network will accept it as long as the transaction is valid and you have enough ETH to cover transaction fees. Ethereum doesn’t know whether you intended to make the transfer or whether someone stole your private key. As far as the network is concerned, the signature is valid.</p><p>This is where I believe we could improve account security.</p><h3>Introducing Native Spending Limits</h3><p>What if Ethereum allowed you to configure how much ETH an account could spend over a given period? For example, an account could hold 10 ETH but have a spending limit of 1 ETH every 24 hours.</p><p>I propose implementing this as a system contract, following the system-contract pattern introduced by <a href="https://eips.ethereum.org/EIPS/eip-7002">EIP-7002</a>, where a protocol feature is exposed through a predeployed contract at a fixed address instead of a new transaction type or opcode. Configuring a limit would be an ordinary signed transaction from the account to that address, so the account’s own signature authorizes the change. The difference from a regular smart contract is that the protocol itself would consult this contract whenever ETH leaves the account, so the limit applies to every transfer, not just the ones a wallet chooses to check.</p><pre>{<br>  &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>  &quot;method&quot;: &quot;eth_sendTransaction&quot;,<br>  &quot;params&quot;: [{<br>    &quot;from&quot;: &quot;0xYourAccount&quot;,<br>    &quot;to&quot;: &quot;0xAccountSecuritySystemContract&quot;,<br>    &quot;data&quot;: &quot;setSpendingLimit(1 ETH, 24 hours)&quot;<br>  }],<br>  &quot;id&quot;: 1<br>}</pre><p>The amount and period would be configurable. The data field is readable shorthand rather than real ABI encoding, and the wallet signs the transaction like any other. Unlike spending limits implemented by wallet applications, the restriction would be enforced directly by Ethereum. Even if someone managed to compromise the account’s private key, they would still be restricted by its configured spending limit.</p><p>Ideally, the accounting would use a rolling period rather than a fixed reset time, preventing someone from spending the full allowance immediately before and after a reset.</p><p>This could already limit the damage caused by a compromised key. But there is an obvious problem. What prevents someone from simply increasing or removing the spending limit after stealing the key?</p><h3>Protecting Changes to Security Settings</h3><p>I propose introducing a 14-day delay before changes that weaken an account’s security can take effect. For example, if an account has a spending limit of 1 ETH per day and someone attempts to increase it to 5 ETH, the new limit would only become active after 14 days. The same would apply to removing the limit entirely. However, decreasing the spending limit could happen immediately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SYfRtSBmhQstHG2oTPOcfQ.png" /><figcaption>How fast these operations can take effect</figcaption></figure><p>The reasoning is simple. Changes that improve security should not require a waiting period, while changes that weaken it should give the owner time to react.</p><p>This is an important distinction from simply limiting how often an account can change its settings.</p><p><strong>A security change must remain inactive during the 14-day period.</strong></p><p>Otherwise, an attacker could increase the limit, drain the account, and simply wait before making another change.</p><p>We now have a way to limit spending, even when the private key is compromised. But what happens when we discover that an account has actually been compromised?</p><h3>Introducing a Compromised-Account State</h3><p>I would add a second function to the same system contract:</p><pre>{<br>  &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>  &quot;method&quot;: &quot;eth_sendTransaction&quot;,<br>  &quot;params&quot;: [{<br>    &quot;from&quot;: &quot;0xYourAccount&quot;,<br>    &quot;to&quot;: &quot;0xAccountSecuritySystemContract&quot;,<br>    &quot;data&quot;: &quot;declareCompromised()&quot;<br>  }],<br>  &quot;id&quot;: 1<br>}</pre><p>Calling this operation would mark the account as compromised. Once marked, ordinary outbound transfers would be blocked, regardless of any previously configured spending limit. The primary private key would no longer be able to reverse the compromised state.</p><p>This creates an interesting situation. Even if an attacker manages to obtain the private key, the owner can potentially stop further spending before the entire balance is transferred.</p><p>An attacker could also deliberately invoke this operation, freezing the account. But freezing an account is different from stealing its funds. The tradeoff may be acceptable, provided we have a way to recover the remaining assets.</p><p>That brings us to the next part of the proposal.</p><h3>Introducing the Savior Account</h3><p>A savior would be a separate Ethereum account that receives special recovery authority only after the primary account has been declared compromised. Ideally, this would be a cold wallet or mnemonic backup kept completely separate from everyday activity.</p><p>We could register it using:</p><pre>{<br>  &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>  &quot;method&quot;: &quot;eth_sendTransaction&quot;,<br>  &quot;params&quot;: [{<br>    &quot;from&quot;: &quot;0xYourAccount&quot;,<br>    &quot;to&quot;: &quot;0xAccountSecuritySystemContract&quot;,<br>    &quot;data&quot;: &quot;setCompromisedSavior(0xSaviorAccount)&quot;<br>  }],<br>  &quot;id&quot;: 1<br>}</pre><p>Under normal conditions, the savior would have no authority to move funds. It would only receive recovery authority after:</p><pre>{<br>  &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>  &quot;method&quot;: &quot;eth_sendTransaction&quot;,<br>  &quot;params&quot;: [{<br>    &quot;from&quot;: &quot;0xYourAccount&quot;,<br>    &quot;to&quot;: &quot;0xAccountSecuritySystemContract&quot;,<br>    &quot;data&quot;: &quot;declareCompromised()&quot;<br>  }],<br>  &quot;id&quot;: 1<br>}</pre><p>Once the account is compromised, the savior could execute a recovery operation such as:</p><pre>{<br>  &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>  &quot;method&quot;: &quot;eth_sendTransaction&quot;,<br>  &quot;params&quot;: [{<br>    &quot;from&quot;: &quot;0xSaviorAccount&quot;,<br>    &quot;to&quot;: &quot;0xAccountSecuritySystemContract&quot;,<br>    &quot;data&quot;: &quot;saviorSweep(0xYourAccount, 0xSafeAccount, 9 ETH)&quot;<br>  }],<br>  &quot;id&quot;: 1<br>}</pre><p>Let’s look at an example. An account holds 10 ETH, with a spending limit of 1 ETH per day and a savior address already configured.</p><p>Someone manages to steal the primary private key. The attacker attempts to transfer all 10 ETH but is blocked by the spending limit.</p><p>The owner discovers the compromise and calls declareCompromised. Ethereum immediately prevents further ordinary spending from that account.</p><p>The owner can then use the separate savior wallet to transfer the remaining ETH to a secure destination. The savior’s recovery transfers would not be restricted by the normal spending limits.</p><p><strong>The important condition is that the savior cannot move funds until the account has been declared compromised.</strong></p><p>Replacing or removing an existing savior would require the 14-day delay. Initial savior registration needs a safe activation rule too, so I propose the same 14-day delay when an account has no savior yet. A newly registered savior would stay inactive for 14 days, so an attacker who steals the key can’t register their own savior, declare the account compromised, and immediately sweep the funds. If the account is declared compromised while a registration is still pending, that pending savior would never activate. This is also why a savior is best configured early, before it is ever needed.</p><p>The objective is to separate everyday signing authority from emergency recovery authority. Neither key alone should have unrestricted access to the protected funds under every circumstance.</p><h3>Extending Security to ERC-20 Tokens</h3><p>So far, we’ve only discussed ETH. But Ethereum is also used to manage tokens such as stablecoins and other digital assets.</p><p>ERC-20 balances are maintained by smart contracts, not directly by Ethereum’s native account balances. For that reason, I wouldn’t propose making Ethereum responsible for tracking every token’s spending limits.</p><p>Instead, we could introduce an optional standard called ERC20SecurityExtended. Each participating token would manage its own spending limits.</p><p>For example, an account could configure:</p><ul><li>100 DAI per day.</li><li>500 USDC per day.</li><li>2 WETH per week.</li></ul><p>These are hypothetical examples. Existing tokens would need to support the extension before these protections could apply.</p><p>The extension could introduce an interface similar to:</p><pre>interface IERC20SecurityExtended is IERC20 {<br>    function setSpendingLimit(<br>        uint256 amount,<br>        uint64 period<br>    ) external;<br><br>    function saviorTransfer(<br>        address account,<br>        address destination,<br>        uint256 amount<br>    ) external returns (bool);<br>}</pre><p>The spending limit would be enforced by the token contract itself. This is particularly important because an ERC-20 token can be transferred through several different operations.</p><p>For example, a smart contract might already have permission to transfer tokens from an account using transferFrom(). That existing permission should not allow it to bypass the account’s spending limit.</p><p>The extension would need to enforce restrictions on transfer(), transferFrom(), burns, and other operations that reduce an account&#39;s balance.</p><p>When an account is marked compromised, the token would block ordinary outgoing transfers, including those using existing allowances. The savior could then recover the participating token’s balance.</p><p>This would provide protection at the point where the token actually updates its balances, regardless of which application initiated the transfer.</p><h3>ERC-20 Security Could Come First</h3><p>Realistically, I believe the ERC-20 extension is more likely to be implemented before Ethereum introduces these protections natively, assuming the idea receives enough interest. Changing Ethereum’s protocol requires considerably more coordination and agreement than introducing an optional token standard.</p><p>And there is no reason the ERC-20 extension should depend on a native feature that doesn’t exist yet. So how would savior delegation work without native support? I see two possible approaches.</p><h4>Option 1: A Shared Security Registry</h4><p>We could introduce a single, reusable, audited smart contract on each EVM chain. This contract would manage savior delegation and compromised-account status for accounts using participating ERC-20 tokens.</p><p>For example:</p><pre>interface IAccountSecurityRegistry {<br>    function setCompromisedSavior(<br>        address savior<br>    ) external;<br><br>    function declareCompromised() external;<br><br>    function saviorOf(<br>        address account<br>    ) external view returns (address);<br>    <br>    function isCompromised(<br>        address account<br>    ) external view returns (bool);<br>}</pre><p>A user could register their savior once on a chain. Every ERC-20 token using that registry could recognize the same savior and compromised status.</p><p>The registry would enforce the required security delays, while each token would continue managing its own spending limits. The registry itself wouldn’t transfer tokens or enforce spending limits. That responsibility would remain with each participating ERC-20 contract.</p><p>This avoids requiring users to configure a separate savior for every token they hold. It also allows multiple token implementations to reuse the same audited security contract instead of developing their own recovery system.</p><p>Of course, the registry would become an important security dependency, so its implementation and upgrade rules would need careful consideration.</p><h4>Option 2: Each ERC-20 Manages Its Own Security State</h4><p>Alternatively, every ERC-20 implementation could maintain its own savior delegation and compromised-account state. This would remove the dependency on a shared registry.</p><p>Each token could independently manage:</p><ul><li>Spending limits.</li><li>Savior authorization.</li><li>Compromised-account status.</li><li>Delayed security changes.</li></ul><p>The downside is that users would need to configure their security settings separately for every participating token. Different implementations could also introduce inconsistencies in how recovery and security changes work.</p><p>However, some token developers may prefer this approach because it gives them complete control over their implementation. Both approaches are possible, and neither requires a change to Ethereum itself.</p><h3>Eventually Moving to Native Ethereum Security</h3><p>If Ethereum later adopts native account security, participating ERC-20 contracts could read an account’s savior and compromised status directly from the security system contract. They could then use the native security state instead of maintaining their own delegation or consulting the shared registry.</p><p>The standalone mechanism could eventually be deprecated. Any migration would need to preserve existing protections, particularly compromised states and the 14-day delay. This would allow us to start with an optional ERC-20 implementation, test the idea in practice, and only later consider moving part of the responsibility into Ethereum itself.</p><h3>How Is This Different From Existing Recovery Designs?</h3><p>None of these ideas are entirely new. <a href="https://vitalik.eth.limo/general/2021/01/11/recovery.html">Argent popularized social recovery</a>, where trusted guardians can help restore access to a wallet. <a href="https://eips.ethereum.org/EIPS/eip-7579">ERC-7579 defines modular smart accounts</a>, so spending limits, timelocks, and recovery can be installed as interchangeable modules. Timelocks have long been used to delay sensitive actions. The savior account and the 14-day delay borrow directly from these designs.</p><p>The difference is where the rules are enforced. Guardians, modules, and timelocks live inside the account’s own code, so they only protect assets while that code is in the path of every transfer. This proposal moves the check to the asset itself: the token contract for ERC-20s, and eventually the protocol for ETH. That distinction matters most for the next question.</p><h3>Why Not Just Use a Smart Wallet?</h3><p>I expect one of the first arguments against this proposal will be that smart wallets already support spending limits, multisignature authorization, and recovery mechanisms. And that’s true.</p><p>But I think this overlooks an important difference between <strong>checking an operation before it reaches an asset and enforcing a restriction where that asset is actually transferred</strong>.</p><p>A smart wallet can validate transactions, check signatures, and apply restrictions before executing operations. For ETH held directly by the wallet, a properly implemented smart contract can enforce strong spending controls.</p><p>But these controls depend on the wallet’s implementation and the execution paths it manages. They are not universal rules enforced by Ethereum or the individual token contracts.</p><h4>The ERC-20 Allowance Problem</h4><p>Imagine a smart wallet holding 10,000 USDC with a daily spending limit of 500 USDC. The wallet previously approved another contract to spend 10,000 USDC.</p><p>That contract can later execute:</p><pre>USDC.transferFrom(<br>    wallet,<br>    destination,<br>    amount<br>);</pre><p>The token processes this operation directly. It doesn’t need to execute the smart wallet’s transaction-validation logic again. Unless the ERC-20 token itself enforces the spending limit, the approved contract may be able to transfer more than the wallet’s configured daily limit.</p><p>Of course, a well-designed smart wallet can reduce this problem through restricted allowances, carefully controlled approvals, or additional validation. But that means the wallet must account for the many different ways tokens and applications interact.</p><p>The more complex these restrictions become, the more implementation and integration risks they can introduce. And even with good wallet-level validation, the spending restriction is still not enforced by the ERC-20 contract itself.</p><p>That is precisely what ERC20SecurityExtended would address.</p><h4>What About EIP-7702?</h4><p><a href="https://eips.ethereum.org/EIPS/eip-7702">EIP-7702</a> allows traditional Ethereum accounts to delegate execution to smart contract code. This enables many smart-wallet features without requiring users to move their assets into a separate smart contract wallet.</p><p>However, the original EOA private key can still authorize changes to that delegated code. If the private key is compromised, an attacker may be able to replace the implementation responsible for enforcing wallet-level spending limits.</p><p>A native Ethereum restriction would behave differently. Even if the delegated implementation changes, the protocol would continue enforcing the account’s spending limit and compromised state.</p><p>This is the difference between security implemented by wallet software and security enforced independently by the protocol.</p><h4>More Signers Also Mean More Complexity</h4><p>Another argument is that users should rely on multisignature wallets, MPC, or TSS. These are important security technologies. However, they can introduce additional signers, devices, infrastructure, approval requirements, and operational costs.</p><p>For organizations, this may require dedicated signing services and more complicated transaction flows. Some applications cannot justify introducing an elaborate signing architecture simply to enforce a basic spending restriction. These systems may also make integrations harder or introduce additional smart contract and infrastructure risks.</p><p>I’m not arguing against smart wallets or advanced signing systems.</p><p>I’m arguing that <strong>we shouldn’t make them responsible for every basic security guarantee that could be enforced directly by Ethereum or the token contract</strong>.</p><h3>Even Advanced Wallet Security Can Fail</h3><p>Hardware wallets, multisignature systems, and MPC solutions can significantly improve security. But none of them are immune to compromise.</p><p>Hardware wallets have been targeted through physical modifications and supply-chain attacks. In October 2026, <a href="https://support.ledger.com/article/Ledger-s-Response-to-the-Hardware-Implant-Attack">Ledger disclosed an attack involving modified devices</a> designed to capture sensitive recovery information. The problem wasn’t the cryptographic security of Ledger’s secure chip, but the distribution process surrounding the devices.</p><p>Exchanges have also suffered major compromises. <a href="https://medium.com/kucoinexchange/a-letter-from-the-kucoin-ceo-2020-2021-and-beyond-b9a509f8aa0f">KuCoin experienced a significant hot-wallet breach in 2020</a>. More recently, <a href="https://www.binance.com/en-GB/support/announcement/security-incident-update-2-2026-10-30-d3306d9dca5243548c813b605e1d1751">Binance reported a major hot-wallet security incident in October 2026</a>, with its initial investigation finding no evidence that wallet private keys had been leaked.</p><p>This is an important distinction, because signing infrastructure can potentially be abused without exposing the underlying private keys.</p><p>Advanced signing technologies have also experienced security problems. ECDSA signatures depend on a secret nonce, commonly called k. Reusing that nonce across signatures made with the same private key can reveal the key.</p><p>MPC and Threshold Signature Schemes introduce additional cryptographic complexity, and mistakes in their implementations may lead to serious vulnerabilities. In 2023, <a href="https://www.fireblocks.com/blog/bitforge-fireblocks-researchers-uncover-vulnerabilities-in-over-15-major-wallet-providers">Fireblocks published its BitForge research</a>, identifying vulnerabilities affecting multiple MPC wallet implementations. Some of these vulnerabilities could allow attackers with sufficient access to extract private keys.</p><p>This does not mean MPC is inherently insecure, nor does it establish the cause of any particular exchange incident. But it demonstrates that even sophisticated signing systems can fail.</p><p>And when they do, we often return to the same problem. Why should a failure in signing infrastructure automatically allow an attacker to transfer every asset it controls?</p><p>Protocol-level spending limits would provide an additional security boundary, even when the signing system itself has been compromised.</p><h3>What About Gas Costs?</h3><p>There is no way to introduce additional validation, spending counters, and storage without increasing execution costs. I don’t think we need to pretend otherwise.</p><p>However, I believe these features should be <strong>entirely optional</strong>.</p><p>Accounts that never enable spending limits or recovery protections should continue operating normally, without paying additional per-transaction gas specifically for native security-policy enforcement.</p><p>Once an account enables a feature, additional gas costs are expected. For example, enforcing a spending limit requires checking the account’s configuration and tracking how much ETH has already been spent during the configured period. This requires additional computation and storage. That’s reasonable.</p><p>The ERC-20 extension would also introduce some additional contract execution costs, including security-state checks. Its actual overhead would depend on the implementation.</p><p>Someone who wants stronger security can choose to pay for it, while someone who doesn’t need it can continue using Ethereum as before.</p><p>The protocol would still need an efficient way to detect whether protection is enabled, and any unavoidable baseline overhead would need to be benchmarked. We would also need to account for transaction fees themselves, so an attacker cannot drain ETH simply by repeatedly consuming gas.</p><p>The objective is not free security.</p><p><strong>It is optional protection without requiring every user or application to introduce an entirely new wallet architecture.</strong></p><h3>Why Consider This Now?</h3><p>I understand why Ethereum has historically avoided introducing these kinds of restrictions directly into the protocol. Storage and gas costs matter, and every new protocol feature adds complexity. There are good reasons to keep Ethereum relatively simple and let developers build additional functionality through smart contracts.</p><p>But I also think the security environment is changing. With AI advancing rapidly, we’re seeing greater automation in software development, system administration, vulnerability research, and interactions with sensitive infrastructure. As more systems rely on automated agents, the opportunities for signing authority to be exposed or misused may increase.</p><p>Quantum computing also raises long-term questions about the cryptography we rely on today. I’m not suggesting that quantum computers will break Ethereum tomorrow, or that spending limits would solve that problem. These mechanisms are not a replacement for quantum-resistant cryptography.</p><p>But we don’t need to predict exactly when future threats will become practical to recognize that limiting the authority of a compromised key is useful.</p><p>This brings me back to a familiar saying:</p><p><strong>Not your keys, not your crypto.</strong></p><p>I strongly believe in self-custody. But perhaps we need to revisit what that means in practice.</p><p>We have spent years telling users to protect their keys, use cold wallets, configure multisignature accounts, and avoid mistakes. All of that remains important.</p><p>However, I don’t believe every basic security requirement should continue being pushed onto dApp developers, wallet providers, and advanced users.</p><p>Some applications cannot afford the operational complexity of multiple signers or specialized smart contract wallets. Others cannot easily integrate these systems without increasing costs and introducing new dependencies. And even when these systems are implemented correctly, weaknesses elsewhere in their infrastructure may still expose their signing authority.</p><p>Owning your keys should give you control of your assets.</p><p><strong>But control doesn’t necessarily need to mean that a single compromised key can transfer everything immediately.</strong></p><p>Perhaps Ethereum itself should take a little more responsibility for limiting the damage when those protections fail.</p><h3>Where Do We Go From Here?</h3><p>I would separate the proposal into two parts.</p><p>The first would be an optional ERC20SecurityExtended standard, providing token-level spending limits, compromised-account protection, and savior recovery. It could initially use a shared, audited registry on each EVM chain or allow tokens to maintain their own security state. This could be implemented and tested without requiring any changes to Ethereum.</p><p>The second would be an Ethereum Improvement Proposal introducing these protections natively for ETH through a security system contract, including optional spending limits, delayed security changes, compromised-account status, and savior delegation. If Ethereum eventually adopts it, participating ERC-20 tokens could read the savior and compromised status directly from that contract.</p><p>There are still technical questions to solve, particularly around gas accounting, security-state transitions, initial configuration, migration between security mechanisms, and possible ways of bypassing spending restrictions.</p><p>I also recognize that every addition to Ethereum needs to justify its complexity. But I believe the increasing risks surrounding Web3 infrastructure make this worth discussing.</p><p><strong>We’ve spent years improving how we protect private keys. Perhaps it’s time Ethereum also helps limit what happens when those protections fail.</strong></p><p>Self-custody should remain the foundation of cryptocurrency. But it shouldn’t prevent us from introducing basic, optional security guarantees directly into the protocol.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c32a01133090" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Competitive World of Transaction Confirmations]]></title>
            <link>https://medium.com/@dsylebee/the-competitive-world-of-transaction-confirmations-7b4b9a8f3483?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b4b9a8f3483</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Thu, 09 Jan 2025 22:43:41 GMT</pubDate>
            <atom:updated>2025-01-09T23:39:50.224Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qd_ms0BjZIInjgKXaGeyWA.png" /><figcaption>extract of https://txcity.io/v/evm-btc</figcaption></figure><p>If you’ve ever sent a blockchain transaction, you know the suspense. You send it off, 🤞 hoping it lands in the next block. But blockchains aren’t leisurely strolls — they’re competitive marathons 🏃‍♂️💨. With limited room in each block, every transaction is fighting for a spot like it’s Black Friday at your favorite store 🛍️.</p><p>Here’s the twist: It’s not just about showing up — it’s about paying up 💸. Miners and validators prioritize high-fee transactions, leaving low-fee ones stuck in the queue 🕒 or dropped altogether 🗑️.</p><p>In this article, we’ll break down how transaction confirmations work, why fees matter so much 💰, and what happens when your transaction doesn’t make the cut 🚫. Plus, we’ll share tips to help you stay ahead in this blockchain race. Let’s dive in! 🚀</p><h3>The Max Size of a Block: Why Every Byte Counts 📦</h3><p>In our last article, we explored how blockchain miners and validators prioritize transactions to maximize profits. But there’s one critical constraint they can’t ignore: the maximum size of a block. No matter how lucrative transactions are, a block has a limit, like a carry-on bag on a budget airline 🛫 — you can only fit so much.</p><p>This block size limit isn’t arbitrary; it’s set to ensure the blockchain remains efficient and decentralized. Larger blocks mean more data to process, which can bog down the network and make it harder for nodes to stay in sync. This limit forces block authors to carefully select transactions, balancing high fees with smaller-sized transactions to squeeze out the most profit from each block. Think of it like playing Tetris 🎮, where every transaction must fit perfectly to create a profitable, valid block.</p><p>Understanding this limit gives you insight into why your high-fee transaction might not make it in during peak activity — it’s not just about the fee but also how well it fits into the puzzle!</p><h3>But Wait, What’s the Size of a Block, and How Is It Measured? 🤔</h3><p>The size of a block isn’t as straightforward as it sounds — different blockchains measure it in unique ways:</p><ul><li><strong>EVM Blockchains</strong> (like Ethereum, Binance Smart Chain, Polygon):<br>These use a <strong>Gas Limit</strong>, which measures the computational effort required for storage, memory, and processing of transactions. Every operation in the EVM is assigned a gas cost based on its complexity, and the block’s total gas consumption cannot exceed the limit (e.g., 30 million gas units for Ethereum).</li><li><strong>Polkadot</strong>:<br>Polkadot measures block size in <strong>Weights</strong>, focusing on storage operations and computational effort. This flexible approach ensures fair resource allocation across the network.</li><li><strong>Bitcoin</strong>:<br>Bitcoin measures block size in <strong>bytes</strong>, with a 1 MB cap. Thanks to <strong>SegWit</strong> (Segregated Witness), transaction signatures are moved to a separate section, effectively increasing the usable space to ~4 MB for optimized blocks.</li></ul><h3>Why Is There a Maximum Block Size? 🤔</h3><p>The maximum block size isn’t just an arbitrary rule — it’s essential for the smooth functioning of the blockchain. Here’s why:</p><ul><li><strong>Consistency in Block Creation</strong>: Blockchains aim to maintain a steady rhythm of block creation. If block authors had to wait for enough transactions to fill a block, the time between blocks would become unpredictable, which could disrupt the consensus mechanism.</li><li><strong>Synchronization Efficiency</strong>: Very large blocks would take longer to propagate across the network, making it harder for nodes to stay in sync. This delay could lead to forks and destabilize the blockchain.</li><li><strong>Hardware Requirements</strong>: Without a cap, blocks could become so large that only high-end hardware could handle them, reducing decentralization by excluding smaller participants from running nodes.</li></ul><p>By keeping block sizes manageable, blockchains strike a balance between scalability, security, and accessibility. 🚀📦</p><h3>Why Does Block Size Matter for My Transaction? 🤔</h3><p>It was important to first understand block size because it has a direct impact on transaction pricing. Here’s the deal:</p><ul><li><strong>When Blocks Are Mostly Empty</strong>: If a blockchain lacks activity, transaction fees tend to be very low. Block authors have no reason to reject transactions — they’ll happily include everything they can to maximize their profits.</li><li><strong>When Blocks Are Full</strong>: As activity increases and blocks fill up, competition starts. Not all transactions can fit in the current block, so some are left to wait for the next one.</li><li><strong>When Demand Explodes</strong>: If the number of transactions waiting to be included is consistently higher than the space available in blocks, fees soar. Block authors often prioritize the highest-paying transactions, making the blockchain an expensive place to transact.</li></ul><p>In short, the size and fullness of blocks determine the competitive landscape for your transaction. The busier the blockchain, the higher the price you’ll need to pay to ensure your transaction gets confirmed. 🏗️📈</p><h3>Where Is My Transaction While It Waits? 🤔</h3><p>While your transaction is waiting to be included in a block, it’s essentially in a <strong>distributed queue</strong>. Blockchains have different names for this holding area, but the most common term you’ll hear is the <strong>memory pool</strong> (or mempool). Some people simply call them <strong>pending transactions</strong>.</p><p>The mempool is where transactions go after being broadcasted to the network but before being picked up by block authors (miners or validators). Think of it as the blockchain’s waiting room, where your transaction waits its turn to be included based on the fees you’ve attached and the current activity level of the network. 🕒</p><h3>How Long Can My Transaction Wait? ⏳</h3><p>Your transaction can stay in the mempool (or <strong>memory pool</strong>, not “meme pool” 😉) for varying lengths of time depending on the fees you’ve attached and the network’s activity. If the network gets busy and your transaction offers a lower reward for miners or validators compared to others, it might sit in the mempool for <strong>minutes, hours, or even days</strong>.</p><p>In extreme cases, if your transaction remains uncompetitive for too long and the mempool runs out of space, your transaction could be <strong>dropped entirely</strong>. This means it’s no longer broadcasted or visible to the network, and you’d need to resend it with higher fees to get it processed.</p><h3>Why Do I Need to Decide on a Fee? 💰</h3><p>In blockchains, you’re not just sending a transaction — you’re also bidding for its inclusion in a block. This is where <strong>fees</strong> come into play. The fee is the reward you offer to miners or validators for processing your transaction. And sometimes, you can sweeten the deal with an <strong>extra tip</strong> to encourage faster processing.</p><p>Here’s how it works:</p><ul><li><strong>Normal Fee</strong>: This is the standard reward for including your transaction in a block.</li><li><strong>Extra Tip</strong>: Some blockchains allow you to add a bonus on top of the normal fee to increase the chances of being prioritized.</li></ul><p>When the <strong>mempool</strong> (the queue of pending transactions) fills up with transactions offering higher fees, users often increase their fees to jump the line. This creates a competitive environment where higher fees typically result in faster confirmations. It’s a bit like auctioning for priority — but instead of a shiny new car, you’re bidding for the next block. 🚗✨</p><h3>Is There Anything I Can Do to Cancel My Transaction? 🤔</h3><p>That’s a great question! To answer it, we need to introduce a fascinating concept in blockchain transactions: the <strong>nonce</strong>.</p><p>At its core, the nonce is a crucial mechanism for ensuring the proper ordering of transactions from a single account. Why does this matter? Well, blockchains can’t inherently agree on which transaction came first from your account. This isn’t just a technical quirk; it’s a design decision that puts the responsibility for transaction ordering squarely in the sender’s hands.</p><p>Think of the nonce as a <strong>transaction number</strong> or <strong>invoice ID</strong> — a sequential counter for your transactions. Here’s an example:</p><ul><li>Your transactions are numbered in order: 0, 1, 2, 3, 4, 5.</li><li>If you try to send transaction 5 before 4, the blockchain will hold off processing transaction 5 because it’s waiting for 4 to be confirmed first.</li></ul><p>This ensures your transactions are always processed in the exact order you intended, avoiding any potential confusion or inconsistencies.</p><h4>What Happens If I Skip a Nonce? 🤔</h4><p>If you skip a nonce and don’t submit the required “in-between” transaction, your pending transactions could end up in the <strong>future mempool</strong> (a.k.a. the future queue). This is where transactions go when they’re waiting for earlier, unprocessed nonces. Most blockchains set a limit — like <strong>64 future transactions per account</strong> — to prevent this queue from growing indefinitely.</p><p>Nonce management can get quite complex, so we’ll save that for another article. 😉</p><h3>How Does This Help Me Cancel My Transaction? 🤷‍♂️</h3><p>Let’s paint a picture: your transaction, nonce 125, has been stuck in the mempool for over an hour. Frustrating, right? Maybe you’re one of many trying to swap ETH for USDC, and the competition is fierce. So, what can you do?</p><p>Here’s where the <strong>nonce</strong> comes to the rescue. You can resubmit a new transaction with the <strong>same nonce (125)</strong> but a more competitive fee. This strategy is known as <strong>transaction replacement</strong>, and it works because blockchains will only accept one transaction per nonce. The new transaction effectively overrides the old one.</p><p>Now, what if you decide you don’t want the transaction at all? 🤔 You can still use this approach to <strong>cancel</strong> it. Instead of resubmitting the same operation, you can send a transaction with nonce 125 that transfers 0 value back to yourself. This doesn’t perform any operation other than signaling to the blockchain, “Hey, forget that other one — I’m canceling it.”</p><h4>Wait, Do I Have to Pay to Cancel? 💸</h4><p>Yep, unfortunately. Since canceling a transaction is technically a new transaction, it requires a fee. Think of it this way: by submitting a transaction in the first place, you told the blockchain, “I want this processed.” To undo that, you’re essentially asking the blockchain to process something else — and that comes at a cost. Even if it’s just a 0 ETH transfer to yourself, you’re still utilizing resources, so you’ll need to pay the gas fee.</p><p>But here’s the good news: with the right fee, you can stop waiting and finally take control of your stuck transaction. Sometimes, that’s worth the price. 🚀</p><h3>How Do I Know the Current Price? 🤔</h3><p>Tracking blockchain activity yourself would be a nightmare, but thankfully, <strong>Gas Oracles</strong> do the heavy lifting. These services monitor pending transactions and block sizes to estimate fees, helping wallets provide users with real-time fee recommendations.</p><p>You don’t have to pay for this directly — wallets usually cover the cost to ensure a smoother experience for you. Most Gas Oracles offer fee tiers like:</p><ul><li><strong>Fast:</strong> Higher fee, gets included in the next block (12–30 seconds).</li><li><strong>Medium:</strong> A balanced fee, processes in ~1–2 minutes.</li><li><strong>Slow:</strong> Lowest fee, but could take hours or longer if network demand stays high.</li></ul><p>So, while you don’t need to track the entire blockchain, wallets leveraging Gas Oracles ensure you have the right information at your fingertips. 🚀</p><blockquote>Examples of gas oracles: <a href="https://etherscan.io/gastracker">https://etherscan.io/gastracker</a> , <a href="https://www.blocknative.com/">https://www.blocknative.com/</a></blockquote><h3>Visualizing Blockchain Traffic: The Waiting Room of Transactions</h3><p>Blockchain activity isn’t just about blocks being mined; it’s also about the transactions waiting to get there. Some platforms provide a creative and visual way to track this. For example,<a href="https://txcity.io/v/eth-btc"> <strong>Transaction City</strong></a> offers an animated view of the current state of a blockchain, showcasing the “waiting room” of transactions in a dynamic cityscape format. It’s a fun and insightful way to see how blockchain traffic flows in real time!</p><blockquote>Visit : <a href="https://txcity.io/v/eth-btc">https://txcity.io/v/eth-btc</a></blockquote><h3>Wrapping It Up 🎉</h3><p>Getting your blockchain transaction confirmed isn’t as simple as clicking “send” and crossing your fingers. From understanding block sizes and mempools to grappling with fees and nonce management, there’s a lot happening behind the scenes. This article aimed to demystify those processes, giving you the tools to make smarter decisions about your transactions.</p><p>Ironically, I first joined the blockchain industry to deal with difficult nonce problems — and here I am, years later, writing this article because those same challenges still haunt users and underpin how blockchains prioritize transactions. 😅</p><p>Whether it’s replacing a stuck transaction with a higher fee, learning how fees are determined, or figuring out what happens to skipped nonces, we’ve covered the essentials to help you navigate the competitive world of blockchain confirmations. 🛠️</p><p>Remember, blockchain is all about balancing speed, cost, and reliability. By understanding these dynamics, you can ensure your transactions are prioritized without paying more than you need to.</p><p>Stay tuned for more insights into blockchain mechanics — nonce management, anyone? 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b4b9a8f3483" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding EVM Transactions]]></title>
            <link>https://medium.com/@dsylebee/understanding-evm-transactions-063d05ceec20?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/063d05ceec20</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 02:48:43 GMT</pubDate>
            <atom:updated>2025-02-20T00:30:02.757Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cXwIhnvW7_CUnGGr" /><figcaption>article thumbnail</figcaption></figure><p>Ethereum and its ecosystem of compatible blockchains have revolutionized decentralized computing with the <strong>Ethereum Virtual Machine (EVM)</strong>. At the heart of every interaction — whether it’s transferring ETH, interacting with a smart contract, or deploying a new dApp — lies an <strong>EVM transaction</strong>. By the end of this article, you will have a clear understanding of the data structure behind EVM transactions and how they are encoded.</p><h3>Understanding the Components of EVM Transactions</h3><p>Every EVM transaction includes a set of key fields that define its purpose and behavior. Here’s a quick overview of these components:</p><ul><li><strong>Type</strong>: The transaction type, which we’ll keep a mystery for now and address later. 😉</li><li><strong>From</strong>: The account submitting the transaction.</li><li><strong>To</strong>: The account or smart contract receiving the transaction.</li><li><strong>Value</strong>: The amount of native currency being transferred.</li><li><strong>Gas Limit</strong>: The maximum computational resources the transaction is allowed to consume, measured in gas units.</li><li><strong>Gas Price</strong> or the newer <strong>Max Fee Per Gas</strong> and <strong>Max Priority Fee Per Gas</strong>: These determine the transaction’s cost based on current network activity.</li><li><strong>Data</strong>: A versatile field used for more complex transactions. We won’t go into details just yet, but it plays a crucial role when interacting with smart contracts.</li></ul><h4>The Mystery of the From Field: Deduction Through Signatures</h4><p>The <strong>from</strong> field, while central to any transaction, is not explicitly part of the transaction data. Instead, it is <strong>deduced</strong> during transaction verification by decoding the signature included in the transaction.</p><h4>How It Works: The Signature and RSV Values</h4><p>Each transaction includes a cryptographic signature, which consists of three components:</p><ul><li><strong>R</strong>: A 32-byte value representing part of the elliptic curve point.</li><li><strong>S</strong>: Another 32-byte value, also derived from the elliptic curve signature.</li><li><strong>V</strong>: A single byte indicating the recovery identifier, which helps determine which of the two possible public keys is correct.</li></ul><p>Using these RSV values, the Ethereum Virtual Machine (EVM) can:</p><ol><li><strong>Recover the Public Key</strong>: By applying the elliptic curve recovery algorithm (ECDSA), the EVM derives the public key from the signature.</li><li><strong>Derive the Address</strong>: Ethereum addresses are generated by taking the last 20 bytes of the Keccak-256 hash of the public key.</li></ol><p>This process ensures that the from address is always validated against the signature, providing cryptographic proof that the transaction was authorized by the sender.</p><p>So, while the <strong>from</strong> field is conceptually part of the transaction, it is technically derived, not included explicitly. This clever design eliminates the need for the sender to explicitly include their address, reducing redundancy and ensuring security. 😊</p><h4>The Type Field: Why It Exists and How It Evolved</h4><p>Ethereum pioneered the Ethereum Virtual Machine (EVM), but its success inspired many other blockchains to adopt EVM compatibility. This universality brought advantages but also introduced risks, such as <strong>replay attacks</strong>.</p><p>Unlike Bitcoin, Ethereum accounts are universal across EVM chains. This means a transaction signed for Ethereum could potentially be reused on another EVM-compatible chain, assuming certain conditions are met. Ethereum addressed this with EIP-155, adding chain IDs to transactions to prevent such attacks.</p><h4>What Is a Replay Attack?</h4><p>A replay attack occurs when a transaction signed for one blockchain is submitted to another blockchain with the same signing rules, and it is accepted as valid. While such an attack requires certain conditions to align (e.g., identical chain parameters and account states), it posed a significant risk in environments with overlapping EVM chains.</p><h4>Enter EIP-155 and Type 1 Transactions</h4><p>To mitigate this issue, Ethereum introduced <strong>EIP-155</strong>, which added a <strong>chain ID</strong> to transactions. The chain ID uniquely identifies the target blockchain, preventing a signed transaction from being valid on other EVM-compatible networks.</p><p>With <strong>EIP-155</strong>, the transaction signature process was modified:</p><ol><li>The <strong>chain ID</strong> was included in the transaction signing process, specifically in the V value of the signature (one of the RSV values).</li><li>The <strong>V value</strong> became a calculated field: V = CHAIN_ID * 2 + 35 or V = CHAIN_ID * 2 + 36.</li><li>This adjustment ensured that transactions signed for one chain could not be reused on another, effectively neutralizing replay attacks.</li></ol><p>These changes marked the introduction of <strong>Type 1 transactions</strong>, which added the chain ID as part of the signature logic while remaining backward-compatible with existing transactions on the Ethereum network.</p><h3>EVM Transaction Encoding: How It’s Packed and Sent</h3><p>Now that we’ve covered what a transaction contains, let’s dive into how it’s encoded for transmission over the network. Ethereum transactions use a binary encoding format called <strong>Recursive Length Prefix (RLP)</strong>, which efficiently organizes transaction data into a compact, machine-readable format. This encoding is crucial for minimizing data size while ensuring consistency across nodes.</p><h4>What Is RLP?</h4><p>RLP (Recursive Length Prefix) is a serialization method used in Ethereum to encode structured data. It’s designed to be compact and easy to parse, making it ideal for blockchain applications.</p><p>Here’s how it works:</p><ol><li><strong>Flat Structure</strong>: Each transaction field is encoded as a binary element in a list.</li><li><strong>Length Prefix</strong>: Each element is preceded by its length, ensuring that the data is properly parsed without ambiguity.</li><li><strong>Hierarchical Support</strong>: RLP can encode nested structures, making it flexible for more complex data.</li></ol><h4>How Is a Transaction Encoded?</h4><p>For a simple transaction, the RLP-encoded structure includes the following fields (pre-signature):</p><ol><li><strong>Nonce</strong></li><li><strong>Gas Price</strong></li><li><strong>Gas Limit</strong></li><li><strong>To</strong> (Recipient Address)</li><li><strong>Value</strong> (Amount of ETH)</li><li><strong>Data</strong> (Optional, typically empty for simple transfers)</li><li><strong>V</strong>, <strong>R</strong>, <strong>S</strong> (Signature Values)</li></ol><h4>Example: A Simple Transaction</h4><p>Let’s encode the following transaction:</p><pre>{<br>  &quot;chainId&quot;: &quot;0x1&quot;,<br>  &quot;nonce&quot;: &quot;0x3d&quot;,<br>  &quot;maxPriorityFeePerGas&quot;: &quot;0x9402a0&quot;,<br>  &quot;maxFeePerGas&quot;: &quot;0x181ef9b06&quot;,<br>  &quot;gasLimit&quot;: &quot;0x5208&quot;,<br>  &quot;to&quot;: &quot;0xfdec0bf6123df6210d016be6c73972e6a2af6a22&quot;,<br>  &quot;value&quot;: &quot;0x354a6ba7a18000&quot;,<br>  &quot;v&quot;: &quot;0x0&quot;,<br>  &quot;r&quot;: &quot;0x7f463922c883ebb750eb170de733c91e7ff20cab4fe3c71f223073194b334f8f&quot;,<br>  &quot;s&quot;: &quot;0x216c57aaad167ba8e29951660a911faf1f011fd83c0ed3a67ae1687160877f8&quot;<br>}</pre><p>When RLP-encoded, it might look like this (in hexadecimal):</p><pre>0x02f871013d839402a0850181ef9b0682520894fdec0bf6123df6210d016be6c73972e6a2af6a2287354a6ba7a1800080c080a07f463922c883ebb750eb170de733c91e7ff20cab4fe3c71f223073194b334f8fa00216c57aaad167ba8e29951660a911faf1f011fd83c0ed3a67ae1687160877f8</pre><p>A website like <a href="https://decodevm.xyz/">https://decodevm.xyz/</a> can help you decode simple evm transactions in raw format to understand it.</p><h3>Smart Contracts on EVM: What They Are and How to Use Them</h3><h4>What Is a Smart Contract?</h4><p>A <strong>smart contract</strong> is essentially a piece of software that lives on the blockchain. Unlike regular transactions, which simply send funds between accounts, smart contracts allow you to execute predefined logic — automating tasks, enforcing rules, or even creating entire decentralized applications (dApps). They’re the magic behind the versatility of the EVM.</p><h4>Deploying a Smart Contract</h4><p>To deploy a smart contract, you use the same <strong>EVM transaction format</strong>, but with a few key differences:</p><ul><li><strong>No Destination Address</strong>: Instead of specifying a to address, this field is left empty. The blockchain creates a unique contract address for your smart contract.</li><li><strong>Bytecode in the Data Field</strong>: The contract’s compiled bytecode is placed in the transaction’s data field.</li></ul><p>Here is a sample of a contract being deployed, specifically WETH on Ethereum mainnet.</p><pre>{<br>  &quot;nonce&quot;: &quot;0x1be&quot;,<br>  &quot;gasPrice&quot;: &quot;0x4e3b29200&quot;,<br>  &quot;gasLimit&quot;: &quot;0x16e360&quot;,<br>  &quot;value&quot;: &quot;0x0&quot;,<br>  &quot;data&quot;: &quot;0x60606040526040805190810160405280600d81526020017f57726170706564204574686572000000000000000000000000000000000000008152506000908051906020019061004f9291906100c8565b506040805190810160405280600481526020017f57455448000000000000000000000000000000000000000000000000000000008152506001908051906020019061009b9291906100c8565b506012600260006101000a81548160ff021916908360ff16021790555034156100c357600080fd5b61016d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061010957805160ff1916838001178555610137565b82800160010185558215610137579182015b8281111561013657825182559160200191906001019061011b565b5b5090506101449190610148565b5090565b61016a91905b8082111561016657600081600090555060010161014e565b5090565b90565b610c348061017c6000396000f3006060604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b9578063095ea7b31461014757806318160ddd146101a157806323b872dd146101ca5780632e1a7d4d14610243578063313ce5671461026657806370a082311461029557806395d89b41146102e2578063a9059cbb14610370578063d0e30db0146103ca578063dd62ed3e146103d4575b6100b7610440565b005b34156100c457600080fd5b6100cc6104dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561010c5780820151818401526020810190506100f1565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015257600080fd5b610187600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061057b565b604051808215151515815260200191505060405180910390f35b34156101ac57600080fd5b6101b461066d565b6040518082815260200191505060405180910390f35b34156101d557600080fd5b610229600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061068c565b604051808215151515815260200191505060405180910390f35b341561024e57600080fd5b61026460048080359060200190919050506109d9565b005b341561027157600080fd5b610279610b05565b604051808260ff1660ff16815260200191505060405180910390f35b34156102a057600080fd5b6102cc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b18565b6040518082815260200191505060405180910390f35b34156102ed57600080fd5b6102f5610b30565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033557808201518184015260208101905061031a565b50505050905090810190601f1680156103625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561037b57600080fd5b6103b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bce565b604051808215151515815260200191505060405180910390f35b6103d2610440565b005b34156103df57600080fd5b61042a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610be3565b6040518082815260200191505060405180910390f35b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a2565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105735780601f1061054857610100808354040283529160200191610573565b820191906000526020600020905b81548152906001019060200180831161055657829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156106dc57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156107b457507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156108cf5781600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561084457600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a2757600080fd5b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ab457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a250565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bc65780601f10610b9b57610100808354040283529160200191610bc6565b820191906000526020600020905b815481529060010190602001808311610ba957829003601f168201915b505050505081565b6000610bdb33848461068c565b905092915050565b60046020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820deb4c2ccab3c2fdca32ab3f46728389c2fe2c165d5fafa07661e4e004f6c344a0029&quot;,<br>  &quot;v&quot;: &quot;0x25&quot;,<br>  &quot;r&quot;: &quot;0x7ce08af79f7a6c1b8b336f50890a80602c4dcd1e3cc5ca131373f0e8ff15e278&quot;,<br>  &quot;s&quot;: &quot;0x45e183d91f1e8f31e32d333cf6090990c9bf7d35dd00472cfd2d3a63ca8b1a5&quot;<br>}</pre><blockquote><strong>Note:</strong> The deployment process doesn’t happen by magic; you first need the <strong>bytecode</strong> of the contract. This is generated by writing the smart contract in a high-level language like <strong>Solidity</strong> and then compiling it.</blockquote><blockquote>If this process feels overwhelming, don’t worry — explaining how to write and compile smart contracts is outside the scope of this article. However, the result of the compilation provides two critical outputs:</blockquote><ol><li><strong>Bytecode</strong>: The binary representation of your contract that gets deployed on-chain.</li><li><strong>ABI (Application Binary Interface)</strong>: A JSON-formatted file that defines how to interact with the deployed contract. The ABI lists the contract’s functions, their parameters, and expected outputs.</li></ol><blockquote>You can find the contract source code and ABI here: <a href="https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2#code">https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2#code</a></blockquote><h4>Interacting with Deployed Contracts: How It Works</h4><p>Once a contract is deployed, interacting with it requires two essential pieces of information: the <strong>ABI (Application Binary Interface)</strong> and the <strong>contract address</strong>. The contract address is the account address generated when the smart contract was deployed.</p><p>In a typical transaction, the to field represents the recipient of Ether. However, when interacting with a smart contract, the to field points to the <strong>contract address</strong>. The magic happens in the data field, which contains all the information needed to call a specific function within the contract.</p><p>The data field is <strong>RLP-encoded</strong> and includes the following:</p><ol><li><strong>Function Selector</strong>: The first 4 bytes represent the signature of the function being called, including its name and argument types.</li><li><strong>Encoded Arguments</strong>: The subsequent bytes encode the input arguments in the order expected by the function, based on the contract’s ABI.</li></ol><p>This makes the ABI critical for contract interactions. It not only defines the functions and their parameters but also provides the blueprint for encoding the data correctly. Without it, crafting or decoding interactions with the contract becomes nearly impossible.</p><h4>Breaking Down an EVM Contract Interaction: The WETH9 Deposit Call</h4><p>RLP Encoded transaction being sent.</p><pre>0x02f879018201148445446dd085044201c71d82c32794c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2880186cc6acd4b000084d0e30db0c080a07ead2f5c8f7fd5634b8a0b05ed5cffdcb8117adc61f4db4bd39400de9b2e4545a04e02f7e042d58715b03384d7d0e1211a719ae38da6967039d14c21fd85c85cb2</pre><h4>The Solidity Function</h4><p>The deposit function in WETH9 allows you to deposit Ether into the contract, minting WETH in return. Here&#39;s the Solidity function definition:</p><pre>function deposit() public payable {<br>    balanceOf[msg.sender] += msg.value;<br>    Deposit(msg.sender, msg.value);<br>}</pre><p>Key points:</p><ul><li>It’s a <strong>payable</strong> function, meaning it can accept Ether (msg.value).</li><li>The Deposit event logs the sender&#39;s address and the amount of Ether deposited.</li></ul><h4>The Transaction Breakdown</h4><p>Here’s the transaction data for a call to the deposit function:</p><pre>{<br>  &quot;chainId&quot;: &quot;0x1&quot;,<br>  &quot;nonce&quot;: &quot;0x114&quot;,<br>  &quot;maxPriorityFeePerGas&quot;: &quot;0x45446dd0&quot;,<br>  &quot;maxFeePerGas&quot;: &quot;0x44201c71d&quot;,<br>  &quot;gasLimit&quot;: &quot;0xc327&quot;,<br>  &quot;to&quot;: &quot;0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&quot;,<br>  &quot;value&quot;: &quot;0x186cc6acd4b0000&quot;,<br>  &quot;data&quot;: &quot;0xd0e30db0&quot;,<br>  &quot;accessList&quot;: [],<br>  &quot;v&quot;: &quot;0x0&quot;,<br>  &quot;r&quot;: &quot;0x7ead2f5c8f7fd5634b8a0b05ed5cffdcb8117adc61f4db4bd39400de9b2e4545&quot;,<br>  &quot;s&quot;: &quot;0x4e02f7e042d58715b03384d7d0e1211a719ae38da6967039d14c21fd85c85cb2&quot;<br>}</pre><h4>The Data Field</h4><p>The data field contains encoded information for the function being called. In this case:</p><ul><li>0xd0e30db0: The first 4 bytes represent the function selector, derived from the function signature deposit(). It&#39;s calculated as the first 4 bytes of the Keccak-256 hash of the string &quot;deposit()&quot;.</li><li>There are no arguments in this case since the function doesn&#39;t require any inputs so nothing is after the selector hash</li></ul><blockquote>Transaction being used for this sample is seen here:<br><a href="https://etherscan.io/tx/0x6f84640d341a626f6ddbbe6ce7d85bdcf482b55be574ea8625ca44a4db7089d3">https://etherscan.io/tx/0x6f84640d341a626f6ddbbe6ce7d85bdcf482b55be574ea8625ca44a4db7089d3</a></blockquote><h3>Gas Management for Smart Contract Interactions</h3><p>When interacting with a smart contract, the Gas Limit becomes even more critical. Unlike simple ETH transfers, contract interactions involve executing code, which can vary significantly in complexity and computational cost. To help users estimate the necessary Gas Limit, most nodes provide an RPC method to emulate the transaction before submission, often called eth_estimateGas. This method simulates the transaction execution and provides an estimated gas usage.</p><p>However, the estimation is not always perfect, as different nodes may use slightly varying algorithms. To avoid transaction failure, it’s recommended to add a buffer of 10–20% to the estimated gas limit. This ensures the transaction has enough gas to execute even if the actual cost exceeds the simulation’s estimate.</p><p>One frustrating aspect of this process is that gas estimation may fail if the account doesn’t have enough ETH to cover the transaction cost. The simulation will often revert with an “insufficient ETH” error, leaving users in the dark about how much ETH they need. This can make it challenging to determine the exact funding required, especially for complex interactions or when funds are low. 😅</p><h3>The Power of Events: Observing Smart Contract Interactions</h3><p>One of the key differences between regular native transfers and smart contract interactions is the ability of smart contracts to emit <strong>events</strong>. These events serve as a record of what occurred during the interaction, providing a structured way to log significant actions or outcomes on the blockchain.</p><h4>Events in the WETH9 Example</h4><p>In the deposit function from the WETH9 contract, we see this line:</p><pre>Deposit(msg.sender, msg.value);</pre><p>Here, the Deposit event is emitted whenever the deposit function is called. This event logs two pieces of information:</p><ol><li><strong>msg.sender</strong>: The address of the account that initiated the transaction.</li><li><strong>msg.value</strong>: The amount of Ether deposited.</li></ol><h4>Why Are Events Important?</h4><p>Events are an integral part of how the Ethereum Virtual Machine (EVM) operates and how blockchain interactions can be observed:</p><ul><li><strong>Transparency</strong>: Events provide an immutable log of what happened during a transaction, making it easier to verify and audit interactions.</li><li><strong>Efficiency</strong>: Unlike storing data directly in a contract’s state, emitting events stores the information in the transaction receipt. This approach is cheaper in terms of gas and optimized for read operations.</li><li><strong>Observation</strong>: Developers and applications can “listen” to events using tools like web3.js or ethers.js, enabling real-time interaction tracking.</li></ul><h4>How Events Are Used</h4><p>Events are used for various purposes across EVM-based blockchains:</p><ul><li><strong>Token Transfers</strong>: Emitting Transfer events in ERC-20 or ERC-721 contracts to log token movement.</li><li><strong>State Changes</strong>: Logging updates to on-chain data structures, such as adding liquidity or staking.</li><li><strong>Custom Application Logic</strong>: Developers can define and emit custom events to track unique application-specific actions.</li></ul><p>In the Ethereum Virtual Machine (EVM), events are represented as <strong>logs</strong>. Logs provide a way for smart contracts to emit structured data that can be indexed and retrieved efficiently by off-chain applications.</p><p>Each <strong>log</strong> consists of:</p><ul><li><strong>Contract Address</strong>: The address of the contract that emitted the event. Notably, this is not always the contract you directly interacted with, as contracts can invoke functions in other contracts, leading to logs being emitted from different addresses.</li><li><strong>Topics</strong>:</li><li><strong>Topic 0</strong> always contains the event signature, which is the Keccak-256 hash of the event’s name and parameter types (excluding argument names and whether fields are indexed).</li><li><strong>Additional Topics</strong> contain values of event arguments that are <strong>indexed</strong>. These fields allow efficient filtering when querying logs.</li><li><strong>Data Field</strong>: Contains all event arguments that are <strong>not indexed</strong>, concatenated into a single field.</li></ul><p>The <strong>data field</strong> uses Recursive Length Prefix (RLP) encoding, similar to how transaction calldata is structured. This encoding ensures efficient serialization of variable-length data while maintaining a predictable structure for decoding.</p><h4>Event Signature Does Not Include Indexed Fields</h4><p>Although an event’s ABI specifies which fields are <strong>indexed</strong>, the event signature (Topic 0) is only derived from the event name and its parameter types — <strong>not</strong> whether arguments are indexed or their names.</p><p>For example, both <strong>ERC-20</strong> and <strong>ERC-721</strong> tokens define a Transfer event:</p><p><strong>ERC-20 Transfer Event</strong></p><pre>event Transfer(address indexed from, address indexed to, uint256 value);</pre><p><strong>ERC-721 Transfer Event</strong></p><pre>event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);</pre><p>Even though ERC-20 transfers a <strong>fungible token amount (</strong><strong>value)</strong>, while ERC-721 transfers a <strong>specific non-fungible token (</strong><strong>tokenId)</strong>, both events share the exact same event signature:</p><pre>keccak256(&quot;Transfer(address,address,uint256)&quot;) = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef</pre><p>This happens because the event signature is generated only from:</p><ul><li>The <strong>event name</strong> (Transfer).</li><li>The <strong>parameter types</strong> (address, address, uint256).</li></ul><p>It does <strong>not</strong> include:</p><ul><li>Whether fields are <strong>indexed</strong> (indexed from, indexed to, indexed tokenId).</li><li>The <strong>names</strong> of the arguments (value vs. tokenId).</li></ul><p>Since the event signature is the same, logs must be <strong>decoded</strong> based on context — such as knowing whether the contract implements ERC-20 or ERC-721. This also means that event logs alone do not inherently distinguish between similar-looking events from different contracts.</p><h3>The Role of Signatures: Building Blockchain Standards</h3><p>In the EVM, both functions and events are identified by <strong>signatures</strong> — unique identifiers derived from their name and argument types using Keccak-256.</p><p><strong>Function Signatures</strong>: The first 4 bytes of the Keccak hash of a function name and its arguments uniquely identify it. For example:</p><p>transfer(address,uint256) -&gt;0xa9059cbb</p><p><strong>Event Signatures</strong>: Events use a similar process, enabling efficient identification in transaction logs. For instance:</p><p>Transfer(address,address,uint256) -&gt;0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef</p><h4>Why Signatures Matter</h4><p>Signatures enable contracts to share standardized interfaces. This is the backbone of standards like:</p><ul><li><strong>ERC-20</strong> for fungible tokens.</li><li><strong>WETH9</strong> for wrapped Ether.</li><li><strong>ERC-721 and ERC-1155</strong> for NFTs and multi-tokens.</li></ul><p>Standards allow external apps, like wallets or dApps, to interact with contracts even without the ABI. This interoperability drives ecosystem growth, ensuring contracts can plug into existing tools and protocols seamlessly.</p><p>By using signatures, the EVM ensures that shared standards can thrive, enabling composability and innovation across the blockchain ecosystem.</p><h3>Understanding Type 2 Transactions and EIP-1559</h3><p>Type 2 transactions, introduced through <strong>EIP-1559</strong>, aimed to revolutionize Ethereum’s gas fee model by removing the reliance on external gas oracles, such as the Etherscan Gas Tracker and Blocknative Gas Oracle. Before EIP-1559, users depended heavily on these oracles to estimate transaction fees, which were based on an inefficient auction system. The upgrade sought to simplify fee estimation through a dynamic <strong>Base Fee</strong> that adjusts automatically based on network demand, and a <strong>Priority Fee</strong> (or tip) to incentivize transaction prioritization. This was intended to make gas fee estimation simpler and eliminate the need for external oracles entirely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-mu0SyPHGEBhBOmsSC6uYw.png" /><figcaption>screenshot showing the difference in JSON being signed for the gas price between Legacy (type 0 and type 2 transaction)</figcaption></figure><p>However, the reality has been more nuanced. Computing gas estimates using EIP-1559’s model is resource-intensive, particularly for wallets relying on public RPC endpoints, which aren’t optimized for such operations. As a result, popular wallets like MetaMask and services like Etherscan and Infura adjusted their oracles to accommodate the new pricing model. Instead of removing oracles, EIP-1559 inadvertently reinforced their necessity, as they now provide users with precomputed fee estimates based on the new mechanism.</p><p>While EIP-1559 addressed some problems, such as transaction prioritization and fairer fee distribution, one of its original goals — to eliminate dependency on oracles — remains largely unfulfilled. Oracles still dominate gas fee estimation, highlighting the challenge of balancing technical demands with user convenience in decentralized systems.</p><h4>Fee Changes Beyond Structure</h4><p>The new fee model introduced a <strong>Base Fee</strong>, which is burned (removed from circulation) for every transaction, and a <strong>Priority Fee</strong>, which incentivizes miners (or validators in Ethereum’s proof-of-stake system) to include transactions in blocks. The burning mechanism has added a deflationary element to Ethereum’s monetary policy, reducing ETH supply over time. This change has had significant implications for Ethereum’s economics and is a point of interest for users, investors, and developers alike.</p><p>If you’re interested in understanding how fee burning works and tracking its impact, several platforms provide real-time data and analysis:</p><ul><li><a href="https://ultrasound.money/"><strong>Ultrasound Money</strong></a> — A comprehensive dashboard showing Ethereum’s burn rate, issuance, and deflationary trends.</li><li><a href="https://etherscan.io/chart/dailyethburnt"><strong>Etherscan Gas Tracke</strong></a><strong>r</strong> — Tracks gas prices and provides insights into fee burning.</li><li><a href="https://ethburned.info/"><strong>ETH Burned</strong></a> — Offers detailed metrics on total fees burned and trends over time.</li></ul><p>These tools help visualize the effects of EIP-1559 on Ethereum’s supply and its broader economic implications.</p><h3>Transaction Type 3: Unlocking Efficiency with Blob Transactions</h3><p>Scaling blockchains has been a hot topic, gaining momentum since around 2020. Ethereum’s strategy of leveraging Layer 2 solutions for processing costs while reserving Layer 1 for security has taken center stage in the EVM ecosystem. However, as this approach evolved, new challenges arose, particularly concerning the <strong>data field</strong> in transactions.</p><h4>The Problem with the Data Field</h4><p>The <strong>data field</strong> in Ethereum transactions plays a critical role in integrating Layer 2 solutions, such as zk-rollups or optimistic rollups, by incorporating proofs and other necessary information. However, storing this data permanently on-chain comes with a hefty gas price due to its impact on archive nodes, which must store this data forever. This inefficiency made certain Layer 2 operations prohibitively expensive.</p><h4>Introducing Blob Transactions</h4><p>To address this, Ethereum proposed <strong>EIP-4844</strong>, introducing <strong>blob-carrying transactions</strong> (Transaction Type 3). Blobs are a more cost-effective alternative to the traditional data field. Instead of storing data permanently on-chain, blobs are leased temporarily, significantly reducing costs. These temporary data blobs can be used for various Layer 2 operations, including proofs and dispute resolution, while keeping Ethereum’s archival storage more manageable.</p><h4>Impact on Layer 2 and Costs</h4><p>Transaction Type 3 has revolutionized the economics of Layer 2 scaling. By using blobs instead of the data field, the cost of Layer 2 interactions has dropped dramatically, making these solutions more accessible and widely adopted. This shift has bolstered the use of Layer 2 networks and reduced the overall load on Ethereum’s Layer 1, ensuring a more efficient and scalable ecosystem.</p><p>Blobs have effectively made scaling with rollups more practical and affordable, solidifying Ethereum’s approach to balancing security and scalability.</p><h4>The Complexity and Efficiency of Blob-Carrying Transactions</h4><p>Blob-carrying transactions (Transaction Type 3) significantly reduce costs for Layer 2 rollups by allowing temporary data to be leased on-chain instead of using the data field. However, their encoding is notably complex, with strict requirements, including a minimum size for blobs. This makes them more suited for use cases involving large datasets, such as zk-rollups or optimistic rollups, but less practical for smaller transactions due to potential inefficiencies. While these details are critical for implementation, diving into the specifics of blob encoding and validation would expand the scope of this article. For those curious, Ethereum’s <strong>EIP-4844</strong> offers a comprehensive look at these technical aspects.</p><h3>Understanding Internal Transactions (Also Known as Internal Transfers)</h3><p>Ethereum allows native ETH transfers between two accounts by default. To send ETH to multiple recipients in one transaction, smart contracts enable what we call <strong>internal transfers</strong>.<br>Internal transfers leverage smart contracts to manage complex operations, like distributing ETH to a list of recipients in a single transaction. For instance, a contract could accept a total value and a recipient list, processing and dispatching ETH to each account automatically.<br>This showcases the flexibility of smart contracts in extending Ethereum’s functionality beyond simple one-to-one transfers.</p><h4>The Challenge of Tracking Internal Transfers</h4><p>One significant issue with internal transfers is the lack of a standardized event to indicate when native currency is transferred via a smart contract. Unlike ERC20 tokens, which emit a Transfer event upon transfer, there’s no built-in mechanism to track ETH movements within contracts. This makes identifying and tracking internal transfers a complex task.</p><p>To compound the challenge, Ethereum’s diverse ecosystem of node clients, written in various programming languages and maintained by different organizations, does not have a standardized RPC specification for reporting internal transfers. While this <strong>client diversity</strong> enhances security by reducing the risk of a single point of failure, it also results in inconsistent APIs for tracing internal transactions.</p><p>Many clients have developed their own debug_ or trace_ APIs to help indexers and explorers detect internal transactions. However, these APIs are non-standard, leading to fragmentation and complicating integration for developers and services relying on this data.</p><p>This lack of standardization is also why many wallets don’t display internal transfers. Tracking and displaying them requires more complex work, such as interacting with non-standard APIs or maintaining custom logic to interpret contract interactions. Without a universal approach, wallets often choose to focus on simpler, native transfers to provide a more seamless user experience.</p><p>While there is hope for a standardized tracing or debugging API in the future, this remains an area for Ethereum’s developers to address. Until then, the community continues to navigate this fragmented landscape, striving for better tools and methods to track internal transfers efficiently. 😅</p><h3>TL;DR: The Evolution of EVM Transactions 🚀</h3><p>EVM transactions have come a long way since Ethereum’s inception, evolving to address challenges in scalability, efficiency, and usability. Here’s a quick breakdown of the key milestones:</p><ul><li><strong>Type 0 (Legacy Transactions):</strong> The original transaction format, with gas price auction mechanics that relied on external oracles like Etherscan for fee estimation. Simple but often inefficient, leading to unpredictable costs.</li><li><strong>Type 1 (EIP-155 Transactions):</strong> Introduced chain IDs to prevent replay attacks across EVM-compatible blockchains. This marked the first major enhancement to the transaction format, addressing cross-chain vulnerabilities while maintaining backward compatibility.</li><li><strong>Type 2 (EIP-1559 Transactions):</strong> Revolutionized the fee model by replacing the gas price auction with a dynamic Base Fee and Priority Fee system. This change aimed to eliminate the need for oracles but inadvertently reinforced their importance due to computational demands on wallets and public RPCs. Bonus: It introduced fee burning, reducing ETH supply over time.</li><li><strong>Type 3 (EIP-4844 Blob Transactions):</strong> Aimed at scaling Layer 2 solutions by allowing temporary data storage (blobs) on-chain instead of the expensive data field. This reduced costs for rollups like zk-rollups and optimistic rollups, making Ethereum more efficient and scalable.</li></ul><p>Each transaction type reflects Ethereum’s continuous effort to balance decentralization, scalability, and user experience. While the journey has solved many challenges, it has also introduced new complexities, such as the reliance on oracles for gas estimation and the intricacies of blob transaction encoding.</p><p>As Ethereum and the broader EVM ecosystem evolve, the transaction format will likely continue to adapt, addressing emerging needs and pushing the boundaries of blockchain technology. Understanding these types is key to navigating the ever-expanding world of decentralized applications and finance. 🌐✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=063d05ceec20" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Blockchain Nodes: Roles, Economics, and Why They Matter]]></title>
            <link>https://medium.com/@dsylebee/understanding-blockchain-nodes-roles-economics-and-why-they-matter-e53a9448a77d?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/e53a9448a77d</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Sun, 05 Jan 2025 01:15:08 GMT</pubDate>
            <atom:updated>2025-01-05T01:21:53.498Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KkTMZfghHlOeAFHS" /></figure><p>Blockchain nodes are the unsung heroes of decentralized networks. They validate transactions, maintain the blockchain’s history, and ensure its security and resilience. But why are there different types of nodes? Who runs them? And why might you need to run your own RPC node or rely on providers?</p><p>In this article, we’ll break down the types of nodes, explore their roles in blockchain ecosystems, and dive into the economy that has emerged around running and outsourcing nodes. By the end, you’ll have a clear understanding of how nodes work, why they’re crucial, and how businesses have built entire models around them.</p><h3>Miners and Validators: The Backbone of Blockchain Consensus</h3><p>The most prominent type of blockchain node is the <strong>miner</strong> or <strong>validator</strong>. Their primary role is to maintain the blockchain’s consensus, whether by mining blocks in Proof of Work systems or authoring and finalizing blocks in Proof of Stake systems. In return, they earn rewards for their work.</p><p>These nodes typically operate as <strong>full nodes</strong>, meaning they store a portion of the blockchain’s state. While implementations can vary, a full node might keep the complete headers from the genesis block onward but limit full content storage to, say, the last 256 blocks.</p><p>The main responsibilities of miners and validators include:</p><ul><li><strong>Processing transactions:</strong> Validating and including transactions in blocks.</li><li><strong>Authoring blocks:</strong> Creating new blocks to extend the blockchain.</li><li><strong>Participating in consensus:</strong> Ensuring agreement on the blockchain’s state.</li></ul><p>Miners and validators are the backbone of the blockchain network, ensuring its functionality, security, and trustless nature.</p><h3>RPC Nodes: The Gateway to Blockchain Interaction</h3><p>The second most recognized type of node is the <strong>RPC (Remote Procedure Call) node</strong>. Unlike miners or validators, RPC nodes do not author blocks or participate in consensus finalization. Instead, they remain in sync with the blockchain and provide services to external applications by:</p><ul><li><strong>Submitting transactions:</strong> Allowing users to broadcast their transactions to the network.</li><li><strong>Querying blockchain state:</strong> Fetching account balances, transaction details, and contract data.</li></ul><p>RPC nodes act as the bridge between wallets and the blockchain. They handle communication, ensuring wallets can seamlessly interact with the network.</p><p>Why not rely on miners or validators for this? Simple: miners and validators are already heavily tasked with ensuring the <strong>security and validity of blocks</strong>. Offloading these query and transaction responsibilities to RPC nodes allows the network to remain efficient and scalable.</p><p>RPC nodes are essential to blockchain usability, supporting wallets, dApps, and other tools that depend on reliable blockchain access.</p><h3>Archive Nodes: Preserving Blockchain’s Complete History</h3><p>Archive nodes serve a critical role in blockchain ecosystems by storing the <strong>full state and history</strong> of the blockchain. This includes:</p><ul><li>Every transaction ever made.</li><li>State transitions and account changes.</li><li>Receipts and complete historical data.</li></ul><p>While archive nodes can also function as RPC nodes, they are primarily utilized by <strong>indexers</strong>. Indexers power tools like blockchain explorers, which display the full history of on-chain activity, and analytics platforms, enabling users to generate statistics and analyze blockchain data.</p><p>Archive nodes are more demanding in terms of storage and operational costs, as they require significant space and computational resources to maintain the full blockchain history. However, their presence is essential for maintaining transparency, providing data access for analytical needs, and ensuring the long-term integrity of the blockchain.</p><h3>Bootnodes — The Gatekeepers of Blockchain Networks</h3><p>Bootnodes play a crucial yet understated role in blockchain networks. They are specialized nodes that participate in the <strong>peer-to-peer (P2P)</strong> network and primarily serve to help other nodes join the network.</p><p>When a new node starts up, it connects to a bootnode to discover other participants in the network. After this initial discovery, the new node can persist the list of peers it found and use them for future connections, reducing its reliance on the bootnode.</p><p>Given their importance, bootnodes can become a <strong>single point of failure</strong> if not managed properly. In large networks with many participants, bootnodes need to be rotated periodically to ensure reliability and decentralization.</p><p>In essence, bootnodes exist solely to <strong>introduce new participants</strong> to the P2P network. Once discovery is complete, the network relies on a decentralized process called <strong>network discovery</strong> to maintain connectivity and communication between nodes.</p><h3>Light Nodes: A Step Toward Decentralized Blockchain Interaction</h3><p><strong>Light nodes</strong> (or light clients) are an ambitious effort to reduce reliance on centralized RPC nodes. By connecting directly to the peer-to-peer (P2P) network through <strong>bootnodes</strong> and using <strong>gossip messages</strong> from full nodes, they aim to fetch blockchain data without needing the full chain state.</p><p>But here’s the catch: bootnodes and full nodes often refuse to peer with light nodes. Why? They’re already swamped maintaining consensus and processing transactions, leaving little incentive to cater to light node requests.</p><p>I may get some heat for this one 🔥, but light nodes haven’t exactly taken the blockchain world by storm. While they’ve found utility in cross-chain protocols and trustless bridges, wallets continue to rely heavily on centralized RPCs for simplicity and reliability. 😊</p><p>The potential of light nodes remains promising, but for now, they feel more like a work in progress than a revolution in blockchain interaction.</p><h3>Connecting to Blockchain: The Business of RPC Nodes</h3><p>RPCs and archive nodes lack an official reward system from blockchains, yet they’re essential for users and developers. This gap has created an economy of its own, with companies stepping in to provide these critical services.</p><p>Platforms like <strong>Infura</strong> (for Ethereum networks) and <strong>Chainstack</strong> (supporting multiple blockchains) have emerged as key players, offering RPC access to meet the growing demand. These services enable seamless interaction with blockchains, powering wallets, dApps, and other tools.</p><p>The pricing models reflect the varied needs of users:</p><ul><li><strong>Elastic Usage:</strong> Pay-per-request or credit-based systems for those with fluctuating demands.</li><li><strong>Dedicated Pricing:</strong> Exclusive, non-shared instances for high-performance and reliability needs.</li></ul><p>Running and maintaining an RPC node, especially an archive node, is demanding. It requires significant resources and expertise, from storage and compute power to ensuring uptime and sync with the blockchain. It’s no surprise that this has become an essential, thriving service industry in the blockchain ecosystem.</p><p>I hope this helped clarify the different types of blockchain nodes and their roles. Light nodes are an exciting concept to follow and may play a bigger role in the future. For now, though, we still largely depend on RPC providers to ensure reliable access and guarantees for interacting with blockchains. Let’s see how this space evolves! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e53a9448a77d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hot Wallets vs. Cold Wallets: Safeguarding Your Private Keys and Mnemonic Derivations]]></title>
            <link>https://medium.com/@dsylebee/hot-wallets-vs-cold-wallets-safeguarding-your-private-keys-and-mnemonic-derivations-e97504035fba?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/e97504035fba</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 18:07:42 GMT</pubDate>
            <atom:updated>2025-01-03T18:22:52.299Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zUHT2dYUQJey14M3" /></figure><p>In the world of blockchain, <strong>safeguarding your private keys</strong> is paramount. Your private key is what grants you ownership of your funds and the ability to sign transactions. Losing it — or worse, exposing it — can result in losing access to your assets entirely. It’s no exaggeration to say that your private key is your most valuable digital asset.</p><p>In this article, we’ll explore the differences between <strong>hot wallets</strong> and <strong>cold wallets</strong>, their roles in securing your private keys, and how to strike a balance between convenience and security. We’ll also dive into <strong>mnemonic derivations</strong> and how a single mnemonic phrase can generate multiple private and public keys across different blockchains. By the end, you’ll have a solid understanding of how to manage and protect your keys in the evolving crypto landscape.</p><h3>Why Safeguarding Your Private Key Is Non-Negotiable</h3><p>In traditional systems governed by central authorities — like governments, banks, or legal frameworks — your property is tied to your <strong>identity</strong> or paperwork, such as a title or deed. These systems provide a safety net. For example, if your car gets stolen because you left your keys in it 🚗🔑 (oops!), you still legally own the car. Law enforcement or insurance can help you recover it, thanks to centralized records and processes.</p><p>In the world of blockchain, there’s no central authority to back you up. Here, the <strong>law is the protocol software</strong>, and the protocol dictates that the ownership of an asset belongs to whoever holds the <strong>private key</strong>.</p><p>This means that if your private key is leaked, stolen, or even entrusted to someone else (like a centralized exchange), you lose control of your assets — permanently. The blockchain community has a simple phrase to emphasize this: <strong>“Not your keys, not your crypto.”</strong> If someone else has your private key, they have your crypto. There are no recovery options, no appeals, and no one to call for help.</p><p>Safeguarding your private key isn’t just important — it’s the ownership of the assets.</p><h3>How to Start a Blockchain Account: Understanding Wallets and Mnemonics</h3><p>Most people start their blockchain journey by creating an account through a <strong>wallet</strong>. Wallets come in many forms — some safer than others — and we’ll explore their differences later. But no matter the type of wallet, they all rely on something called a <strong>mnemonic</strong> to create accounts.</p><p>A <strong>mnemonic</strong> is a set of everyday words (usually 12 or 24) that can be used to derive a <strong>private key</strong>, effectively creating an account. What’s more, mnemonics can generate multiple private keys by following different derivation paths, making them versatile.</p><p>One of the biggest advantages of mnemonics is their ability to generate private keys for <strong>different blockchains</strong>. Since not all blockchains use the same cryptographic algorithms for private/public keys, a mnemonic allows you to back up a single set of words and use them to create accounts on multiple blockchains.</p><p>However, this convenience comes with responsibility. Safeguarding your mnemonic is just as important as protecting your private key — if someone gains access to your mnemonic, they effectively have access to all accounts derived from it. Treat your mnemonic like the master key to your blockchain vault! 🏦🔑</p><h3>How Do Mnemonics Derive Accounts?</h3><p>Mnemonics are like the master key 🔑 to your blockchain accounts, but the way they unlock things varies depending on the blockchain. Different blockchains use different standards to interpret these words into private keys and addresses.</p><ul><li><strong>Bitcoin and Ethereum:</strong> Both follow the <strong>BIP-44 standard</strong>, which provides a clear set of rules for generating private keys. Each chain adds its unique twist — Bitcoin uses <strong>0&#39;</strong> as its coin type, while Ethereum uses <strong>60&#39;</strong>. The cryptographic algorithms also differ, with Bitcoin relying on a mix of <strong>SHA-256</strong> and <strong>RIPEMD-160</strong>, while Ethereum uses <strong>Keccak-256</strong> to create its addresses.</li><li><strong>Polkadot and Parachains:</strong> These blockchains take a different approach, using the <strong>SS58 standard</strong>. This method is specifically designed for Polkadot’s ecosystem, making its addresses distinct from those on Bitcoin or Ethereum. It’s a tailored system for a unique multi-chain setup.</li></ul><h3>How Can You Generate Multiple Addresses from a Mnemonic?</h3><p>The typical derivation path for an Ethereum address is:<br>m/44&#39;/60&#39;/0&#39;/0/0</p><p>To create additional addresses, you simply change the last number in the path:</p><ul><li>Second address: m/44&#39;/60&#39;/0&#39;/0/1</li><li>Third address: m/44&#39;/60&#39;/0&#39;/0/2</li><li>Fourth address: m/44&#39;/60&#39;/0&#39;/0/3</li></ul><p>This simple tweak allows you to manage multiple accounts — all tied to the same mnemonic. Efficient, right? Just remember, your mnemonic is the ultimate key to all these addresses, so keep it safe 🛡️!</p><h3>Private Key to Address: Identifying Your Blockchain Account</h3><p>Great! You have a private key. But how do you share your account details to receive tokens? What actually identifies your account?</p><p>Each private key is paired with a <strong>public key</strong>, which is the part you share with others. Since public keys are long sequences of bytes, blockchains transform them into a more readable format called an <strong>address</strong>. This address is derived from the public key and serves as your account identifier.</p><h4>Examples of Address Formats</h4><p><strong>Ethereum:</strong><br>Ethereum addresses are consistent across all networks, starting with 0x followed by 40 hexadecimal characters.</p><ul><li>Example: 0x742d35Cc6634C0532925a3b844Bc454e4438f44e</li></ul><p><strong>Bitcoin:</strong><br>Bitcoin addresses vary by type and network:</p><ul><li>Legacy: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa</li><li>SegWit: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kygt080</li></ul><p><strong>Substrate (e.g., Polkadot):</strong><br>Substrate-based chains use an SS58 format, with prefixes distinguishing networks:</p><ul><li>Polkadot: 12w5WfDHLZCX6ZwbynRj7Nh6T6yB5HrjSnR9Z7Vf6kH3GkR</li><li>Kusama: HNZfqV3cKFp3GkDxuGhPKNfxwPPqnAfnNDgQpABNHDpNUKQ</li></ul><p><strong>Key Takeaway</strong></p><p>Always check the address format and prefix to ensure transactions are sent to the correct network. 🛡️</p><h4>Naming Services for Easier Interaction</h4><p>Addresses, though text-based, can still be hard to remember. To make things simpler, services like the <strong>Ethereum Name Service (ENS)</strong> allow you to register a human-readable name, such as johndoe.eth, which resolves to your blockchain address. This works similarly to how google.com translates to an IP address, making it easier for others to interact with your account.</p><p>However, <strong>not all blockchains support such naming services</strong>. While Ethereum and its ecosystem widely use ENS, many blockchains do not have equivalent features, requiring users to stick with their long, complex addresses. Always check if your preferred blockchain offers naming services before relying on this convenience.</p><p>In essence, your address (or ENS name) is like your blockchain username, while your private key remains the master password that secures it all. 🛡️</p><h3>Accessibility is key to security</h3><p>Imagine you had a treasure, and the only thing standing between it and the world was its key. In a world without laws, banks, or anyone to help you recover it, the security of that key is entirely up to you. Whether you hide it, bury it, or lock it away, its safety depends on how accessible it is to others.</p><p>This principle applies to your <strong>private key</strong>, the cryptographic key that unlocks your blockchain accounts. Most people use wallets to manage their private keys, and how that wallet operates determines its security level.</p><p>Here’s where the terms <strong>Hot Wallet</strong> and <strong>Cold Wallet</strong> come in:</p><ul><li><strong>Hot Wallet:</strong> A wallet connected to the internet most or all of the time, making it accessible for transactions but potentially more vulnerable to cyber threats.</li><li><strong>Cold Wallet:</strong> A wallet disconnected from the internet, used primarily to sign transactions securely, minimizing exposure to online risks.</li></ul><p>In essence, a <strong>wallet</strong> is simply software that helps you interact with the blockchain, but its “temperature” (hot or cold) determines how secure it is. We’ll explore more about protecting your mnemonic later, but the same principle applies: <strong>the less accessible, the safer</strong>. 🛡</p><h3>Why Hardware Wallets Use 24 Words and Unique Derivation Paths</h3><p>Hardware wallets are designed with <strong>extra layers of security</strong> compared to hot wallets. One key difference is the use of <strong>24-word mnemonics</strong>, rather than the 12 words typically used by hot wallets. This longer mnemonic provides an added level of entropy, making it significantly harder for attackers to brute-force or guess the private key.</p><p>In addition to the longer mnemonic, hardware wallets often use a <strong>different derivation path</strong> from standard hot wallets. These paths are designed to reduce the likelihood of collisions (multiple wallets generating the same private key). However, it’s worth noting that these derivation paths are publicly known, so while they prevent accidental overlaps, they do not add any additional security against an attacker who already has access to the mnemonic.</p><p>These design choices highlight the emphasis on security for hardware wallets, making them the preferred choice for safeguarding substantial crypto assets. While they may come with a higher upfront cost, the peace of mind they offer is well worth the investment.</p><h3>When Should You Use a Hot Wallet or Cold Wallet?</h3><p>The decision to use a <strong>hot wallet</strong> or invest in a <strong>cold wallet</strong> (like a hardware wallet) often comes down to cost and the value of your assets. Hardware wallets typically range from $150 to $200, which can feel steep — until you consider what you might lose without one.</p><p>Ask yourself: <strong>Do I have more at stake than I’m willing to lose because of a virus or hack?</strong> If the answer is yes, it’s probably time to invest in a hardware wallet and transfer your valuable assets into it. Think of it like buying a safe for your home or renting a lockbox at the bank.</p><p>However, be cautious about trusting centralized services, such as exchanges, to secure your crypto. A lockbox at the bank is similar to keeping your funds on an exchange: <strong>Not your keys, not your crypto.</strong> With a hardware wallet, <strong>you</strong> control the private keys, ensuring your assets remain yours, no matter what happens to external services.</p><h3>Bridging the Gap: Hot Wallets and Cold Wallets</h3><p>This may sound a bit confusing, but it’s crucial to understand the relationship between <strong>hot wallets</strong> and <strong>cold wallets</strong>.</p><p>Hot wallets, like browser extensions or mobile app wallets, are incredibly user-friendly. That’s why they’re the starting point for most people entering the blockchain space — they’re accessible and familiar.</p><p>Cold wallets, such as hardware wallets, provide much greater security but aren’t as widely adopted. To bridge this gap, hardware wallet manufacturers have worked hard to make their products compatible with the popular hot wallet apps people are already used to.</p><p>This means you can connect your <strong>hardware wallet (cold wallet)</strong> to these familiar apps, enabling you to enjoy the usability of a hot wallet while maintaining the security of a cold wallet. These connections are often made via USB or even Bluetooth for some hardware wallets, ensuring that even enhanced security doesn’t compromise ease of use.</p><h4>How Hardware Wallets Work</h4><p>Hardware wallets (cold wallets) are designed to prioritize security, and they achieve this by staying <strong>offline</strong>. To interact with the blockchain, they rely on a <strong>hot wallet app</strong> as an intermediary. Here’s how the process works:</p><ol><li><strong>Connection:</strong><br>Hardware wallets connect to your hot wallet app via <strong>USB, USB-C, or Bluetooth</strong>.</li><li><strong>Request and Confirmation:</strong><br>When you want to sign a transaction, the hot wallet app sends a request to the hardware wallet. The hardware wallet does not expose your private key but uses it to generate the required <strong>signature</strong>. To confirm, you’ll need to:</li></ol><ul><li>Enter your <strong>PIN</strong> on the hardware wallet.</li><li>Physically approve the transaction by pressing a button or using a touch interface on the device.</li></ul><ol><li><strong>Returning the Signature:</strong><br>Once approved, the hardware wallet sends the <strong>signature</strong> back to the hot wallet app.</li><li><strong>Interaction with the Blockchain:</strong><br>The hot wallet app, being connected to the internet, uses this signature to broadcast the transaction to the blockchain.</li></ol><h4>Why This Makes Hardware Wallets Cold Wallets</h4><p>The defining feature of a cold wallet is its <strong>disconnection from the internet</strong>. A hardware wallet can’t interact with the blockchain directly — it relies on the hot wallet app for that. This separation is what makes hardware wallets so secure. Even if the connected hot wallet app is compromised, the hardware wallet ensures your <strong>private keys never leave the device</strong>, protecting your assets from online threats.</p><h3>What Makes a Wallet Trusted? Open Source and Transparency</h3><p>When dealing with private keys, trust in your wallet is paramount. Unlike physical safes, where you can see the lock and gauge its strength, the security of a wallet depends on the software behind it — something you can’t directly observe.</p><p>This is why many of the most trusted wallets are <strong>open source</strong>. Open-source wallets allow their code to be reviewed, audited, and tracked by the community, ensuring no hidden vulnerabilities or malicious features that could compromise your mnemonic or private keys.</p><p>For example, a notable hardware wallet like <strong>Ledger</strong> gains trust because its <strong>firmware</strong> (the software running on the wallet) is open source. This means that anyone in the community, especially those deeply invested in crypto security, can scrutinize the code to ensure it’s safe.</p><p>Not only is the hardware wallet itself open source, but the various blockchain applications it supports are as well. This ensures that even the apps used on the wallet don’t leak or mishandle your private key.</p><p>In short, the transparency provided by open-source wallets builds confidence, giving users peace of mind that their assets are secure. Without such transparency, trust would be much harder to establish in the decentralized world of blockchain. 🛡️</p><h3>Securing Large Quantities of Assets</h3><p>When it comes to managing substantial amounts of on-chain assets, especially for organizations or situations requiring multiple people to handle transactions, more advanced security methods are necessary.</p><p>There are several options available for securing large quantities of assets, including:</p><ul><li><strong>Threshold Signatures</strong></li><li><strong>MPC (Multi-Party Computation)</strong></li><li><strong>Multi-Signature Wallets</strong></li><li><strong>Safe Contract Wallets</strong></li></ul><p>These methods enable multiple parties to participate in the signing process, with customizable thresholds to determine how many signatures are required for a transaction to proceed. For example, you could set a rule requiring 3 out of 5 people to sign off on a transfer before it’s executed.</p><p>A whole industry has emerged to address these challenges for organizations, hedge funds, and other entities managing large crypto holdings. For instance, open-source solutions like <strong>Gnosis Safe (https://safe.global) </strong>provide transparent and customizable options, while commercial platforms like <strong>Fireblocks (https://fireblocks.com) </strong>offer enterprise-level security with robust support and additional features.</p><p>Each of these techniques adds an extra layer of protection and governance, making them ideal for organizations or individuals managing significant holdings.</p><blockquote>I won’t dive into the details here, but I might write an article later on that topic.</blockquote><h3>Securing Your Crypto and the Potential Future of Insurance</h3><p>As cryptocurrencies grow in value and adoption, <strong>insurance companies</strong> are beginning to explore ways to protect large quantities of digital assets. They’re examining how individuals and organizations secure their private keys, whether through isolation techniques or advanced methods like <strong>multi-signature wallets</strong>, <strong>threshold signatures</strong>, or <strong>MPC (Multi-Party Computation)</strong>.</p><p>This movement could become a cornerstone for a healthier crypto industry. By offering insurance against theft or loss, these companies may encourage standardized, robust security practices. Wallet providers might be incentivized to adopt stricter guidelines and provide <strong>clear recommendations</strong> for safeguarding private keys to meet insurance requirements.</p><p>Companies like <strong>Neptune Mutual</strong> are already paving the way with blockchain-based insurance solutions, while initiatives like Ethereum’s <strong>EIP-7702</strong> aim to create frameworks that facilitate the involvement of insurance providers in the crypto space. These advancements may accelerate the adoption of insured crypto holdings and set industry-wide standards.</p><blockquote><strong>Source</strong>: <a href="https://blog.thirdweb.com/eip-7702/">https://blog.thirdweb.com/eip-7702/</a></blockquote><p>Imagine a future where wallets are certified as secure, and crypto holders can sleep better at night knowing their assets are not just well-protected but also insured. While we’re not there yet, these developments signal an exciting step toward maturity in the blockchain world. 🛡️✨</p><h3><strong>Building a Safer Future for Crypto</strong></h3><p>We’ve come a long way in understanding how to secure our assets, but the journey doesn’t stop here. Educating users about safeguarding private keys 🛡️, creating simpler wallet experiences, advancing smart and safe wallets for organizations, and involving insurance companies to set industry standards are the next big steps.</p><p>The blockchain space is maturing every day, and it’s exciting to see how these developments are shaping the future. With the right focus and effort, we’re building a safer and more accessible ecosystem for everyone. As always, feel free to share your thoughts or questions — let’s keep the conversation going! 🚀✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e97504035fba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account Model vs. UTXO: How Blockchain Tracks Balances]]></title>
            <link>https://medium.com/@dsylebee/account-model-vs-utxo-how-blockchain-tracks-balances-7a42168b0a90?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a42168b0a90</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Thu, 02 Jan 2025 23:24:44 GMT</pubDate>
            <atom:updated>2025-01-09T21:31:41.996Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FIFqJ5dah545J4zb" /></figure><p>In our previous discussion, we briefly touched on <strong>accounts</strong> and how ownership is established through asymmetric cryptography. However, we didn’t dive into an equally important aspect: <strong>how balances are tracked</strong> on blockchains. 🧮</p><p>Different blockchains use different methods to record and manage balances. The two most common approaches are the <strong>Account Model</strong> and the <strong>UTXO (Unspent Transaction Output) Model</strong>. These models define how transactions are processed, validated, and recorded, playing a critical role in shaping a blockchain’s functionality and use cases.</p><p>In this article, we’ll explore these two models, compare their strengths and weaknesses, and discuss why different blockchains have chosen one approach over the other. Let’s unravel how the seemingly simple task of tracking balances has led to vastly different designs in blockchain systems. 🚀</p><h3><strong>Account Model: Simple and Familiar</strong></h3><p>Let’s start with the <strong>Account Model</strong>, as it feels more familiar to most users — it’s essentially like a <strong>traditional bank account</strong>. 🏦 In this model, your balance is neatly stored and tracked in the blockchain’s state, eliminating the need to sum up all past transactions to determine your funds. Querying your balance is straightforward and can be done directly through the blockchain, making it much easier to manage compared to the UTXO model.</p><h4>How the Account Model Works</h4><p>In the Account Model, blocks contain <strong>state changes</strong> rather than a list of unspent outputs. Each account has a recorded balance, and transactions simply modify this balance. For example:</p><p>When you send ETH to another account, your balance decreases, and the recipient’s balance increases — simple and clean, no need to dig through transaction hashes like you would in the UTXO model. 🧹</p><p>This simplicity makes the Account Model efficient and user-friendly, especially for basic transactions.</p><h4>Who Uses the Account Model?</h4><p>The Account Model is used by many prominent blockchains, including:</p><ul><li><strong>Ethereum:</strong> A pioneer in introducing smart contracts alongside the Account Model.</li><li><strong>Binance Smart Chain (BSC):</strong> A popular Ethereum-compatible blockchain.</li><li><strong>Solana, Algorand, Polkadot, and others</strong> use variations of the Account Model tailored to their specific ecosystems.</li></ul><h4>Simplicity with a Trade-Off</h4><p>The simplicity of the Account Model comes with a trade-off: <strong>extra storage</strong>. By keeping the state of account balances directly on-chain, the blockchain requires more storage for maintaining the global state. This, in turn, makes transactions slightly more expensive. 💸</p><p>But here’s the silver lining:</p><ul><li>Blockchain nodes <strong>don’t need to act as archive nodes</strong> storing every transaction ever made. Instead, they can operate as full nodes, retaining only the current state and not all transaction details. This reduces the storage burden on individual nodes while keeping the network functional and efficient. 🖥️🔧</li></ul><p>It’s a balance between slightly higher transaction fees and a lighter workload for nodes. So, while you might grumble about the fees, at least you’re not paying for unnecessary storage of every transaction since Genesis! 😅</p><p>The <strong>Account Model</strong> is simple, familiar, and ideal for blockchains focused on smart contracts and stateful applications. While it has its trade-offs, like higher transaction fees, its ability to streamline balance management and enable advanced functionality keeps it at the forefront of blockchain design. 🚀</p><h3>UTXO — Unspent Transaction Output Model</h3><p>The <strong>UTXO (Unspent Transaction Output)</strong> model is like keeping your finances in multiple little treasure chests scattered across the blockchain. Want to know how much you have? You’d better start hunting. Unlike the Account Model, where your balance is like a simple number in your bank app, UTXO balances are the sum of all unspent outputs from past transactions. To use this balance, you must reference the transaction hashes of these outputs, ensuring that they haven’t been spent yet. Easy, right? 😅 Not quite.</p><h4>Why UTXO Balances Are Hard to Track</h4><p>In the UTXO model, your balance isn’t conveniently stored in one place — it’s scattered. You need to scan the blockchain for all transactions linked to your address, pick out the unspent outputs, and calculate their total. Unlike the Account Model, where balances are part of the blockchain state and can be easily queried via RPC, UTXOs require extra legwork. This is why querying your balance directly from the blockchain is like asking your dog to calculate your taxes — it’s technically possible but impractical.</p><p>Most UTXO-based wallets handle this complexity off-chain. They use indexing solutions that monitor the blockchain, track relevant transactions, and maintain a local database of your unspent outputs. Alternatively, <strong>Simplified Payment Verification (SPV)</strong> lets lightweight clients validate transactions without downloading the entire blockchain. But even SPV clients often depend on external services to get the job done. For the purists running a full node, congratulations — you can independently calculate your balance, but be ready to sacrifice storage space and processing power.</p><h4>The Benefits: Flexibility</h4><p>Despite the complexity, the UTXO model shines in how it handles transactions. Think of it as the blockchain’s answer to EFT (Electronic Funds Transfer) files in banking. A single UTXO transaction can reference multiple inputs and create multiple outputs. This allows for some serious multitasking — batching payments, splitting funds across addresses, or consolidating smaller amounts into larger ones, all in one go.</p><p>For example, let’s say you have a pile of small unspent amounts. A UTXO transaction can combine them to make a larger payment while also sending the remaining change back to you. Efficient, right? It’s like buying coffee with all your loose change and still getting some back for parking. ☕➡️</p><h4>Why Bitcoin Loves UTXOs</h4><p>Lastly, the UTXO model is highly efficient for large-scale payment scenarios. Whether you’re consolidating hundreds of small inputs or distributing payments to multiple recipients, UTXOs reduce transaction overhead and provide unmatched flexibility. It’s no wonder Bitcoin, the OG of blockchains, relies on UTXOs as a cornerstone of its architecture. Sure, it’s not the easiest to use, but what it lacks in simplicity, it makes up for in efficiency and elegance. 🏗️✨</p><p>While UTXOs may require some extra effort to manage, they’re a powerhouse for flexibility, making them a perfect fit for Bitcoin’s philosophy. Keep that in mind the next time you wonder why your wallet app feels like it’s running a mini calculator under the hood! 🤖</p><h3>Conclusion: UTXO vs. Account Model</h3><p>When comparing the <strong>UTXO model</strong> and the <strong>Account model</strong>, it’s clear that each has unique strengths and trade-offs, tailored to different blockchain use cases.</p><p>The <strong>UTXO model</strong>, used by Bitcoin, operates like managing a set of digital receipts 🧾. Its design allows for flexibility in handling complex payment structures, as individual transaction outputs can be split across multiple addresses or consolidated into a single output. While this can make tracing transactions more challenging.</p><p>The <strong>Account model</strong>, adopted by Ethereum and similar blockchains, is more like a traditional bank account 🏦. It simplifies balance management, allowing for direct queries and seamless integration with smart contracts 🤖.</p><p>In essence, while the UTXO model offers flexibility and a decentralized way to manage transaction outputs. Meanwhile, the Account model prioritizes ease of use and programmability, making it a natural fit for blockchains focused on smart contracts and decentralized applications. Both models serve distinct purposes in the blockchain ecosystem 🌐✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a42168b0a90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proof of Stake: A Sustainable Alternative to Proof of Work]]></title>
            <link>https://medium.com/@dsylebee/proof-of-stake-a-sustainable-alternative-to-proof-of-work-4851610ff877?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/4851610ff877</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Thu, 02 Jan 2025 20:23:26 GMT</pubDate>
            <atom:updated>2025-01-02T20:35:08.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FBupWb5npk6lmwRr" /><figcaption>Image representing locked tokens with a time limit</figcaption></figure><p>In my last article, I mentioned that I would write about the challenges of <strong>Proof of Work (PoW)</strong> and the search for better consensus mechanisms. This is the promised follow-up article, where I’ll dive into <strong>Proof of Stake (PoS)</strong> — the second most popular consensus algorithm and a compelling alternative to PoW.</p><p>Unlike PoW, which relies on significant computational power to secure the network, PoS replaces the energy-intensive process with a staking system. Participants lock up a portion of their cryptocurrency as a stake, which incentivizes good behavior while reducing the environmental impact. In this article, we’ll explore how PoS works, its benefits, and why it’s gaining traction as a more sustainable approach to blockchain consensus.</p><h3>From Miners to Validators: The Commitment in Proof of Stake</h3><p>Similar to Proof of Work (PoW), <strong>nodes</strong> in Proof of Stake (PoS) systems are the operators of the blockchain. However, unlike PoW, where nodes are referred to as <strong>miners</strong>, in PoS, they are called <strong>validators</strong>.</p><h4>Key Differences Between PoW and PoS</h4><p>One of the fundamental differences between PoW and PoS lies in what is required to participate:</p><ul><li><strong>Proof of Work:</strong> Only computational power is needed. A node runs a computer to compete for block rewards, with no further commitment.</li><li><strong>Proof of Stake:</strong> Validators must make a commitment to stay online and perform their duties when called upon. Additionally, validators face penalties for misbehavior or failure to fulfill their responsibilities.</li></ul><h4>A Punitive and Rewarding System</h4><p>This shift from PoW to PoS transforms the ecosystem. While PoW is a purely <strong>reward-based system</strong>, PoS introduces a combination of <strong>rewards and penalties</strong>:</p><ul><li><strong>Rewards:</strong> Validators earn rewards for authoring or validating blocks correctly.</li><li><strong>Penalties:</strong> Validators can lose part of their staked funds if they behave maliciously, fail to validate, or go offline during critical operations.</li></ul><p>This dual mechanism incentivizes proper behavior while discouraging negligence, creating a more balanced and accountable system.</p><h3>How Does PoS Solve the Competition Problem?</h3><p>The core issue in blockchain consensus is <strong>the incentive to compete with others to create the next block.</strong> PoS addresses this by introducing a system where participants lock up the native currency of the blockchain (staking) for a certain period, typically measured in blocks.</p><p>Here’s how it works:</p><ol><li><strong>Locking Tokens:</strong> Participants lock their tokens for a specified time — this can vary across blockchains.</li><li><strong>Becoming a Validator:</strong> Once tokens are locked, participants can sign a transaction signaling their intent to become a validator.</li></ol><h4>Variations in PoS Staking</h4><p>Different blockchains implement staking differently:</p><ul><li><strong>Fixed Stake:</strong> Some chains, like Ethereum, require a fixed amount of stake to qualify as a validator.</li><li><strong>Weighted Stake:</strong> Others, like Polkadot, use a weighted staking approach, where the amount of stake influences validator selection. (We’ll explore these variations in more detail later in this article.)</li></ul><p>The key idea is that participants must <strong>commit</strong> to consensus, which involves two responsibilities:</p><ul><li><strong>Producing Blocks:</strong> Sometimes, validators are responsible for authoring a block.</li><li><strong>Voting on Blocks:</strong> At other times, validators vote to confirm whether a block is valid.</li></ul><h4>Finality in PoS vs. PoW</h4><p>Another significant difference is in how finality is achieved. While PoW relies on <strong>probabilistic finality</strong>, PoS typically separates the block authoring process from the block finalization process.</p><p>This results in two key metrics on PoS blockchains:</p><ol><li>The <strong>latest block</strong>, which represents the most recent addition to the chain.</li><li>The <strong>latest finalized block</strong>, which has been validated and is considered irreversible.</li></ol><p>Some PoS chains reach finality faster, while others take longer depending on their specific implementation — a topic we’ll delve into later in this article.</p><h3>Leader Election in Proof of Stake — Determining Block Authors</h3><p>A key question in Proof of Stake (PoS) systems is: <strong>Who is responsible for authoring blocks, and who is responsible for voting on blocks?</strong></p><p>Different PoS systems have different rules, but the essential concept is that, unlike Proof of Work (PoW), where nodes compete to produce blocks, PoS requires a <strong>logical and trustless method</strong> to determine whose turn it is to author a block. This process is typically referred to as <strong>Leader Election</strong>.</p><h4>How Leader Election Works</h4><p>The blockchain must establish a deterministic and trustless system that informs validators when it’s their turn to produce a block. Here are some common approaches:</p><ol><li><strong>Specified Validators:</strong><br>Some blockchains predefine which validator — or a group of backup validators — should author a block. This ensures continuity in case the primary validator is offline.</li><li><strong>Pseudo-Randomness with VRF (Verifiable Random Functions):</strong><br>Other blockchains use pseudo-randomness combined with VRFs to select block authors. This approach ensures: Validators can determine when it’s their turn to produce a block and that the identity of the next block producer is not revealed until necessary, protecting against targeted attacks on specific nodes.</li></ol><h4>Minimal Competition, Maximal Efficiency</h4><p>No matter which method is employed, PoS systems ensure that block authors are determined without requiring intense competition. While some competition exists due to backup validators in case the primary validator is offline, it is a far cry from the energy-intensive racing of PoW systems.</p><p>By design, PoS eliminates unnecessary resource waste, replacing it with an efficient and secure process for block production.</p><h3>The Benefits of Proof of Stake: A New Perspective on Consensus</h3><p>A key difference between Proof of Stake (PoS) and Proof of Work (PoW) is that PoS requires the existence of tokens to participate in the consensus. In contrast, PoW requires no tokens, which might seem easier for onboarding at first glance.</p><p>Let’s explore the reality of both systems and why PoS offers unique advantages.</p><h4>Addressing the Truth About PoW Onboarding</h4><p>Today, if you want to become a PoW miner on a highly decentralized network, the competition is fierce. The chances of successfully mining a block are slim unless you invest in extremely expensive hardware. This means that, much like PoS, you still need significant capital to even begin competing.</p><p>With PoS, while you need to purchase tokens to start, the requirements for computer hardware are far less demanding than PoW mining rigs. This levels the playing field and makes onboarding more accessible.</p><h3>Key Benefits of Proof of Stake</h3><ol><li><strong>Stable Block Times:</strong><br>PoS guarantees more stable block times because blocks are authored without solving heavy cryptographic puzzles. Validators are scheduled based on their stake, eliminating concerns like the “long chain problem” often seen in PoW.</li><li><strong>Less Stress on Hardware:</strong><br>Since PoS doesn’t require computationally intensive tasks, the physical hardware used by validators experiences less stress. This increases the longevity of the equipment and makes PoS-friendly to cloud services. Notably, many popular cloud providers have banned PoW mining but allow PoS validation in their data centers.</li><li><strong>Cost Efficiency for Users:</strong><br>The reduced need for computational power means the costs of operating PoS validators are lower. This translates to reduced fees for users transacting on the blockchain, making it more efficient.</li><li><strong>Faster Throughput:</strong><br>Without cryptographic puzzles slowing down block production, PoS systems can achieve faster block times, increasing the network’s throughput significantly.</li><li><strong>Finality of Transactions:</strong><br>Unlike PoW, which relies on <strong>probabilistic finality</strong> (transactions are only considered secure after a certain number of block confirmations), PoS provides true finality. Once a block is finalized, the transactions within it are irreversible, ensuring confidence in the system.</li></ol><h4>A Balanced System with Unique Advantages</h4><p>While PoW requires immense computational power and capital, PoS shifts the focus to staking and responsibility, offering a consensus mechanism that is cost-effective, environmentally friendly, and efficient. The ability to guarantee finality and faster transaction times highlights why PoS is increasingly adopted as a sustainable alternative.</p><h3>Understanding Finality in Proof of Stake: How Blocks Become Irreversible</h3><p>Taking a Step Back: What About Finality?</p><p>We’ve discussed block authoring, but what about <strong>finality</strong>? How is it achieved in Proof of Stake (PoS) systems?</p><p>Finality happens in parallel with block authoring but typically lags behind it. Validators who are <strong>not responsible for authoring blocks</strong> are tasked with voting on their validity. This process ensures that blocks are not only cryptographically valid but also finalized for the canonical blockchain.</p><h4>How Finality Works</h4><p>Validators not authoring the block perform several tasks:</p><ol><li>They validate that the block adheres to the cryptographic rules of the chain.</li><li>They check that all transactions in the block maintain valid state transitions and balances.</li><li>They vote on whether the block should be considered finalized.</li></ol><p>For finality to be achieved, most PoS chains require a supermajority vote from validators. The threshold is often <strong>2/3+1</strong> (also described as “two-thirds plus one”). Once this threshold is met, the block is finalized in one of the next authored blocks.</p><h4>What Happens if Finality Fails?</h4><p>While it is unlikely due to incentive structures, it’s possible for finality to stall if:</p><ul><li><strong>Validators fail to reach a supermajority:</strong> This can happen if some validators go offline.</li><li><strong>Validators are not participating as expected:</strong> Validators who fail to perform their duties can face penalties, such as <strong>slashing</strong> (loss of part of their staked funds) and exclusion from the next set of selected validators.</li></ul><p>During this time, block authoring continues, but <strong>finality is not reached</strong>. This is problematic for the health of the blockchain. Without finality, transactions cannot be fully trusted until finality is restored. The longer this situation persists, the more the network’s reliability is called into question.</p><h4>Finality: The Backbone of Trust</h4><p>Finality ensures that blocks — and the transactions within them — become irreversible. It is the backbone of trust in PoS systems, allowing users to be confident that once a block is finalized, it cannot be altered. Ensuring that validators perform their roles diligently is essential for maintaining the integrity and health of the blockchain.</p><h3>The Consequences of Dishonesty: What Happens When Validators Lie</h3><p>If a validator lies about block authoring — such as proposing an invalid block or tampering with transactions — they risk severe penalties under Proof of Stake (PoS) systems. Validators are required to follow strict cryptographic rules, and their actions are continuously verified by other validators in the network. If a validator submits a fraudulent block, their misbehavior is detected during the validation process. As a consequence, they may face <strong>slashing</strong>, where a portion of their staked tokens is forfeited as a penalty. Additionally, they can be removed from the validator set, losing the opportunity to earn rewards in the future. These punitive measures are designed to discourage dishonest behavior and maintain the integrity of the blockchain. Validators have a strong financial incentive to act honestly, as the cost of being caught far outweighs the potential benefits of attempting fraud.</p><h3><strong>How Fast is Finality Reached in Proof of Stake?</strong></h3><p>🚨 <strong>Pay attention — this is a critical topic!</strong> 🚨</p><p>The speed of finality depends significantly on the rules governing validator participation, particularly whether the blockchain uses <strong>Fixed Stake</strong> or <strong>Weighted Stake</strong> systems.</p><h3>Fixed Stake vs. Weighted Stake</h3><p><strong>Fixed Stake:</strong></p><ul><li>In a fixed stake system, validators are required to lock a set amount of tokens to participate.</li><li>This often motivates individuals to create multiple validators to maximize rewards, which increases the <strong>number of validators</strong> in the network.</li><li>A higher number of validators can lead to slower finality because reaching a supermajority 2/3+1 takes longer when more validators need to agree.</li></ul><p><strong>Weighted Stake:</strong></p><ul><li>In a weighted stake system, a single validator can lock a larger amount of tokens, which increases their influence in terms of rewards, block authoring, and voting power.</li><li>This system reduces the <strong>number of validators</strong> in the network, allowing a supermajority to be reached more quickly and enabling faster finality.</li></ul><h4>The Trade-offs in Protocol Design</h4><p><strong>Fixed Stake Systems:</strong></p><ul><li>Simpler and easier to maintain in the protocol code.</li><li>All validators share equal responsibilities, making the rules straightforward and transparent.</li><li>However, this system can lead to slower finalization due to the larger validator population.</li></ul><p><strong>Weighted Stake Systems:</strong></p><ul><li>More complex and challenging to implement in the protocol code.</li><li>Validators with larger stakes carry more responsibility, making the system more efficient at reaching finality.</li><li>This efficiency can lead to faster finalization, but it comes at the cost of introducing potential centralization risks.</li></ul><h3>The Impact of Faster or Slower Finalization</h3><p>In the past, blockchains relied on <strong>probabilistic finality</strong> to determine when a transaction was safe from being reverted. However, with the shift to Proof of Stake (PoS), blockchains now depend on <strong>deterministic finality</strong>, where blocks are explicitly finalized. While this provides stronger guarantees, the speed of finality can significantly impact blockchain usability.</p><p>For instance, under Ethereum’s previous Proof of Work (PoW) system, probabilistic finality was typically achieved in <strong>12 blocks</strong> (approximately <strong>144 seconds or 2.4 minutes</strong>, assuming 12-second block times). In contrast, Ethereum’s current PoS system can take up to <strong>35 minutes</strong> to finalize blocks. On the other hand, <strong>Polkadot</strong> reaches finality much faster due to its optimized Proof of Stake system. Polkadot’s <strong>GRANDPA consensus</strong> allows finality to be achieved in seconds, even across multiple blocks, making it significantly more efficient for applications like <strong>bridges</strong> and <strong>cross-chain transactions</strong>.</p><h4>Balancing Speed and Risk</h4><p>However, having fewer validators in a PoS system — often a feature of weighted stake models — does not come without its risks. A smaller validator set increases the vulnerability of the network to <strong>denial-of-service (DoS) attacks</strong> targeting its validators. This risk is considerably lower in fixed stake systems like Ethereum’s, which maintain a larger and more distributed validator population. While faster finality is a significant advantage, networks must carefully balance efficiency with security to ensure resilience against such attacks.</p><h4>Why Finalization Speed Matters</h4><p>The speed of finalization directly impacts systems like <strong>bridges</strong> and <strong>centralized exchanges</strong>, which rely on finality to guarantee that funds on one chain are securely locked before releasing equivalent funds on another chain. Slow finality delays these processes, increasing operational costs and user frustration. Faster finality, like Polkadot’s, enhances efficiency and trust but comes with additional risks due to smaller validator sets.</p><h3>Additional Players in Staking: Nominators and Staking Pools</h3><p>Staking can be challenging for individuals who don’t have the resources to meet the required stake to be elected as a validator. To address this, many blockchain communities have introduced mechanisms to make staking more accessible and inclusive.</p><h4>Chain-Integrated Mechanisms</h4><p>Polkadot allows <strong>solo nominators</strong> and <strong>nomination pools</strong> to participate. These nominators delegate their stake to back validators, increasing the validator’s total stake and influencing their chances of being elected. This system ensures even smaller token holders can contribute to consensus indirectly.</p><h4>External Solutions</h4><p>In Ethereum, services like <strong>Lido Staking</strong> allow participants to stake their Ether without needing to meet the full 32 ETH requirement to become a validator. Lido pools user deposits and handles validator operations on their behalf, issuing liquid staking tokens (e.g., <strong>stETH</strong>) that represent the staked Ether. These tokens can be used in DeFi protocols, providing liquidity to users while their assets are staked.</p><h3>Additional Players Participating in Staking</h3><p>Staking can be challenging for individuals who don’t have the resources to meet the required stake to be elected as a validator. To address this, many blockchain communities have introduced mechanisms to make staking more accessible and inclusive.</p><h4>Chain-Integrated Mechanisms</h4><p>Polkadot allows <strong>solo nominators</strong> and <strong>nomination pools</strong> to participate. These nominators delegate their stake to back validators, increasing the validator’s total stake and influencing their chances of being elected. This system ensures even smaller token holders can contribute to consensus indirectly.</p><h4>External Solutions</h4><p><strong>Ethereum and Lido Staking:</strong><br>In Ethereum, services like <strong>Lido Staking</strong> allow participants to stake their Ether without needing to meet the full 32 ETH requirement to become a validator. Lido pools user deposits and handles validator operations on their behalf, issuing liquid staking tokens (e.g., <strong>stETH</strong>) that represent the staked Ether. These tokens can be used in DeFi protocols, providing liquidity to users while their assets are staked.</p><h4>Benefits of Additional Staking Participants</h4><p>These systems and services:</p><ul><li>Enable broader participation in staking, even for those with smaller token holdings.</li><li>Enhance decentralization by diversifying the validator backing.</li><li>Provide flexibility, such as liquidity in staking through services like Lido, which boosts the utility of staked assets.</li></ul><p>By introducing additional players and mechanisms into staking, blockchains can ensure more inclusive participation while maintaining network security and efficiency.</p><h3>How Rewards Are Distributed in Proof of Stake Systems</h3><p>Unlike Proof of Work (PoW), where rewards are minted and distributed immediately upon block authoring, Proof of Stake (PoS) systems handle reward distribution differently.</p><p>This difference arises because:</p><ol><li><strong>Finality arrives later in PoS:</strong> Rewards cannot be fully allocated at block authoring since finality — a key step in ensuring the block is irreversible — happens after the block is produced.</li><li><strong>Compute intensity:</strong> Distributing rewards at the time of block authoring would be too computationally intensive to fit into the block due to the complexity of determining and updating stakes for multiple participants.</li></ol><p>To address these challenges, PoS systems typically implement a <strong>reward points system</strong>:</p><ul><li><strong>Accumulation:</strong> Validators and nominators earn points for their contributions (e.g., producing blocks, voting on blocks). These points are then translated into rewards.</li><li><strong>Claiming Rewards:</strong> Users can claim their accumulated rewards at a later time, reducing the strain on the blockchain protocol by spreading out the computational load.</li><li><strong>Expiration:</strong> Rewards often come with an expiration date, encouraging timely claims and preventing indefinite accumulation of unused rewards.</li></ul><h4>Benefits of Deferred Reward Distribution</h4><p>This approach offers several advantages:</p><ul><li><strong>Efficiency:</strong> By deferring reward claims, the blockchain avoids bottlenecks associated with distributing rewards at the time of block authoring.</li><li><strong>Scalability:</strong> It allows PoS systems to accommodate large numbers of participants without overwhelming the network.</li><li><strong>Flexibility:</strong> Users can choose when to claim their rewards, balancing their needs with the network’s operational efficiency.</li></ul><p>This design ensures a smoother and more scalable reward distribution mechanism that aligns with the efficiency goals of PoS systems.</p><h3>The Tax Implications of Proof of Stake: What You Need to Know</h3><h4>Impact on Income Taxes</h4><p>Proof of Stake (PoS) introduces complexities to income tax declarations that differ significantly from those of Proof of Work (PoW).</p><p>In PoW, taxation is relatively straightforward:</p><ul><li><strong>Minted rewards</strong> are treated as income at the time they are earned.</li><li><strong>Expenses,</strong> such as transaction fees, and the <strong>cost of mining hardware</strong> can be claimed as deductions or depreciated as assets.</li></ul><p>In contrast, PoS brings additional layers of complexity due to the nature of locked tokens and deferred rewards.</p><h4>How Taxation Works for Proof of Stake (Example: USA)</h4><p>In the United States (as of the last review):</p><ol><li><strong>Locked Tokens:</strong> Locking does not constitute a taxable event since no sale or transfer has occurred.</li><li><strong>Rewards:</strong> Staking rewards are not considered taxable income until the tokens are unlocked and made transferable.</li><li><strong>Compounded Rewards:</strong> If staking rewards are compounded (added to the stake instead of being withdrawn), they remain untaxed until they are eventually unlocked and become liquid.</li></ol><p>This system means that taxable income is deferred, aligning with when users unlock and claim their staking rewards.</p><h4>Adapting to Tax Regulations</h4><p>The complexities of PoS taxation have driven platforms like <strong>Crypto Ledger</strong> and others to quickly adapt, creating software that aligns with various legislations and country-specific regulations regarding staking income. As PoS adoption grows, these tools are becoming essential for users navigating the tax implications of staking.</p><blockquote>🚨 <strong>Important Disclaimer</strong>🚨</blockquote><blockquote>Please note that I am not an accountant, and nothing stated here constitutes accounting or financial advice. Tax laws vary by jurisdiction and can change over time. For personalized guidance, consult a qualified accountant familiar with the regulations in your area. Even the example provided for the United States may not reflect current or future legislation.</blockquote><h3>Conclusion</h3><p>So here we are, at the end of yet another deep dive. Proof of Stake isn’t just a different way of achieving consensus — it’s a complete paradigm shift in how we think about blockchain participation, efficiency, and even taxation. It brings exciting innovations but also new complexities that we need to understand, whether it’s how rewards are distributed, how finality is achieved, or even how your staking income might be taxed.</p><p>It’s a lot, I know. But the beauty of this space is that it’s constantly evolving, and we’re all learning together. If there’s one takeaway, it’s this: Proof of Stake offers immense promise for scalability and sustainability, but with every innovation comes responsibility. Be curious, ask questions, and always keep exploring.</p><p>And hey, don’t take my word for it — dive in yourself. This journey is just getting started. 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4851610ff877" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep dive into blockchain]]></title>
            <link>https://medium.com/@dsylebee/deep-dive-into-blockchain-ede2c5e77c2d?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/ede2c5e77c2d</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Wed, 01 Jan 2025 19:21:28 GMT</pubDate>
            <atom:updated>2025-01-03T18:09:43.156Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0aOpijSWtSjAG7AAGWwnQ.png" /></figure><p>Welcome to the realm of blockchain! Joining the blockchain industry can feel overwhelming, especially if you’re new to crypto or blockchain concepts. The idea of diving into a world full of unfamiliar jargon, complex technologies, and decentralized principles might seem intimidating at first.</p><p>But fear not — my goal with this deep-dive article is to simplify the process and speed up your journey into understanding this fascinating industry.</p><p>Blockchain operates on a set of principles that allow data to be governed by multiple participants rather than relying on a single, centralized source of truth. Developers in this space — whether part of a company like Gluwa or an organization like the Ethereum Foundation — write code that can be executed by many independent participants who may not have any direct connection to the code maintainers. This requires the system to work in a trustless, decentralized manner.</p><p>Over the years, blockchain technology has matured significantly, blending elements of <strong>peer-to-peer networking</strong>, <strong>cryptography</strong>, <strong>game theory</strong>, and <strong>economics</strong>. In this guide, I’ll break down blockchain into manageable topics to help you navigate and accelerate your learning.</p><p>Most importantly, remember that asking questions and leveraging the expertise of your peers is key to mastering the industry. Let’s get started!</p><h3>A Chain of Blocks</h3><p>What is a blockchain? The name gives a hint — just like many programming concepts, it’s a “chain” of “blocks.” Why a chain? Because each block includes a reference to the previous block, creating a connected sequence.</p><p>The term “reference” might sound technical, but it simply means that each block has a unique identifier for the previous block. Blockchain achieves this through cryptographic hashes, also known as digests, which uniquely identify the content of a block. To ensure uniqueness and maintain the chain, the digest of the previous block is also included in each block. This is what makes it a “chain” of “blocks.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-1bYRt_BbPC0O08c" /><figcaption><a href="https://www.youtube.com/watch?v=SSo_EIwHSd4">Extracted from How does a blockchain work — Simply Explained</a></figcaption></figure><p>You might wonder: what about the first block? The first block is called the genesis block. Since it has no predecessor, its reference to a previous block is empty — essentially because it’s the starting point of the chain.</p><h3>How Blocks Translate to Transactions</h3><p>Why blocks? How do blocks relate to transactions? The answer lies in the structure of blocks: each block contains a digest and a reference to the previous block. This allows blocks to hold a set of transactions that can be verified using the data from preceding blocks.</p><p>For example, consider the genesis block (Block 0), where Account A starts with 100,000 tokens. In Block 1, which references Block 0, Account A decides to transfer 10 tokens to Account B. To verify this transaction, you check Block 0 to confirm that Account A has enough tokens to make the transfer. By following the chain of blocks, you can calculate all transactions and ensure that no anomalies are introduced, maintaining financial accuracy and consistency.</p><h3>Accounts and Ownership in Blockchain</h3><p>Accounts? Hold on — we’re moving too quickly, jumping from blocks to transactions to accounts.</p><p>Blockchains need a way to identify ownership of value, and for this, they rely on cryptography — specifically, asymmetric cryptography. Asymmetric cryptography allows users to sign information using a secret key known as the <strong>private key</strong>. Additionally, there is something called the <strong>public key</strong>. Since a public key is a series of bytes, blockchains often transform it into a more readable format, usually called an <strong>address</strong> (or sometimes a <strong>public address</strong>). This address functions similarly to an account number or ID in traditional software or banking systems.</p><p>Asymmetric encryption enables users to sign information, and others can verify that this signed information is indeed tied to the public address. Crucially, it ensures the signature could only have been created by someone who possesses the corresponding private key (the secret).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JZudxpf_X0AlQSp7.png" /><figcaption>Source <a href="https://jamesbachini.com/asymmetric-cryptography/">https://jamesbachini.com/asymmetric-cryptography/</a> — Great image.</figcaption></figure><p>This is why, in blockchain, securing your private key is of utmost importance. I’ll address best practices for safeguarding it in later topics.</p><blockquote>You can read Account Model vs UTXO — How blockchains tracks balances <a href="https://medium.com/@dsylebee/account-model-vs-utxo-how-blockchain-tracks-balances-7a42168b0a90">https://medium.com/@dsylebee/account-model-vs-utxo-how-blockchain-tracks-balances-7a42168b0a90</a></blockquote><h3>The Role of Cryptography and Incentives in Cryptocurrency</h3><p>Now that we understand how to identify ourselves on a blockchain, what exactly is cryptocurrency? And why are blockchains often referred to as “crypto” rather than just “blockchain”?</p><p>The answer lies in both <strong>incentives</strong> and <strong>cryptography</strong>. In our world, incentives drive behavior and are often rewarded with currency. This principle holds true for blockchain as well. Because a blockchain operates through decentralization — run by many participants instead of a single organization — it needs a currency to reward those participants for their contributions.</p><p>But why is it called <strong>cryptocurrency</strong>? This is because it uses cryptography to secure transactions and ensure the integrity of the blockchain. Some people also refer to it as <strong>digital currency</strong> because its existence is purely in the form of data, without any physical counterpart.</p><p>These participants, who work together to maintain and secure a copy of the blockchain, are rewarded with cryptocurrency. This is why blockchains are more popularly known as cryptocurrencies.</p><h3>The Roles of Participants in Blockchain</h3><p>In a blockchain network, there are many types of participants. Different blockchains may have varying sets of participants, but they are usually grouped into two main categories:</p><ol><li><strong>Operators</strong> — These participants run the blockchain software to earn fees. They are the decentralized contributors who make the blockchain functional and maintain its existence.</li><li><strong>Users</strong> — These are the consumers who find value in interacting with the blockchain for various purposes.</li></ol><p>Operators maintain the blockchain and are rewarded financially for their contributions. Users interact with the blockchain and pay fees for the services it provides. Together, these two groups sustain the blockchain ecosystem.</p><h3>Nodes in Blockchain: What They Do and Why They Matter</h3><p>Nodes, also known as blockchain nodes, are a type of operator with critical responsibilities in a blockchain network. Their main tasks include:</p><ul><li>Keeping a complete copy of the blockchain.</li><li>Communicating with other nodes about transactions that are attempting to be included in the blockchain.</li><li>Depending on the consensus mechanism used, either proposing new blocks or verifying existing blocks.</li></ul><blockquote><em>Nodes are interconnected using peer-to-peer technology, often relying on libraries like </em><strong><em>libp2p</em></strong><em>. These connections typically use </em><strong><em>TCP/IP</em></strong><em>, though newer methods like the </em><strong><em>QUIC protocol</em></strong><em> or </em><strong><em>WebSocket protocols</em></strong><em> are emerging.</em></blockquote><p>For now, let’s avoid diving too deep into the technical details, but it’s important to understand that nodes are the backbone of blockchain operations, enabling the decentralized and secure nature of the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUGB3Mq-rlYXoinbuEPE8Q.png" /></figure><p>Nodes maintain a copy of the blockchain on their own computers, specifically the most valid version, which is also known as the <strong>canonical blockchain</strong>. All blocks within the canonical blockchain are referred to as <strong>canonical blocks</strong> or <strong>confirmed blocks</strong>.</p><p>Nodes communicate with one another over a network to share information about transactions attempting to be included in the next block. This communication method is called <strong>gossip</strong>. Since no single entity can be trusted to ensure communication, each node forwards the message it receives to all its connected peers. This ensures that everyone in the network can reach agreement without relying on trust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*58KnD0_l5M806iXw-tUirQ.png" /><figcaption>Credit to CFTE, Image of p2p networks</figcaption></figure><p>To maintain security, nodes — just like regular users — use cryptography to authenticate the messages they send. This ensures that messages forwarded by other nodes can be trusted because they are signed, similar to the account authentication process described earlier in this article.</p><p>When it comes to creating blocks, one node will propose a block containing pending transactions that have been gossiped throughout the network. This block proposal is also disseminated via gossip. Other nodes in the network will then verify the proposed block, and only if all the transactions are valid will they include it in their canonical blockchain. The <strong>node that successfully produces the block</strong> and gets it included in the canonical blockchain is <strong>rewarded</strong>, typically with <strong>cryptocurrency</strong>, as an <strong>incentive </strong>for maintaining the network.</p><h3>Solving the Race for Rewards: Blockchain Consensus Explained</h3><p>Wait a second — if proposing a block gives you a reward, doesn’t that create an incentive to race to be the first to create a block or even produce many blocks at once?</p><p>Ah, my friend, nothing gets past you! You’ve nailed it. This is exactly where blockchain’s amazing innovation comes into play.</p><p>The inventor of Bitcoin, known by the alias <strong>Satoshi Nakamoto</strong>, tackled this issue with an ingenious solution we now call <strong>consensus</strong> in the blockchain industry.</p><p>There are several major problems that need to be addressed in this context:</p><ul><li><strong>The incentive to compete with others to create the next block.</strong></li><li><strong>The ability to create blocks quickly to earn multiple rewards.</strong></li><li><strong>Determining which blockchain is the valid one.</strong></li><li><strong>Handling situations where many blocks are proposed simultaneously.</strong></li></ul><p>Let’s address them carefully, starting with the question: <strong>How do I know which blockchain is the valid one?</strong></p><p>Blockchain uses something called the <strong>Longest Chain Rule</strong>. This rule states that the chain with the most blocks is considered the valid one. Sounds great, right? Well, not quite. A malicious participant could exploit this by producing blocks much faster than everyone else, earning more rewards and potentially controlling the network. Uh-oh!</p><p>To counter this, Satoshi introduced a brilliant concept derived from an old idea originally designed to reduce spam emails (though it seems like our inboxes could still use some help). The solution involves requiring nodes that propose a block to solve a <strong>very complex cryptographic puzzle</strong>, which demands significant computational power and energy. This process inherently takes time, effectively slowing down the block creation process.</p><p>This mechanism, known as <strong>Proof of Work (PoW)</strong>, comes with adjustable difficulty levels, referred to as <strong>mining difficulty</strong>. The difficulty can be recalibrated — for instance, every 10 blocks — to ensure that creating a block takes a consistent amount of time on average. For Bitcoin, this target is 10 minutes. If blocks are being produced faster than this, the difficulty increases; if it takes too long to produce blocks, the difficulty decreases.</p><p>While this doesn’t entirely eliminate the “racing” incentive (nodes still compete to author a block), it ensures that the process is fair and manageable. On the rare occasion when multiple nodes successfully propose blocks simultaneously, the issue is resolved using a predefined rule — such as selecting the block with the most transactions, the highest value transferred, or another universally accepted logic encoded in the blockchain software.</p><h3>The Rise of Proof of Work and the Quest for a Better Consensus</h3><p>One crucial aspect not fully addressed in the earlier discussion on consensus is:</p><ul><li><strong>The incentive to compete with others to create the next block.</strong></li></ul><p>This has brought significant scrutiny to the blockchain industry. The rewards for authoring blocks became so lucrative that the competition to create the next block grew intensely fierce. In Proof of Work (PoW) consensus, nodes — commonly referred to as miners — engage in a relentless race to solve cryptographic puzzles and author blocks to earn rewards.</p><p>As competition escalated, miners invested in increasingly specialized hardware and optimized code to produce blocks faster than their peers. This arms race for efficiency continuously pushed mining difficulty higher each month, consuming ever-growing amounts of electricity. Today, the energy consumed to secure some blockchains exceeds the power usage of entire countries.</p><p>Concerned by this unsustainable trend, blockchain developers and maintainers began exploring alternatives to PoW in search of a consensus algorithm that could reduce energy consumption without compromising decentralization or security.</p><blockquote>The energy consumption of all crypto assets combined is between <a href="https://www.sciencedirect.com/science/article/abs/pii/S0959652623007308"><strong>0.4% and 0.9%</strong></a> of annual global electricity usage, or <a href="https://www.sciencedirect.com/science/article/pii/S0959652623036995"><strong>120 and 240 billion</strong></a> <a href="https://justenergy.com/blog/kilowatts-and-calculations/"><strong>kilowatt-hours</strong></a> per year. That’s more energy usage than all the world’s data centers combined. Crypto is a big energy user.<br>source: <a href="https://justenergy.com/blog/crypto-energy-consumption-crypto-energy/#:~:text=The%20energy%20consumption%20of%20all,is%20a%20big%20energy%20user">https://justenergy.com/blog/crypto-energy-consumption-crypto-energy/#:~:text=The%20energy%20consumption%20of%20all,is%20a%20big%20energy%20user</a>.</blockquote><p>This topic is vast and could lead us down an intricate rabbit hole, which I’ll address in future articles. For now, I wanted to acknowledge this critical issue and highlight its importance before diving into other concerns.</p><blockquote>Written since <a href="https://medium.com/@dsylebee/proof-of-stake-a-sustainable-alternative-to-proof-of-work-4851610ff877">https://medium.com/@dsylebee/proof-of-stake-a-sustainable-alternative-to-proof-of-work-4851610ff877</a></blockquote><h3>How Blockchain Users Communicate and Compete to Include Transactions</h3><p>Let’s take a step back from the operators’ perspective and return to the users’ realm.</p><h4>How Do Users Interact with a Blockchain?</h4><p>Users wanting to add their transactions to the blockchain must communicate with one of the blockchain nodes to submit their transaction. Since blockchains rely on transactions to create blocks (as explained earlier), they use a process called <strong>gossip</strong> to share these transactions across the network.</p><p>As a blockchain user, you inform a node about the transaction you want to add to the blockchain. That node then gossips your transaction to all other nodes through peer-to-peer communication. These nodes may eventually include your transaction in a block — or will they?</p><h4>Competing to Get Transactions Included</h4><p>Here’s where things get interesting. Because nodes are incentivized by rewards, including transactions in blocks is not guaranteed. As a user, you are competing with others to have your transaction included in the next block — or one of the next few blocks.</p><p>Think of it like trying to get an Uber after a concert with 25,000 attendees. If you leave early and skip the encore, you may pay less for your ride. But if you wait and try to get an Uber at the same time as everyone else, the price surges and you need to wait longer. Similarly, in blockchain, if many users are submitting transactions simultaneously, it becomes a competition. You can bid a higher fee to prioritize your transaction for faster inclusion in the next block(s).</p><p>If you bid too low, your transaction might remain in the pending queue indefinitely — or worse, it may eventually be dropped from the queue altogether.</p><h4>Paying with Native Tokens</h4><p>All transactions on a blockchain are paid for using its native cryptocurrency, often referred to as the <strong>native token</strong>. This token is what fuels the blockchain economy, incentivizing operators (nodes) and facilitating user interactions.</p><h3>How Wallets Simplify Blockchain Interactions</h3><p>Wait a second — you’re telling me I need to talk to a decentralized node. How am I even supposed to know how to communicate with that node?</p><p>Ahh… you’ve stumbled upon one of the challenges that drive innovation in blockchain: making user interactions more user-friendly and intuitive.</p><p>This is where <strong>wallets</strong> come into play. Wallet builders create user-friendly software to make interacting with blockchains seamless. These wallets often come as browser extensions or mobile apps, designed to bridge the gap between users and blockchain nodes.</p><p>The primary responsibilities of a wallet are:</p><ul><li><strong>Securing your private key</strong> to ensure the safety of your transactions.</li><li><strong>Facilitating the use of your private key</strong> by clearly displaying what you’re submitting to the nodes.</li><li><strong>Identifying and connecting to the appropriate nodes</strong> for the blockchain you wish to interact with.</li><li><strong>Recommending secure backup options for your mnemonics</strong> (the recovery phrase that serves as a backup for your wallet). Proper backup guidance ensures you can recover your wallet in case of device loss or failure.</li></ul><p>The topic of wallet security and backup best practices is expansive, so I’ll save that for another article to avoid branching into multiple discussions here.</p><blockquote>For more information read: <strong>Hot Wallets vs. Cold Wallets: Safeguarding Your Private Keys and Mnemonic Derivations</strong></blockquote><blockquote><a href="https://medium.com/@dsylebee/hot-wallets-vs-cold-wallets-safeguarding-your-private-keys-and-mnemonic-derivations-e97504035fba">https://medium.com/@dsylebee/hot-wallets-vs-cold-wallets-safeguarding-your-private-keys-and-mnemonic-derivations-e97504035fba</a></blockquote><h3>What is a Mnemonic and Why is it Important?</h3><p>A <strong>Mnemonic</strong> what? Overwhelmed yet? Yes, diving into blockchain can feel like information overload, but I’ve been trying to guide you step-by-step with one cliffhanger after another. 😄</p><p>A <strong>mnemonic</strong> is a set of words — usually 12 or 24 for added security — that can be used to derive one or more private keys. Think of it as a <strong>safe phrase</strong> that you can write down, lock in a safe, or even bury underground — something only you should know.</p><p>These words can be transformed into blockchain accounts, consisting of private and public keys. In essence, a mnemonic is the foundation for managing one or more blockchain accounts.</p><p><strong>Wallets</strong> assist you by generating these mnemonic phrases and recommending secure ways to back them up. Speaking of backups, I once stamped my mnemonic on a piece of metal using a hammer and letter molds. It felt like I was using cutting-edge technology while simultaneously connecting with ancient ancestors carving hieroglyphs — just, you know, not for public display! 😄</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*P3cH0pT7H-GJsI3ETeVFdA.png" /><figcaption>Screenshot of amazon purchase for seed storage kit</figcaption></figure><p>An entire industry is dedicated to protecting mnemonics, and I’ll delve into this topic in future articles because it’s a significant subject on its own.</p><h3>How to Get Your Hands on Cryptocurrency</h3><p>That’s a great question!</p><p>To acquire cryptocurrency, you need to convert fiat currency (traditional government-issued money) into cryptocurrency. This process typically involves purchasing cryptocurrency with fiat. In the early days of crypto, governments were wary of this new financial concept and often attempted to ban it, which ironically motivated people to create <strong>illegal peer-to-peer networks</strong> for buying and selling cryptocurrency.</p><p>Over time, governments became more familiar with the industry and introduced regulations, which gave rise to <strong>exchanges</strong>. Another new term? Yes, but an important one!</p><h4>What Are Exchanges?</h4><p>Exchanges are usually centralized organizations regulated by governments. They enable you to purchase cryptocurrency using your <strong>bank account, debit card, or credit card</strong>, and they allow you to sell cryptocurrency back into your bank account. These exchanges are often required to comply with government regulations by verifying your identity through processes known as <strong>KYC (Know Your Customer)</strong> or <strong>AML (Anti-Money Laundering).</strong></p><h4>A Word of Caution</h4><p>While exchanges are convenient for buying and selling cryptocurrency, I strongly recommend <strong>not holding large amounts of cryptocurrency on exchanges</strong>. Historically, there have been unfortunate cases of exchanges disappearing along with users’ funds. You can use exchanges to transact, but for holding your crypto, ensure it is stored in a <strong>non-custodial wallet</strong> — a wallet where only you have access to the private keys.</p><blockquote>Remember: <strong>Not your keys, not your crypto!</strong></blockquote><h3>How can I track my transactions?</h3><p>That’s a great question!</p><p>Blockchain nodes excel at operating and maintaining the blockchain but are not designed for helping you review the historical activity of your wallet. They are optimized to produce and validate blocks, not to provide detailed insights into your transaction history.</p><p>Additionally, because blockchain transactions can be expensive, wallets &amp; exchanges often optimize and batch transactions into larger operations. As a result, most wallets only provide a very basic view of your transaction history.</p><p>To make tracking easier, groups have developed software specifically designed to index and follow blockchain transactions. These tools, called <strong>explorers</strong>, make it simple to view and analyze your transaction history. Yes, another term to add to the list! 😄</p><h4>What Are Explorers?</h4><p>Explorers are user-friendly tools built to query and display blockchain data. You can enter your <strong>public address</strong> into an explorer to retrieve a detailed history of your account’s transactions. Explorers are also tailored to follow the latest trends in blockchain technology, ensuring they provide a seamless and informative experience for users looking to track their activity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jKR1WKaNVOT-iFzSmWPQ-Q.png" /><figcaption>Screenshot of etherscan explorer for a random address selected</figcaption></figure><h3>Understanding Taxes in the World of Cryptocurrency</h3><p>Over the years, as governments have become more familiar with cryptocurrency and its widespread use for transactions, income, and investment, they’ve naturally wanted their share — <strong>taxes</strong>. Booo! 😜</p><h4>The Basics You Need to Understand:</h4><ol><li><strong>Income from fees as an operator</strong>: If you earn fees by operating in the blockchain ecosystem, this is generally considered taxable income.</li><li><strong>Capital gains or losses</strong>: If you buy crypto and later sell it, the difference between the purchase and sale price may result in a taxable gain or a deductible loss.</li><li><strong>Transaction fees</strong>: Fees you pay to interact with the blockchain can often be deducted from your capital gains.</li></ol><p>These are the fundamentals, but the rules can vary depending on your location. Many organizations worldwide are developing software to simplify the process of reporting crypto taxes — examples include tools like <strong>Crypto Ledger</strong>.</p><h4>Crypto Tax Havens</h4><p>Some countries have more <strong>lax laws</strong> regarding cryptocurrency taxation, making them attractive <strong>tax havens</strong> for crypto founders and investors. These jurisdictions may offer low or no taxes on crypto gains, prompting many people to relocate to such countries to benefit from these favorable regulations. For those who work or invest in cryptocurrency, moving to a crypto-friendly country can have significant financial advantages.</p><p>It’s crucial to stay informed about your local tax laws and consider how they align with your crypto activities. Do your research and plan accordingly to navigate this evolving financial landscape.</p><h3>How Smart Contracts Transformed Blockchain</h3><p>A <strong>Token</strong> what? A <strong>Smart Contract</strong> what? A <strong>Collectible</strong>? <strong>NFT</strong>? What’s going on?! Yes, it’s my deep dive — I can go as far as I want, okay? 😄</p><p>Let’s start with a young visionary named <strong>Vitalik Buterin</strong>, who appeared at Bitcoin Toronto with an ambitious idea. He said, “Great, we have cryptocurrency, but what about adding logic to it? What if we could do more than just trade value?”</p><p>This question sparked the creation of a new blockchain called <strong>Ethereum</strong>. Vitalik proposed a blockchain that would allow software developers to write programs — software that could live on-chain. Software running other software?! Yes! And not just that — this software would be <strong>predictable</strong> and <strong>verifiable</strong>, ensuring that any node authoring a block could execute an interaction with the program while other nodes could validate it, producing a consistent, predictable outcome.</p><h4>The Smart Contract Revolution</h4><p>This innovation <strong>revolutionized blockchain</strong> and unleashed a wave of creativity. <strong>Smart Contracts</strong> opened the door for anyone to write software that operates on-chain, enabling countless new possibilities:</p><ul><li><strong>Tokens</strong>: Developers created contracts to represent cryptocurrencies other than the blockchain’s native currency (used to pay gas fees).</li><li><strong>Non-Fungible Tokens (NFTs)</strong>: Collectibles representing unique items like art, concert tickets, or anything one-of-a-kind.</li><li><strong>Decentralized Exchanges (DEXs)</strong>: Contracts that allow users to swap one currency for another securely without needing to trust a centralized exchange.</li><li><strong>Decentralized Finance (DeFi)</strong>: Smart contracts enabling lending, borrowing, yield farming, savings bonds, lottery systems, and more — all operating transparently on the blockchain.</li></ul><h4>Beyond Ethereum</h4><p>The ingenuity didn’t stop there. Ethereum’s <strong>smart contracts</strong> inspired many other blockchains to develop their own virtual machines and contract languages, further expanding the capabilities of decentralized technology.</p><p>Smart contracts didn’t just open a door — they flung it wide open, paving the way for innovation and transforming how we think about value, utility, and decentralization.</p><h3>Native Currency vs Tokens: Understanding the Difference</h3><p>Now that you understand <strong>smart contracts</strong> (as explained above), it’s crucial to distinguish between native currency and tokens.</p><h4>Native Currency</h4><p>The <strong>native currency</strong> of a blockchain is typically used to:</p><ul><li>Reward operators for maintaining and securing the network.</li><li>Pay transaction fees required to interact with the blockchain.</li></ul><p>Examples of native currencies include <strong>Bitcoin (BTC)</strong> for Bitcoin, <strong>Ether (ETH)</strong> for Ethereum, and <strong>BNB</strong> for Binance Smart Chain.</p><h4>Tokens</h4><p>Tokens, on the other hand, are other cryptocurrencies created and managed by smart contracts that live on the blockchain. To transact with tokens, you’ll need to have some native currency to cover transaction fees.</p><p>Tokens often come with their own <strong>tokenomics</strong> (yes, another new term! 😄), which are mechanisms designed to create incentives for using or holding them. For example, tokens may be used for governance, staking, or rewarding users in decentralized applications.</p><h4>Stable Coins</h4><p>Some tokens fluctuate in value, similar to native currencies. However, others are designed to maintain a stable value because they are pegged to real-world fiat currencies, such as USD, EUR, or others. These are known as <strong>Stable Coins</strong>. Examples include <strong>USDT (Tether)</strong>, <strong>USDC (USD Coin)</strong>, and <strong>DAI</strong>.</p><p>Stable coins offer an additional benefit: they allow you to <strong>sell your crypto without leaving the blockchain</strong>. Instead of converting to fiat currency and moving funds off-chain, you can sell your volatile assets for stable coins and continue transacting or holding value on-chain. This is especially useful for traders and DeFi users who want to avoid the complexities and costs of moving between crypto and fiat.</p><h4>Stable Coin Liquidity Statistics</h4><p>As of today, stable coins represent a significant portion of blockchain liquidity. Here are some statistics about stable coin liquidity across major blockchains:</p><ul><li><strong>Ethereum</strong>: Over $60 billion in stable coin liquidity, with USDT, USDC, and DAI leading the pack.</li><li><strong>Binance Smart Chain (BSC)</strong>: Approximately $20 billion, primarily USDT and BUSD.</li><li><strong>Tron</strong>: More than $35 billion, dominated by USDT.</li><li><strong>Solana</strong>: Around $6 billion, with USDC and USDT as the main stable coins.</li></ul><p>These stable coins play a crucial role in the blockchain ecosystem, enabling seamless on-chain transactions, trading, and cross-border value transfers without the volatility of other cryptocurrencies.</p><h3>Scalability Challenges and Layered Solutions in Blockchain</h3><h4>Scalability Problems</h4><p>Blockchain scalability is a significant challenge. When too many users want to transact simultaneously, fees increase — remember the concert/Uber problem? Yep, it applies here too.</p><p>Blockchains also face a critical limitation: they cannot sacrifice <strong>security</strong> for <strong>liveness</strong> (speed). As discussed in the <strong>Consensus</strong> section, the number of transactions that can be included in a block is deliberately limited to ensure the blockchain remains steady and safe.</p><p>This limitation poses a question: how can blockchain compete with traditional systems like credit and debit cards, which can process thousands of transactions per second with near-instant confirmation?</p><p>Consensus mechanisms inherently take time — imagine trying to get hundreds of people to agree on which restaurant to visit for a holiday party. It’s a slow process. However, just as networking solved bandwidth issues with layered models, blockchain is adopting a similar <strong>multi-layered approach</strong>.</p><h4>The Layer 1 and Layer 2 Solution</h4><p>The base blockchain, known as <strong>Layer 1</strong>, focuses on maintaining security and decentralization. To scale, Layer 1 chains can have multiple <strong>Layer 2</strong> solutions built on top of them. Layer 2 systems leverage the security of Layer 1 while providing faster and cheaper transactions.</p><p>Layer 2 achieves this by bundling or “rolling up” many transactions into a single batch that is submitted to Layer 1. These “rollups” come in two main types:</p><ul><li><strong>ZK Rollups (Zero-Knowledge Rollups):</strong> Use cryptographic proofs to validate transactions efficiently.</li><li><strong>Optimistic Rollups:</strong> Assume transactions are valid but allow for disputes if they aren’t.</li></ul><p>By using these methods, Layer 2 solutions significantly reduce the cost and time of transactions, making blockchain more competitive with traditional payment systems.</p><h4>Ethereum’s Scalability Upgrades</h4><p>Ethereum, one of the most widely used blockchains, has made significant advancements to support Layer 2 solutions. For example, the <strong>Ethereum upgrade introducing blobs (EIP-4844)</strong> has drastically reduced the costs of rollups on Layer 2. Before this upgrade, the average cost of an Ethereum transaction on Layer 2 was around <strong>$0.25-$0.50</strong>, compared to <strong>$10-$20 on Layer 1 during high network demand</strong>. Post-upgrade, rollup transaction costs have dropped even further, making Layer 2 transactions a viable and affordable solution for everyday use.</p><h4>Polkadot and the Parachain Ecosystem</h4><p>While Ethereum focuses on rollups, <strong>Polkadot</strong> has taken a different approach with its <strong>parachain ecosystem</strong>. Parachains are independent blockchains that run parallel to the main Polkadot chain (Layer 1) and share its security. Each parachain can be optimized for specific use cases, such as DeFi, gaming, or data storage, and they interact seamlessly via Polkadot’s <strong>cross-chain messaging</strong> system.</p><p>This architecture allows Polkadot to process many transactions across multiple parachains while maintaining decentralization and security. It’s a scalable model designed to support a variety of applications without the congestion often seen on single-layer blockchains.</p><p>Blockchain scalability continues to evolve through these innovations, bridging the gap between decentralized technology and the efficiency of traditional financial systems. The combination of Layer 1 and Layer 2 solutions, along with ecosystems like Polkadot, demonstrates how blockchain can scale without sacrificing its foundational principles.</p><h3>Cross-Chain Swaps and Bridging: Navigating the Challenges</h3><p>Now that we have more and more blockchains, a natural question arises: <strong>What if I want to buy cryptocurrency on another chain?</strong> Ah, you’ve asked one of the most pressing questions in crypto!</p><p>The ability to securely swap assets between blockchains has been one of the industry’s biggest challenges over the years. <strong>How do you securely exchange value across chains?</strong></p><p>This challenge has spurred innovation from both blockchain and non-blockchain organizations. Solutions are being developed — some centralized, some decentralized — to address these issues. Unfortunately, the immaturity of this space has also led to significant crypto theft, as builders rush to find reliable solutions. However, the industry has come a long way, and the tools available today are far more robust than those from years ago.</p><h4>Cross-Chain Swaps and Bridges</h4><p>Cross-chain swaps, also referred to as <strong>bridging</strong> or <strong>peg-unpeg</strong>, are methods used to move or exchange assets between blockchains. A <strong>bridge</strong> is essentially software or infrastructure designed to facilitate this movement.</p><h4>Centralized Bridges</h4><ul><li>Typically more cost-effective.</li><li>Involve trusting a centralized entity to manage the transfer.</li><li>Higher risk due to potential failures or bad actors.</li></ul><h4>Decentralized Bridges</h4><ul><li>Use decentralized protocols to facilitate asset transfers.</li><li>Generally considered more secure since they reduce reliance on a single entity.</li><li>Can be more expensive due to network fees and operational complexity.</li></ul><h4>Key Considerations</h4><p>When deciding how to bridge assets, it’s essential to use good judgment based on the value of the assets involved. For small transfers, a centralized bridge might be acceptable for its cost-effectiveness. For large-value transfers, the added security of a decentralized bridge may be worth the extra expense.</p><p>Bridging remains a rapidly evolving field, and understanding these options will help you navigate the world of cross-chain transactions more securely and confidently.</p><h3>The Journey Ahead</h3><p>Oh, we’ve finally arrived — the point where I won’t leave you with another cliffhanger to keep you reading.</p><p>This is where I’ll pause for now, but rest assured, I’ll be creating more articles to dive deeper into specific topics. I thought <strong>layers (scalability)</strong> and <strong>bridging (cross-chain)</strong> were a good stopping point, as these represent some of the most pressing challenges the blockchain industry is tackling today.</p><p>The blockchain space grows more mature every day, with incredible solutions being proposed to revolutionize the decentralization of software and currency. It’s no longer just about being a believer in crypto for <strong>libertarian ideals</strong> — it’s now practical, increasingly secure, and steadily becoming part of our everyday lives.</p><p>Through this text, I hope you’ve caught a glimpse of my journey over the past three years as a software engineer in the crypto industry. Feel free to share your thoughts, ask questions, or dive into discussions — I’d love to hear from you!</p><h4>My Predictions for Blockchain’s Future:</h4><ol><li><strong>More Throughput</strong>: Blockchains will handle higher transaction volumes, making them increasingly competitive with traditional financial systems.</li><li><strong>Simpler Use of Layer 2</strong>: Layer 2 solutions will become easier to use, with seamless integrations that abstract away complexities for users.</li><li><strong>Everyday Use of Stable Coins</strong>: We’ll see stable coins used in everyday transactions across Europe and Asia, with North America following suit.</li><li><strong>Insurance for Large Accounts</strong>: Insurance providers will enter the market, offering coverage for large crypto accounts that adhere to proper security protocols — similar to FDIC insurance for traditional bank accounts.</li><li><strong>Increased Adoption by Investment Firms</strong>: Investment companies will increasingly allow brokers and financial advisors to recommend crypto investments, further legitimizing and normalizing the space.</li></ol><p>Credits to <strong>Simply Explained</strong>, whose interactive videos helped me grasp fundamental blockchain concepts when I first joined Gluwa.<br><a href="https://www.youtube.com/watch?v=FkUn86bH34M&amp;list=PLzvRQMJ9HDiQF_5bEErheiAawrJ-2zQoI">https://www.youtube.com/watch?v=FkUn86bH34M&amp;list=PLzvRQMJ9HDiQF_5bEErheiAawrJ-2zQoI</a></p><p>Credits to <strong>The BIU Research Center on Applied Cryptography and Cyber Security </strong>for publishing long but great source of knowledge for anyone interested in blockchain: <a href="https://www.youtube.com/watch?v=LOVpky8upwA&amp;list=PL8Vt-7cSFnw1gx51WHRgAtioVqAjzMS1w">https://www.youtube.com/watch?v=LOVpky8upwA&amp;list=PL8Vt-7cSFnw1gx51WHRgAtioVqAjzMS1w</a></p><p>A heartfelt thank you to my colleagues over the years who have greatly contributed to my understanding of blockchain and related technologies:</p><ul><li><strong>Tae Oh Lim</strong></li><li><strong>Kyungsuk Lee</strong></li><li><strong>Jeremy Frank</strong></li><li><strong>Kevin Nguyen</strong></li><li><strong>Marc Aurele Besner</strong></li><li><strong>Jon Zlotnik</strong></li></ul><p>Your guidance and insights have been invaluable on this journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ede2c5e77c2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Set Up a Farmer with Autonomys Blockchain]]></title>
            <link>https://medium.com/@dsylebee/how-to-set-up-a-farmer-with-autonomys-blockchain-7ea868efb7c8?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ea868efb7c8</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 23:06:46 GMT</pubDate>
            <atom:updated>2025-01-09T21:38:13.341Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bAMR6XeaqspLserp.jpeg" /></figure><p>Setting up a bare-metal server to run decentralized applications is always an exciting challenge. In this post, I’ll share my experience setting up a farmer with Autonomys Blockchain.</p><blockquote>Our network provides the infrastructure to scale decentralized AI3.0 applications on-chain — hyper-scalable permanent data storage, super fast data availability &amp; flexible EVM-compatible decoupled execution.<br><a href="https://www.autonomys.xyz/">https://www.autonomys.xyz/</a></blockquote><p>I have a few good friends at Autonomys, and I thought it would be a good idea to share my experience setting up a farmer and explore some interesting ways to monitor it.</p><p>I’ll attempt to document the steps I took to set up the bare-metal server.</p><ul><li><strong>Hosting Choice:</strong> <a href="https://eco.us.ovhcloud.com/kimsufi/">Kimsufi by OVHcloud</a> — an affordable bare-metal server provider for experimentation.</li><li><strong>Operating System:</strong> Ubuntu Server as the template OS image.</li><li><strong>Grafana </strong>for metrics monitoring, combined with the Subspace dashboard.</li><li><strong>UFW </strong>(Uncomplicated Firewall) for software firewall protection.</li><li><strong>BetterStack </strong>for health monitoring and system reliability.</li></ul><p>There are different ways to set up a farmer with Autonomys:</p><ul><li><strong>Space Acres:</strong> The easiest option.</li><li><strong>Advanced CLI:</strong> A more technical approach.</li><li><strong>Farming Clusters:</strong> For experts.</li></ul><p>In this article, I’ll show you how to set up a simple single-server farmer using the <strong>Advanced CLI.</strong></p><h3><strong>The first step is to establish an SSH connection with your server.</strong></h3><blockquote>I recommend using the <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh">Remote — SSH extension for Visual Studio Code</a>. It offers a user-friendly interface for exploring files, supports opening multiple terminals within the SSH session, and can create SSH tunnels to inspect ports without exposing them directly.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*p54pvukzf3FbIdG9nxCQGA.png" /></figure><h3><strong>Updating the Operating System</strong></h3><p>It’s important to ensure your system is up to date. Start by running the usual Ubuntu update and upgrade commands:</p><pre># Update system packages<br>sudo apt-get update  <br>sudo apt upgrade</pre><h3>Creating the Services</h3><p>I prefer using systemctl because it ensures that services are automatically restarted if they crash, and it also manages logging and log retention.</p><p>First, I created a folder called autonomys and a data folder to store the node&#39;s storage data:</p><pre>mkdir ~/autonomys<br>mkdir ~/autonomys/data<br>cd ~/autonomys</pre><p>Next, I obtained the binaries from the documentation. I used <a href="https://docs.autonomys.xyz/farming/advanced-cli/install/">this link</a>, right-clicked to copy the URL, and used wget to download it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*99lmbevwaSmA01yTugznUA.png" /><figcaption>download page screenshot</figcaption></figure><pre>wget https://github.com/autonomys/subspace/releases/download/mainnet-2024-dec-09/subspace-node-ubuntu-x86_64-skylake-mainnet-2024-dec-09<br>wget https://github.com/autonomys/subspace/releases/download/mainnet-2024-dec-09/subspace-farmer-ubuntu-x86_64-skylake-mainnet-2024-dec-09</pre><p>There are two binaries for running the node and the farmer. For each of them, I created a shell script and a service file.</p><p>Here are the shell scripts for both:</p><ol><li><strong>start-node.sh</strong></li></ol><pre>#!/bin/bash<br>echo &quot;Current working directory: $(pwd)&quot;<br><br>./subspace-node-ubuntu-x86_64-skylake-mainnet-2024-dec-09 run --chain mainnet --base-path ~/autonomys/data/node --name &quot;Ace&#39;s Node&quot; --farmer --prometheus-listen-on 0.0.0.0:9615</pre><ol><li><strong>start-farmer.sh</strong></li></ol><pre>#!/bin/bash<br>echo &quot;Current working directory: $(pwd)&quot;<br><br>./subspace-farmer-ubuntu-x86_64-skylake-mainnet-2024-dec-09 farm --reward-address &lt;Your reward address&gt; path=~/autonomys/data/farmer,size=350GI --prometheus-listen-on=0.0.0.0:9616</pre><p>Make sure to replace &lt;Your reward address&gt; with your actual reward address and your farm size with size=…</p><p>Turn your scripts into executable shells.</p><pre>chmod +x start-node.sh<br>chmod +x start-farmer.sh</pre><p>You can then test the node is starting properly as well as the farmer.</p><pre>./start-node.sh <br>./start-farmer.sh</pre><p>Once you confirm they work, its time to stop them and turn them into daemon (services).</p><p>example how to turn the <strong>node </strong>into a <strong>service</strong>.</p><pre>[Unit]<br>Description=Node<br>After=network.target <br><br>[Service]<br>ExecStart=/home/&lt;your linux user&gt;/autonomys/start-node.sh<br>Restart=always<br>User=&lt;your linux user&gt;<br>WorkingDirectory=/home/&lt;your linux user&gt;/autonomys<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>once that file is created you can use it to create the service like so.</p><pre># this turns it into a service.<br>sudo systemctl link ~/node.service<br><br># you can start it like so.<br>sudo systemctl enable node.service<br>sudo systemctl start node.service<br><br># you can check the status like this.<br>systemctl status node.service<br><br># you can query the logs like so.<br>journalctl -u node.service | grep &lt;SEARCH FOR SOME TEXT&gt;<br><br># you can follow the logs like so<br>journalctl -f -u node.service</pre><p>The benefit of using a service is log retention with journalctl. Even if your node crashes and restarts, the logs will be saved in journalctl, allowing you to review them later.</p><p>By following the same steps for the farmer, you’ve successfully turned both the <strong>node </strong>and <strong>farmer </strong>into systemctl daemons (services).</p><blockquote>I recommend you wait for your node to be fully synced to the blockchain before starting your farmer.</blockquote><h3><strong>Monitoring the Uptime of Your Binaries</strong></h3><p>It’s important to track the health of your two binaries. To do this, I wrote a simple Python script that can be used as a health check endpoint.</p><pre>import socket<br>import subprocess<br>import argparse<br>import os<br>from flask import Flask, jsonify, request<br><br># Flask app setup<br>app = Flask(__name__)<br><br>def is_port_open(port):<br>    &quot;&quot;&quot;Check if a given port is open on localhost.&quot;&quot;&quot;<br>    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:<br>        s.settimeout(1)<br>        result = s.connect_ex((&#39;127.0.0.1&#39;, port))<br>        return result == 0<br><br>def check_service_status(service_name):<br>    &quot;&quot;&quot;Check the status of a system service using systemctl.&quot;&quot;&quot;<br>    try:<br>        result = subprocess.run(<br>            [&#39;systemctl&#39;, &#39;is-active&#39;, service_name],<br>            capture_output=True, text=True<br>        )<br>        return result.stdout.strip() == &#39;active&#39;<br>    except Exception as e:<br>        return f&quot;Error checking service: {str(e)}&quot;<br><br>def get_folder_size(path):<br>    &quot;&quot;&quot;Calculate the total size of a folder.&quot;&quot;&quot;<br>    total_size = 0<br>    try:<br>        for dirpath, dirnames, filenames in os.walk(path):<br>            for f in filenames:<br>                fp = os.path.join(dirpath, f)<br>                # Skip if it is a broken symlink<br>                if not os.path.islink(fp):<br>                    total_size += os.path.getsize(fp)<br>        return {<br>            &quot;Path&quot;: path,<br>            &quot;Used&quot;: f&quot;{total_size // (1024 * 1024)} MB&quot;<br>        }<br>    except Exception as e:<br>        return {<br>            &quot;Error&quot;: f&quot;Unable to calculate folder size for {path}: {str(e)}&quot;<br>        }<br><br>@app.route(&#39;/health&#39;, methods=[&#39;GET&#39;])<br>def health_check():<br>    &quot;&quot;&quot;Perform the health check and return JSON response.&quot;&quot;&quot;<br>    # Check port statuses<br>    port_statuses = {str(port): &quot;Open&quot; if is_port_open(port) else &quot;Closed&quot; for port in args.ports}<br>    all_ports_open = all(status == &quot;Open&quot; for status in port_statuses.values())<br><br>    # Check service status<br>    service_status = check_service_status(args.service)<br><br>    # Check folder usage info<br>    path = args.path<br>    folder_usage_info = get_folder_size(path)<br><br>    all_checks_healthy = all_ports_open and service_status == True<br>    health_status = &quot;Healthy&quot; if all_checks_healthy else &quot;Unhealthy&quot;<br>    status_code = 200 if health_status == &quot;Healthy&quot; else 500<br><br>    response = {<br>        &quot;Health&quot;: health_status,<br>        &quot;Ports&quot;: port_statuses,<br>        &quot;Service&quot;: {args.service: &quot;Active&quot; if service_status == True else &quot;Inactive&quot;},<br>        &quot;Folder Usage&quot;: folder_usage_info<br>    }<br>    return jsonify(response), status_code<br><br>if __name__ == &#39;__main__&#39;:<br>    # Argument parser setup<br>    parser = argparse.ArgumentParser(description=&quot;Health check for ports, a system service, and a specific path.&quot;)<br>    parser.add_argument(<br>        &#39;--ports&#39;, <br>        type=int, <br>        nargs=&#39;+&#39;, <br>        default=[30333, 30433, 30533, 9615, 9616], <br>        help=&#39;Ports to check (default: [30333, 30433, 30533, 9615, 9616])&#39;<br>    )<br>    parser.add_argument(<br>        &#39;--service&#39;, <br>        type=str, <br>        required=True, <br>        help=&#39;Name of the system service to check (e.g., farmer.service)&#39;<br>    )<br>    parser.add_argument(<br>        &#39;--health-port&#39;, <br>        type=int, <br>        default=9700, <br>        help=&#39;Port for the health check server (default: 9700)&#39;<br>    )<br>    parser.add_argument(<br>        &#39;--path&#39;, <br>        type=str, <br>        default=&#39;/&#39;, <br>        help=&#39;Path to check for folder usage (default: /)&#39;<br>    )<br>    args = parser.parse_args()<br><br>    # Run the Flask app<br>    app.run(host=&#39;0.0.0.0&#39;, port=args.health_port)</pre><p>This Python script can be used to create additional services for checking the health of each node</p><p>For the node:</p><pre>[Unit]<br>Description=Node - Monitor<br>After=network.target<br><br>[Service]<br>ExecStart=python3 /home/&lt;your user&gt;/autonomys/service-monitor.py --service node.service --ports 30333 30433 --path /home/&lt;your user&gt;/autonomys/data/node<br>Restart=always<br>User=&lt;your user&gt;<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>For the farmer:</p><pre>[Unit]<br>Description=Farmer - Monitor<br>After=network.target<br><br>[Service]<br>ExecStart=python3 /home/&lt;your user&gt;/autonomys/service-monitor/main.py --service farmer.service --ports 30533 --health-port 9701 --path /home/&lt;your user&gt;/autonomys/data/farmer<br>Restart=always<br>User=&lt;your user&gt;<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>Next, you can create daemons for your monitoring services.</p><pre>sudo systemctl link node-monitor.service<br>sudo systemctl link farmer-monitor.service<br>sudo systemctl start node-monitor.service<br>sudo systemctl start farmer-monitor.service<br><br># use status to check if its working<br>systemctl status farmer-monitor.service<br>systemctl status node-monitor.service</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XfoZOdbtYZJ4LBiti6HqQQ.png" /></figure><p>You can then use the monitoring service of your choice to monitor it like so, in my case I used better stack.</p><h3>Firewall Management</h3><p>I setup the firewall rules like so.</p><pre># I assume you use, ssh add this to not be kicked out<br>sudo ufw allow ssh<br><br># use this for the binary ports for node and farmer<br>sudo ufw allow 30333<br>sudo ufw allow 30433<br>sudo ufw allow 30533<br><br># use this to allow monitoring python scripts to monoitor if the node and <br># farmer are working by some external web uptime monitoring platform.<br>sudo ufw allow 9700<br>sudo ufw allow 9701</pre><p>Enabling the Firewall</p><blockquote>Before enabling the firewall, make sure to open the necessary ports for connections, such as SSH or any other service you use to connect to your machine.</blockquote><pre>sudo ufw enable</pre><h3>Grafana Monitoring</h3><p>Autonomys offers a dashboard already made for farmers.</p><blockquote>You can install the grafana agent using this link <a href="https://grafana.com/docs/agent/latest/static/set-up/install/install-agent-linux/">https://grafana.com/docs/agent/latest/static/set-up/install/install-agent-linux/</a></blockquote><pre>sudo mkdir -p /etc/apt/keyrings/<br>wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg &gt; /dev/null<br>echo &quot;deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main&quot; | sudo tee /etc/apt/sources.list.d/grafana.list<br><br>sudo apt-get update<br><br>sudo apt-get install grafana-agent</pre><p>Create a free account on grafana.com</p><p>Obtain your Prometheus user and password using the interface</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l77IWxNltIruwdej0Hy5uw.png" /></figure><p>Use those credentials to create your grafana-agent.yml file</p><pre># Sample config for Grafana Agent<br># For a full configuration reference, see: https://grafana.com/docs/agent/latest/configuration/.<br>server:<br>  log_level: warn<br><br>metrics:<br>  global:<br>    scrape_interval: 1m<br>  wal_directory: &#39;/var/lib/grafana-agent&#39;<br>  configs:<br>    - name: integrations<br>      scrape_configs:<br>        - job_name: &#39;node metrics&#39;<br>          static_configs:<br>            - targets: [&#39;localhost:9615&#39;, &#39;localhost:9616&#39;]<br>      remote_write:<br>      - url: https://your server url from grafana.com/api/prom/push<br>        basic_auth:<br>          username: your userame from grafana dot com<br>          password: your password from grafana dot com <br><br>integrations:<br>  agent:<br>    enabled: true<br>  node_exporter:<br>    enabled: true<br>    include_exporter_metrics: true<br>    disable_collectors:<br>      - &quot;mdadm&quot;<br><br><br><br></pre><p>Copy the grafana agent configuration in</p><pre># copy your grafana agent configuration<br>cp &lt;localfile working&gt; /etc/grafana-agent.yaml<br><br># start the agent<br>sudo systemctl enable grafana-agent<br>sudo systemctl start grafana-agent<br><br># check the status on your agent<br>systemctl status grafana-agent</pre><p>You can import this dashboard in your Grafana instance<br><a href="https://grafana.com/grafana/dashboards/20433-subspace/">https://grafana.com/grafana/dashboards/20433-subspace/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Um7mIVnZNUK-3RWL1PVww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*E09mUrr1Xv78x0ikeHJGLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cY61Zv7xDidz7zXuwXV02A.png" /></figure><p>I hope this guide helps you get your farmer set up and running smoothly on Autonomys Blockchain. Don’t hesitate to leave a comment if you have any questions or run into any issues along the way!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ea868efb7c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Blockchain Could Help Aid Countries Against Election Tampering]]></title>
            <link>https://medium.com/@dsylebee/how-blockchain-could-help-aid-countries-against-election-tampering-f8b5abcf9a3a?source=rss-dae1f06b09db------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8b5abcf9a3a</guid>
            <dc:creator><![CDATA[David L]]></dc:creator>
            <pubDate>Fri, 02 Aug 2024 21:08:32 GMT</pubDate>
            <atom:updated>2024-08-02T23:48:53.866Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fnXMU3WWioZ67WaOsJsb2g.png" /></figure><p>In no way am I taking any partisan sides in any election. I’m simply proposing a solution to a potential problem that people have raised concerns about over the years.</p><p>This idea may not work for all countries, but it proposes an interesting solution. I’ll use the USA and Canada as sample countries because I am most familiar with them.</p><p>In recent years, advancements in blockchain technology have brought us to a point where it can provide innovative solutions to various problems, including election tampering. Here’s how:</p><p><strong>1. Zero Knowledge Proofs (ZKPs):</strong> These can be used to identify people without revealing their identity. This technology supports Decentralized Identity (DID), ensuring privacy and security.</p><p><strong>2. Consensus Algorithms:</strong> These are perfect for removing the need for central trust. In a blockchain, the consensus mechanism ensures that all participants agree on the state of the data.</p><p><strong>3. Immutability and Transparency:</strong> Blockchain is immutable, meaning once data is recorded, it cannot be altered. It is also transparent, allowing anyone to verify the data.</p><p><strong>4. Indexability:</strong> Blockchains are indexable, meaning that data can be organized and accessed efficiently.</p><h3>Proposal</h3><p>I propose that each state or province could stake in USD$ or CAD$ (which would act as the native currency of the chain) and would join in as a whitelisted validator of a proof-of-stake algorithm. For the sake of this proposal, let’s consider Ethereum, given my familiarity with it.</p><p><strong>Benefits of This System:</strong></p><p><strong>Transparency and Trust:</strong> While votes are being submitted on-chain, all states/provinces can verify the data using their local state of their Validator node. States/provinces have the same staked amount and face slashing for proposing any invalid blocks. They also vote to reach finality of blocks using their stake.</p><p><strong>Reliable Information Sources:</strong> People can trust the indexing source or their own indexing to know the progress of the election, rather than relying on news outlets which have become less trustworthy in maintaining unbiased reporting.<br><br>Technology like The Graph can be used to reward curators to index the chain and provide a trustless source of querying.</p><p><strong>Zero Knowledge Proofs:</strong> These can be used to provide on-chain proof of citizenship linked to social security numbers or various government identifications without revealing this information to the chain. This is the beauty of decentralized identity and zero knowledge proofs.</p><p><strong>Secure Voting Period:</strong> Elections can be locked by a block range represented in “Time” because proof-of-stake guarantees steady block time. This would avoid any voting outside of the permitted times. Early voting could be allowed if a Zero Knowledge Proof of early voting registration is provided.</p><p><strong>Facilitate Remote Voting:</strong> This system could also facilitate voting for citizens residing outside of the country.</p><p><strong>Future Applications:</strong> Eventually, this could also open the door to proper surveying of public opinions and other very interesting applications.</p><p><strong>Accountability and Security:</strong> If by any means states/provinces modify the source code of the validator and collude, they would essentially create a fork and the chain would not finalize. This would be easy to detect, and it would be straightforward to identify when it occurred. People could write decentralized software to detect such events and hold accountable the states/provinces involved.</p><p><strong>Scalability Concerns:</strong> The system could also be expanded to cities, but it may cause too many validators, potentially reducing potential throughput of the blockchain.</p><p><strong>Incentives and Fees:</strong> The fees paid by users could be refunded as tax credits. This ensures that the chain is not susceptible to denial-of-service attacks and de-incentivizes citizens from attacking the chain by submitting incorrect or excessive data.</p><p>I hope you’ve enjoyed this exploration of blockchain’s potential in securing elections. I’m really excited to hear your feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8b5abcf9a3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>