SATS20

Docs · 04 / 8

Deploying a program

The commit/reveal envelope that publishes a program.

Commit and reveal

Deploying takes two transactions: a commit, then a reveal. The reveal's input 0 spends a taproot leaf of this form:

reveal leaf script
0x20 <pubkey> OP_CHECKSIG OP_FALSE OP_IF <envelope> OP_ENDIF

The envelope

The envelope carries, in order:

  1. The tag sats20:contract.
  2. A version byte.
  3. An empty separator.
  4. The program JSON, in chunks.

What a deploy produces

When a deploy fails

A program whose JSON does not compile, or whose init fails, is not deployed.