Scriptless Scripts Andrew Poelstra grindelwald@wpsoftware.net - - PowerPoint PPT Presentation

scriptless scripts
SMART_READER_LITE
LIVE PREVIEW

Scriptless Scripts Andrew Poelstra grindelwald@wpsoftware.net - - PowerPoint PPT Presentation

Scriptless Scripts Scriptless Scripts Andrew Poelstra grindelwald@wpsoftware.net March 4, 2017 Scriptless Scripts Introduction Scriptless Scripts? Scriptless scripts: magicking digital signatures so that they can only be created by


slide-1
SLIDE 1

Scriptless Scripts

Scriptless Scripts

Andrew Poelstra

grindelwald@wpsoftware.net

March 4, 2017

slide-2
SLIDE 2

Scriptless Scripts Introduction

“Scriptless Scripts”?

Scriptless scripts: magicking digital signatures so that they can only be created by faithful execution of a smart contract.

slide-3
SLIDE 3

Scriptless Scripts Introduction

“Scriptless Scripts”?

Scriptless scripts: magicking digital signatures so that they can only be created by faithful execution of a smart contract. Limited in power, but not nearly as much as you might expect

slide-4
SLIDE 4

Scriptless Scripts Introduction

“Scriptless Scripts”?

Scriptless scripts: magicking digital signatures so that they can only be created by faithful execution of a smart contract. Limited in power, but not nearly as much as you might expect Mimblewimble is a blockchain design that supports only scriptless scripts, and derives its privacy and scaling properties from this.

slide-5
SLIDE 5

Scriptless Scripts Introduction

Why use Scriptless Scripts?

Bitcoin (and Ethereum, etc.) uses a scripting language to describe smart contracts and enforce their execution

slide-6
SLIDE 6

Scriptless Scripts Introduction

Why use Scriptless Scripts?

Bitcoin (and Ethereum, etc.) uses a scripting language to describe smart contracts and enforce their execution These scripts must be downloaded, parsed, validated by all full nodes on the network.

slide-7
SLIDE 7

Scriptless Scripts Introduction

Why use Scriptless Scripts?

Bitcoin (and Ethereum, etc.) uses a scripting language to describe smart contracts and enforce their execution These scripts must be downloaded, parsed, validated by all full nodes on the network. Have little intrinsic structure to be compressed or aggregated

slide-8
SLIDE 8

Scriptless Scripts Introduction

Why use Scriptless Scripts?

Bitcoin (and Ethereum, etc.) uses a scripting language to describe smart contracts and enforce their execution These scripts must be downloaded, parsed, validated by all full nodes on the network. Have little intrinsic structure to be compressed or aggregated The details of the script are visible forever and compromise privacy and fungibility.

slide-9
SLIDE 9

Scriptless Scripts Introduction

Why use Scriptless Scripts?

Bitcoin (and Ethereum, etc.) uses a scripting language to describe smart contracts and enforce their execution These scripts must be downloaded, parsed, validated by all full nodes on the network. Have little intrinsic structure to be compressed or aggregated The details of the script are visible forever and compromise privacy and fungibility. With scriptless scripts, the only visible things are public keys (i.e. uniformly random curvepoints) and digital signatures.

slide-10
SLIDE 10

Scriptless Scripts Introduction

Schnorr Signatures Support Scriptless Scripts

Schnorr signatures: signer has a secret key x, ephemeral secret key k. Publishes a public key xG.

slide-11
SLIDE 11

Scriptless Scripts Introduction

Schnorr Signatures Support Scriptless Scripts

Schnorr signatures: signer has a secret key x, ephemeral secret key k. Publishes a public key xG. A signature is the ephemeral public key kG as well as s = k − ex where e = H(kGxGmessage).

slide-12
SLIDE 12

Scriptless Scripts Introduction

Schnorr Signatures Support Scriptless Scripts

Schnorr signatures: signer has a secret key x, ephemeral secret key k. Publishes a public key xG. A signature is the ephemeral public key kG as well as s = k − ex where e = H(kGxGmessage). Verified by checking sG = kG − exG

slide-13
SLIDE 13

Scriptless Scripts Introduction

Schnorr Signatures Support Scriptless Scripts

Schnorr signatures: signer has a secret key x, ephemeral secret key k. Publishes a public key xG. A signature is the ephemeral public key kG as well as s = k − ex where e = H(kGxGmessage). Verified by checking sG = kG − exG ECDSA signatures (used in Bitcoin) have the same shape, but s lacks some structure and e commits to only the message.

slide-14
SLIDE 14

Scriptless Scripts Scriptless scripts in the wild

Simplest (Sorta) Scriptless Script

OP RETURN outputs are used in Bitcoin to encode data for purpose of timestamping

slide-15
SLIDE 15

Scriptless Scripts Scriptless scripts in the wild

