More Schnorr Tricks for Bitcoin Yannick Seurin Agence nationale de - - PowerPoint PPT Presentation

more schnorr tricks for bitcoin
SMART_READER_LITE
LIVE PREVIEW

More Schnorr Tricks for Bitcoin Yannick Seurin Agence nationale de - - PowerPoint PPT Presentation

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion More Schnorr Tricks for Bitcoin Yannick Seurin Agence nationale de la scurit des systmes dinformation November 22, 2018 BlockSem Seminar


slide-1
SLIDE 1

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

More Schnorr Tricks for Bitcoin

Yannick Seurin

Agence nationale de la sécurité des systèmes d’information

November 22, 2018 — “BlockSem” Seminar

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 1 / 40

slide-2
SLIDE 2

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Motivation: improving efficiency and privacy

  • Bitcoin script allows to specify (pretty sophisticated) conditions for

spending a transaction output

  • allows very nice applications, but:
  • scripts are recorded forever in the blockchain

→ goes against space efficiency and privacy

  • scripts must be validated by all nodes

→ goes against computational efficiency

  • coins have a distinguished “history”

→ goes against fungibility (all coins should be “equivalent”)

  • we will see how Schnorr signatures can help make things better
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 2 / 40

slide-3
SLIDE 3

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Motivation: improving efficiency and privacy

  • Bitcoin script allows to specify (pretty sophisticated) conditions for

spending a transaction output

  • allows very nice applications, but:
  • scripts are recorded forever in the blockchain

→ goes against space efficiency and privacy

  • scripts must be validated by all nodes

→ goes against computational efficiency

  • coins have a distinguished “history”

→ goes against fungibility (all coins should be “equivalent”)

  • we will see how Schnorr signatures can help make things better
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 2 / 40

slide-4
SLIDE 4

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Motivation: improving efficiency and privacy

  • Bitcoin script allows to specify (pretty sophisticated) conditions for

spending a transaction output

  • allows very nice applications, but:
  • scripts are recorded forever in the blockchain

→ goes against space efficiency and privacy

  • scripts must be validated by all nodes

→ goes against computational efficiency

  • coins have a distinguished “history”

→ goes against fungibility (all coins should be “equivalent”)

  • we will see how Schnorr signatures can help make things better
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 2 / 40

slide-5
SLIDE 5

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Motivation: improving efficiency and privacy

  • Bitcoin script allows to specify (pretty sophisticated) conditions for

spending a transaction output

  • allows very nice applications, but:
  • scripts are recorded forever in the blockchain

→ goes against space efficiency and privacy

  • scripts must be validated by all nodes

→ goes against computational efficiency

  • coins have a distinguished “history”

→ goes against fungibility (all coins should be “equivalent”)

  • we will see how Schnorr signatures can help make things better
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 2 / 40

slide-6
SLIDE 6

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Motivation: improving efficiency and privacy

  • Bitcoin script allows to specify (pretty sophisticated) conditions for

spending a transaction output

  • allows very nice applications, but:
  • scripts are recorded forever in the blockchain

→ goes against space efficiency and privacy

  • scripts must be validated by all nodes

→ goes against computational efficiency

  • coins have a distinguished “history”

→ goes against fungibility (all coins should be “equivalent”)

  • we will see how Schnorr signatures can help make things better
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 2 / 40

slide-7
SLIDE 7

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Motivation: improving efficiency and privacy

  • Bitcoin script allows to specify (pretty sophisticated) conditions for

spending a transaction output

  • allows very nice applications, but:
  • scripts are recorded forever in the blockchain

→ goes against space efficiency and privacy

  • scripts must be validated by all nodes

→ goes against computational efficiency

  • coins have a distinguished “history”

→ goes against fungibility (all coins should be “equivalent”)

  • we will see how Schnorr signatures can help make things better
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 2 / 40

slide-8
SLIDE 8

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Outline

Bitcoin Script Refresher: Schnorr Signatures and MuSig Taproot Scriptless Scripts Discreet Log Contracts Conclusion

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 3 / 40

slide-9
SLIDE 9

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Outline

Bitcoin Script Refresher: Schnorr Signatures and MuSig Taproot Scriptless Scripts Discreet Log Contracts Conclusion

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 4 / 40

slide-10
SLIDE 10

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Bitcoin transactions: UTXO model

A Bitcoin transaction spends inputs and creates outputs:

  • an input consists of a reference to an output of a previous

transaction and a signature authorizing spending of this output

  • an output consists of an amount and a public key

txid: e62b0a. . . Inputs Outputs

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 5 / 40

slide-11
SLIDE 11

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Bitcoin transactions: UTXO model

A Bitcoin transaction spends inputs and creates outputs:

  • an input consists of a reference to an output of a previous

transaction and a signature authorizing spending of this output

  • an output consists of an amount and a public key

txid: e62b0a. . . Inputs Outputs prevOut: {txid = 29a5c7. . . , ind=3} sig: 3f4de6. . . 3 BTC prevOut: {txid = 63ba6f. . . , ind=1} sig: f7b6c4. . . 1 BTC prevOut: {txid = e953b0. . . , ind=7} sig: fbb521. . . 5 BTC

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 5 / 40

slide-12
SLIDE 12

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Bitcoin transactions: UTXO model

A Bitcoin transaction spends inputs and creates outputs:

  • an input consists of a reference to an output of a previous

transaction and a signature authorizing spending of this output

  • an output consists of an amount and a public key

txid: e62b0a. . . Inputs Outputs prevOut: {txid = 29a5c7. . . , ind=3} sig: 3f4de6. . . 3 BTC prevOut: {txid = 63ba6f. . . , ind=1} sig: f7b6c4. . . 1 BTC prevOut: {txid = e953b0. . . , ind=7} sig: fbb521. . . 5 BTC val: 4 BTC pubKey: 601b3a. . . val: 4 BTC pubKey: d781a3. . .

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 5 / 40

slide-13
SLIDE 13

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Programmable money: Bitcoin script

  • output public keys and input signatures are actually scripts
  • output: scriptPubKey, input: scriptSig
  • concatenated script scriptSig scriptPubKey must execute correctly
  • stack-based language designed for Bitcoin, inspired by Forth
  • 256 instructions (15 disabled, 75 reserved):
  • basic arithmetic, logic (if/then), data handling
  • cryptographic operations (hash and signature verification)
  • no loops, Turing-incomplete
  • limits on time/memory required for execution (no halting problem)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 6 / 40

slide-14
SLIDE 14

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-15
SLIDE 15

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey

sig

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-16
SLIDE 16

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey

sig pubKey

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-17
SLIDE 17

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey

sig pubKey pubKey

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-18
SLIDE 18

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey

sig pubKey pubKeyHash’

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-19
SLIDE 19

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey

sig pubKey pubKeyHash’ pubKeyHash

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-20
SLIDE 20

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey

sig pubKey

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-21
SLIDE 21

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-22
SLIDE 22

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Example: Pay-to-Public-Key-Hash (P2PKH)

sig pubKey

  • scriptSig

OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

  • scriptPubKey
  • Bitcoin “address” = RIPEMD-160(SHA-256(public key)) encoded

in Base58Check format (starts with a ’1’)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 7 / 40

slide-23
SLIDE 23

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-24
SLIDE 24

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-25
SLIDE 25

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-26
SLIDE 26

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-27
SLIDE 27

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-28
SLIDE 28

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-29
SLIDE 29

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-30
SLIDE 30

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-31
SLIDE 31

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-32
SLIDE 32

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-33
SLIDE 33

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Other useful instructions

  • m-of-n MULTISIG:
  • scriptPubKey contains n public keys
  • scriptSig must provide m ≤ n valid signatures for m out of n of

these public keys

  • many applications (multi-authentication wallet, escrow, etc.)
  • OP_RETURN:
  • makes output unspendable
  • used to put arbitrary data in the blockchain
  • Lock-time:
  • output unspendable until some time in the future
  • absolute (CLTV) or relative (CSV)
  • application: payment channels, Lightning Network
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 8 / 40

slide-34
SLIDE 34

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Hash Time-Lock Contract (HTLC)

  • Hash Time-Locked Contracts HTLC(h, X1, τ, X2):

OP_IF OP_SHA256 h OP_EQUALVERIFY X1 OP_CHECKSIG OP_ELSE τ OP_CLTV OP_DROP X2 OP_CHECKSIG OP_ENDIF

  • in words, such a output can be spent either
  • with y such that SHA256(y) = h and a signature under X1
  • OR after time τ with a signature under X2
  • used in the Lightning Network for payment channels and routing
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 9 / 40

slide-35
SLIDE 35

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Hash Time-Lock Contract (HTLC)

  • Hash Time-Locked Contracts HTLC(h, X1, τ, X2):

OP_IF OP_SHA256 h OP_EQUALVERIFY X1 OP_CHECKSIG OP_ELSE τ OP_CLTV OP_DROP X2 OP_CHECKSIG OP_ENDIF

  • in words, such a output can be spent either
  • with y such that SHA256(y) = h and a signature under X1
  • OR after time τ with a signature under X2
  • used in the Lightning Network for payment channels and routing
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 9 / 40

slide-36
SLIDE 36

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Hash Time-Lock Contract (HTLC)

  • Hash Time-Locked Contracts HTLC(h, X1, τ, X2):

