<?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 Chisom on Medium]]></title>
        <description><![CDATA[Stories by Chisom on Medium]]></description>
        <link>https://medium.com/@nwikechisom77?source=rss-9a9fb6e94adf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uUZd_LKH1B0aWIE-72Ab1Q.jpeg</url>
            <title>Stories by Chisom on Medium</title>
            <link>https://medium.com/@nwikechisom77?source=rss-9a9fb6e94adf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:12:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nwikechisom77/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[Why Messaging Layer Security (MLS) Needs a Decentralized Transport]]></title>
            <link>https://medium.com/@nwikechisom77/why-messaging-layer-security-mls-needs-a-decentralized-transport-af182e62dc3a?source=rss-9a9fb6e94adf------2</link>
            <guid isPermaLink="false">https://medium.com/p/af182e62dc3a</guid>
            <category><![CDATA[mls]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[marmot]]></category>
            <dc:creator><![CDATA[Chisom]]></dc:creator>
            <pubDate>Sun, 06 Dec 2026 07:23:34 GMT</pubDate>
            <atom:updated>2026-12-06T07:23:34.446Z</atom:updated>
            <content:encoded><![CDATA[<p>End-to-end encryption (E2EE) has solved an important problem: keeping our messages private so that outsiders cannot read what we send to each other. However, most encrypted messaging applications still depend on centralised servers to manage users, decide who can communicate, and control how messages get delivered.</p><p>When the Internet Engineering Task Force (IETF) published <strong>Messaging Layer Security (MLS, RFC 9420)</strong>, it introduced a better way to secure large group conversations. MLS makes it possible to maintain strong encryption in group chats without having to encrypt a separate copy of every message for every member.</p><p>It also provides two important security properties:</p><ul><li><strong>Forward Secrecy:</strong> Even if someone gets access to a current encryption key, they should not be able to use it to read previous messages.</li><li><strong>Post-Compromise Security:</strong> If an attacker compromises a member’s keys, the group can recover its security after new keys are generated and applied.</li></ul><p>However, MLS does not handle everything needed to build a complete messaging application. It focuses mainly on the cryptographic part and leaves two important responsibilities to the application:</p><ol><li><strong>Authentication Service (AS):</strong> Responsible for verifying users and their identities.</li><li><strong>Delivery Service (DS):</strong> Responsible for delivering messages and other MLS data to group members.</li></ol><p>In most messaging applications today, both services are handled by one company’s backend.</p><p>This raises an important question: What happens when that company decides to block your account, stops providing its service, or controls which messages can reach you?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHP9RJpHh8k_wLq4AorJiw.png" /></figure><p>To understand how decentralized transport can solve some of these problems, we need to look at how MLS works and what changes when we remove the central server.</p><h3>The Architectural Bottleneck in Modern Group Encryption</h3><p><strong>From Pairwise Encryption to Tree-Based Key Agreement: </strong>Before MLS, securing group conversations often involved extending pairwise encryption protocols like the Signal Double Ratchet.</p><p>In this approach, when someone sends a message to a group of N people, the sender has to encrypt and send a separate copy to each recipient.</p><p>For example, in a group of 100 people, the sender may need to create 99 separate encrypted messages.</p><p>This works for small groups, but the cost increases as more people join. Both bandwidth and processing requirements grow with the number of participants.</p><p>MLS solves this using a system called <strong>TreeKEM (Tree Key Encapsulation Mechanism)</strong>.</p><p>Instead of maintaining separate encryption sessions with every group member, MLS organises members into a shared binary tree of cryptographic keys.</p><p>The tree works like this:</p><ul><li><strong>Leaf nodes:</strong> Each member has their own leaf node containing their cryptographic key information.</li><li><strong>Parent nodes:</strong> These contain keys that help members of different branches derive shared secrets.</li><li><strong>Root node:</strong> The root contributes to deriving the shared group secret for the current epoch.</li></ul><p>An epoch represents the current cryptographic state of the group.</p><p>Whenever someone joins, leaves, or updates their keys, MLS uses a Commit message to update the affected parts of the tree.</p><p>The important thing is that it does not need to update every member’s key individually. It only updates the path from the affected member’s leaf node to the root.</p><p>Because the tree grows logarithmically, these updates can be handled in approximately (O(log N)) operations instead of (O(N)).</p><p>This makes MLS more efficient for large and frequently changing groups.</p><h4>The Two Centralisation Dependencies in RFC 9420</h4><p>Although MLS solves the problem of managing encryption keys in large groups, it still needs two external services to operate as a complete messaging system.</p><ol><li><strong>Authentication Service (AS): </strong>MLS verifies cryptographic signatures, but it does not decide how a public key belongs to a particular person. For example, if Alice wants to communicate with Bob, she needs a way to confirm that the public key she receives actually belongs to Bob. Something outside the MLS protocol must establish that relationship. In a traditional messaging application, this is usually handled by the company’s backend using phone numbers, email addresses, or user accounts.</li><li><strong>Delivery Service (DS): </strong>The Delivery Service handles the delivery of messages, KeyPackages, and other MLS data. It also plays an important role in managing the order of group membership changes. For example, if a group moves from Epoch 1 to Epoch 2 and then Epoch 3, members must agree on the same sequence of accepted Commit messages. If two members create conflicting commits based on the same epoch, the application needs a way to decide which one becomes the accepted group state. RFC 9420 leaves this responsibility to the surrounding application architecture.</li></ol><p>In most commercial messaging applications, the same company provides both services. The company manages user identities, stores public keys, delivers messages, and coordinates group changes.</p><p>This creates a problem.</p><p>Even though messages are encrypted, the company still controls important parts of the communication system. If its servers go offline, block a user, or refuse to deliver certain messages, communication can stop.</p><p>It can also observe information about group membership, when people join or leave groups, and when messages are exchanged, even if it cannot read their contents. This is one of the major reasons why decentralizing the transport layer matters.</p><h3>Replacing Centralized Services with Cryptographic Primitives</h3><p>To remove dependence on a single company, we need to approach identity and message delivery differently. Instead of trusting one central authority, users should be able to manage their own identities, while messages should be delivered through multiple independent transport nodes.</p><h4>Decentralizing the Authentication Service</h4><p>In a decentralized system, a user’s identity should not depend entirely on a phone number, email address, or account created on a particular platform. Instead, identity can be based on a cryptographic keypair generated locally by the user.</p><p>For example, using elliptic curve cryptography such as secp256k1, which is also used by Bitcoin and Nostr, a user can have a persistent public key that represents their identity.</p><p>Within MLS, this identity can be represented using a BasicCredential. When Alice wants to invite Bob into an MLS group, the process looks like this:</p><ol><li>Bob creates and publishes a signed KeyPackage containing his MLS encryption keys and identity credential.</li><li>Alice receives the KeyPackage and verifies its signature against Bob’s public identity key.</li><li>Once the verification succeeds, Alice can use the KeyPackage to add Bob to the group.</li></ol><p>This removes the need for a central identity server to approve every interaction.</p><p>Bob’s cryptographic identity is no longer tied to one messaging application. He can use the same identity across different clients and supported transport networks.</p><p>However, there is an important distinction: cryptographic verification proves that a key was signed by the corresponding private key. It does not automatically prove that the key belongs to the real-world person Bob. Applications still need a way to establish initial trust.</p><h4>Decentralizing the Delivery Service</h4><p>Replacing the Delivery Service is more complicated. With a centralized system, one server receives messages and coordinates their delivery to group members. In a decentralized system, we can use independent relays, such as Nostr relays, to distribute messages. Instead of depending on one server, clients can publish encrypted messages to several relays at the same time.</p><p>For example, if a client publishes a message to five relays and two of them go offline, the remaining three can still help deliver the message. This improves availability and makes it harder for one relay operator to control communication.</p><p>However, removing the central server also introduces new challenges.</p><p><strong>1. No Global Message Ordering: </strong>Independent relays do not automatically share one global sequence of messages. Relay A might receive Alice’s Commit before Bob&#39;s, while Relay B receives Bob&#39;s first. Both relays may therefore show clients different versions of the group’s activity.</p><p><strong>2. Delayed and Out-of-Order Delivery: </strong>Unlike a central server with coordinated message queues, relays may deliver messages at different times. A user who has been offline for several hours might reconnect and receive messages from multiple relays in an unexpected order. This means the client cannot blindly process every message as it arrives.</p><p>The MLS engine must handle missing messages, buffer messages that arrive too early, and ensure that group members eventually agree on the same cryptographic state. This is where the engineering becomes more interesting: the client must take greater responsibility for maintaining the group’s state instead of depending entirely on the server.</p><h3>Case Study: Decoupling MLS Across Protocol Surfaces</h3><p>To understand how these ideas work in practice, we can look at the <strong>Marmot Protocol</strong>. Marmot is an open protocol designed to run IETF MLS over decentralized Nostr relays without depending on one central messaging server. Rather than putting everything into one large application, Marmot separates the system into four major parts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JSpLZJXY_5oSkgzNS3DODQ.png" /></figure><h4>1. Foundation: Portable Cryptographic Identity</h4><p>The foundation layer defines the common cryptographic building blocks used throughout the system. This includes key formats, byte encoding, and cryptographic registries. Marmot uses 32-byte secp256k1 public keys, commonly represented using the npub format, as the basis for persistent user identities. This means a user’s identity is not owned by a particular messaging application or relay.</p><p>For example, someone can use different identities for personal communication, work, or automated agents without needing a completely different underlying protocol implementation.</p><h4>2. Protocol-Core: Making Group State Consistent</h4><p>The protocol core handles the MLS state machine, using implementations such as OpenMLS. One of its major responsibilities is dealing with messages that arrive in the wrong order.</p><p>Since decentralized relays do not guarantee a shared message sequence, the client needs to determine which messages it can process and which ones it needs to wait for.</p><p>For example:</p><ul><li>Every Commit references the group epoch it was created from.</li><li>If a client is still on Epoch 4 but receives an application message for Epoch 5, it cannot immediately process that message.</li><li>The client waits until it receives and processes the missing Commit that moves the group to Epoch 5.</li></ul><p>The protocol core also enforces the rules around who can make group changes. For example, only authorised administrators should be able to make certain membership or group metadata changes. The goal is to ensure that every group member eventually arrives at the same cryptographic state, even when messages come through different relays.</p><h4>3. App-Components: Protecting Group Metadata</h4><p>In traditional messaging applications, information such as group names, descriptions, member lists, and administrator details is often stored in the company’s database. This means the server may know a lot about a group even when it cannot read the actual messages. Marmot takes a different approach. Instead of keeping this information exposed in a central database, application-level metadata can be stored inside MLS Group Context Extensions.</p><p>For example, information such as:</p><ul><li>Group name and description.</li><li>Group administrators.</li><li>Member-related metadata.</li><li>Preferred relay information.</li></ul><p>Can be included in the encrypted group state. When an administrator changes the group name or updates other supported metadata, the change is distributed through an MLS Commit. Only current group members with the appropriate cryptographic state can decrypt and verify the update. This helps reduce the amount of sensitive group information exposed to transport providers.</p><h4>4. Transports: Treating Relays as Simple Message Carriers</h4><p>The transport layer handles how MLS data moves between users. In Marmot, Nostr relays are used to carry MLS messages and other protocol data. The important idea is that relays do not need to understand the actual message contents or manage the group’s encryption state. They simply receive and distribute encrypted data. Marmot uses specific Nostr event kinds for this purpose.</p><ul><li><strong>KeyPackages (Kind 443): </strong>KeyPackages are published so that other users can retrieve the information needed to invite someone into an MLS group. This is particularly important when the person being invited is offline. They can also be wrapped using NIP-59 Gift Wrap to provide additional privacy around the exchange.</li><li><strong>Group Messages and Commits (Kind 445): </strong>These events carry encrypted MLS messages and group state updates. They use a rotatable group identifier (h tag) to help relays route messages without exposing the actual group name. They can also use ephemeral, one-time Nostr signing keys instead of exposing the sender’s persistent identity key on every event. Because the transport layer only carries encrypted payloads, the same MLS engine can potentially work with different transport implementations.</li></ul><p>For example:</p><ul><li>Nostr relays.</li><li>Local WebSocket connections.</li><li>Peer-to-peer networks.</li><li>Command-line applications running in the background.</li></ul><p>The cryptographic logic does not need to be rewritten every time the transport changes.</p><h3>The Engineering Trade-Offs of Decentralized MLS</h3><p>Decentralizing MLS comes with benefits, but it also introduces new engineering challenges. Removing the central server does not automatically make everything easier. Some responsibilities that were previously handled by the server now have to be handled by the client.</p><h4>State Divergence and Fork Resolution</h4><p>One of the biggest challenges is handling conflicting Commit messages. Imagine Alice and Bob are both administrators of the same group. They are temporarily connected to different relays, and both create a Commit based on Epoch 3. Alice creates a commit that moves the group to Epoch 4. At almost the same time, Bob creates another commit based on that same Epoch 3. Since there is no central server coordinating both operations, different members may receive the commits in different orders. Some members might process Alice’s commit first, while others process Bob’s.</p><p>This can cause the group to split into two different cryptographic states. To prevent this, the application needs a clear way to handle conflicting commits.</p><p>For example, it can define deterministic rules for choosing which commit becomes the accepted one. Every client must follow the same rule so that they eventually arrive at the same group state. RFC 9420 explicitly requires applications to establish a way of resolving conflicting commits. The exact approach depends on the application architecture.</p><h4>Transport-Layer Metadata Leakage</h4><p>End-to-end encryption protects message contents, but it does not automatically hide everything happening at the network level. Even when messages and group information are encrypted, relay operators may still observe:</p><ul><li>The user’s IP address, unless additional privacy tools such as Tor or a mixnet are used.</li><li>The group’s routing identifier (h tag).</li><li>When messages are sent and received.</li><li>The approximate size of encrypted messages.</li></ul><p>This information can still reveal patterns about how people communicate. There are different ways to reduce this exposure.</p><p>For example:</p><ul><li>Rotate group routing identifiers periodically.</li><li>Add padding to encrypted messages to make their sizes less predictable.</li><li>Use encrypted, content-addressed storage such as Blossom for larger media attachments.</li><li>Use keys derived from the MLS exporter secret to protect media content before uploading it.</li></ul><p>These measures do not completely eliminate metadata leakage, but they make it harder for transport providers to build a complete picture of users’ communication activities.</p><h4>Latency vs. Sovereignty</h4><p>There is also a trade-off between central coordination and decentralization. A centralized messaging system has one main server coordinating delivery. This makes some operations easier, especially when messages need to be delivered immediately. A decentralized system distributes this responsibility across independent relays. This gives users more control and reduces dependence on individual service providers, but it also means clients must handle more complicated delivery and synchronization problems.</p><p>The main differences are:</p><ul><li><strong>Identity:</strong> Centralized systems usually tie identity to an account, phone number, or email. Decentralized systems can use cryptographic keys that users control.</li><li><strong>Censorship resistance:</strong> Centralized systems can be disrupted by blocking one server. Decentralized systems can use multiple relays, making individual relay failures less disruptive.</li><li><strong>Message ordering:</strong> Centralized systems can coordinate message ordering through one server. Decentralized systems require additional client-side logic to handle conflicting and delayed messages.</li><li><strong>Privacy:</strong> Centralized servers can observe group membership and communication activity. Decentralized systems can reduce this exposure using encrypted metadata and rotating identifiers, although relays may still observe network-level information.</li><li><strong>Voice and video:</strong> Centralized systems can use integrated SFU and TURN infrastructure. Decentralized systems need separate solutions for signalling and peer-to-peer media delivery.</li></ul><p>For applications that need very low-latency communication, such as live video calls involving 100 people, centralized Selective Forwarding Units (SFUs) are still difficult to replace.</p><p>However, for asynchronous messaging, team coordination, and communication between humans and automated agents, decentralized transport offers a different approach.</p><p>Users can retain control of their identities, while messages move through independent transport providers instead of depending on one company’s infrastructure.</p><h3>Conclusion</h3><p>MLS provides a strong foundation for securing modern group conversations, but encryption alone does not make a messaging system decentralized. We also need to consider who controls identity, who delivers messages, and who decides how group changes are processed.</p><p>This is where protocols like Marmot become interesting. By separating cryptographic identity, group state management, application metadata, and message transport, Marmot demonstrates how MLS can operate without depending on one central messaging backend.</p><p>The trade-off is that more responsibility moves to the client. It must handle delayed messages, conflicting commits, synchronization, and other problems that a central server would normally coordinate. But that is an important part of building communication infrastructure where users are not completely dependent on one company to maintain their identities or deliver their messages.</p><p><strong>The bigger idea is simple: encryption protects the conversation, but decentralizing the infrastructure gives users more control over how that conversation happens.</strong></p><p><strong>References:</strong></p><ul><li>Messaging Layer Security (MLS) — RFC 9420 — <a href="https://datatracker.ietf.org/doc/html/rfc9420?utm_source=chatgpt.com">Read RFC 9420</a>.</li><li><a href="https://www.rfc-editor.org/info/rfc9750/?utm_source=chatgpt.com">The Messaging Layer Security (MLS) Architecture — RFC 9750</a>.</li><li><a href="https://marmot.build/">Marmont protocal</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af182e62dc3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contributing to Bitcoin through curiosity and product empathy]]></title>
            <link>https://medium.com/@nwikechisom77/contributing-to-bitcoin-through-curiosity-and-product-empathy-b32de6b9697e?source=rss-9a9fb6e94adf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b32de6b9697e</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Chisom]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 06:22:05 GMT</pubDate>
            <atom:updated>2026-11-21T06:22:05.797Z</atom:updated>
            <content:encoded><![CDATA[<p>In my journey towards contributing to the Bitcoin ecosystem as a developer, I have come to realise that there are many ways to get started. But sometimes, the number of options available can be overwhelming. Almost every guide gives you the same starting points: look for repositories with good first issue labels, fix a typo in a README, or review open pull requests.</p><p>As a new developer, I believe reviewing PRs is one of the best ways to get familiar with a codebase, understand how things are done, and learn how maintainers think. I rely on it a lot myself. However, looking back at what I have been doing over the past three weeks, I realised there is another approach worth exploring. One that does not require you to wait for an issue to be created or assigned before you can start contributing.</p><p>The approach I want to discuss in this article takes a slightly different path. Instead of treating a repository as just a list of issues to pick from, it starts with learning about Bitcoin’s foundational mission and the technologies behind it. From there, you move into a live projects to see how those ideas are actually implemented in code, and then look at those implementations from the perspective of security and end-user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2Z2SSdueyxSUhawt8VQpQ.png" /></figure><h3>Starting With the “Why”: Bitcoin’s Mission as a Compass</h3><p>As a developer, it is easy to want to jump straight into writing code, learning frameworks, and studying architecture diagrams. But with Bitcoin, technical decisions are not just about writing clean code. Every cryptographic primitive, key derivation path, fee estimation model, and network rule has a purpose. They all play a role in protecting users’ control over their funds and keeping the network secure.</p><p>Understanding how Bitcoin works and <em>why</em> certain standards exist gives you a good starting point when you eventually open a real codebase. For example, when you study a Bitcoin Improvement Proposal (BIP) or a Layer 2 mechanism, you get to understand what it is designed to achieve and the guarantees it is supposed to provide to users.</p><p>Once you understand these things, you are no longer just reading code to see how it works. You can also compare the actual implementation with what the standard is supposed to achieve and ask yourself whether it is doing what it should.</p><h3>Bridging Theory and Reality: Tracing Concepts in Live Code</h3><p>There is always a difference between reading how a protocol works on paper and seeing how developers actually implement it while dealing with real-world challenges. One way to bridge that gap is to pick an active open-source Bitcoin project. In my case, I chose BlueWallet, set it up locally on my machine, and started tracing some of the concepts I had been learning about.</p><p>Instead of trying to understand the entire codebase at once, which can easily become overwhelming, you can choose to focus on one feature at a time. The idea is to understand how the standards and concepts you have learnt about move from low-level libraries into the actual buttons, prompts, and screens that users interact with.</p><p>Combining this approach with reviewing open PRs has also changed the way I read code. It becomes easier to understand why certain architectural decisions were made and the trade-offs developers had to consider. For example, developers sometimes have to balance cryptographic security with limited mobile screen space, network delays, and user convenience.</p><p>More importantly, following a feature from beginning to end helps you connect what you have learnt from protocol documentation to the actual code. You can run it, test it, understand how it works, and even identify areas that may need improvement.</p><p>For example, after learning about the importance of private keys, I became curious about how to secure them better, especially in extreme situations. That was how I came across the BIP39 passphrase, also known as the salt, 13th or 25th word. It adds another layer of security by combining with your seed phrase to generate a completely different wallet.</p><p>I decided to check how it was implemented in the BlueWallet codebase and how users interact with it through the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRM3riDTY6R_jklu24Q3aQ.png" /></figure><p>Then I tested the wallet import process with custom passphrases to understand some of its security use cases, such as plausible deniability, adding another layer of protection against physical theft, and keeping funds in separate wallets using a single seed backup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T_EDVGz0oJjLu6b6kBq_8w.png" /></figure><p>While testing, I noticed that users could add a BIP39 passphrase when importing an existing wallet, but there was no option to do the same when creating a new wallet. I went ahead and discussed this with my mentor at the Btrust Fellowship. After that, I raised an issue to bring it to the team’s attention and eventually submitted a PR to implement the feature.</p><h3>A Beginner’s Advantage: Looking at Security and UX with Fresh Eyes</h3><p>If you are new to open source, it is easy to feel like you don’t know enough to suggest improvements to maintainers who have been working on a codebase for years. But sometimes, being new to a project can actually work to your advantage.</p><p>Developers who have spent years working on a codebase can get used to certain rough edges, hidden assumptions, and complicated processes. As a beginner, you are seeing things with fresh eyes. So, an unclear warning, a hidden setting, or a confusing step can easily stand out to you.</p><p>In Bitcoin, user experience and security go hand in hand. A confusing user experience is not just a design problem; it can also create security risks. For example, if a user misunderstands a backup prompt, ignores a fee warning, or skips an optional security feature because they don’t understand its purpose, the consequences can be serious and sometimes irreversible.</p><p>As I started tracing how protocol features are presented to users, I noticed some areas where the underlying technology was already doing its job, but the way users interacted with it could still be improved. This gave me ideas on how small changes to the flow, explanations, or safety checks could improve both the user experience and security.</p><p>You don’t need to have spent years working on a repository before you can ask yourself: <em>“If someone is using this feature for the first time, will they understand what to do to keep their funds safe?”</em></p><h3>Your 4-Step Blueprint to get you Started</h3><p>If you are trying to find your way into Bitcoin open source and want to go a bit deeper, try pairing your PR reviews with this curiosity-driven exercise as you explore more:</p><ol><li><strong>Pick one Bitcoin concept you have recently studied.</strong> It could be a BIP, a key management standard, or a Layer 2 mechanism. Try to explain in simple terms what it is meant to do and how it helps protect or benefit the end user.</li><li><strong>Clone an active project and run it locally.</strong> Pick a Bitcoin wallet, node interface, or developer tool you would like to understand better. Set it up and get it running on your machine.</li><li><strong>Follow that concept from the UI to the actual code.</strong> Trace how it moves from what the user sees on the screen down to the underlying implementation. Take note of anything you find confusing, setup steps that are not properly explained, or areas where a new user could easily make mistakes.</li><li><strong>Turn what you discover into a contribution.</strong> Take one practical step based on what you have found. You could open a discussion about a UX or security issue, fix a documentation problem you encountered during setup, review an active PR related to that feature, or suggest a small code improvement.</li></ol><p>I hope you find this article helpful as a reader and here are some useful links:</p><ul><li><strong>Official Bitcoin Improvement Proposals (BIPs) Repository: </strong><a href="https://github.com/bitcoin/bips">github.com/bitcoin/bip</a></li><li><a href="https://github.com/bitcoin/bips">s</a><a href="https://bitcoindevs.xyz/good-first-issues"><strong>The Bitcoin Dev Project: Good First Issues</strong></a><strong>:</strong> <a href="https://bitcoindevs.xyz/good-first-issues">https://bitcoindevs.xyz/good-first-issues</a></li><li><a href="https://opensats.org/projects"><strong>OpenSats Project Showcase</strong></a><strong>:</strong> <a href="https://opensats.org/projects">https://opensats.org/projects</a></li><li><a href="https://github.com/bitcoin/bips"><strong>Bitcoin Improvement Proposals (bitcoin/bips)</strong></a><strong>:</strong> <a href="https://github.com/bitcoin/bips">https://github.com/bitcoin/bips</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b32de6b9697e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Silent Payments Work]]></title>
            <link>https://medium.com/@nwikechisom77/how-silent-payments-work-fbd7f1980c47?source=rss-9a9fb6e94adf------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbd7f1980c47</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Chisom]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 21:44:16 GMT</pubDate>
            <atom:updated>2026-10-30T22:16:34.031Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever posted a Bitcoin address online for tips, donations, or invoices, you’ve likely faced a privacy dilemma. When reusing that address, anyone with access to a block explorer can look up its transaction history, see how much Bitcoin has moved through it, and track its connections to other transactions. Depending on what they can link to that address, they may even be able to identify your other payments and estimate your overall holdings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*foiW90_vMJx_HPINnq-eiQ.png" /><figcaption>the problem of reusing one address multiple times</figcaption></figure><p>On the other hand, generating a new address for every person or payment can become difficult to manage, especially for businesses, content creators, and organisations that receive payments regularly. You need a reliable way to identify incoming payments, keep track of them, and ensure that the funds can be accessed by the right person.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-0v2fmbN_CRyt90ptnaaQ.png" /><figcaption>Per-invoice servers, generating new address for every transaction</figcaption></figure><p>Silent Payments (BIP 352) is one of the proposals aimed at solving this problem. Instead of asking you to generate a new address for every person who wants to send you Bitcoin, it allows you to publish one static address that people can reuse. The interesting part is that even though everyone sends to the same published address, each payment creates a unique output on the blockchain, making it difficult for an outside observer to link those payments together just by looking at the address.</p><p>But how does this actually work? How can the sender and receiver use the same published address to create a unique payment output without having to communicate directly with each other? The answer lies in the cryptography behind Silent Payments, using the Elliptic Curve Diffie–Hellman (ECDH), which allows the sender and receiver to derive a shared secret.</p><p>In this walkthrough, we’ll look at how the process works step by step, from the keys the receiver publishes to how the sender derives a unique payment output and how the receiver scans the blockchain to find and spend the funds. We’ll focus on what happens under the hood and how the different cryptographic operations fit together to provide better on-chain privacy.</p><h3>Step 1: Creating Your Silent Payment Static Address</h3><p>Instead of generating a new Bitcoin address every time someone wants to pay you, Silent Payments (BIP 352) allows you to create one reusable address that starts with sp1q... and share it with anyone who wants to send you Bitcoin.</p><p>Behind this address are two public keys that serve different purposes:</p><ul><li><strong>Scan Public Key (</strong><strong>B_scan):</strong> This key helps the receiver&#39;s wallet scan the blockchain and identify payments intended for them.</li><li><strong>Spend Public Key (</strong><strong>B_spend):</strong> This key is used to derive the payment output and establish the receiver&#39;s ability to spend the funds later, together with the corresponding private key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RkYeoy1Q9uf9oAO18spPSg.png" /></figure><p>The interesting part is that you can publish this address on your social media bio, website, or invoice without directly exposing a list of all your payments. Anyone can use the same address to send you Bitcoin, but each payment can generate a different on-chain output.</p><p>So, rather than creating and managing a new address for every sender, you have one address to share, while the cryptography behind Silent Payments handles the generation and detection of individual payments.</p><pre># Formula: Address = Encode(B_scan, B_spend)<br><br># like:<br>def generate_silent_payment_address(b_scan, b_spend):<br>    if isValidPrivateKey(b_scan) and isValidPrivateKey(b_spend):<br>        B_scan = multiply_generator(b_scan)<br>        B_spend = multiply_generator(b_spend)<br>        sp_address = encode_bech32m(&quot;sp&quot;, B_scan, B_spend)<br>        return sp_address<br>    else:<br>        raise ValueError(&quot;Invalid private key input&quot;)</pre><h3>Step 2: The Sender Derives a Unique Payment Output</h3><p>Now, someone wants to send you Bitcoin using your published Silent Payment address. The good thing is that both of you don’t need to be online at the same time or communicate directly for the payment to work. The sender’s wallet handles the cryptographic calculations needed to create a unique payment output.</p><p>This is where <strong>Elliptic-Curve Diffie–Hellman (ECDH)</strong> comes in. The sender’s wallet uses information from the private keys associated with the inputs (UTXOs) being spent in the transaction, together with your public scan key (B_scan), to derive a shared secret.</p><p>The wallet then uses this secret, along with the relevant public-key information, to calculate a unique output key for the payment. The Bitcoin is sent to this derived output, rather than directly to the reusable sp1q... address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NdfJG8qyS1lsGg6xdqmBdw.png" /></figure><p>To someone inspecting the blockchain, the payment appears as an ordinary Taproot output. The output does not directly reveal the receiver’s published Silent Payment address, although this does not guarantee that the payment can never be linked through other information or analysis.</p><p>The key idea is that <strong>the sender uses your published address to derive a unique destination for the payment, without needing to ask you for a new address each time.</strong></p><pre># Formula: P_out = B_spend + BaggHash((a_sum * B_scan) || k) * G<br><br># like:<br>def derive_sender_output(input_private_keys, B_scan, B_spend, outpoint_data):<br>    a_sum = sum(input_private_keys) % SECP256K1_ORDER<br>    <br>    if a_sum != 0:<br>        P_ecdh = multiply_point(B_scan, a_sum)<br>        t = bagghash(P_ecdh + outpoint_data)<br>        P_out = add_points(B_spend, multiply_generator(t))<br>        return P_out<br>    else:<br>        raise ValueError(&quot;Invalid input key aggregation sum&quot;)<br><br></pre><h3>Step 3: The Receiver Scans the Blockchain</h3><p>Now, the Bitcoin has been sent, but there is a small problem. The payment was sent to a unique Taproot output, not directly to your published sp1q... address. So, how does your wallet know that the Bitcoin is meant for you?</p><p>This is where your <strong>private scan key (</strong><strong>b_scan)</strong> comes in. Your wallet uses it together with the public keys of the inputs in each relevant transaction to perform the necessary cryptographic calculations. It then checks whether the derived output matches any of the outputs recorded on the blockchain.</p><p>When it finds a match, the wallet identifies that output as a payment belonging to you and records it among your wallet’s UTXOs. This allows you to see and track the received Bitcoin, even though the on-chain output does not directly reveal your published Silent Payment address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DIP0oKlJtx5j2HCSlnuoqg.png" /></figure><p>You don’t need to contact each sender or tell them which output to use. Your wallet uses the cryptographic relationship between your keys and the transaction data to discover the payments intended for you.</p><p><strong>In simple terms, the sender creates a unique payment destination, and your wallet uses your private scan key to find it.</strong></p><pre># Formula: Is_Match = (P_target == P_out_on_chain)<br><br># like:<br>def scan_transaction_output(input_public_keys, b_scan, B_spend, tx_output_key, outpoint_data):<br>    A_sum = sum_points(input_public_keys)<br>    P_ecdh = multiply_point(A_sum, b_scan)<br>    t = bagghash(P_ecdh + outpoint_data)<br>    P_target = add_points(B_spend, multiply_generator(t))<br>    <br>    if P_target == tx_output_key:<br>        # Match found: Store tweak &#39;t&#39; with the UTXO for future spending<br>        return True, t<br>    else:<br>        return False, None</pre><h3>Step 4: Unlocking and Spending the Received Bitcoin</h3><p>Now that your wallet has identified the payment and added it to your list of UTXOs, you can spend the Bitcoin just like any other funds in your wallet. But before the transaction can be spent, your wallet needs to derive the private key that corresponds to the unique output created for that payment.</p><p>It does this using your <strong>private spend key (</strong><strong>b_spend)</strong> together with the shared secret tweak derived from the Silent Payment process. Your wallet combines these according to the protocol to derive the private key needed to spend that particular output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pm6KSIakpLQF1N4aWfN4gg.png" /></figure><p>With the correct private key, your wallet can create the required signature, construct the spending transaction, and broadcast it to the Bitcoin network for validation.</p><p>The important thing is that you don’t need a separate private key created and stored manually for every payment. Your wallet can derive the necessary key when needed, while your original Silent Payment address remains reusable.</p><pre># Formula: p_out = (b_spend + t) mod n<br><br># like:<br>def derive_spending_private_key(b_spend, tweak, target_public_key):<br>    p_out = (b_spend + tweak) % SECP256K1_ORDER<br>    derived_pubkey = multiply_generator(p_out)<br>    <br>    if derived_pubkey == target_public_key:<br>        return p_out  # Valid private key ready to sign Schnorr signature<br>    else:<br>        raise SecurityError(&quot;Derived private key does not match transaction output key&quot;)1</pre><p><strong>That is how Silent Payments connects the whole process: the sender derives a unique payment output, the receiver scans for it, and the receiver’s wallet derives the key needed to spend the funds.</strong></p><h3>References</h3><ul><li><strong>Josibake, Somsen, R., &amp; Falbesoner, S. (2023).</strong> <em>BIP 352: Silent Payments</em>. Bitcoin Improvement Proposals.<a href="https://bips.dev/352/">https://bips.dev/352/</a></li><li><strong>Wuille, P., Nick, J., &amp; Townes, T. (2020).</strong> <em>BIP 341: Taproot: SegWit version 1 spending rules</em>. Bitcoin Improvement Proposals. <a href="https://bips.dev/341/">https://bips.dev/341/</a></li><li><strong>Wuille, P., Roeskams, M., &amp; Townes, T. (2020).</strong> <em>BIP 350: Schnorr Signatures for Secp256k1</em>. Bitcoin Improvement Proposals. <a href="https://bips.dev/350/">https://bips.dev/350/</a></li><li><strong>Diffie, W., &amp; Hellman, M. (1976).</strong> New directions in cryptography. <em>IEEE Transactions on Information Theory</em>, <em>22</em>(6),644–654. <a href="https://doi.org/10.1109/TIT.1976.1055638">https://doi.org/10.1109/TIT.1976.1055638</a></li><li><strong>Nakamoto, S. (2008).</strong> <em>Bitcoin: A Peer-to-Peer Electronic Cash System.</em> <a href="https://bitcoin.org/bitcoin.pdf">https://bitcoin.org/bitcoin.pdf</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbd7f1980c47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin as a Software, From Satoshi’s Code to a Global Open-Source Network]]></title>
            <link>https://medium.com/@nwikechisom77/bitcoin-as-a-software-from-satoshis-code-to-a-global-open-source-network-58e48bc1431d?source=rss-9a9fb6e94adf------2</link>
            <guid isPermaLink="false">https://medium.com/p/58e48bc1431d</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[bitcoin-core]]></category>
            <category><![CDATA[economics]]></category>
            <dc:creator><![CDATA[Chisom]]></dc:creator>
            <pubDate>Fri, 09 Oct 2026 20:03:09 GMT</pubDate>
            <atom:updated>2026-10-09T20:03:09.867Z</atom:updated>
            <content:encoded><![CDATA[<p>Before Bitcoin existed, every attempt at creating digital cash relied on trusted third parties like banks or payment processors. These intermediaries were necessary to process transactions, balance accounts, and prevent users from spending the same digital token twice, a fundamental flaw known as the double-spending problem. However, relying on central authorities introduced unavoidable friction: high transaction fees, risk of censorship, and the requirement that complete strangers trust a single entity with their financial sovereignty.</p><p>Establishing trust between mutually suspicious participants across a global network without a coordinator was considered an unsolved problem in computer science. In October 2008, an anonymous researcher named Satoshi Nakamoto published a white-paper titled <em>Bitcoin: A Peer-to-Peer Electronic Cash System</em>, outlining a theoretical solution that combined cryptography, economic incentives, and peer-to-peer networking. Yet writing a whitepaper was only half the battle; abstract concepts cannot process financial transactions. Turning theoretical consensus into reality required actual computer code that real people could run on their hardware.</p><h3>Turning Satoshi’s Idea into Software</h3><p>In January 2009, Satoshi released the first version of the Bitcoin software, making the ideas in the whitepaper operational. This original implementation integrated several distinct cryptographic and technical primitives into a single functional client: key pairs for ownership, proof-of-work to solve double-spending, a distributed ledger, and peer-to-peer routing to broadcast data.</p><p>Satoshi anchored the system by mining the genesis block on January 3, 2009, embedding a famous message about bank bailouts into its transaction data. Over the next two years, Satoshi served as the project’s primary developer, fixing bugs, responding to user feedback, and coordinating with early contributors like Hal Finney.</p><p>Crucially, Satoshi did not just propose a novel monetary design; Satoshi published working software that anyone could download, inspect, compile, and run. This open-source distribution transformed a theoretical paper into an active, self-sustaining network.</p><h3>From the Original Codebase to Bitcoin Core</h3><p>The initial version of the software, originally known simply as Bitcoin or BitCoin, was a monolithic C++ application containing the wallet, node validation engine, miner, and graphical user interface all in one bundle. Over the past decade and a half, that initial codebase evolved into Bitcoin Core through millions of lines of refactoring, testing, and security hardening.</p><p>Modern Bitcoin Core bears little resemblance to Satoshi’s original implementation in terms of internal organization, as performance bottlenecks have been rewritten and security vulnerabilities patched. Today, the codebase is modularized into distinct components, separating transaction validation, wallet functionality, network transport, and database handling into clean layers.</p><h3>How Bitcoin Works Under the Hood</h3><p>At its core, Bitcoin operates on an Unspent Transaction Output (UTXO) model rather than an account-based balance model. Transactions do not transfer balances directly; instead, they consume existing UTXOs as inputs and produce new UTXOs as outputs.</p><p>To spend an input, a user provides a digital signature that satisfies the cryptographic conditions defined in Bitcoin Script, a simple, non-Turing-complete smart contracting language. When nodes receive a valid transaction, it enters their local memory pool (mempool) and propagates across the network.</p><p>Miners bundle these unconfirmed transactions into blocks and perform proof-of-work, racing to find a hash below a target threshold. Once a miner finds a valid block, it broadcasts it to the network, where full nodes independently verify every rule before updating their local copy of the chainstate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5gW-z0GrskJ3Y_lPK-0qA.png" /></figure><h3>Following a Transaction Through the Code</h3><p>Tracing a transaction highlights how these components interact inside Bitcoin Core. It begins in the wallet module, where private keys generate a digital signature spending a set of UTXOs. The wallet constructs the raw transaction bytes and passes them to the node’s networking engine (net_processing).</p><p>Upon receipt, the node routes the transaction to the validation engine (validation.cpp), which executes the script interpreter (script/interpreter.cpp) to verify signature validity, checks for double-spends against the current UTXO set (coins.cpp), and verifies fee rates. If valid, the transaction is added to the node&#39;s mempool (txmempool.cpp) and relayed to connected peers.</p><p>When a miner mines a new block containing this transaction, the block is received by other nodes, validated against block-level consensus rules, and committed to local disk storage (blocks.cpp), permanently updating the chainstate database.</p><h3>Trustless Consensus and Rule Enforcement</h3><p>Bitcoin maintains consensus without central authority because every full node independently enforces every network rule. When a node receives a block or transaction, it does not trust the peer that sent it; it validates all cryptographic signatures, supply caps, block sizes, and UTXO references against its own local ruleset.</p><p>If a miner creates an invalid block; such as one containing a transaction that spends non-existent coins, every full node automatically rejects that block. The rest of the network ignores the invalid data regardless of how much hashpower the miner possesses, ensuring that rules are enforced by software execution rather than central authority.</p><h3>How Developers Maintain Bitcoin Today</h3><p>Maintaining a decentralized network requires a cautious approach to development. Changes to Bitcoin Core undergo a rigorous open-source pipeline involving public GitHub issues, code reviews, unit tests, functional test suites, and regression testing environments.</p><p>Major consensus changes or feature additions are proposed through Bitcoin Improvement Proposals (BIPs), where the broader technical community evaluates the security and architectural implications. Because no central entity can force users to run new code, protocol upgrades require broad voluntary adoption across node operators, miners, and economic entities who choose to run the updated software.</p><h3>The Global Open-Source Ecosystem</h3><p>In late 2010, Satoshi Nakamoto quietly handed over maintenance responsibilities to developer Gavin Andresen and withdrew from public involvement entirely. Far from killing the project, Satoshi’s departure proved the viability of its open-source design.</p><p>Over the years, a diverse global community of developers, security researchers, and maintainers took over the work of auditing and improving Bitcoin Core. Furthermore, the ecosystem expanded far beyond a single client, spurring the creation of alternative node implementations, specialized hardware mining software, open-source wallets, and Layer-2 scaling solutions like the Lightning Network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4ZKdFhU3As4y5OPnRtLNA.png" /></figure><h3>Getting Involved: Protecting the Network You love</h3><p>You do not need to be a senior C++ engineer to take an active role in how Bitcoin evolves and safeguards your wealth. Because Bitcoin is permissionless software, its security, decentralization, and governance rely on a broad, participatory community operating at every level like:</p><ul><li><strong>Run Your Own Full Node:</strong> Running a full node (like Bitcoin Core) ensures you independently verify your own transactions rather than trusting third-party servers. Node operators form the economic consensus network that enforces network rules and rejects invalid blocks.</li><li><strong>Participate in Mining or Solo/P2Pool Operation:</strong> Contributing hashpower, whether running home miners, joining decentralized pools, or testing open-source Stratum v2 implementations, helps secure the ledger against transaction reorganization and censorship.</li><li><strong>Review Code &amp; PRs:</strong> Anyone can read open pull requests on the Bitcoin Core repository, test proposed changes locally, and leave feedback on edge cases.</li><li><strong>Subscribe to the Bitcoin Development Mailing List:</strong> Following and participating in the Development Mailing List gives you a front-row seat to active protocol debates, proposal feedback, security advisories, and technical discussions surrounding future BIPs.</li><li><strong>Join PR Review Clubs:</strong> Participate in study groups like the <em>Bitcoin Core PR Review Club</em> to walk through code proposals alongside other developers and learners.</li><li><strong>Test Release Candidates:</strong> Download pre-release builds to test RPC endpoints, wallet features, and edge cases before new code hits mainnet.</li><li><strong>Engage in Public Protocol Discussions:</strong> Follow discussions on the Bitcoin Development Mailing List, Delving Bitcoin, or GitHub issues where architectural trade-offs and BIP proposals are debated in public.</li></ul><p>Whether your background is in node operation, QA testing, hardware management, documentation, or public debate, taking an active role ensures the software powering your financial sovereignty remains secure, decentralized, and peer-reviewed</p><h3>References</h3><ul><li><strong>Nakamoto, S. (2008).</strong> <em>Bitcoin: A Peer-to-Peer Electronic Cash System.</em></li><li><strong>Narayanan, A., &amp; Clark, J. (2017).</strong> <em>Bitcoin’s Academic Pedigree.</em> ACM Queue, 15(4), 20–35.</li><li><strong>Antonopoulos, A. M., &amp; Harding, D. A. (2023).</strong> <em>Mastering Bitcoin: Programming the Open Blockchain</em> (3rd ed.). O’Reilly Media.</li></ul><h4>Useful links</h4><ul><li><strong>Bitcoin Core GitHub Repository:</strong> <a href="https://github.com/bitcoin/bitcoin">github.com/bitcoin/bitcoin</a></li><li><strong>Official Bitcoin Improvement Proposals (BIPs) Repository:</strong> <a href="https://github.com/bitcoin/bips">github.com/bitcoin/bips</a></li><li><strong>Bitcoin Core Developer Documentation:</strong> <a href="https://bitcoincore.academy/">bitcoincore.academy</a></li><li><strong>Bitcoin Optech:</strong> <a href="https://bitcoinops.org/">bitcoinops.org</a></li><li><strong>Bitcoin Transcripts:</strong> <a href="https://btctranscripts.com/">btctranscripts.com</a></li><li><strong>Bitcoin Core PR Review Club:</strong> <a href="https://bitcoincore.reviews/">bitcoincore.reviews</a></li><li><strong>Bitcoin Dev Mailing List :</strong> <a href="https://groups.google.com/g/bitcoindev">groups.google.com/g/bitcoindev</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58e48bc1431d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Bitcoin Settles in Milliseconds: Under the Hood of a Lightning Network Payment]]></title>
            <link>https://medium.com/@nwikechisom77/how-bitcoin-settles-in-milliseconds-under-the-hood-of-a-lightning-network-payment-b3f53cce7f16?source=rss-9a9fb6e94adf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3f53cce7f16</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Chisom]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 21:32:17 GMT</pubDate>
            <atom:updated>2026-09-18T21:32:17.538Z</atom:updated>
            <content:encoded><![CDATA[<p>So, one Sunday, you are sitting at your desk trying to pay for a domain name, a book, a hosting server, or maybe a digital subscription. You get to the checkout page, and among the payment options, you see <strong>“Pay with Bitcoin.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3gI6I2L2N0_Dyoyy93-yQ.png" /></figure><p>You click it, and two options immediately show up: <strong>On-Chain</strong> or <strong>Off-Chain (Lightning).</strong></p><p>If you have spent some time around the internet and bitcoin, you probably already know which one you are going for. You click <strong>Lightning</strong>.</p><p>Why? Nobody wants to pay a significant Bitcoin network fee of up to $5 for a small $10 payment, or sit there watching a payment remain pending while waiting for a block confirmation. When you are paying for something online, you want the payment to go through and be done with it.</p><p>A QR code appears, together with a long string starting with lnbc.... That is a Lightning invoice. You open a Lightning-compatible wallet on your phone(probably the one a friend recommended last month.), tap <strong>Send</strong>, scan the QR code, or paste the invoice.</p><p>Now, notice what did <strong>not</strong> happen.</p><ul><li>You did not have to fill out a long form asking for your home address and other unnecessary details.</li><li>You did not have to start looking for a virtual dollar card or request a foreign-currency Visa or Mastercard from your bank.</li><li>You did not have to enter a 16-digit card number, expiry date, and CVV on a website you barely know, potentially exposing your payment information to phishing attacks or database leaks.</li></ul><p>Instead, your wallet reads the invoice and automatically knows the amount you need to pay in satoshis. You simply check the details and tap <strong>Confirm</strong>.</p><p>Before you can even put your phone back on the table, the browser updates:</p><p><strong>“Payment Received. Order Confirmed.”</strong></p><p>No waiting for a Bitcoin block confirmation. No need to broadcast a transaction directly to the base layer. Just a fast payment that can move across borders without depending on a traditional bank or payment processor.</p><p>And as you sit there watching your domain become active almost immediately, you may start asking yourself:</p><p><em>How did that actually happen?</em></p><p>Bitcoin is known for having roughly 10-minute block intervals, so how can a Lightning payment settle almost instantly, sometimes in milliseconds, while still using Bitcoin as its underlying monetary network?</p><p>That is where things start getting interesting.</p><p>To understand what happened behind that green <strong>“Payment Received”</strong> message, we need to look under the hood of the Bitcoin protocol and understand what Lightning is actually doing behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CGqqoAlRZExnlRI2BwFePw.png" /></figure><p>The Lightning Network is not a separate blockchain, and it does not have a separate token. It is a collection of open protocols that work on top of Bitcoin and are anchored to the Bitcoin base layer. Each part of the protocol has its own job, and together they make it possible to send Bitcoin almost instantly without giving up the security provided by Bitcoin.</p><h3>Base Protocol &amp; Transport Layer (The Secure Pipe)</h3><p>Before your wallet can send even one satoshi through the Lightning Network, it first needs a secure way to communicate with another Lightning node(a commputer/server that is running the software that connects to the lightning network). This communication happens through a private, encrypted connection.</p><p><strong>Noise_XK Protocol:</strong> Your wallet establishes an end-to-end encrypted TCP connection with another Lightning node using the <strong>Noise_XK</strong> protocol specified in <strong>BOLT #8</strong>. It uses secp256k1 keys, the same elliptic-curve cryptography used by Bitcoin, allowing nodes to authenticate each other without depending on third-party certificate authorities.</p><p><strong>Base Protocol and Message Framing:</strong> Once the connection has been established, the nodes communicate using raw binary messages defined by <strong>BOLT #1</strong>. They exchange information about the features they support using bitfields.</p><p>Lightning also follows an interesting rule known as <strong>“It’s okay to be odd.”</strong> If a node receives an odd-numbered feature that it does not understand, it can safely ignore it and continue operating. However, if it encounters an unknown even-numbered feature, it disconnects because that feature may be required for the connection to work correctly.</p><blockquote>Note: BOLT stands for Basis of Lightning Technology. The BOLTs are a collection of technical specification documents that define how different parts of the Lightning Network should work and provide developers with the rules and standards needed to build compatible Lightning software.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C1npi82_s2Erm9BAx97lwg.png" /><figcaption>Noise_XK peer-to-peer node connection</figcaption></figure><p>This approach allows the Lightning Network to keep adding new features without breaking older implementations, while still making sure that nodes do not continue a connection when they encounter a feature they are required to understand but cannot support.</p><h3>Channel Update &amp; Watchtower Layer (The Off-Chain Vault)</h3><p>Now that the secure connection between the two Lightning nodes has been established, the next question is: <strong>how do we actually move the Money off-chain and make that instant payment possible?</strong></p><p>This is where the Lightning channel comes in.</p><p><strong>The On-Chain Anchor:</strong> Before your purchase, maybe days or even weeks earlier, both parties first create a <strong>2-of-2 multisig funding transaction</strong> on the Bitcoin blockchain. This transaction locks real BTC into a shared digital vault on Layer 1. The Bitcoin is still secured by the Bitcoin blockchain, but the two parties can now update how that money should be divided without creating a new on-chain transaction every time.</p><p><strong>Asymmetric Commitment Transactions:</strong> Now, instead of broadcasting every payment or balance change to Bitcoin miners, both channel partners keep pre-signed transactions locally. These are called <strong>commitment transactions</strong>. Every time the balance changes, both parties create and sign a new state. The important part is that each side has a slightly different version of the transaction, allowing the protocol to determine who is trying to cheat if an old state is broadcast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szibB2zOoWtDh5jTB9iKKg.png" /><figcaption>Bitcoin Layer 1 to Layer 2 channel setup</figcaption></figure><p><strong>RSMC &amp; Revocation Secrets:</strong> Now imagine your peer tries to cheat by broadcasting an older channel state in which they had more Bitcoin. This is where the <strong>Revocable Sequence Maturity Contract (RSMC)</strong> comes in.</p><p>The cheating party’s funds are placed behind a timelock called to_self_delay. This gives you time to detect that an old state has been broadcast. During previous channel updates, both parties exchanged <strong>revocation secrets</strong>. These secrets allow the honest party to prove that the old state is invalid and claim the cheating party&#39;s funds as a penalty before the timelock expires.</p><p>If you are not online to notice the cheating attempt yourself, an automated third party known as a <strong>Watchtower</strong> can monitor the blockchain for you. The Watchtower can detect the old commitment transaction and use the previously provided information to help enforce the penalty.</p><p>So, even though the actual Lightning payments are happening off-chain, the Bitcoin blockchain is still there as the final security layer. The channel can move money back and forth thousands of times without putting every single payment on-chain, while the commitment and revocation system makes cheating economically dangerous.</p><h3>Routing &amp; Payment Layer (The Execution)</h3><p>So, the channel is already funded, the connection is secure, and the payment can now happen without putting a new transaction on the Bitcoin blockchain. This is where the actual payment you are making at checkout takes place.</p><p><strong>The Invoice:</strong> When you clicked <strong>“Pay,”</strong> the website generated a cryptographic payment request starting with lnbc..., as defined by <strong>BOLT #11</strong>. This invoice contains important information such as the exact amount to be paid in satoshis, an expiration time, the merchant’s node information, and a <strong>payment hash (H)</strong>. The hash is generated from a secret value called the <strong>preimage (S)</strong>, which is initially known only to the recipient.</p><p>In simple terms: H = Hash(S)</p><p>The merchant does not need to send you the secret itself. Instead, your payment can only be completed when the correct preimage is eventually revealed.</p><p><strong>Gossip Protocol and Pathfinding:</strong> Your wallet now needs to figure out how to get the payment from you to the merchant. Lightning nodes continuously share information about their channels with one another using the <strong>gossip protocol defined in BOLT #7</strong>.</p><p>Your wallet uses this information to build a local view of the Lightning Network and find a suitable route from your wallet to the merchant. The payment may not go directly to the merchant. It can pass through several other Lightning nodes along the way.</p><p><strong>Sphinx Onion Routing:</strong> Once the route has been selected, your wallet prepares the routing instructions using <strong>onion routing</strong>, as specified in <strong>BOLT #4</strong>. The routing information is wrapped in multiple layers of encryption, similar to the layers of an onion. Each intermediate node can decrypt only the part meant for it. This tells the node where to forward the payment next, but it does not reveal the complete route. So, the middle nodes do not know where the payment originally came from, and each node only sees the information it needs to forward the payment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fbl9RzRpWxZfdnL2IDfqCA.png" /><figcaption>A multi-hop network graph diagram</figcaption></figure><p><strong>Hashed and Timelock Contracts (HTLCs):</strong> Now the actual payment starts moving through the selected route. At each hop, the payment is locked behind a condition based on the same payment hash H. Each node effectively agrees to the following condition: <strong>“I will forward this payment if the next party can provide the preimage </strong><strong>S that produces the correct hash </strong><strong>Hbefore the time limit expires.” </strong>This is what allows the payment to move safely from one Lightning channel to another. If the correct preimage is revealed, the payment can be claimed. If it is not revealed before the timelock expires, the funds can safely return through the appropriate channel.</p><h3>The Final Settlement</h3><p>So, the payment has now reached the merchant. The merchant reveals the secret preimage S to claim the funds from the final hop.</p><p>Remember:</p><p>H = Hash(S)</p><p>Once the preimage is revealed, the previous node can use it to claim its own funds. The same process continues backwards through each hop until the entire payment route is settled.</p><p>And just like that, your browser blinks:</p><p><strong>“Order Confirmed.”</strong></p><p>From your side, it looked like a simple payment. Scan the QR code, tap <strong>Confirm</strong>, and the payment is done.</p><p>But underneath, a lot has happened. Encrypted connections carried the messages between nodes, Lightning channels handled the payment off-chain, onion routing kept the path private, and HTLCs used cryptographic conditions to make sure the payment could move safely from one hop to another.</p><p>The Bitcoin blockchain did not have to process a new transaction for every single payment. It remains underneath the whole system as the final settlement and security layer.</p><p>No bank approval, No 16-digit card number entered on a random website, No need to wait for a new Bitcoin block before the merchant can confirm the payment.</p><p>Just a combination of open protocols, cryptography, and Bitcoin’s underlying security working together to move money across the internet and open-source mathematics settling real value across the globe in milliseconds.</p><h3>Challenges &amp; Protocol Upgrades</h3><p>Behind that simple experience, the Lightning Network has to deal with several engineering challenges. As the network grows, developers continue to work on different ways to make payments more reliable, scalable, private, and efficient. Some of these solutions are already being used, while others are still being developed, tested, or proposed.</p><p><strong>Liquidity Management &amp; Rebalancing:</strong> Lightning payments depend on having enough liquidity on the required side of a channel. As payments move through the network, the balance of a channel can become uneven. One side may end up with most of the available liquidity while the other side has very little, making it difficult to route payments in a particular direction.</p><p>This becomes important when trying to maintain that near-instant payment experience. Even if a route exists between two nodes, the payment cannot complete if there is not enough usable liquidity along the route.</p><p>Techniques such as <strong>Submarine Swaps</strong> can move liquidity between the Bitcoin base layer and Lightning without requiring a channel to be completely closed. <strong>Splicing</strong> also provides a way to add or remove funds from an existing channel. These approaches are being used and developed to make liquidity management more flexible as the network grows.</p><p><strong>Network Topology &amp; Hub-and-Spoke Dynamics:</strong> Finding a route is another challenge. Lightning is made up of many interconnected nodes and channels, but liquidity and connectivity are not evenly distributed across the network. Some nodes become more heavily connected and may act as important routing points.</p><p>This makes <strong>pathfinding</strong> an important part of the payment process. A wallet needs to find a route with sufficient liquidity while also considering fees and the reliability of the channels along the path. Developers continue to improve routing algorithms and network connectivity to make payments more efficient and reduce excessive dependence on highly connected nodes.</p><p><strong>Security &amp; Countermeasures:</strong> The network also has to deal with attacks that can interfere with payment channels. One example is <strong>Channel Jamming</strong>, where an attacker can occupy HTLC slots with payments that take a long time to fail, potentially preventing legitimate payments from using the channel.</p><p>Other issues, including <strong>Transaction Pinning</strong>, continue to be areas of research and development. Different implementations are exploring or deploying mechanisms such as upfront unconditional fees, local reputation systems, and <strong>Route Blinding</strong> to address different reliability, denial-of-service, and privacy concerns. Not all of these approaches are universally deployed or fully standardised, so developers are still evaluating how they should work in practice.</p><p><strong>The Evolution Beyond HTLCs:</strong> Another area of ongoing development is the move beyond traditional <strong>Hash Time-Locked Contracts (HTLCs)</strong>. <strong>Point Time-Locked Contracts (PTLCs)</strong> use Schnorr signatures and related cryptographic techniques to provide a different way of constructing multi-hop payments.</p><p>PTLCs are still part of the ongoing development and evolution of Lightning rather than something that has completely replaced HTLCs across the network. Their potential benefits include improved privacy and making it more difficult to correlate the different hops of a payment.</p><h4><strong>References</strong></h4><p>Nakamoto, S. (2008). Bitcoin: A Peer-to-Peer Electronic Cash System. <br>Posen, J. (2018). Lightning BOLT by BOLT, LA Blockchain Meetup. <br>Pickhardt, R. (2019). The Update Layer (RSMCs), Chaincode Labs Lightning Residency. <br>Kirk-Cohen, C. (2019). A Walk Through the Layers of Lightning, Bitcoin Edge Dev++. <br>Mouton, E. (2021). LN Things: Creating Channels, Updating State, and HTLCs, 7DaysOfBitcoin Series. <br>Poon, J., &amp; Dryja, T. (2016). The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3f53cce7f16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecture of the Bitcoin Protocol: From Cryptographic Foundations to Layer-1 Optimisation]]></title>
            <link>https://medium.com/@nwikechisom77/architecture-of-the-bitcoin-protocol-from-cryptographic-foundations-to-layer-1-optimisation-e7056d76b081?source=rss-9a9fb6e94adf------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7056d76b081</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Chisom]]></dc:creator>
            <pubDate>Sat, 05 Sep 2026 12:57:01 GMT</pubDate>
            <atom:updated>2026-09-07T20:26:18.153Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Cryptographic Foundations &amp; Consensus Mechanics</h3><p><strong><em>Before 2008: </em></strong>Satoshi Nakamoto did not invent digital cash completely from scratch. Instead, Bitcoin was built by bringing together ideas and research from almost three decades of work in cryptography and computer science. Some of the important ideas that contributed to Bitcoin include:</p><ul><li><strong>Linked Timestamping Chains (1991–1997):</strong> Haber and Stornetta introduced the idea of using hash chains, where each record is linked to the previous one, to arrange and protect digital records without depending on a central authority or notary.</li><li><strong>Merkle Trees (1980):</strong> Ralph Merkle introduced binary hash trees, which make it possible to represent a large number of transactions using a single 32-byte root hash. This also allows the network to prove that a particular transaction is included in a set of transactions without having to process the entire list. These proofs can be done in O(log N) time.</li><li><strong>Proof-of-Work (1992–1997):</strong> Researchers such as Cynthia Dwork, Moni Naor, and Adam Back developed ideas around using computational work to control the rate at which resources could be consumed. Adam Back’s Hashcash, for example, used a partial hash-collision puzzle. In Bitcoin, this principle is applied through the condition (SHA256(block_header) less than or equall to target ). This means miners have to repeatedly change the block header and calculate its hash until they find a result that is less than or equal to the network’s target. This makes it costly to produce blocks at a very high rate and helps protect the network from attacks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYaEO8c1TCOGwEn1j0wsvA.png" /></figure><p>Nakamoto’s major breakthrough<strong> (2007- 2008) </strong>was combining this data structure with economic incentives that encourage participants to act honestly. Instead of using identity-based voting, such as “one IP address, one vote,” Bitcoin uses computing power, or hash rate, to determine who gets to contribute to the network. In simple terms, the more computing power a miner contributes, the higher their chance of successfully adding a new block. This approach, known as Nakamoto Consensus, helps Bitcoin deal with problems such as double-spending and Sybil attacks without requiring a central authority to control the network.</p><h4>Node Security Models &amp; Trade-Offs</h4><p>When participating in Bitcoin’s network, there are different types of nodes, and each one comes with its own advantages and limitations. The main differences are based on how much data the node stores, how much storage it requires, and how much the user has to trust other participants in the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iM0eFIS60lg7lqeXG54I7Q.png" /><figcaption><strong>Node Trade-off Matrix / Spectrum Diagram</strong></figcaption></figure><ul><li><strong>Archival Full Node:</strong> This type of node validates all Bitcoin consensus rules and keeps the complete history of the blockchain, starting from the Genesis Block. It requires a significant amount of storage, currently more than 600 GB on an SSD. The major advantage is that the user has full control and does not need to rely on external parties for verification.</li><li><strong>Pruned Full Node:</strong> A pruned full node also validates all Bitcoin consensus rules, just like an archival full node. However, it does not keep the entire blockchain history. Instead, it removes older block files after they have been validated while keeping the UTXO set and the necessary undo data. This reduces the storage requirement to roughly 10–20 GB. The downside is that it cannot provide old blockchain data to new nodes during their initial block download (IBD).</li><li><strong>SPV Light Client:</strong> An SPV (Simplified Payment Verification) client does not fully validate Bitcoin’s consensus rules. Instead, it mainly checks proof-of-work and the depth of blocks. It also does not store the full blockchain; it only keeps the 80-byte block headers. Because of this, its storage requirement is very small, around 100 MB. However, the trade-off is that the user has to place more trust in miners and other sources of blockchain information. It can also have privacy issues, especially when techniques such as Bloom filters are used to request transaction information.</li></ul><h3>2. Transaction Malleability &amp; Segregated Witness (BIP 141/143)</h3><h4>The Malleability Problem</h4><p>In older Bitcoin transactions, the signature information, known as scriptSig, was included directly inside the transaction input. The problem was that ECDSA signatures could be modified in certain ways without making the signature invalid. For example, the S-value of a signature could be changed using:</p><p>S’ = N — S mod N</p><p>This meant that a third party, such as another node or miner, could modify some of the signature data without affecting the validity of the transaction itself.</p><p>The bigger problem was that Bitcoin’s transaction ID, or txid, was calculated from the transaction data, including the scriptSig:</p><p>txid = SHA256d(version || inputs || outputs || locktime)</p><p>So, if someone changed the scriptSig, even though the transaction was still cryptographically valid, the transaction ID would also change.</p><p>This became a serious problem for systems that depended on the transaction ID before the transaction was confirmed on the blockchain. For example, second-layer payment systems such as the Lightning Network could create a transaction that depended on the txid of an earlier, unconfirmed transaction. If that original transaction was modified and its txid changed before confirmation, the dependent transaction could no longer reference the correct transaction.</p><p>This transaction malleability issue was therefore an important problem that had to be addressed before Bitcoin could reliably support more advanced second-layer protocols.</p><h4>The SegWit Architecture (BIP 141)</h4><p>SegWit, which means Segregated Witness, was introduced to solve the transaction malleability problem. The main idea was to separate the signature information from the main transaction data. Instead of keeping the signature data inside the transaction input, SegWit moves it into a separate section called the <strong>Witness Structure</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GbE_mVj98cdodyufH0qTbw.png" /><figcaption>Legacy Serialization vs. SegWit Extended Serialization</figcaption></figure><p>In the older Bitcoin transaction format, the structure looked like this:</p><p><strong>Legacy Transaction Format:</strong></p><p>[version] [input vector(<strong>with ScritpSig</strong>)] [Output vector] [locktime]</p><p>The transaction ID, or txid, was calculated by applying SHA256d to the entire transaction data. Because the scriptSig was part of this data, changing the signature could also change the txid.</p><p>With SegWit, the transaction is organised differently:</p><p><strong>SegWit Transaction Format:</strong></p><p>[version] [marker (0x00)] [flag(0x01)] [input (<strong>no ScritpSig</strong>)] [Output vector] [locktime]</p><p>The signature information is moved into a separate <strong>Witness Vector</strong>.</p><p>The important difference is that the normal transaction ID (txid) is calculated from the base transaction data without including the Marker, Flag, or Witness data:</p><p>txid = SHA256d(base transaction data)</p><p>The Witness data is instead used when calculating the Witness Transaction ID (wtxid) and is also included in the block&#39;s Merkle commitment.</p><p>In simple terms, SegWit separates the transaction information that identifies the transaction from the signature information used to prove that the transaction is authorised. This prevents changes to the witness data from changing the normal txid, thereby solving the transaction malleability problem and making it easier to build reliable second-layer protocols such as the Lightning Network.</p><h4>Linear Sighash Scaling (BIP 143)</h4><p>Before SegWit, Bitcoin’s signature hashing could become very expensive as the number of inputs in a transaction increased. This was because each input had to hash a large part of the transaction again. As a result, the amount of work could grow quadratically, or O(N²), with the size of the transaction.</p><p>BIP 143 improved this by introducing pre-computed double-SHA256 hashes for important parts of the transaction. These include:</p><ul><li><strong>hashPrevouts:</strong> A SHA256d hash of all the previous transaction outputs being spent by the inputs.</li><li><strong>hashSequence:</strong> A SHA256d hash of all the input nSequence values.</li><li><strong>hashOutputs:</strong> A SHA256d hash of all the transaction outputs, including their amounts and scriptPubKey data.</li></ul><p>Instead of repeatedly hashing the same information for every input, these values can be calculated once and reused. This reduced the signature hashing complexity from O(N²) to O(N).</p><p>In practical terms, this made it much harder for very large transactions to consume excessive CPU resources during validation and reduced the possibility of using transaction validation as a Denial-of-Service (DoS) attack vector against Bitcoin nodes.</p><h4>Block Capacity and Weight Units</h4><p>SegWit also changed how Bitcoin measures the size of a block. Before SegWit, blocks had a straightforward 1 MB size limit. With SegWit, Bitcoin introduced a new measurement called <strong>Weight Units (WU)</strong>, with a maximum block weight of 4,000,000 WU.</p><p>The block weight is calculated as:</p><p>Block Weight = (Base Bytes × 4) + (Witness Bytes × 1)</p><p>This means that the transaction data in the base block is given four times the weight of the witness data. Put another way, witness data receives a 75% discount when calculating block weight.</p><p>This approach encouraged users to use SegWit transactions because moving signature data into the witness section makes transactions more space-efficient under the block-weight rules.</p><p>As a result, Bitcoin can fit more transactions into a block than the old 1 MB limit would allow. Depending on the type and size of the transactions, the effective block capacity can be roughly 1.6–2.0 MB or more in practical terms.</p><p>The important point is that SegWit did not simply increase Bitcoin’s block size from 1 MB to 4 MB. Instead, it introduced a different way of measuring block capacity, giving different weights to the base transaction data and the witness data.</p><h3>3. P2P Network Propagation &amp; Mining Mechanics</h3><h4>Compact Block Relay (BIP 152)</h4><p>One of the problems Bitcoin nodes can face is the amount of time it takes to send a newly mined block across the network. If nodes have to wait too long to receive and process a complete block, it can increase network delays and the chances of stale blocks.</p><p>BIP 152, known as <strong>Compact Block Relay</strong>, was introduced to reduce this problem. Instead of sending the full block and all its transactions to another node, a node can first send a much smaller version of the block containing enough information for the receiving node to reconstruct it using transactions it already has in its mempool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oUEiNqGWcrnizO_6hONkjw.png" /></figure><p>A typical CMPCTBLOCK message contains:</p><ul><li><strong>80-byte block header:</strong> Contains the basic information about the block, including the previous block hash, timestamp, and Merkle root.</li><li><strong>Pre-filled coinbase transaction:</strong> The coinbase transaction is included because it is newly created by the miner and therefore will not normally already exist in the receiving node’s mempool.</li><li><strong>Short Transaction IDs:</strong> Instead of sending every full transaction, the block contains short 6-byte transaction identifiers generated using salted SipHash-2–4. These identifiers help the receiving node identify transactions it already has.</li></ul><h4>How the Reconstruction Works</h4><p>The process is relatively straightforward:</p><ol><li>The receiving node checks its local mempool, which contains transactions that have been received but are still waiting to be confirmed.</li><li>It calculates the corresponding short transaction IDs for the transactions in its mempool.</li><li>The node then compares these IDs with the short transaction IDs contained in the compact block.</li><li>If the node already has all the required transactions, it can reconstruct the complete block locally without requesting the full transactions from the other node. This saves bandwidth and reduces the time needed to relay the block across the network.</li><li>If the receiving node is missing some transactions, it does not need to request the entire block again. Instead, it sends a getblocktxn request asking for only the specific transactions that are missing.</li><li>The other node responds with those transactions using a blocktxn message, allowing the receiving node to complete the block reconstruction.</li></ol><p>In simple terms, Compact Block Relay works on the assumption that most nodes already have the transactions contained in a newly mined block because they received them earlier through the normal transaction relay process. Rather than sending the same transactions again, the network sends short identifiers and only sends the transactions that are actually missing.</p><p>This helps reduce bandwidth usage, speed up block propagation, and reduce the chances of blocks becoming stale because of network delays.</p><h4>Decoupling Mining Pools via Braidpool &amp; FROST</h4><p>Traditional peer-to-peer mining pools have a major challenge when it comes to paying a large number of miners. If a pool has thousands of miners, the coinbase transaction may need to contain many different payout outputs. This can take up valuable block space and make the pool less efficient.</p><p>Newer decentralised approaches, such as <strong>Braidpool</strong>, try to solve this problem by combining two important technologies:</p><ul><li><strong>DAG of Weak Blocks:</strong> Instead of recording every miner’s share directly as a normal Bitcoin block, miners submit lower-difficulty blocks, often referred to as <strong>weak blocks</strong>. These shares are organised into a Directed Acyclic Graph (DAG). This makes it possible to keep track of miners’ contributions more efficiently and helps reduce payout variance, especially for smaller miners who may otherwise wait for a long time before receiving rewards.</li><li><strong>FROST Threshold Schnorr Signatures:</strong> FROST (<em>Flexible Round-Optimized Schnorr Threshold Signatures</em>) allows multiple miners to work together to produce a single Schnorr signature. With this approach, payouts can be controlled by a single N-of-N threshold arrangement rather than creating a separate on-chain output for every miner.</li></ul><p>The miners can coordinate and combine their signatures off-chain. As a result, the Bitcoin blockchain only needs to deal with a single, constant-sized payout output instead of having to include thousands of individual outputs.</p><p>In simple terms, the idea is to move most of the coordination and accounting between miners off-chain while keeping the actual on-chain footprint small. This can make decentralised mining pools more scalable without allowing the number of miners in the pool to directly translate into a much larger coinbase transaction.</p><h3>4. Advanced Scripting: Taproot, Schnorr &amp; MAST (BIP 340/341/342)</h3><h4>Taproot</h4><p>Taproot was activated on the Bitcoin network at block 709,632. It introduced three major changes that improved how Bitcoin handles smart contracts and more complex spending conditions.</p><p>At the centre of Taproot is the <strong>Taproot Output Key (Q)</strong>. It is created by combining an internal public key (P) with a tweak derived from the internal key and the Merkle root of the script tree.</p><p>In simple terms:</p><p>Internal Key (P) + TapTweak(P, Merkle Root) = Taproot Output Key (Q)</p><p>The Merkle root represents the different scripts that can be used to spend the Bitcoin.</p><p>For example, a setup could have:</p><ul><li><strong>Script A:</strong> A 2-of-3 multisignature escrow condition.</li><li><strong>Script B:</strong> A timelock recovery condition.</li></ul><p>These different conditions are organised into a Merkle tree. However, they do not all have to be revealed when the Bitcoin is spent.</p><h4>a. Schnorr Signatures (BIP 340)</h4><p>Taproot introduced Schnorr signatures as the new signature scheme for Taproot outputs, replacing ECDSA for this part of the protocol.</p><p>Schnorr signatures are 64 bytes and have useful mathematical properties that make signature aggregation possible. With key aggregation techniques such as MuSig, multiple participants can combine their public keys and signatures so that an N-of-N arrangement can appear on-chain like a normal single-key spend.</p><p>This improves both privacy and efficiency because observers do not necessarily need to know that multiple parties were involved in the transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1vDBcuYjUKwpS8UGCAmFg.png" /><figcaption>A <strong>Taproot Merkle Tree Architecture Diagram</strong>.</figcaption></figure><h4>b. MAST (Merkleized Alternative Script Trees)</h4><p>Taproot also uses Merkle trees to organise different spending conditions. Instead of putting every possible condition directly into the transaction, each condition is stored as a separate leaf in the Merkle tree.</p><p>For example:</p><ul><li>Leaf 1 → 2-of-3 escrow</li><li>Leaf 2 → Timelock recovery</li></ul><p>If a user spends through one of these script conditions, they only need to reveal the script that was actually used together with the necessary Merkle proof showing that the script belongs to the original tree.</p><p>The other unused spending conditions remain hidden. This improves privacy and can also reduce the amount of data that needs to be included in the transaction.</p><h4>c. Key-Path Spending</h4><p>Taproot also provides a simpler way to spend the funds when all the required parties agree.</p><p>If everyone agrees on the outcome, they can use the aggregated internal key (P) to create the required Schnorr signature. The transaction can then be spent through the <strong>key path</strong> without revealing or executing any of the scripts in the Merkle tree.</p><p>From the perspective of someone looking at the blockchain, this can appear similar to a normal single-signature Taproot spend.</p><p>This is one of the major advantages of Taproot: complicated spending conditions can exist behind the scenes, but when the participants can agree and use the key path, those conditions do not need to be revealed on-chain. This can improve privacy while also saving transaction fees.</p><h4>Key Technical References &amp; Specifications</h4><ol><li>Nakamoto, S. (2008). <em>Bitcoin: A Peer-to-Peer Electronic Cash System.</em></li><li>Wuille, P., Lombrozo, E., &amp; Lau, J. (2015). <em>BIP 141: Segregated Witness (Consensus layer).</em></li><li>Corallo, M. (2016). <em>BIP 152: Compact Block Relay.</em></li><li>Wuille, P., Nick, J., &amp; Townes, T. (2020). <em>BIP 341: Taproot: SegWit version 1 spending rules.</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7056d76b081" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding Bitcoin with Rust: What I Learned from BTCdemy]]></title>
            <link>https://medium.com/@nwikechisom77/decoding-bitcoin-with-rust-what-i-learned-from-btcdemy-84c4acd8e3aa?source=rss-9a9fb6e94adf------2</link>
            <guid isPermaLink="false">https://medium.com/p/84c4acd8e3aa</guid>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[btrust]]></category>
            <dc:creator><![CDATA[Chisom]]></dc:creator>
            <pubDate>Fri, 26 Jun 2026 17:44:23 GMT</pubDate>
            <atom:updated>2026-06-26T17:44:23.548Z</atom:updated>
            <content:encoded><![CDATA[<p>Bitcoin is built on code that absolutely cannot fail. When bugs mean lost funds, developers need a programming language that treats security, memory safety, and performance as non-negotiable. That is exactly why the global Bitcoin open-source community is moving rapidly toward <strong>Rust</strong>.</p><p>I recently completed <strong>The Bitcoiner’s Intro to Rust</strong> course on BTCdemy. The course completely reframed how I think about building secure financial infrastructure. Here is a breakdown of what I built and the core concepts I learned.</p><h3>🛠️ The Capstone: Building a Raw Transaction Decoder</h3><p>Rather than just studying syntax, the core of the course focuses on a real-world, hands-on project: <strong>building a raw Bitcoin transaction decoder from scratch</strong>.</p><p>If you have ever used Bitcoin Core, this tool functions just like the bitcoin-cli decoderawtransaction command. I learned how to:</p><ul><li>Take a raw, serialized hexadecimal string representing a Bitcoin transaction.</li><li>Parse the inputs, outputs, scripts, and witnesses.</li><li>Format and print out human-readable transaction details.</li></ul><p>Working with bare bytes forced me to see exactly how Bitcoin structures data under the hood while using Rust to parse it safely.</p><h3>🧠 Key Technical Takeaways</h3><p>Rust is famously strict, but it feels like pairing up with a highly precise senior developer. During the course, I mastered several foundational concepts:</p><h3>1. Ownership and Memory Structure</h3><ul><li><strong>The Stack and the Heap:</strong> I learned how Rust manages data layouts. Rust leans heavily on the stack by default to maximize speed and remove overhead.</li><li><strong>References and Borrowing:</strong> Instead of copying huge transaction payloads in memory, I learned how to pass safe references. Rust guarantees these references are always valid without needing a slow garbage collector.</li></ul><h3>2. Robust Type Safety and Traits</h3><ul><li><strong>Type Systems:</strong> Bitcoin codebases are packed with values that look identical but have different meanings (like satoshis vs. BTC, or TXIDs vs. Block Hashes). Rust’s strict type system ensures you cannot accidentally mix them up.</li><li><strong>Traits:</strong> I explored how traits allow different data structures to share behavior, making the decoder code modular and reusable.</li></ul><h3>3. Bulletproof Error Handling</h3><ul><li><strong>No Null Values:</strong> Rust uses Option&lt;T&gt; and Result&lt;T, E&gt; to handle situations where data might be missing or corrupted.</li><li>Parsing raw hex data can easily crash software if a byte is misplaced. Rust’s strict error-handling patterns forced me to safely account for every edge case before the code could even compile.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H5wHzYrrbi7g5C0Rx66mfg.png" /></figure><h3>🌍 The Bigger Picture: Why Rust is the Future of Bitcoin</h3><p>Writing a transaction decoder opened my eyes to why major open-source Bitcoin protocols are rewriting their tech stacks in Rust. The skills from this course translate directly to core open-source projects like:</p><ul><li><a href="https://github.com/rust-bitcoin/rust-bitcoin"><strong>rust-bitcoin</strong></a><strong>:</strong> The underlying library powering Rust-based Bitcoin applications.</li><li><strong>BDK (Bitcoin Dev Kit):</strong> For building highly secure wallets.</li><li><strong>LDK (Lightning Dev Kit):</strong> For creating lightning-fast, lightweight layer-2 nodes.</li><li><strong>Fedimint:</strong> For building collaborative custody communities.</li></ul><h3>🏁 Conclusion</h3><p>The BTCdemy course was the perfect bridge between theory and production-grade software development. It showed me that while Rust has a steep learning curve, the safety and speed it rewards you with are exactly what the future of global, decentralized money requires.</p><p>If you are a programmer looking to move closer to real Bitcoin code, I highly recommend checking out this course!</p><p>I also want to give a big thank you to BTrust. While it’s not the main focus of this article, BTrust provided the foundation and structured learning pathway that made up the other vital part of my learning experience, with the BTCdemy course being one of the learning materials in the Live Rust for Bitcoiners pathway. The ecosystem is doing incredible work equipping builders for this space. If you are a developer who is brand new to Bitcoin or looking to take your interest to the next level, I highly recommend joining the BTrust community and it is the perfect place to start.</p><h3>🔗 Helpful Links</h3><ul><li><strong>Course:</strong> <a href="https://btcdemy.thinkific.com/">BTCdemy Intro to Rust</a></li><li><strong>BTrust Learning &amp; Ecosystem:</strong> <a href="https://pathways.btrust.tech/">BTrust Builders Pathways</a> | <a href="https://blog.btrust.tech/">BTrust Blog</a></li><li><strong>Others:</strong> <a href="https://learnmeabitcoin.com/beginners/">https://learnmeabitcoin.com/beginners/</a> | <a href="https://doc.rust-lang.org/book/title-page.html">https://doc.rust-lang.org/book/title-page.html</a> |</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84c4acd8e3aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Local Layer-2 Bitcoin Sandbox: A Full-Stack Walkthrough of LND, LndHub, and Channel…]]></title>
            <link>https://medium.com/@nwikechisom77/building-a-local-layer-2-bitcoin-sandbox-a-full-stack-walkthrough-of-lnd-lndhub-and-channel-b977de76a53c?source=rss-9a9fb6e94adf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b977de76a53c</guid>
            <category><![CDATA[node]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[lightning-network]]></category>
            <dc:creator><![CDATA[Chisom]]></dc:creator>
            <pubDate>Sun, 24 May 2026 14:48:59 GMT</pubDate>
            <atom:updated>2026-05-24T14:48:59.606Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Local Layer-2 Bitcoin Sandbox: A Full-Stack Walkthrough of LND, LndHub, and Channel Liquidity</h3><p>Testing Bitcoin applications on public testnets or signets introduces unwanted variables: rate-limited faucets, unpredictable block times, and external network latency. For developers building consumer-facing Lightning interfaces, engineering a local, deterministic playground is the only way to rapidly iterate on user experience and edge-case error states.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A4-0wDe5ya4hJKbvIPwoDQ.jpeg" /></figure><p>This technical case study documents the setup of a localized Layer-2 Bitcoin banking infrastructure running entirely inside an isolated environment on a single machine. It covers the core architectural stack, the implementation of an accounting wrapper API, and a deep-dive breakdown of the fundamental L1/L2 liquidity mechanics encountered during initial testing.</p><h3>The Architectural Stack</h3><p>To achieve instant, zero-fee settlement behavior locally, the environment separates the architecture into three discrete components: the base blockchain ledger, the peer-to-peer routing engine, and the multi-tenant database translation layer.</p><h3>1. Base Layer: Bitcoin Core (regtest)</h3><p>At the bottom of the stack sits a native Bitcoin Core instance running in regression test mode (regtest). Unlike mainnet or testnet, regtest does not synchronize with a public peer network. Instead, it allows the local system to instantly mine blocks on-demand. This provides complete control over the underlying blockchain state, enabling immediate confirmation of channel-opening transactions and on-chain funding outputs.</p><h3>2. Layer-2 Infrastructure: LND (Node 1)</h3><p>Operating on top of the base ledger is an LND (Lightning Network Daemon) instance acting as the primary hub (Node 1). LND handles the heavy lifting of the peer-to-peer Lightning protocol: tracking channel states, managing cryptographic commitment transactions, and monitoring the base blockchain for potential routing fraud. Node 1 connects to the system via high-performance binary gRPC streams rather than text-based REST endpoints, ensuring minimal transport latency and reliable event-driven data streaming.</p><h3>3. Multi-Tenant Accounting Bridge: LndHub</h3><p>LND is fundamentally designed as a single-user daemon; whoever holds its administrative credentials controls the absolute node balance. To serve multiple front-end user accounts from this single node, a Node.js LndHub wrapper API is introduced, backed by a persistent Redis cache layer.</p><p>LndHub changes the custody model: it interacts with Node 1 as the master node administrator but exposes a separate REST API to client applications. When a client requests a wallet layout, LndHub generates a virtual sub-wallet, tracking internal user balances inside its Redis ledger while utilizing the physical node’s liquidity channels to execute actual on-chain and off-chain movements.</p><h3>Connecting the Flow: App Simulation to Node Hub</h3><p>With the backend stack initialized and listening locally (http://127.0.0.1:3000), a mobile client application simulator can be pointed directly at the custom LndHub API gateway.</p><p>I pointed the mobile app simulator directly to the local LndHub instance and initialized a new virtual session, generating a standard 1,000 satoshi BOLT 11 invoice. The mobile interface successfully displayed the payment string and its corresponding QR code payload, confirming that the front-end rendering layer and the LndHub accounting ledger were successfully bridging state changes.</p><p>To test the payment execution lifecycle, an external, isolated node (Node 2) was introduced into the local network topology. Node 2 was pre-loaded with an on-chain confirmed wallet balance of 1,000,000 satoshis. However, attempting to pay the 1,000 satoshi invoice directly from Node 2’s base wallet balance resulted in an immediate, hard routing failure: FAILURE_REASON_INSUFFICIENT_BALANCE.</p><h3>The Core Concept: On-Chain Balance vs. Outbound Liquidity</h3><p>This failure highlights the fundamental technical divide between Layer-1 ledger accounting and Layer-2 state-channel routing.</p><p>On-chain balances exist as Unspent Transaction Outputs (UTXOs) locked on the base blockchain. They cannot be routed instantly across the Lightning Network because they have not been committed to a peer-to-peer payment channel. To move satoshis off-chain, capital must be locked into a multi-signature smart contract explicitly binding two peer nodes together.</p><p>To establish the required routing path:</p><ol><li>A dedicated Lightning payment channel with a capacity of 250,000 satoshis was opened from Node 2 targeting Node 1.</li><li>A local block was immediately mined via the regtest engine to confirm the channel-funding transaction on the base blockchain.</li><li>Mining this block shifted Node 2’s capital from a static on-chain UTXO into an active, off-chain <strong>outbound liquidity lane</strong>. Node 2 now held 250,000 satoshis on its local side of the channel ledger, spendable instantly across the network graph.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b977de76a53c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>