Simplest (Sorta) Scriptless Script

OP RETURN outputs are used in Bitcoin to encode data for purpose of timestamping Instead, replace the public key (or emphemeral key) P with P + Hash(Pm)G.

slide-16
SLIDE 16

Scriptless Scripts Scriptless scripts in the wild

Simplest (Sorta) Scriptless Script

OP RETURN outputs are used in Bitcoin to encode data for purpose of timestamping Instead, replace the public key (or emphemeral key) P with P + Hash(Pm)G. Replacing the public key is called “pay to contract” and is used by Elements and Liquid to move coins onto a sidechain.

slide-17
SLIDE 17

Scriptless Scripts Scriptless scripts in the wild

Simplest (Sorta) Scriptless Script

OP RETURN outputs are used in Bitcoin to encode data for purpose of timestamping Instead, replace the public key (or emphemeral key) P with P + Hash(Pm)G. Replacing the public key is called “pay to contract” and is used by Elements and Liquid to move coins onto a sidechain. Replacing the emphemeral key is called “sign to contract” and can be used to append a message commitment in any ordinary transaction with zero network overhead.

slide-18
SLIDE 18

Scriptless Scripts Scriptless scripts in the wild

Simplest (Sorta) Scriptless Script

OP RETURN outputs are used in Bitcoin to encode data for purpose of timestamping Instead, replace the public key (or emphemeral key) P with P + Hash(Pm)G. Replacing the public key is called “pay to contract” and is used by Elements and Liquid to move coins onto a sidechain. Replacing the emphemeral key is called “sign to contract” and can be used to append a message commitment in any ordinary transaction with zero network overhead. Works with Schnorr or ECDSA

slide-19
SLIDE 19

Scriptless Scripts Scriptless scripts in the wild

multi-Signatures in Scriptless Script

By adding Schnorr signature keys, a new key is obtained which can only be signed with with the cooperation of all parties.

slide-20
SLIDE 20

Scriptless Scripts Scriptless scripts in the wild

multi-Signatures in Scriptless Script

By adding Schnorr signature keys, a new key is obtained which can only be signed with with the cooperation of all parties. Can be generalized to m-of-n by all parties giving m-of-n shares to all others so they can cooperatively replace missing parties.

slide-21
SLIDE 21

Scriptless Scripts Scriptless scripts in the wild

multi-Signatures in Scriptless Script

By adding Schnorr signature keys, a new key is obtained which can only be signed with with the cooperation of all parties. Can be generalized to m-of-n by all parties giving m-of-n shares to all others so they can cooperatively replace missing parties. (Don’t try this at home: some extra precautions are needed to prevent adversarial choice of keys.)

slide-22
SLIDE 22

Scriptless Scripts Scriptless scripts in the wild

multi-Signatures in Scriptless Script

By adding Schnorr signature keys, a new key is obtained which can only be signed with with the cooperation of all parties. Can be generalized to m-of-n by all parties giving m-of-n shares to all others so they can cooperatively replace missing parties. (Don’t try this at home: some extra precautions are needed to prevent adversarial choice of keys.) Works with Schnorr only.

slide-23
SLIDE 23

Scriptless Scripts Scriptless scripts in the wild

moSt exSpressive Scriptless Script

Zero-Knowledge Contingent payments: sending coins conditioned on the recipient providing the solution to some hard problem.

slide-24
SLIDE 24

Scriptless Scripts Scriptless scripts in the wild

moSt exSpressive Scriptless Script

Zero-Knowledge Contingent payments: sending coins conditioned on the recipient providing the solution to some hard problem. Recipient provides a hash H and a zk-proof that the preimage is the encryption key to a valid solution. Sender puts coins in a script that allows claimage by revealing the preimage.

slide-25
SLIDE 25

Scriptless Scripts Scriptless scripts in the wild

moSt exSpressive Scriptless Script

Zero-Knowledge Contingent payments: sending coins conditioned on the recipient providing the solution to some hard problem. Recipient provides a hash H and a zk-proof that the preimage is the encryption key to a valid solution. Sender puts coins in a script that allows claimage by revealing the preimage. Use the signature hash e in place of H and now you have a scriptless script ZKCP: a single digital signature which cannot be created without the signer solving some arbitrary (but predetermined) problem for you.

slide-26
SLIDE 26

Scriptless Scripts Scriptless scripts in the wild

moSt exSpressive Scriptless Script

Zero-Knowledge Contingent payments: sending coins conditioned on the recipient providing the solution to some hard problem. Recipient provides a hash H and a zk-proof that the preimage is the encryption key to a valid solution. Sender puts coins in a script that allows claimage by revealing the preimage. Use the signature hash e in place of H and now you have a scriptless script ZKCP: a single digital signature which cannot be created without the signer solving some arbitrary (but predetermined) problem for you. Must be done as a multisig between sender and receiver so that the sender can enforce what e is.

