Micro-transaction channels Corné Plooy
Contents Uni-directional micro-transaction channels Bi-directional micro-transaction channels Unlimited lifetime micro-transaction channels Lightning and Amiko Pay
A Bitcoin transaction Amount TxID Amount ScriptPubKey Index ScriptSig Amount ScriptPubKey Amount ScriptPubKey TxID Index ScriptSig Amount ScriptPubKey Amount ScriptPubKey Amount ScriptPubKey Amount ScriptPubKey
Example: WiFi hot-spot 80 minutes Internet 0.8 mBTC
Example: WiFi hot-spot 1 mBTC 80 minutes Internet 0.2 mBTC
Example: WiFi hot-spot 1 minute Internet 0.01 mBTC 1 minute Internet 0.01 mBTC 1 minute Internet 0.01 mBTC
Micro-transaction channels B 1 mBTC to A
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Withdraw: 1 mBTC to A 0 mBTC to B
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Send transaction Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 1 mBTC to A 0 mBTC to B
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Send signature Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 1 mBTC to A 0 mBTC to B B B
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Withdraw: 1 mBTC to A 0 mBTC to B B
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Send transaction Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 0.99 mBTC to A 0.01 mBTC to B B A
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Send transaction Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 0.98 mBTC to A 0.02 mBTC to B B A
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Send transaction Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 0.2 mBTC to A 0.8 mBTC to B B A
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 0.2 mBTC to A 0.8 mBTC to B B B A
Micro-transaction channels B 1 mBTC to A Deposit: 1 mBTC to A+B A Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 0.2 mBTC to A 0.8 mBTC to B A B A
Micro-transaction channels B 1 mBTC to A Lock time Deposit: 1 mBTC to A+B A Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 0.2 mBTC to A 0.8 mBTC to B B A
Questions? A B 1 mBTC to A Deposit: 1 mBTC to A+B Withdraw: 0 mBTC to B Withdraw: 0.2 mBTC to A 0.8 mBTC to B B A
Example: Bitcoin exchange 3 BTC 2 BTC 5 BTC
Example: Bitcoin exchange Withdraw: 10 BTC to A 0 BTC to B B 10 BTC to A B Withdraw: 7 BTC to A 3 BTC to B Deposit: 10 BTC to A+B A A
Example: Bitcoin exchange Withdraw: 10 BTC to A 0 BTC to B B 10 BTC to A B Withdraw: 7 BTC to A 3 BTC to B Deposit: 10 BTC to A+B A A Withdraw: 9 BTC to A 1 BTC to B ???? ?
Example: Bitcoin exchange Withdraw: 10 BTC to A 0 BTC to B B 10 BTC to A B Withdraw: 7 BTC to A 3 BTC to B Deposit: 10 BTC to A+B A A Withdraw: 9 BTC to A 1 BTC to B ???? B
Bi-directional channel Withdraw: 10 BTC to A 0 BTC to B B 10 BTC to A B Withdraw: 7 BTC to A 3 BTC to B Deposit: 10 BTC to A+B A A Withdraw: 9 BTC to A 1 BTC to B B
Questions? A B Withdraw: 10 BTC to A 0 BTC to B 10 BTC to A Withdraw: Deposit: 10 BTC to A+B A A Withdraw: 9 BTC to A 1 BTC to B B
Lock times Amount TxID Amount ScriptSig Index ScriptSig ScriptPubKey
Lock times TxID Amount Index Amount ScriptSig ScriptPubKey ScriptSig SequenceNr Amount ScriptSig Amount ScriptSig Amount ScriptSig TxID Index ScriptPubKey SequenceNr Amount ScriptSig Amount ScriptSig LockTime Amount ScriptSig
Lock times OP_CHECKLOCKTIMEVERIFY OP_CHECKSEQUENCEVERIFY TxID Amount ScriptSig TxID Index ScriptPubKey SequenceNr Amount ScriptSig Amount ScriptSig Amount ScriptSig TxID Index ScriptPubKey SequenceNr Amount ScriptSig Amount ScriptSig LockTime Amount ScriptSig OP_CHECKLOCKTIMEVERIFY OP_CHECKSEQUENCEVERIFY
OP_CHECKLOCKTIMEVERIFY A 1 mBTC to A B Deposit: 1 mBTC to A+B A Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 0.3 mBTC to A 0.7 mBTC to B Withdraw: 0.2 mBTC to A 0.8 mBTC to B B A A
OP_CHECKLOCKTIMEVERIFY A 1 mBTC to A B Deposit: 1 mBTC to: (A AND CLTV) OR (A AND B) A Withdraw: 1 mBTC to A 0 mBTC to B Withdraw: 0.3 mBTC to A 0.7 mBTC to B Withdraw: 0.2 mBTC to A 0.8 mBTC to B A A
Unlimited lifetime channel 10 BTC A A B 10 BTC A AND B A 8 BTC A AND CSV OR B AND RA 2 BTC B 8 BTC A 2 BTC B AND CSV OR A AND RB B A ... ... Relative lock time
Unlimited lifetime channel 10 BTC A A B 10 BTC A AND B A 8 BTC A AND CSV OR B AND RA 2 BTC B 8 BTC A 2 BTC B AND CSV OR A AND RB B A
Unlimited lifetime channel 10 BTC A A B 10 BTC A AND B A 8 BTC A AND CSV OR B AND RA 2 BTC B 8 BTC A 2 BTC B AND CSV OR A AND RB B A 6 BTC A AND CSV OR B AND RA' 4 BTC B 6 BTC A 4 BTC B AND CSV OR A AND RB' B A
Unlimited lifetime channel 10 BTC A A B 10 BTC A AND B A 8 BTC A AND CSV OR B AND RA 2 BTC B 8 BTC A 2 BTC B AND CSV OR A AND RB B A 6 BTC A AND CSV OR B AND RA' 4 BTC B 6 BTC A 4 BTC B AND CSV OR A AND RB' RA + B A
Regularly check your channel! 10 BTC A A B 10 BTC A AND B A 10 BTC A AND CSV OR B AND RA 0 BTC B 10 BTC A 0 BTC B AND CSV OR A AND RB B A 1 BTC A AND CSV OR B AND RA' 9 BTC B 1 BTC A 9 BTC B AND CSV OR A AND RB' RA + B A
Regularly check your channel! 10 BTC A A B 10 BTC A AND B A 10 BTC A AND CSV OR B AND RA 0 BTC B 10 BTC A 0 BTC B AND CSV OR A AND RB A B A 1 BTC A AND CSV OR B AND RA' 9 BTC B 1 BTC A 9 BTC B AND CSV OR A AND RB' RA + B A
Regularly check your channel! 10 BTC A A B 10 BTC A AND B A 10 BTC A AND CSV OR B AND RA 0 BTC B A B
Regularly check your channel! 10 BTC A A B 10 BTC A AND B A 10 BTC A AND CSV OR B AND RA 0 BTC B A B 10 BTC A 10 BTC B A RA B
Regularly check your channel! 10 BTC A A B 10 BTC A AND B A 10 BTC A AND CSV OR B AND RA 0 BTC B A B 10 BTC A 10 BTC B 1 BTC A 9 BTC B A RA B RA B
Questions? A B 10 BTC A 10 BTC A AND B A 10 BTC A AND CSV OR B AND RA
Lightning / Amiko Pay
Lightning / Amiko Pay
Lightning / Amiko Pay
Lightning / Amiko Pay
Lightning / Amiko Pay H H H t+1day t+3days H t+2days H t+4days R = random() H = hash(R)
Lightning / Amiko Pay Hash Time Locked Contract (HTLC) H H H t+1day t+3days H t+2days H t+4days R = random() H = hash(R) Hash Time Locked Contract (HTLC)
A AND CHECKLOCKTIMEVERIFY HTLC A AND CHECKLOCKTIMEVERIFY OR B AND R R = random() H = hash(R)
C-Lightning channel design 10 BTC A A B 10 BTC A AND B A 6 BTC A AND CSV OR B AND RA 2 BTC R AND B OR CLTV AND CSV AND A B AND RA 2 BTC B 6 BTC A 2 BTC R AND B AND CSV OR CLTV AND A A AND RB 2 BTC B AND CSV OR A AND RB B A
Questions? A B 10 BTC A 10 BTC A AND B A 6 BTC A AND CSV OR B AND RA R AND B OR CLTV AND CSV AND A B AND RA 2 BTC B 6 BTC A 2 BTC R AND B AND CSV OR CLTV AND A A AND RB 2 BTC B AND CSV OR A AND RB B A
1Cj3pyT1VDGK1g4DF5epbG4DL7rXAvzFwe Thank you http://cornwarecjp.github.io/amiko-pay 1Cj3pyT1VDGK1g4DF5epbG4DL7rXAvzFwe
Scripts A AND CSV OR B AND RA OP_HASH160 <H(RA)> OP_EQUAL OP_IF <key B> OP_ELSE <delay> OP_CHECKSEQUENCEVERIFY OP_DROP <key A> OP_ENDIF OP_CHECKSIG
Scripts OR CLTV AND A B AND RA R AND CSV AND B OP_HASH160 OP_DUP <H(R)> OP_EQUAL OP_IF <delay> OP_CHECKSEQUENCEVERIFY OP_2DROP <key B> OP_ELSE <H(RA)> OP_EQUAL OP_NOTIF <HTLC timeout> OP_CHECKLOCKTIMEVERI FY OP_DROP OP_ENDIF <key A> OP_CHECKSIG
Scripts OR CLTV AND CSV AND A B AND RA R AND B OP_HASH160 OP_DUP <H(R)> OP_EQUAL OP_SWAP <H(RA)> OP_EQUAL OP_ADD OP_IF <key B> OP_ELSE <HTLC timeout> OP_CHECKLOCKTIMEVERIFY <delay> OP_CHECKSEQUENCEVERIFY OP_2DROP <key A> OP_ENDIF OP_CHECKSIG