Table of Contents

Bitcoin Whitepaper Notes

The bitcoin protocol can encompass the global fiinancial transaction volume in all electronic payment systems today, without a single custodial third party holding funds or requiring participants to have anything more than a computer using a broadband connection.

A decentralized system is proposed whereby transactions are sent over a network of micropayment channels whose transfer of value occurs off-blockchain to scale the system.

1. Centralization Concerns:

The payment network Visa achieved 47,000 peak transactions per second (tps) on its network during the 2013 holidays. On 2016, bitcoin supports less than 7 transactions per second with a 1 megabyte block limit. If we use an average of 300 bytes per bitcoin transaction and assumed unlimited block sizes, an equivalent capacity to peak Visa transaction volume of 47,000/tps would be nearly 8 gigabytes per Bitcoin block. The scalability issue indirectly encouraged centralization. As the cost and technical requirements of running a full node increased (due to larger blockchain size and more transactions to process), fewer individuals and organizations were able to participate, potentially leading to a more centralized network.

Extremely large blocks, for example in the above case of 8 gigabytes every 10 minutes on average, would imply that only a few parties would be able to do block validation. This creates a great possibility that entities will end up trusting centralized parties.

2. Increasing Confirmation Times and Transaction Fees:

With more transactions vying for limited space in each block, many transactions were left waiting in the mempool. This situation led to longer waiting times for transaction confirmations, especially if the transaction fee attached was relatively low. This demand led to higher transaction fees, as users would bid more to have their transactions included in the next block. High fees made Bitcoin less attractive for small, everyday transactions, limiting its utility as a digital currency.

“If a tree falls in the forest and no one is around to hear it, does it make a sound?” In the context of Lightning Network transactions, if both parties in a payment channel agree on their final balance, does it matter to the rest of the network how they arrived at that balance?

if only two participants care about an everyday recurring transaction, it’s not necessary for all other nodes in the bitcoin network to know about that transaction. It is instead preferable to only have the bare minimum of information on the blockchain.

Using a network of these micropayment channels can scale to billions of transactions per day. Micropayment channels use real bitcoin transactions, which only electing to defer the broadcast to the blockchain in such a way that both parties can guarantee their current balance on the blockchain.

This system allows two parties maintain a financial relationship by creating micropayment channels without needing to trust each other or a third party.

3. QUESTION: What if one side disagress about the current balance of funds?

4. ANSWER: Cryptographic Mechanisims

The foundation of trust in the Lightning Network lies in its use of cryptographic protocols. These protocols ensure that transactions can only be made with the consent of the parties involved.

4.1. In a micropayment channel, both parties must sign off on a transaction for it to be valid.

4.2. When two parties in a Lightning Network channel agree to update the balance in their chennel, they signed a new transactions representing this updated balance.

4.3. At the same time, parties also create special cryptographic keys known as revocation keys, by exchanging keys. both parties acknowledge that the previous state is no longer valid.

By exchanging revocation secrets, each party assures the other that they will not attempt to cheat by using an old state. If they do, the other party can use the revocation secret to penalize them, typically by claiming all the funds in the channel. Trustless security – neither party needs to trust the other not to cheat because the consequences of cheating are automatically enforced by the protocol.

4.4. Hash TimeLock Contract (HTLC)

HTLC plays a crucial role in determining when funds can be spent after a transaction is broadcast. An HTLC is a type of smart contract used in various blockchain protocols. It enables the conditional transfer of cryptocurrencies between parties, based on the fulfillment of certain pre-defined criteria: "Match the hashlock or Exceeding certain time period (timelock)"