slide-27
SLIDE 27

Scriptless Scripts Scriptless scripts in the wild

Simultaneous Scriptless Scripts

Executing separate transactions in an atomic fashion is traditionally done with preimages: if two transactions require the preimage to the same hash, once one is executed, the preimage is exposed so that the other one can be too.

slide-28
SLIDE 28

Scriptless Scripts Scriptless scripts in the wild

Simultaneous Scriptless Scripts

Executing separate transactions in an atomic fashion is traditionally done with preimages: if two transactions require the preimage to the same hash, once one is executed, the preimage is exposed so that the other one can be too. Atomic Swaps and Lightning channels use this construction.

slide-29
SLIDE 29

Scriptless Scripts Scriptless scripts in the wild

Simultaneous Scriptless Scripts

Executing separate transactions in an atomic fashion is traditionally done with preimages: if two transactions require the preimage to the same hash, once one is executed, the preimage is exposed so that the other one can be too. Atomic Swaps and Lightning channels use this construction. The previous hash-preimage construction doesn’t work because a signature hash can’t be controlled like this, plus it would require nonce-reuse (breaking the signature security), plus it would link the two transactions, which violates the spirit of scriptless scipts.

slide-30
SLIDE 30

Scriptless Scripts Scriptless scripts in the wild

Simultaneous Scriptless Scripts

Instead what we do is consider the difference of two Schnorr signatures: d = s − s′ = k − k′ + ex − e′x′

slide-31
SLIDE 31

Scriptless Scripts Scriptless scripts in the wild

Simultaneous Scriptless Scripts

Instead what we do is consider the difference of two Schnorr signatures: d = s − s′ = k − k′ + ex − e′x′ Given kG, k′G, e, e′ this construction can be verified as dG = kG − k′G + exG − e′x′G

slide-32
SLIDE 32

Scriptless Scripts Scriptless scripts in the wild

Simultaneous Scriptless Scripts

Instead what we do is consider the difference of two Schnorr signatures: d = s − s′ = k − k′ + ex − e′x′ Given kG, k′G, e, e′ this construction can be verified as dG = kG − k′G + exG − e′x′G Given d and either s or s′, the other can be computed. So possession of d makes these two signatures atomic!

slide-33
SLIDE 33

Scriptless Scripts Scriptless scripts in the wild

Simultaneous Scriptless Scripts

Instead what we do is consider the difference of two Schnorr signatures: d = s − s′ = k − k′ + ex − e′x′ Given kG, k′G, e, e′ this construction can be verified as dG = kG − k′G + exG − e′x′G Given d and either s or s′, the other can be computed. So possession of d makes these two signatures atomic! But since d is computable by anybody after s, s′ are available, this scheme does nothing to link the two signatures or harm their security.

slide-34
SLIDE 34

Scriptless Scripts Scriptless scripts in the wild

Sorceror’s Scriptless Script

MimbleWimble is the ultimate scriptless script.

slide-35
SLIDE 35

Scriptless Scripts Scriptless scripts in the wild

Sorceror’s Scriptless Script

MimbleWimble is the ultimate scriptless script. Every input and output has a key (actually a Pedersen commitment, but the transaction balances exactly when these commitment behave like keys; this trick is Confidential Transactions).

slide-36
SLIDE 36

Scriptless Scripts Scriptless scripts in the wild

Sorceror’s Scriptless Script

MimbleWimble is the ultimate scriptless script. Every input and output has a key (actually a Pedersen commitment, but the transaction balances exactly when these commitment behave like keys; this trick is Confidential Transactions). A transaction signature uses the multisignature key of all input and output keys (called a “kernel” in MimbleWimble parlance). It is irrelevant what gets signed, just that something is.

slide-37
SLIDE 37

Scriptless Scripts Scriptless scripts in the wild

Sorceror’s Scriptless Script

MimbleWimble is the ultimate scriptless script. Every input and output has a key (actually a Pedersen commitment, but the transaction balances exactly when these commitment behave like keys; this trick is Confidential Transactions). A transaction signature uses the multisignature key of all input and output keys (called a “kernel” in MimbleWimble parlance). It is irrelevant what gets signed, just that something is. Transaction validity is now contained in a scriptless script; further, the signature has be used with other scriptless script constructions (atomic swaps, ZKCP, etc.) to add additional validity requirements with zero overhead.

slide-38
SLIDE 38

Scriptless Scripts Conclusion

Open Problems

Generic scriptless scripts

slide-39
SLIDE 39

Scriptless Scripts Conclusion

Open Problems

Generic scriptless scripts Locktimes or other extrospection

slide-40
SLIDE 40

Scriptless Scripts Conclusion

Thank You Andrew Poelstra <grindelwald@wpsoftware.net>