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_ENDIFThe envelope
The envelope carries, in order:
- The tag
sats20:contract. - A version byte.
- An empty separator.
- The program JSON, in chunks.
What a deploy produces
- The deployer is the identity address of the signing key.
- The program id is the reveal transaction id.
- The program's
initsteps run once, at deploy, with$program.deployerset. Their writes are stored with the program.
When a deploy fails
A program whose JSON does not compile, or whose init fails, is not deployed.