4.4.1. Hashlock

  1. Case: Routed Payment throught Intermediates

    Imagine Alice wants to send payment to Bob, but they don't have a direct channel between them. Instead, they are connected through an intermediary, say Carol. The channel setup looks like this: Alice --(Channel 1)--> Carol --(Channel 2)--> Bob

    1. 1. Creating the Hashlock:

      Alice generates a secret (a random number) and then computes its hash (let's call this H). She keeps the secret but shares H with Bob.

    2. 2. Initiating the Payment

      Alice sends a payment to Carol in Channel 1, but this payment is conditional. It can only be claimed by Carol if she can produce the secret that hashes to H. Carol, in turn, forwards the payment to Bob in Channel 2, again conditionally requiring the same secret.

    3. 3. Completing the Payment:

      Bob, knowing the secret because Alice sent it to him, reveals it to Carol to claim the payment in Channel 2.

  2. Conditional Payment

    The payment is contingent upon revealing the correct secret. If the secret is not revealed, the funds are not transferred. This ensures that Bob (Who knows the shared Hashlock) must be involved for the transaction to complete.

  3. Atomicity

    The transaction is atomic; it either fully happens or doesn’t happen at all. Carol can only claim her funds (transaction fee) from Alice if she successfully forwards the funds to Bob.

4.4.2. Timelock

  1. Case: Malicious Old State Broadcast

    In a channel between Bob and Alice, when Bob broadcasts an old state to the mainchain, the timelock mechanism serves as a safeguard for Alice. It ensures that there is a predefined time period during which Alice can contest this broadcast by submitting proof of a more recent state. Here is how does it works:

    1. Before Timelock Expires:

      If Alice is online and notices the fraudulent activity, she can submit a newer state to the network within this timeframe. The network will then accept this newer state instead of the old one broadcast by Bob and penalize him.

    2. If Alice Doesn't Respond:

      If Alice is offline or doesn't respond before the timelock expires, the network will process Bob's transaction as valid. This means the old state becomes the accepted state, and the funds are transferred according to that state.

      During the timelock period, the funds are essentially in limbo. They are in Bob's account, but Bob cannot use them until the network resolves the state. (either by accepting Alice's newer state or defaulting to Bob's state after the timelock expires).

  2. Security Against Fraud:

    In the Case: Routed Payment throught Intermediates: If Carol tries to keep the funds without forwarding them to Bob, she won’t be able to claim them because she doesn’t know the secret. The funds will eventually return to Alice after the timelock expires.

4.5. Automated Monitoring Tools

Despite everything, there is still a minimal possibility in which a malicious user can take advantage of the counterparty’s offline period, broadcasting an old transaction without the other part being able to do anything within the timelock deadline (as he/she is offline).

The monitoring service or software keeps track of the latest state of the user's payment channels. If it detects a transaction that does not match the latest state (indicating a potential fraudulent action), it will automatically respond.

4.6. "The sidechain do not have consensus mechanisims (PoW/PoS), only cryptographoc security."

5. ANSWER: We do not need to trust the node of sidechain, cryptographic mechanisims is enough.

6. Follow-up: Then why do we need PoW/PoS in the layer 1 of blockchain other since cryptographic security would worked alone?

6.1. Off-chain solutions generally involve agreements between a much smaller number of parties and don't require network-wide consensus.

6.2. PoW and PoS are mechanisms designed to achieve consensus across a decentralized network, involving potentially thousands or millions of participants (mainchain).

Imagine if there is no consensus mechanisims in the mainchain, and instead the system rely solely on a majority of nodes validating transactions before appending them to the mainchain. Several significant challenges and risks would arise:

6.2.1. 1. Sybil Attacks:

Without a consensus mechanism like PoW or PoS, the network would be vulnerable to Sybil attacks, where an attacker creates a large number of pseudonymous identities and uses them to gain a disproportionate influence over the network. PoW and PoS provide a barrier to this by requiring significant computational resources or stake ownership, respectively.

6.2.2. 2. 51% Attacks:

In a system where blocks are added after validation by a majority, a 51% attack could be more feasible, especially if there aren't significant barriers to gaining a majority (like the computational power in PoW or economic stake in PoS).

6.2.3. Immutable Record Keeping:

One of the key features of blockchain is the immutability of its records. Formal consensus mechanisms ensure that once a block is added to the chain, reversing this addition becomes computationally or financially infeasible. Without such mechanisms, the immutability of the blockchain could be compromised.

7. Cryptographic Security Alone is Not Enough, in both mainchain and sidechain.

While cryptographic techniques are vital for securing transactions and data on the blockchain, they don't address issues like network consensus, transaction finality, and equitable participation in the validation process. These aspects are crucial for the overall functioning and security of a blockchain.

7.1. Why also in sidechain?

Off-chain solutions like the Lightning Network still depend on the security and integrity of the mainchain. They settle their final state on the blockchain, relying on its consensus mechanism to ensure this final state is accurately and immutably recorded.

In the Lightning Network (LN), to start transacting - whether using direct channels or through routing. Each participant must first have at least one open channel with another participant. This initial step requires interaction with the Bitcoin mainchain.

Created: 2024-10-28 Mon 19:26

Validate