OP_IF OP_SHA256 h OP_EQUALVERIFY X1 OP_CHECKSIG OP_ELSE τ OP_CLTV OP_DROP X2 OP_CHECKSIG OP_ENDIF

  • in words, such a output can be spent either
  • with y such that SHA256(y) = h and a signature under X1
  • OR after time τ with a signature under X2
  • used in the Lightning Network for payment channels and routing
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 9 / 40

slide-37
SLIDE 37

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-38
SLIDE 38

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-39
SLIDE 39

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-40
SLIDE 40

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-41
SLIDE 41

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-42
SLIDE 42

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-43
SLIDE 43

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-44
SLIDE 44

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-45
SLIDE 45

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-46
SLIDE 46

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-47
SLIDE 47

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Atomic (cross-chain) swaps [Nol13]

  • allows trading without a trusted party
  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice (public key XA) and Bob (public key XB) proceed as follows:
  • Bob chooses random y and sends h = SHA256(y) to Alice
  • Bob sends 100 litecoins to HTLC(XA, h, XB, τB)
  • Alice sends 1 bitcoin to HTLC(XB, h, XA, τA)
  • Bob claims Alice’s bitcoin, revealing y
  • Alice can claim Bob’s 100 litecoins using y
  • if anything goes wrong, parties can get funds back after τA/τB
  • τB must be significantly later than τA (otherwise Bob could claim

both HTLC outputs between τB and τA)

  • problem: not private at all, the payments can be linked with y
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 10 / 40

slide-48
SLIDE 48

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Automated bounties

  • What does the following scriptPubKey?

OP_2DUP OP_EQUAL OP_NOT OP_VERIFY OP_SHA1 OP_SWAP OP_SHA1 OP_EQUAL

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 11 / 40

slide-49
SLIDE 49

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Automated bounties

  • What does the following scriptPubKey?

OP_2DUP OP_EQUAL OP_NOT OP_VERIFY OP_SHA1 OP_SWAP OP_SHA1 OP_EQUAL

  • scriptSig = m1 m2 returns True if

m1 = m2 and SHA1(m1) = SHA1(m2)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 11 / 40

slide-50
SLIDE 50

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Automated bounties

  • What does the following scriptPubKey?

OP_2DUP OP_EQUAL OP_NOT OP_VERIFY OP_SHA1 OP_SWAP OP_SHA1 OP_EQUAL

  • scriptSig = m1 m2 returns True if

m1 = m2 and SHA1(m1) = SHA1(m2)

  • bounty created in Sept. 2013 by P. Todd

