The Bitcoin blockchain

  • Event-driven architecture
  • Stores Bitcoin transactions
  • Alice sends 0.1 BTC to Bob
  • Balances are implicit
  • Past transactions are never changed
  • Broadcast network

A Bitcoin Transaction

Transaction Details

A Bitcoin Transaction

Transaction Details

Spending outputs

  • Outputs become inputs of its child transaction
  • Outputs have a script that needs to be satisfied
  • That script is often just a signature
  • Can have other requirements, e.g. timelock
  • May also require multiple signatures

MultiSig/MuSig

  • m-of-n signatures are required
  • 3-of-5 = 5 privKeys are authorized to sign, 3 of them are required
  • 2-of-2 = 2 privKeys are authorized, both are required

Lightning channels [setup]

  • Are based on a 2-of-2 MultiSig
  • Alice and Bob put 1 Bitcoin onto a 2-of-2 multisig
  • Alice gives 0.5 Bitcoin, Bob too
  • They broadcast that transaction [tx]
  • Both Alice AND Bob need to sign to spend the money
  • Both Alice and Bob sign a spending tx (of their 2-of-2 multisig), that sends 0.5 BTC to Alice and 0.5 BTC to Bob
  • They do NOT broadcast that tx, but keep it stored on their machines

Lightning channels [use 1]

  • Alice wants to pay Bob 0.1 BTC
  • Alice and Bob sign another spending transaction that sends 0.4 to Alice and 0.6 to Bob
  • They do NOT broadcast that tx, but keep it stored on their machines

Lightning channels [use 2]

  • Alice wants to pay Bob 0.1 BTC again
  • Alice and Bob sign another spending transaction that sends 0.3 to Alice and 0.7 to Bob
  • They do NOT broadcast that tx, but keep it stored on their machines

Lightning channels [use 3]

  • Bob wants to pay Alice 0.3 BTC again
  • Alice and Bob sign another spending transaction that sends 0.6 to Alice and 0.4 to Bob
  • They do NOT broadcast that tx, but keep it stored on their machines

Lightning channels [close]

  • Alice and Bob want to close their channel
  • Now they broadcast the last spending transaction they've stored on their machine
  • In this case, Alice receives 0.6 BTC and Bob 0.4

Overview

Transaction Details

Benefits

  • Only the settlement transaction is broadcasted to the world
  • Gain in efficiency and privacy
  • Channels can stay open forever!