(https://bitcointalk.org/index.php?topic=293382.0)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 11 / 40

slide-51
SLIDE 51

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Outline

Bitcoin Script Refresher: Schnorr Signatures and MuSig Taproot Scriptless Scripts Discreet Log Contracts Conclusion

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 12 / 40

slide-52
SLIDE 52

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Signature scheme: definition

A signature scheme consists of three algorithms:

  • 1. key generation algorithm Gen:
  • returns a public/secret key pair (pk, sk)
  • 2. signature algorithm Sign:
  • takes as input a secret key sk and a message m
  • returns a signature σ
  • 3. verification algorithm Ver:
  • takes as input a public key pk, a message m, and a signature σ
  • returns 1 if the signature is valid and 0 otherwise

Correctness property: ∀(pk, sk) ← Gen, ∀m, Ver

pk, m, Sign(sk, m) = 1

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 13 / 40

slide-53
SLIDE 53

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Signature scheme: definition

A signature scheme consists of three algorithms:

  • 1. key generation algorithm Gen:
  • returns a public/secret key pair (pk, sk)
  • 2. signature algorithm Sign:
  • takes as input a secret key sk and a message m
  • returns a signature σ
  • 3. verification algorithm Ver:
  • takes as input a public key pk, a message m, and a signature σ
  • returns 1 if the signature is valid and 0 otherwise

Correctness property: ∀(pk, sk) ← Gen, ∀m, Ver

pk, m, Sign(sk, m) = 1

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 13 / 40

slide-54
SLIDE 54

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Mathematical background

Cyclic group and generator

Let G be an abelian group of order p. An element G ∈ G is called a generator if G

def

= {0G, 1G, 2G, . . .} = G. If G is a generator, then for any X ∈ G, there exists a unique x ∈ {0, . . . , p − 1} such that X = xG.

Discrete logarithm problem

Given X ∈ G, find x ∈ {0, . . . , p − 1} such that X = xG. NB: with multiplicative notation, xG ∼ Gx

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 14 / 40

slide-55
SLIDE 55

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Mathematical background

Cyclic group and generator

Let G be an abelian group of order p. An element G ∈ G is called a generator if G

def

= {0G, 1G, 2G, . . .} = G. If G is a generator, then for any X ∈ G, there exists a unique x ∈ {0, . . . , p − 1} such that X = xG.

Discrete logarithm problem

Given X ∈ G, find x ∈ {0, . . . , p − 1} such that X = xG. NB: with multiplicative notation, xG ∼ Gx

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 14 / 40

slide-56
SLIDE 56

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Schnorr signatures [Sch89, Sch91]

  • public parameters:
  • a cyclic group G of prime order p and a generator G
  • a hash function H
  • key generation:
  • secret key x ←$ Zp
  • public key X = xG
  • signature: on input m and x,
  • draw r ←$ Zp and compute R = rG
  • compute c = H(X, R, m) and s = r + cx mod p
  • output σ = (R, s)
  • verification: on input X, m and σ = (R, s),
  • compute c = H(X, R, m) and check sG

?

= R + cX

  • alternative:
  • signature σ = (c, s)
  • verification: compute R = sG − cX and check H(X, R, m)

?

= c

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 15 / 40

slide-57
SLIDE 57

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Schnorr signatures [Sch89, Sch91]

  • public parameters:
  • a cyclic group G of prime order p and a generator G
  • a hash function H
  • key generation:
  • secret key x ←$ Zp
  • public key X = xG
  • signature: on input m and x,
  • draw r ←$ Zp and compute R = rG
  • compute c = H(X, R, m) and s = r + cx mod p
  • output σ = (R, s)
  • verification: on input X, m and σ = (R, s),
  • compute c = H(X, R, m) and check sG

?

= R + cX

  • alternative:
  • signature σ = (c, s)
  • verification: compute R = sG − cX and check H(X, R, m)

?

= c

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 15 / 40

slide-58
SLIDE 58

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Schnorr signatures [Sch89, Sch91]

  • public parameters:
  • a cyclic group G of prime order p and a generator G
  • a hash function H
  • key generation:
  • secret key x ←$ Zp
  • public key X = xG
  • signature: on input m and x,
  • draw r ←$ Zp and compute R = rG
  • compute c = H(X, R, m) and s = r + cx mod p
  • output σ = (R, s)
  • verification: on input X, m and σ = (R, s),
  • compute c = H(X, R, m) and check sG

?

= R + cX

  • alternative:
  • signature σ = (c, s)
  • verification: compute R = sG − cX and check H(X, R, m)

?

= c

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 15 / 40

slide-59
SLIDE 59

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Schnorr signatures [Sch89, Sch91]

  • public parameters:
  • a cyclic group G of prime order p and a generator G
  • a hash function H
  • key generation:
  • secret key x ←$ Zp
  • public key X = xG
  • signature: on input m and x,
  • draw r ←$ Zp and compute R = rG
  • compute c = H(X, R, m) and s = r + cx mod p
  • output σ = (R, s)
  • verification: on input X, m and σ = (R, s),
  • compute c = H(X, R, m) and check sG

?

= R + cX

  • alternative:
  • signature σ = (c, s)
  • verification: compute R = sG − cX and check H(X, R, m)

?

= c

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 15 / 40

slide-60
SLIDE 60

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Schnorr signatures [Sch89, Sch91]

  • public parameters:
  • a cyclic group G of prime order p and a generator G
  • a hash function H
  • key generation:
  • secret key x ←$ Zp
  • public key X = xG
  • signature: on input m and x,
  • draw r ←$ Zp and compute R = rG
  • compute c = H(X, R, m) and s = r + cx mod p
  • output σ = (R, s)
  • verification: on input X, m and σ = (R, s),
  • compute c = H(X, R, m) and check sG

?

= R + cX

  • alternative:
  • signature σ = (c, s)
  • verification: compute R = sG − cX and check H(X, R, m)

?

= c

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 15 / 40

slide-61
SLIDE 61

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-62
SLIDE 62

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-63
SLIDE 63

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-64
SLIDE 64

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-65
SLIDE 65

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-66
SLIDE 66

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-67
SLIDE 67

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-68
SLIDE 68

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-69
SLIDE 69

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • assume n signers with public keys {X1 = x1G, . . . , Xn = xnG} want

to sign the same message m

  • they compute an aggregate key
  • X :=

n

  • i=1

µiXi with µi = H({X1, . . . , Xn}, Xi)

  • signature protocol:
  • signers draw nonces Ri = riG and send commitments hi = H′(Ri)
  • signers exchange nonces Ri
  • signers compute R = n

i=1 Ri and c = H(

X, R, m)

  • signers compute and exchange partial signatures si = ri + cµixi
  • signers compute s = n

i=1 si mod p

  • the multi-signature is σ = (R, s)
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 16 / 40

slide-70
SLIDE 70

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • verification: (R, s) is a valid signature for m under

X if sG = R + H( X, R, m) X

  • correctness proof:

sG =

n

  • i=1

siG =

  • riG

R

+H( X, R, m)

  • µixiG
  • X
  • same as standard Schnorr signature for public key

X!

  • secure in the plain public key model:
  • no assumption on how participants choose their public keys
  • multipliers µi = H({X1, . . . , Xn}, Xi) prevent rogue key attacks
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 17 / 40

slide-71
SLIDE 71

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • verification: (R, s) is a valid signature for m under

X if sG = R + H( X, R, m) X

  • correctness proof:

sG =

n

  • i=1

siG =

  • riG

R

+H( X, R, m)

  • µixiG
  • X
  • same as standard Schnorr signature for public key

X!

  • secure in the plain public key model:
  • no assumption on how participants choose their public keys
  • multipliers µi = H({X1, . . . , Xn}, Xi) prevent rogue key attacks
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 17 / 40

slide-72
SLIDE 72

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • verification: (R, s) is a valid signature for m under

X if sG = R + H( X, R, m) X

  • correctness proof:

sG =

n

  • i=1

siG =

  • riG

R

+H( X, R, m)

  • µixiG
  • X
  • same as standard Schnorr signature for public key

X!

  • secure in the plain public key model:
  • no assumption on how participants choose their public keys
  • multipliers µi = H({X1, . . . , Xn}, Xi) prevent rogue key attacks
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 17 / 40

slide-73
SLIDE 73

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • verification: (R, s) is a valid signature for m under

X if sG = R + H( X, R, m) X

  • correctness proof:

sG =

n

  • i=1

siG =

  • riG

R

+H( X, R, m)

  • µixiG
  • X
  • same as standard Schnorr signature for public key

X!

  • secure in the plain public key model:
  • no assumption on how participants choose their public keys
  • multipliers µi = H({X1, . . . , Xn}, Xi) prevent rogue key attacks
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 17 / 40

slide-74
SLIDE 74

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • verification: (R, s) is a valid signature for m under

X if sG = R + H( X, R, m) X

  • correctness proof:

sG =

n

  • i=1

siG =

  • riG

R

+H( X, R, m)

  • µixiG
  • X
  • same as standard Schnorr signature for public key

X!

  • secure in the plain public key model:
  • no assumption on how participants choose their public keys
  • multipliers µi = H({X1, . . . , Xn}, Xi) prevent rogue key attacks
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 17 / 40

slide-75
SLIDE 75

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MuSig: Multi-signatures supporting key aggregation

  • verification: (R, s) is a valid signature for m under

X if sG = R + H( X, R, m) X

  • correctness proof:

sG =

n

  • i=1

siG =

  • riG

R

+H( X, R, m)

  • µixiG
  • X
  • same as standard Schnorr signature for public key

X!

  • secure in the plain public key model:
  • no assumption on how participants choose their public keys
  • multipliers µi = H({X1, . . . , Xn}, Xi) prevent rogue key attacks
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 17 / 40

slide-76
SLIDE 76

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: replacing OP_CHECKMULTISIG

  • using MuSig, an n-of-n multisig output for public keys

{X1, . . . , Xn} can be replaced by a standard P2PKH output for the aggregate key X

  • this improves both efficiency and privacy
  • one public key and one signature to store and verify

(versus n pk and n sigs)

  • individual public keys are never revealed
  • the multisig output is indistinguishable from a standard P2PKH
  • utput
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 18 / 40

slide-77
SLIDE 77

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: replacing OP_CHECKMULTISIG

  • using MuSig, an n-of-n multisig output for public keys

{X1, . . . , Xn} can be replaced by a standard P2PKH output for the aggregate key X

  • this improves both efficiency and privacy
  • one public key and one signature to store and verify

(versus n pk and n sigs)

  • individual public keys are never revealed
  • the multisig output is indistinguishable from a standard P2PKH
  • utput
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 18 / 40

slide-78
SLIDE 78

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: replacing OP_CHECKMULTISIG

  • using MuSig, an n-of-n multisig output for public keys

{X1, . . . , Xn} can be replaced by a standard P2PKH output for the aggregate key X

  • this improves both efficiency and privacy
  • one public key and one signature to store and verify

(versus n pk and n sigs)

  • individual public keys are never revealed
  • the multisig output is indistinguishable from a standard P2PKH
  • utput
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 18 / 40

slide-79
SLIDE 79

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: replacing OP_CHECKMULTISIG

  • using MuSig, an n-of-n multisig output for public keys

{X1, . . . , Xn} can be replaced by a standard P2PKH output for the aggregate key X

  • this improves both efficiency and privacy
  • one public key and one signature to store and verify

(versus n pk and n sigs)

  • individual public keys are never revealed
  • the multisig output is indistinguishable from a standard P2PKH
  • utput
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 18 / 40

slide-80
SLIDE 80

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: replacing OP_CHECKMULTISIG

  • using MuSig, an n-of-n multisig output for public keys

{X1, . . . , Xn} can be replaced by a standard P2PKH output for the aggregate key X

  • this improves both efficiency and privacy
  • one public key and one signature to store and verify

(versus n pk and n sigs)

  • individual public keys are never revealed
  • the multisig output is indistinguishable from a standard P2PKH
  • utput
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 18 / 40

slide-81
SLIDE 81

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Outline

Bitcoin Script Refresher: Schnorr Signatures and MuSig Taproot Scriptless Scripts Discreet Log Contracts Conclusion

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 19 / 40

slide-82
SLIDE 82

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

P2SH (Pay-to-Script-Hash)

  • new type of transaction activated in 2012 (BIP 16)
  • output only contains a hash of the actual scriptPubKey (redeem

script) acting as a (binding) commitment

  • spending the output requires the redeem script and a valid

signature script

  • advantages:
  • the sender does not need to know the redeem script when creating

the transaction (only the hash)

  • all P2SH addresses “look the same”
  • redeem scripts not contained in the UTXO set anymore (only

revealed when spending an output)

  • P2SH addresses start with a ’3’
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 20 / 40

slide-83
SLIDE 83

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

P2SH (Pay-to-Script-Hash)

  • new type of transaction activated in 2012 (BIP 16)
  • output only contains a hash of the actual scriptPubKey (redeem

script) acting as a (binding) commitment

  • spending the output requires the redeem script and a valid

signature script

  • advantages:
  • the sender does not need to know the redeem script when creating

the transaction (only the hash)

  • all P2SH addresses “look the same”
  • redeem scripts not contained in the UTXO set anymore (only

revealed when spending an output)

  • P2SH addresses start with a ’3’
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 20 / 40

slide-84
SLIDE 84

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

P2SH (Pay-to-Script-Hash)

  • new type of transaction activated in 2012 (BIP 16)
  • output only contains a hash of the actual scriptPubKey (redeem

script) acting as a (binding) commitment

  • spending the output requires the redeem script and a valid

signature script

  • advantages:
  • the sender does not need to know the redeem script when creating

the transaction (only the hash)

  • all P2SH addresses “look the same”
  • redeem scripts not contained in the UTXO set anymore (only

revealed when spending an output)

  • P2SH addresses start with a ’3’
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 20 / 40

slide-85
SLIDE 85

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

P2SH (Pay-to-Script-Hash)

  • new type of transaction activated in 2012 (BIP 16)
  • output only contains a hash of the actual scriptPubKey (redeem

script) acting as a (binding) commitment

  • spending the output requires the redeem script and a valid

signature script

  • advantages:
  • the sender does not need to know the redeem script when creating

the transaction (only the hash)

  • all P2SH addresses “look the same”
  • redeem scripts not contained in the UTXO set anymore (only

revealed when spending an output)

  • P2SH addresses start with a ’3’
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 20 / 40

slide-86
SLIDE 86

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

P2SH (Pay-to-Script-Hash)

  • new type of transaction activated in 2012 (BIP 16)
  • output only contains a hash of the actual scriptPubKey (redeem

script) acting as a (binding) commitment

  • spending the output requires the redeem script and a valid

signature script

  • advantages:
  • the sender does not need to know the redeem script when creating

the transaction (only the hash)

  • all P2SH addresses “look the same”
  • redeem scripts not contained in the UTXO set anymore (only

revealed when spending an output)

  • P2SH addresses start with a ’3’
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 20 / 40

slide-87
SLIDE 87

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

P2SH (Pay-to-Script-Hash)

  • new type of transaction activated in 2012 (BIP 16)
  • output only contains a hash of the actual scriptPubKey (redeem

script) acting as a (binding) commitment

  • spending the output requires the redeem script and a valid

signature script

  • advantages:
  • the sender does not need to know the redeem script when creating

the transaction (only the hash)

  • all P2SH addresses “look the same”
  • redeem scripts not contained in the UTXO set anymore (only

revealed when spending an output)

  • P2SH addresses start with a ’3’
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 20 / 40

slide-88
SLIDE 88

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

P2SH (Pay-to-Script-Hash)

  • new type of transaction activated in 2012 (BIP 16)
  • output only contains a hash of the actual scriptPubKey (redeem

script) acting as a (binding) commitment

  • spending the output requires the redeem script and a valid

signature script

  • advantages:
  • the sender does not need to know the redeem script when creating

the transaction (only the hash)

  • all P2SH addresses “look the same”
  • redeem scripts not contained in the UTXO set anymore (only

revealed when spending an output)

  • P2SH addresses start with a ’3’
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 20 / 40

slide-89
SLIDE 89

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

P2SH (Pay-to-Script-Hash)

  • new type of transaction activated in 2012 (BIP 16)
  • output only contains a hash of the actual scriptPubKey (redeem

script) acting as a (binding) commitment

  • spending the output requires the redeem script and a valid

signature script

  • advantages:
  • the sender does not need to know the redeem script when creating

the transaction (only the hash)

  • all P2SH addresses “look the same”
  • redeem scripts not contained in the UTXO set anymore (only

revealed when spending an output)

  • P2SH addresses start with a ’3’
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 20 / 40

slide-90
SLIDE 90

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MAST (Merkelized Abstract Syntax Trees) [RNS14]

  • credited to R. O’Connor and P. Wuille, not deployed yet
  • scripts are usually an OR of several conditions
  • put all disjunctions in a Merkel tree
  • output contains the Merkle root
  • to spend a MAST output, the input must contain one of the

disjunctions Si, a Merkle proof, and a valid scriptSig for Si

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 21 / 40

slide-91
SLIDE 91

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MAST (Merkelized Abstract Syntax Trees) [RNS14]

  • credited to R. O’Connor and P. Wuille, not deployed yet
  • scripts are usually an OR of several conditions
  • put all disjunctions in a Merkel tree
  • output contains the Merkle root
  • to spend a MAST output, the input must contain one of the

disjunctions Si, a Merkle proof, and a valid scriptSig for Si

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 21 / 40

slide-92
SLIDE 92

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MAST (Merkelized Abstract Syntax Trees) [RNS14]

  • credited to R. O’Connor and P. Wuille, not deployed yet
  • scripts are usually an OR of several conditions
  • put all disjunctions in a Merkel tree
  • output contains the Merkle root
  • to spend a MAST output, the input must contain one of the

disjunctions Si, a Merkle proof, and a valid scriptSig for Si

Root Hash0,1 Hash2,3 Hash0 Hash1 Hash2 Hash3 S0 S1 S2 S3

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 21 / 40

slide-93
SLIDE 93

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MAST (Merkelized Abstract Syntax Trees) [RNS14]

  • credited to R. O’Connor and P. Wuille, not deployed yet
  • scripts are usually an OR of several conditions
  • put all disjunctions in a Merkel tree
  • output contains the Merkle root
  • to spend a MAST output, the input must contain one of the

disjunctions Si, a Merkle proof, and a valid scriptSig for Si

Root Hash0,1 Hash2,3 Hash0 Hash1 Hash2 Hash3 S0 S1 S2 S3

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 21 / 40

slide-94
SLIDE 94

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MAST (Merkelized Abstract Syntax Trees) [RNS14]

  • credited to R. O’Connor and P. Wuille, not deployed yet
  • scripts are usually an OR of several conditions
  • put all disjunctions in a Merkel tree
  • output contains the Merkle root
  • to spend a MAST output, the input must contain one of the

disjunctions Si, a Merkle proof, and a valid scriptSig for Si

Root Hash0,1 Hash2,3 Hash0 Hash1 Hash2 Hash3 S0 S1 S2 S3

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 21 / 40

slide-95
SLIDE 95

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

MAST (Merkelized Abstract Syntax Trees) [RNS14]

  • credited to R. O’Connor and P. Wuille, not deployed yet
  • scripts are usually an OR of several conditions
  • put all disjunctions in a Merkel tree
  • output contains the Merkle root
  • to spend a MAST output, the input must contain one of the

disjunctions Si, a Merkle proof, and a valid scriptSig for Si

Root Hash0,1 Hash2,3 Hash0 Hash1 Hash2 Hash3 S0 S1 S2 S3

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 21 / 40

slide-96
SLIDE 96

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: description

  • propose by G. Maxwell [Max18]
  • in practice, redeem scripts often have a unanimity clause:

(n parties agree to sign)

  • n-of-n multisig

OR (some more complex conditions)

  • script S
  • can be achieved indistinguishably from a standard P2PKH output
  • let

X be the MuSig aggregate key for the n parties

  • output uses public key Y =

X + H( X, S)G

  • two ways to spend the output:
  • the n parties agree to sign with Y (one of them simply adds a

corrective term cH( X, S) to its partial signature si) ⇒ looks like a normal P2PKH spending, S remains forever private

X and S are revealed and a scriptSig S′ is provided; valid if

  • X + H(

X, S)G = Y and S′S returns True

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 22 / 40

slide-97
SLIDE 97

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: description

  • propose by G. Maxwell [Max18]
  • in practice, redeem scripts often have a unanimity clause:

(n parties agree to sign)

  • n-of-n multisig

OR (some more complex conditions)

  • script S
  • can be achieved indistinguishably from a standard P2PKH output
  • let

X be the MuSig aggregate key for the n parties

  • output uses public key Y =

X + H( X, S)G

  • two ways to spend the output:
  • the n parties agree to sign with Y (one of them simply adds a

corrective term cH( X, S) to its partial signature si) ⇒ looks like a normal P2PKH spending, S remains forever private

X and S are revealed and a scriptSig S′ is provided; valid if

  • X + H(

X, S)G = Y and S′S returns True

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 22 / 40

slide-98
SLIDE 98

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: description

  • propose by G. Maxwell [Max18]
  • in practice, redeem scripts often have a unanimity clause:

(n parties agree to sign)

  • n-of-n multisig

OR (some more complex conditions)

  • script S
  • can be achieved indistinguishably from a standard P2PKH output
  • let

X be the MuSig aggregate key for the n parties

  • output uses public key Y =

X + H( X, S)G

  • two ways to spend the output:
  • the n parties agree to sign with Y (one of them simply adds a

corrective term cH( X, S) to its partial signature si) ⇒ looks like a normal P2PKH spending, S remains forever private

X and S are revealed and a scriptSig S′ is provided; valid if

  • X + H(

X, S)G = Y and S′S returns True

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 22 / 40

slide-99
SLIDE 99

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: description

  • propose by G. Maxwell [Max18]
  • in practice, redeem scripts often have a unanimity clause:

(n parties agree to sign)

  • n-of-n multisig

OR (some more complex conditions)

  • script S
  • can be achieved indistinguishably from a standard P2PKH output
  • let

X be the MuSig aggregate key for the n parties

  • output uses public key Y =

X + H( X, S)G

  • two ways to spend the output:
  • the n parties agree to sign with Y (one of them simply adds a

corrective term cH( X, S) to its partial signature si) ⇒ looks like a normal P2PKH spending, S remains forever private

X and S are revealed and a scriptSig S′ is provided; valid if

  • X + H(

X, S)G = Y and S′S returns True

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 22 / 40

slide-100
SLIDE 100

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: description

  • propose by G. Maxwell [Max18]
  • in practice, redeem scripts often have a unanimity clause:

(n parties agree to sign)

  • n-of-n multisig

OR (some more complex conditions)

  • script S
  • can be achieved indistinguishably from a standard P2PKH output
  • let

X be the MuSig aggregate key for the n parties

  • output uses public key Y =

X + H( X, S)G

  • two ways to spend the output:
  • the n parties agree to sign with Y (one of them simply adds a

corrective term cH( X, S) to its partial signature si) ⇒ looks like a normal P2PKH spending, S remains forever private

X and S are revealed and a scriptSig S′ is provided; valid if

  • X + H(

X, S)G = Y and S′S returns True

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 22 / 40

slide-101
SLIDE 101

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: description

  • propose by G. Maxwell [Max18]
  • in practice, redeem scripts often have a unanimity clause:

(n parties agree to sign)

  • n-of-n multisig

OR (some more complex conditions)

  • script S
  • can be achieved indistinguishably from a standard P2PKH output
  • let

X be the MuSig aggregate key for the n parties

  • output uses public key Y =

X + H( X, S)G

  • two ways to spend the output:
  • the n parties agree to sign with Y (one of them simply adds a

corrective term cH( X, S) to its partial signature si) ⇒ looks like a normal P2PKH spending, S remains forever private

X and S are revealed and a scriptSig S′ is provided; valid if

  • X + H(

X, S)G = Y and S′S returns True

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 22 / 40

slide-102
SLIDE 102

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: description

  • propose by G. Maxwell [Max18]
  • in practice, redeem scripts often have a unanimity clause:

(n parties agree to sign)

  • n-of-n multisig

OR (some more complex conditions)

  • script S
  • can be achieved indistinguishably from a standard P2PKH output
  • let

X be the MuSig aggregate key for the n parties

  • output uses public key Y =

X + H( X, S)G

  • two ways to spend the output:
  • the n parties agree to sign with Y (one of them simply adds a

corrective term cH( X, S) to its partial signature si) ⇒ looks like a normal P2PKH spending, S remains forever private

X and S are revealed and a scriptSig S′ is provided; valid if

  • X + H(

X, S)G = Y and S′S returns True

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 22 / 40

slide-103
SLIDE 103

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: description

  • propose by G. Maxwell [Max18]
  • in practice, redeem scripts often have a unanimity clause:

(n parties agree to sign)

  • n-of-n multisig

OR (some more complex conditions)

  • script S
  • can be achieved indistinguishably from a standard P2PKH output
  • let

X be the MuSig aggregate key for the n parties

  • output uses public key Y =

X + H( X, S)G

  • two ways to spend the output:
  • the n parties agree to sign with Y (one of them simply adds a

corrective term cH( X, S) to its partial signature si) ⇒ looks like a normal P2PKH spending, S remains forever private

X and S are revealed and a scriptSig S′ is provided; valid if

  • X + H(

X, S)G = Y and S′S returns True

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 22 / 40

slide-104
SLIDE 104

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: security

  • a taproot public key Y =

X + H( X, S)G acts as a (hiding and binding) commitment on S:

  • hiding: Y does not reveal anything about S
  • binding: computationally hard to find (

X ′, S′) = ( X, S) such that Y = X ′ + H( X ′, S′)G (provably so in the random oracle model)

  • unforgeability can be proved in the ROM by extending the proof

for Schnorr signatures

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 23 / 40

slide-105
SLIDE 105

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: security

  • a taproot public key Y =

X + H( X, S)G acts as a (hiding and binding) commitment on S:

  • hiding: Y does not reveal anything about S
  • binding: computationally hard to find (

X ′, S′) = ( X, S) such that Y = X ′ + H( X ′, S′)G (provably so in the random oracle model)

  • unforgeability can be proved in the ROM by extending the proof

for Schnorr signatures

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 23 / 40

slide-106
SLIDE 106

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: security

  • a taproot public key Y =

X + H( X, S)G acts as a (hiding and binding) commitment on S:

  • hiding: Y does not reveal anything about S
  • binding: computationally hard to find (

X ′, S′) = ( X, S) such that Y = X ′ + H( X ′, S′)G (provably so in the random oracle model)

  • unforgeability can be proved in the ROM by extending the proof

for Schnorr signatures

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 23 / 40

slide-107
SLIDE 107

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Taproot: security

  • a taproot public key Y =

X + H( X, S)G acts as a (hiding and binding) commitment on S:

  • hiding: Y does not reveal anything about S
  • binding: computationally hard to find (

X ′, S′) = ( X, S) such that Y = X ′ + H( X ′, S′)G (provably so in the random oracle model)

  • unforgeability can be proved in the ROM by extending the proof

for Schnorr signatures

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 23 / 40

slide-108
SLIDE 108

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Outline

Bitcoin Script Refresher: Schnorr Signatures and MuSig Taproot Scriptless Scripts Discreet Log Contracts Conclusion

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 24 / 40

slide-109
SLIDE 109

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Scriptless Scripts

  • proposed by A. Poelstra, originally motivated by Mimblewimble
  • goal: enforce smart contracts without publishing the contract in

the blockchain, using only standard (P2PKH) transactions

  • MuSig is a kind of basic scriptless script (makes n-of-n multisig

indistinguishable from a standard P2PKH)

  • relies on a tool called adaptor signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 25 / 40

slide-110
SLIDE 110

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Scriptless Scripts

  • proposed by A. Poelstra, originally motivated by Mimblewimble
  • goal: enforce smart contracts without publishing the contract in

the blockchain, using only standard (P2PKH) transactions

  • MuSig is a kind of basic scriptless script (makes n-of-n multisig

indistinguishable from a standard P2PKH)

  • relies on a tool called adaptor signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 25 / 40

slide-111
SLIDE 111

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Scriptless Scripts

  • proposed by A. Poelstra, originally motivated by Mimblewimble
  • goal: enforce smart contracts without publishing the contract in

the blockchain, using only standard (P2PKH) transactions

  • MuSig is a kind of basic scriptless script (makes n-of-n multisig

indistinguishable from a standard P2PKH)

  • relies on a tool called adaptor signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 25 / 40

slide-112
SLIDE 112

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Scriptless Scripts

  • proposed by A. Poelstra, originally motivated by Mimblewimble
  • goal: enforce smart contracts without publishing the contract in

the blockchain, using only standard (P2PKH) transactions

  • MuSig is a kind of basic scriptless script (makes n-of-n multisig

indistinguishable from a standard P2PKH)

  • relies on a tool called adaptor signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 25 / 40

slide-113
SLIDE 113

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Adaptor signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer chooses (t, T = tG) and offsets the signature:

s − t = r − t + H(X, R, m)x (1) (s − t)G = R − T + H(X, R, m)X (2)

  • signer reveals adaptor signature (R, T,¯

s = s − t): → not a valid signature, but (1) can be verified using (2)

  • then revealing signature s ⇔ revealing t
  • t can be some secret value necessary for an auxiliary protocol

(correctness can be proved in zero-knowledge from T)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 26 / 40

slide-114
SLIDE 114

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Adaptor signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer chooses (t, T = tG) and offsets the signature:

s − t = r − t + H(X, R, m)x (1) (s − t)G = R − T + H(X, R, m)X (2)

  • signer reveals adaptor signature (R, T,¯

s = s − t): → not a valid signature, but (1) can be verified using (2)

  • then revealing signature s ⇔ revealing t
  • t can be some secret value necessary for an auxiliary protocol

(correctness can be proved in zero-knowledge from T)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 26 / 40

slide-115
SLIDE 115

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Adaptor signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer chooses (t, T = tG) and offsets the signature:

s − t = r − t + H(X, R, m)x (1) (s − t)G = R − T + H(X, R, m)X (2)

  • signer reveals adaptor signature (R, T,¯

s = s − t): → not a valid signature, but (1) can be verified using (2)

  • then revealing signature s ⇔ revealing t
  • t can be some secret value necessary for an auxiliary protocol

(correctness can be proved in zero-knowledge from T)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 26 / 40

slide-116
SLIDE 116

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Adaptor signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer chooses (t, T = tG) and offsets the signature:

s − t = r − t + H(X, R, m)x (1) (s − t)G = R − T + H(X, R, m)X (2)

  • signer reveals adaptor signature (R, T,¯

s = s − t): → not a valid signature, but (1) can be verified using (2)

  • then revealing signature s ⇔ revealing t
  • t can be some secret value necessary for an auxiliary protocol

(correctness can be proved in zero-knowledge from T)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 26 / 40

slide-117
SLIDE 117

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Adaptor signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer chooses (t, T = tG) and offsets the signature:

s − t = r − t + H(X, R, m)x (1) (s − t)G = R − T + H(X, R, m)X (2)

  • signer reveals adaptor signature (R, T,¯

s = s − t): → not a valid signature, but (1) can be verified using (2)

  • then revealing signature s ⇔ revealing t
  • t can be some secret value necessary for an auxiliary protocol

(correctness can be proved in zero-knowledge from T)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 26 / 40

slide-118
SLIDE 118

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice sends 1 bitcoin to a 2-of-2 MuSig public key
  • X = µAXA + µBXB

with µi = H({XA, XB}, Xi), i ∈ {A, B}

  • Bob sends 100 litecoins to a 2-of-2 MuSig public key
  • X ′ = µ′

AX ′ A + µ′ BX ′ B

with µ′

i = H({X ′ A, X ′ B}, X ′ i ), i ∈ {A, B}

  • Alice and Bob must now compute two signatures:
  • (R = (rA + rB)G, s) sending the bitcoin to Bob with

s = rA + H( X, R, m)µAxA

  • sA

+ rB + H( X, R, m)µBxB

  • sB
  • (R′ = (r ′

A + r ′ B)G, s′) sending the 100 litecoins to Alice with

s′ = r ′

A + H(

X ′, R′, m′)µ′

Ax′ A

  • s′

A

+ r ′

B + H(

X ′, R′, m′)µ′

Bx′ B

  • s′

B

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 27 / 40

slide-119
SLIDE 119

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice sends 1 bitcoin to a 2-of-2 MuSig public key
  • X = µAXA + µBXB

with µi = H({XA, XB}, Xi), i ∈ {A, B}

  • Bob sends 100 litecoins to a 2-of-2 MuSig public key
  • X ′ = µ′

AX ′ A + µ′ BX ′ B

with µ′

i = H({X ′ A, X ′ B}, X ′ i ), i ∈ {A, B}

  • Alice and Bob must now compute two signatures:
  • (R = (rA + rB)G, s) sending the bitcoin to Bob with

s = rA + H( X, R, m)µAxA

  • sA

+ rB + H( X, R, m)µBxB

  • sB
  • (R′ = (r ′

A + r ′ B)G, s′) sending the 100 litecoins to Alice with

s′ = r ′

A + H(

X ′, R′, m′)µ′

Ax′ A

  • s′

A

+ r ′

B + H(

X ′, R′, m′)µ′

Bx′ B

  • s′

B

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 27 / 40

slide-120
SLIDE 120

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice sends 1 bitcoin to a 2-of-2 MuSig public key
  • X = µAXA + µBXB

with µi = H({XA, XB}, Xi), i ∈ {A, B}

  • Bob sends 100 litecoins to a 2-of-2 MuSig public key
  • X ′ = µ′

AX ′ A + µ′ BX ′ B

with µ′

i = H({X ′ A, X ′ B}, X ′ i ), i ∈ {A, B}

  • Alice and Bob must now compute two signatures:
  • (R = (rA + rB)G, s) sending the bitcoin to Bob with

s = rA + H( X, R, m)µAxA

  • sA

+ rB + H( X, R, m)µBxB

  • sB
  • (R′ = (r ′

A + r ′ B)G, s′) sending the 100 litecoins to Alice with

s′ = r ′

A + H(

X ′, R′, m′)µ′

Ax′ A

  • s′

A

+ r ′

B + H(

X ′, R′, m′)µ′

Bx′ B

  • s′

B

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 27 / 40

slide-121
SLIDE 121

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice sends 1 bitcoin to a 2-of-2 MuSig public key
  • X = µAXA + µBXB

with µi = H({XA, XB}, Xi), i ∈ {A, B}

  • Bob sends 100 litecoins to a 2-of-2 MuSig public key
  • X ′ = µ′

AX ′ A + µ′ BX ′ B

with µ′

i = H({X ′ A, X ′ B}, X ′ i ), i ∈ {A, B}

  • Alice and Bob must now compute two signatures:
  • (R = (rA + rB)G, s) sending the bitcoin to Bob with

s = rA + H( X, R, m)µAxA

  • sA

+ rB + H( X, R, m)µBxB

  • sB
  • (R′ = (r ′

A + r ′ B)G, s′) sending the 100 litecoins to Alice with

s′ = r ′

A + H(

X ′, R′, m′)µ′

Ax′ A

  • s′

A

+ r ′

B + H(

X ′, R′, m′)µ′

Bx′ B

  • s′

B

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 27 / 40

slide-122
SLIDE 122

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice sends 1 bitcoin to a 2-of-2 MuSig public key
  • X = µAXA + µBXB

with µi = H({XA, XB}, Xi), i ∈ {A, B}

  • Bob sends 100 litecoins to a 2-of-2 MuSig public key
  • X ′ = µ′

AX ′ A + µ′ BX ′ B

with µ′

i = H({X ′ A, X ′ B}, X ′ i ), i ∈ {A, B}

  • Alice and Bob must now compute two signatures:
  • (R = (rA + rB)G, s) sending the bitcoin to Bob with

s = rA + H( X, R, m)µAxA

  • sA

+ rB + H( X, R, m)µBxB

  • sB
  • (R′ = (r ′

A + r ′ B)G, s′) sending the 100 litecoins to Alice with

s′ = r ′

A + H(

X ′, R′, m′)µ′

Ax′ A

  • s′

A

+ r ′

B + H(

X ′, R′, m′)µ′

Bx′ B

  • s′

B

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 27 / 40

slide-123
SLIDE 123

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • suppose Alice wants to trade 1 bitcoin for 100 litecoins with Bob
  • Alice sends 1 bitcoin to a 2-of-2 MuSig public key
  • X = µAXA + µBXB

with µi = H({XA, XB}, Xi), i ∈ {A, B}

  • Bob sends 100 litecoins to a 2-of-2 MuSig public key
  • X ′ = µ′

AX ′ A + µ′ BX ′ B

with µ′

i = H({X ′ A, X ′ B}, X ′ i ), i ∈ {A, B}

  • Alice and Bob must now compute two signatures:
  • (R = (rA + rB)G, s) sending the bitcoin to Bob with

s = rA + H( X, R, m)µAxA

  • sA

+ rB + H( X, R, m)µBxB

  • sB
  • (R′ = (r ′

A + r ′ B)G, s′) sending the 100 litecoins to Alice with

s′ = r ′

A + H(

X ′, R′, m′)µ′

Ax′ A

  • s′

A

+ r ′

B + H(

X ′, R′, m′)µ′

Bx′ B

  • s′

B

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 27 / 40

slide-124
SLIDE 124

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • Bob and Alice exchange nonces

RA = rAG, RB = rBG R′

A = r ′ AG,

R′

B = r ′ BG

  • Bob sends two partial adaptor signatures (R = (rA + rB)G, T,¯

sB) and (R′ = (r ′

A + r ′ B)G, T,¯

s′

B) with the same (t, T = tG)

¯ sB = sB − t = rB − t + H( X, R, m)µBxB ¯ s′

B = s′ B − t = r ′ B − t + H(

X ′, R′, m′)µ′

Bx′ B

  • Alice checks them and sends her partial signature sA to Bob
  • Bob claims the bitcoin with s = sA + sB, revealing sB and hence t
  • Alice can compute s′

B = ¯

s′

B + t and claim the 100 litecoins

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 28 / 40

slide-125
SLIDE 125

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • Bob and Alice exchange nonces

RA = rAG, RB = rBG R′

A = r ′ AG,

R′

B = r ′ BG

  • Bob sends two partial adaptor signatures (R = (rA + rB)G, T,¯

sB) and (R′ = (r ′

A + r ′ B)G, T,¯

s′

B) with the same (t, T = tG)

¯ sB = sB − t = rB − t + H( X, R, m)µBxB ¯ s′

B = s′ B − t = r ′ B − t + H(

X ′, R′, m′)µ′

Bx′ B

  • Alice checks them and sends her partial signature sA to Bob
  • Bob claims the bitcoin with s = sA + sB, revealing sB and hence t
  • Alice can compute s′

B = ¯

s′

B + t and claim the 100 litecoins

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 28 / 40

slide-126
SLIDE 126

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • Bob and Alice exchange nonces

RA = rAG, RB = rBG R′

A = r ′ AG,

R′

B = r ′ BG

  • Bob sends two partial adaptor signatures (R = (rA + rB)G, T,¯

sB) and (R′ = (r ′

A + r ′ B)G, T,¯

s′

B) with the same (t, T = tG)

¯ sB = sB − t = rB − t + H( X, R, m)µBxB ¯ s′

B = s′ B − t = r ′ B − t + H(

X ′, R′, m′)µ′

Bx′ B

  • Alice checks them and sends her partial signature sA to Bob
  • Bob claims the bitcoin with s = sA + sB, revealing sB and hence t
  • Alice can compute s′

B = ¯

s′

B + t and claim the 100 litecoins

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 28 / 40

slide-127
SLIDE 127

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • Bob and Alice exchange nonces

RA = rAG, RB = rBG R′

A = r ′ AG,

R′

B = r ′ BG

  • Bob sends two partial adaptor signatures (R = (rA + rB)G, T,¯

sB) and (R′ = (r ′

A + r ′ B)G, T,¯

s′

B) with the same (t, T = tG)

¯ sB = sB − t = rB − t + H( X, R, m)µBxB ¯ s′

B = s′ B − t = r ′ B − t + H(

X ′, R′, m′)µ′

Bx′ B

  • Alice checks them and sends her partial signature sA to Bob
  • Bob claims the bitcoin with s = sA + sB, revealing sB and hence t
  • Alice can compute s′

B = ¯

s′

B + t and claim the 100 litecoins

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 28 / 40

slide-128
SLIDE 128

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • Bob and Alice exchange nonces

RA = rAG, RB = rBG R′

A = r ′ AG,

R′

B = r ′ BG

  • Bob sends two partial adaptor signatures (R = (rA + rB)G, T,¯

sB) and (R′ = (r ′

A + r ′ B)G, T,¯

s′

B) with the same (t, T = tG)

¯ sB = sB − t = rB − t + H( X, R, m)µBxB ¯ s′

B = s′ B − t = r ′ B − t + H(

X ′, R′, m′)µ′

Bx′ B

  • Alice checks them and sends her partial signature sA to Bob
  • Bob claims the bitcoin with s = sA + sB, revealing sB and hence t
  • Alice can compute s′

B = ¯

s′

B + t and claim the 100 litecoins

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 28 / 40

slide-129
SLIDE 129

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-130
SLIDE 130

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-131
SLIDE 131

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-132
SLIDE 132

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-133
SLIDE 133

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-134
SLIDE 134

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-135
SLIDE 135

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-136
SLIDE 136

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-137
SLIDE 137

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Application: private atomic swaps [Gib17]

  • the swap is perfectly private:
  • the two transactions look “standard” to an external observer
  • nobody can tell that an atomic swap took place or link the two

transactions together

  • what if Alice or Bob defects once the funds have been sent to the

MuSig addresses?

  • ⇒ use a time-lock:
  • Alice’s bitcoin can be spent either with the MuSig key

X or by Alice alone after time τA

  • Bob’s 100 litecoins can be spent either with the MuSig key

X ′ or by Bob alone after time τB

  • note: the time-lock for Bob must be larger than the one for Alice
  • using Taproot, this more complex script “sign with

X OR sign with XA after time τA” can be made indistinguishable from a standard P2PKH address

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 29 / 40

slide-138
SLIDE 138

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Outline

Bitcoin Script Refresher: Schnorr Signatures and MuSig Taproot Scriptless Scripts Discreet Log Contracts Conclusion

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 30 / 40

slide-139
SLIDE 139

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Discreet Log Contracts (DLC) [Dry17]

  • goal: enforce contracts based on external events
  • example: gambling, insurance, . . .
  • problem: the blockchain is not aware of external events
  • existing solutions: Augur, Gnosis, ChainLink, Oraclize
  • Discreet Log Contracts allow conditional payments based on an

external event, in a private way

  • rely on a tool called anticipated signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 31 / 40

slide-140
SLIDE 140

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Discreet Log Contracts (DLC) [Dry17]

  • goal: enforce contracts based on external events
  • example: gambling, insurance, . . .
  • problem: the blockchain is not aware of external events
  • existing solutions: Augur, Gnosis, ChainLink, Oraclize
  • Discreet Log Contracts allow conditional payments based on an

external event, in a private way

  • rely on a tool called anticipated signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 31 / 40

slide-141
SLIDE 141

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Discreet Log Contracts (DLC) [Dry17]

  • goal: enforce contracts based on external events
  • example: gambling, insurance, . . .
  • problem: the blockchain is not aware of external events
  • existing solutions: Augur, Gnosis, ChainLink, Oraclize
  • Discreet Log Contracts allow conditional payments based on an

external event, in a private way

  • rely on a tool called anticipated signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 31 / 40

slide-142
SLIDE 142

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Discreet Log Contracts (DLC) [Dry17]

  • goal: enforce contracts based on external events
  • example: gambling, insurance, . . .
  • problem: the blockchain is not aware of external events
  • existing solutions: Augur, Gnosis, ChainLink, Oraclize
  • Discreet Log Contracts allow conditional payments based on an

external event, in a private way

  • rely on a tool called anticipated signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 31 / 40

slide-143
SLIDE 143

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Discreet Log Contracts (DLC) [Dry17]

  • goal: enforce contracts based on external events
  • example: gambling, insurance, . . .
  • problem: the blockchain is not aware of external events
  • existing solutions: Augur, Gnosis, ChainLink, Oraclize
  • Discreet Log Contracts allow conditional payments based on an

external event, in a private way

  • rely on a tool called anticipated signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 31 / 40

slide-144
SLIDE 144

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Discreet Log Contracts (DLC) [Dry17]

  • goal: enforce contracts based on external events
  • example: gambling, insurance, . . .
  • problem: the blockchain is not aware of external events
  • existing solutions: Augur, Gnosis, ChainLink, Oraclize
  • Discreet Log Contracts allow conditional payments based on an

external event, in a private way

  • rely on a tool called anticipated signatures
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 31 / 40

slide-145
SLIDE 145

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Anticipated signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer draws r and reveals R = rG before choosing

which message to sign

  • for any message m, anyone can compute

Sm := smG = R + H(X, R, m)X where (R, sm) is the signature on m

  • (X, R) can be seen as a one-time public key
  • (sm, Sm) can be seen as a key pair associated with m
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 32 / 40

slide-146
SLIDE 146

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Anticipated signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer draws r and reveals R = rG before choosing

which message to sign

  • for any message m, anyone can compute

Sm := smG = R + H(X, R, m)X where (R, sm) is the signature on m

  • (X, R) can be seen as a one-time public key
  • (sm, Sm) can be seen as a key pair associated with m
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 32 / 40

slide-147
SLIDE 147

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Anticipated signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer draws r and reveals R = rG before choosing

which message to sign

  • for any message m, anyone can compute

Sm := smG = R + H(X, R, m)X where (R, sm) is the signature on m

  • (X, R) can be seen as a one-time public key
  • (sm, Sm) can be seen as a key pair associated with m
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 32 / 40

slide-148
SLIDE 148

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Anticipated signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer draws r and reveals R = rG before choosing

which message to sign

  • for any message m, anyone can compute

Sm := smG = R + H(X, R, m)X where (R, sm) is the signature on m

  • (X, R) can be seen as a one-time public key
  • (sm, Sm) can be seen as a key pair associated with m
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 32 / 40

slide-149
SLIDE 149

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Anticipated signatures

  • Schnorr signature (R = rG, s) on m under key (x, X = xG):

secret eq. s = r + H(X, R, m)x public eq. sG = R + H(X, R, m)X

  • assume the signer draws r and reveals R = rG before choosing

which message to sign

  • for any message m, anyone can compute

Sm := smG = R + H(X, R, m)X where (R, sm) is the signature on m

  • (X, R) can be seen as a one-time public key
  • (sm, Sm) can be seen as a key pair associated with m
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 32 / 40

slide-150
SLIDE 150

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Setup

  • Alice and Bob want to execute a contract based on some external

event with a predetermined number of outcomes {E1, . . . , En}

  • Olivia: oracle in charge of observing the event and signing the
  • utcome with public key (X = xG, R = rG)
  • for each possible outcome Ei of the event, anybody can compute

Si := siG = R + H(X, R, Ei)X

  • for each possible outcome Ei of the event, Alice, resp. Bob

compute public keys

  • XA,i = xAG + Si,

resp.

  • XB,i = xBG + Si
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 33 / 40

slide-151
SLIDE 151

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Setup

  • Alice and Bob want to execute a contract based on some external

event with a predetermined number of outcomes {E1, . . . , En}

  • Olivia: oracle in charge of observing the event and signing the
  • utcome with public key (X = xG, R = rG)
  • for each possible outcome Ei of the event, anybody can compute

Si := siG = R + H(X, R, Ei)X

  • for each possible outcome Ei of the event, Alice, resp. Bob

compute public keys

  • XA,i = xAG + Si,

resp.

  • XB,i = xBG + Si
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 33 / 40

slide-152
SLIDE 152

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Setup

  • Alice and Bob want to execute a contract based on some external

event with a predetermined number of outcomes {E1, . . . , En}

  • Olivia: oracle in charge of observing the event and signing the
  • utcome with public key (X = xG, R = rG)
  • for each possible outcome Ei of the event, anybody can compute

Si := siG = R + H(X, R, Ei)X

  • for each possible outcome Ei of the event, Alice, resp. Bob

compute public keys

  • XA,i = xAG + Si,

resp.

  • XB,i = xBG + Si
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 33 / 40

slide-153
SLIDE 153

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Setup

  • Alice and Bob want to execute a contract based on some external

event with a predetermined number of outcomes {E1, . . . , En}

  • Olivia: oracle in charge of observing the event and signing the
  • utcome with public key (X = xG, R = rG)
  • for each possible outcome Ei of the event, anybody can compute

Si := siG = R + H(X, R, Ei)X

  • for each possible outcome Ei of the event, Alice, resp. Bob

compute public keys

  • XA,i = xAG + Si,

resp.

  • XB,i = xBG + Si
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 33 / 40

slide-154
SLIDE 154

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Creating the contract

  • to establish the contract, Alice and Bob create an opening

transaction T op sending funds to a 2-of-2 multisig address

  • they also create n pairs of closing transactions: T cl

A,i for Alice and

T cl

B,i for Bob

  • let BalA,i and BalB,i be the balances of Alice and Bob in case Ei

happens; then:

  • T cl

A,i sends BalB,i to XB and BalA,i to script

XA,i ∨ (τ ∧ XB)

  • T cl

B,i sends BalA,i to XA and BalB,i to script

XB,i ∨ (τ ∧ XA)

  • once the opening transaction and the n closing transaction pairs

have been created, they include the opening transaction in the blockchain

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 34 / 40

slide-155
SLIDE 155

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Creating the contract

  • to establish the contract, Alice and Bob create an opening

transaction T op sending funds to a 2-of-2 multisig address

  • they also create n pairs of closing transactions: T cl

A,i for Alice and

T cl

B,i for Bob

  • let BalA,i and BalB,i be the balances of Alice and Bob in case Ei

happens; then:

  • T cl

A,i sends BalB,i to XB and BalA,i to script

XA,i ∨ (τ ∧ XB)

  • T cl

B,i sends BalA,i to XA and BalB,i to script

XB,i ∨ (τ ∧ XA)

  • once the opening transaction and the n closing transaction pairs

have been created, they include the opening transaction in the blockchain

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 34 / 40

slide-156
SLIDE 156

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Creating the contract

  • to establish the contract, Alice and Bob create an opening

transaction T op sending funds to a 2-of-2 multisig address

  • they also create n pairs of closing transactions: T cl

A,i for Alice and

T cl

B,i for Bob

  • let BalA,i and BalB,i be the balances of Alice and Bob in case Ei

happens; then:

  • T cl

A,i sends BalB,i to XB and BalA,i to script

XA,i ∨ (τ ∧ XB)

  • T cl

B,i sends BalA,i to XA and BalB,i to script

XB,i ∨ (τ ∧ XA)

  • once the opening transaction and the n closing transaction pairs

have been created, they include the opening transaction in the blockchain

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 34 / 40

slide-157
SLIDE 157

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Creating the contract

  • to establish the contract, Alice and Bob create an opening

transaction T op sending funds to a 2-of-2 multisig address

  • they also create n pairs of closing transactions: T cl

A,i for Alice and

T cl

B,i for Bob

  • let BalA,i and BalB,i be the balances of Alice and Bob in case Ei

happens; then:

  • T cl

A,i sends BalB,i to XB and BalA,i to script

XA,i ∨ (τ ∧ XB)

  • T cl

B,i sends BalA,i to XA and BalB,i to script

XB,i ∨ (τ ∧ XA)

  • once the opening transaction and the n closing transaction pairs

have been created, they include the opening transaction in the blockchain

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 34 / 40

slide-158
SLIDE 158

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Creating the contract

  • to establish the contract, Alice and Bob create an opening

transaction T op sending funds to a 2-of-2 multisig address

  • they also create n pairs of closing transactions: T cl

A,i for Alice and

T cl

B,i for Bob

  • let BalA,i and BalB,i be the balances of Alice and Bob in case Ei

happens; then:

  • T cl

A,i sends BalB,i to XB and BalA,i to script

XA,i ∨ (τ ∧ XB)

  • T cl

B,i sends BalA,i to XA and BalB,i to script

XB,i ∨ (τ ∧ XA)

  • once the opening transaction and the n closing transaction pairs

have been created, they include the opening transaction in the blockchain

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 34 / 40

slide-159
SLIDE 159

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Creating the contract

  • to establish the contract, Alice and Bob create an opening

transaction T op sending funds to a 2-of-2 multisig address

  • they also create n pairs of closing transactions: T cl

A,i for Alice and

T cl

B,i for Bob

  • let BalA,i and BalB,i be the balances of Alice and Bob in case Ei

happens; then:

  • T cl

A,i sends BalB,i to XB and BalA,i to script

XA,i ∨ (τ ∧ XB)

  • T cl

B,i sends BalA,i to XA and BalB,i to script

XB,i ∨ (τ ∧ XA)

  • once the opening transaction and the n closing transaction pairs

have been created, they include the opening transaction in the blockchain

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 34 / 40

slide-160
SLIDE 160

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Executing the contract

  • when the external event happens, Olivia signs the observed
  • utcome E¯

ı, revealing s¯ ı

  • Alice and Bob can compute resp. xA + s¯

ı and xB + s¯ ı; one of them

(e.g. Alice) broadcasts the corresponding closing transaction T cl

A,¯ ı;

then:

  • Alice can claim BalA,¯

ı using

XA,¯

ı = (xA + s¯ ı)G

  • Bob can claim BalB,¯

ı using XB

  • if Bob tries to cheat and sends an incorrect closing transaction

T cl

B,j, j = ¯

ı, he is unable to claim the output worth BalB,j controlled by script XB,j ∨ (τ ∧ XA), which can be claimed by Alice after time τ

  • NB: funds cannot be locked (Alice’s closing transactions always

return all funds to Bob after time τ and vice-versa)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 35 / 40

slide-161
SLIDE 161

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Executing the contract

  • when the external event happens, Olivia signs the observed
  • utcome E¯

ı, revealing s¯ ı

  • Alice and Bob can compute resp. xA + s¯

ı and xB + s¯ ı; one of them

(e.g. Alice) broadcasts the corresponding closing transaction T cl

A,¯ ı;

then:

  • Alice can claim BalA,¯

ı using

XA,¯

ı = (xA + s¯ ı)G

  • Bob can claim BalB,¯

ı using XB

  • if Bob tries to cheat and sends an incorrect closing transaction

T cl

B,j, j = ¯

ı, he is unable to claim the output worth BalB,j controlled by script XB,j ∨ (τ ∧ XA), which can be claimed by Alice after time τ

  • NB: funds cannot be locked (Alice’s closing transactions always

return all funds to Bob after time τ and vice-versa)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 35 / 40

slide-162
SLIDE 162

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Executing the contract

  • when the external event happens, Olivia signs the observed
  • utcome E¯

ı, revealing s¯ ı

  • Alice and Bob can compute resp. xA + s¯

ı and xB + s¯ ı; one of them

(e.g. Alice) broadcasts the corresponding closing transaction T cl

A,¯ ı;

then:

  • Alice can claim BalA,¯

ı using

XA,¯

ı = (xA + s¯ ı)G

  • Bob can claim BalB,¯

ı using XB

  • if Bob tries to cheat and sends an incorrect closing transaction

T cl

B,j, j = ¯

ı, he is unable to claim the output worth BalB,j controlled by script XB,j ∨ (τ ∧ XA), which can be claimed by Alice after time τ

  • NB: funds cannot be locked (Alice’s closing transactions always

return all funds to Bob after time τ and vice-versa)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 35 / 40

slide-163
SLIDE 163

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Executing the contract

  • when the external event happens, Olivia signs the observed
  • utcome E¯

ı, revealing s¯ ı

  • Alice and Bob can compute resp. xA + s¯

ı and xB + s¯ ı; one of them

(e.g. Alice) broadcasts the corresponding closing transaction T cl

A,¯ ı;

then:

  • Alice can claim BalA,¯

ı using

XA,¯

ı = (xA + s¯ ı)G

  • Bob can claim BalB,¯

ı using XB

  • if Bob tries to cheat and sends an incorrect closing transaction

T cl

B,j, j = ¯

ı, he is unable to claim the output worth BalB,j controlled by script XB,j ∨ (τ ∧ XA), which can be claimed by Alice after time τ

  • NB: funds cannot be locked (Alice’s closing transactions always

return all funds to Bob after time τ and vice-versa)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 35 / 40

slide-164
SLIDE 164

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Executing the contract

  • when the external event happens, Olivia signs the observed
  • utcome E¯

ı, revealing s¯ ı

  • Alice and Bob can compute resp. xA + s¯

ı and xB + s¯ ı; one of them

(e.g. Alice) broadcasts the corresponding closing transaction T cl

A,¯ ı;

then:

  • Alice can claim BalA,¯

ı using

XA,¯

ı = (xA + s¯ ı)G

  • Bob can claim BalB,¯

ı using XB

  • if Bob tries to cheat and sends an incorrect closing transaction

T cl

B,j, j = ¯

ı, he is unable to claim the output worth BalB,j controlled by script XB,j ∨ (τ ∧ XA), which can be claimed by Alice after time τ

  • NB: funds cannot be locked (Alice’s closing transactions always

return all funds to Bob after time τ and vice-versa)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 35 / 40

slide-165
SLIDE 165

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

DLC: Executing the contract

  • when the external event happens, Olivia signs the observed
  • utcome E¯

ı, revealing s¯ ı

  • Alice and Bob can compute resp. xA + s¯

ı and xB + s¯ ı; one of them

(e.g. Alice) broadcasts the corresponding closing transaction T cl

A,¯ ı;

then:

  • Alice can claim BalA,¯

ı using

XA,¯

ı = (xA + s¯ ı)G

  • Bob can claim BalB,¯

ı using XB

  • if Bob tries to cheat and sends an incorrect closing transaction

T cl

B,j, j = ¯

ı, he is unable to claim the output worth BalB,j controlled by script XB,j ∨ (τ ∧ XA), which can be claimed by Alice after time τ

  • NB: funds cannot be locked (Alice’s closing transactions always

return all funds to Bob after time τ and vice-versa)

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 35 / 40

slide-166
SLIDE 166

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Outline

Bitcoin Script Refresher: Schnorr Signatures and MuSig Taproot Scriptless Scripts Discreet Log Contracts Conclusion

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 36 / 40

slide-167
SLIDE 167

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Conclusion

  • Schnorr signatures can help improve privacy and fungibility:
  • multisigs made indistinguishable from P2PKH (MuSig)
  • complex scripts made indistinguishable from P2PKH (Taproot)
  • stealthy enforcement of contracts (Scriptless Scripts, Discreet Log

Contracts)

  • all this also implies space and computational gains (less data to

verify and store in the blockchain)

  • BIP for Schnorr is currently under review
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 37 / 40

slide-168
SLIDE 168

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Conclusion

  • Schnorr signatures can help improve privacy and fungibility:
  • multisigs made indistinguishable from P2PKH (MuSig)
  • complex scripts made indistinguishable from P2PKH (Taproot)
  • stealthy enforcement of contracts (Scriptless Scripts, Discreet Log

Contracts)

  • all this also implies space and computational gains (less data to

verify and store in the blockchain)

  • BIP for Schnorr is currently under review
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 37 / 40

slide-169
SLIDE 169

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Conclusion

  • Schnorr signatures can help improve privacy and fungibility:
  • multisigs made indistinguishable from P2PKH (MuSig)
  • complex scripts made indistinguishable from P2PKH (Taproot)
  • stealthy enforcement of contracts (Scriptless Scripts, Discreet Log

Contracts)

  • all this also implies space and computational gains (less data to

verify and store in the blockchain)

  • BIP for Schnorr is currently under review
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 37 / 40

slide-170
SLIDE 170

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Conclusion

  • Schnorr signatures can help improve privacy and fungibility:
  • multisigs made indistinguishable from P2PKH (MuSig)
  • complex scripts made indistinguishable from P2PKH (Taproot)
  • stealthy enforcement of contracts (Scriptless Scripts, Discreet Log

Contracts)

  • all this also implies space and computational gains (less data to

verify and store in the blockchain)

  • BIP for Schnorr is currently under review
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 37 / 40

slide-171
SLIDE 171

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Conclusion

  • Schnorr signatures can help improve privacy and fungibility:
  • multisigs made indistinguishable from P2PKH (MuSig)
  • complex scripts made indistinguishable from P2PKH (Taproot)
  • stealthy enforcement of contracts (Scriptless Scripts, Discreet Log

Contracts)

  • all this also implies space and computational gains (less data to

verify and store in the blockchain)

  • BIP for Schnorr is currently under review
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 37 / 40

slide-172
SLIDE 172

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

Conclusion

  • Schnorr signatures can help improve privacy and fungibility:
  • multisigs made indistinguishable from P2PKH (MuSig)
  • complex scripts made indistinguishable from P2PKH (Taproot)
  • stealthy enforcement of contracts (Scriptless Scripts, Discreet Log

Contracts)

  • all this also implies space and computational gains (less data to

verify and store in the blockchain)

  • BIP for Schnorr is currently under review
  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 37 / 40

slide-173
SLIDE 173

Bitcoin Script Schnorr Taproot Scriptless Scripts Discreet Log Contracts Conclusion

The end. . .

Thanks for your attention! Comments or questions?

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 38 / 40

slide-174
SLIDE 174

References

References I

Thaddeus Dryja. Discreet Log Contracts, 2017. Available at https://adiabat.github.io/dlc.pdf. Adam Gibson. Flipping the scriptless script on Schnorr, 2017. Available at https://joinmarket.me/blog/blog/ flipping-the-scriptless-script-on-schnorr. Gregory Maxwell. Taproot: Privacy preserving switchable scripting, January

  • 2018. Post on Bitcoin development mailing list,

https://lists.linuxfoundation.org/pipermail/bitcoin-dev/ 2018-January/015614.html. Tier Nolan. Alt chains and atomic transfers, May 2013. BitcoinTalk post, https://bitcointalk.org/index.php?topic=193281.0. Jeremy Rubin, Manali Naik, and Nitya Subramanian. Merkelized Abstract Syntax Trees, 2014. Available at https://rubin.io/public/pdfs/858report.pdf.

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 39 / 40

slide-175
SLIDE 175

References

References II

Claus-Peter Schnorr. Efficient Identification and Signatures for Smart Cards. In Advances in Cryptology - CRYPTO ’89, pages 239–252. Claus-Peter Schnorr. Efficient Signature Generation by Smart Cards. J. Cryptology, 4(3):161–174, 1991.

  • Y. Seurin (ANSSI)

More Schnorr Tricks for Bitcoin 22/11/2018 — BlockSem 40 / 40