Skip to main content

After Your First Contract

Your First Contract ends with two parties, one signature rule, and a witness that lets either of them sign. The pages below are what you do next. Each one adds one idea and one use case, and each one ends on a commit you cause to be refused.

Read them in order. Each page starts its own directory, so a mistake on an earlier page does not block the next one. When a page shows a modality block, that block is the file model/default.modality. Replace the file with it before the commit that follows. Formulas come from the formula cookbook. Models come from the model cookbook.

You learnYou use it to
1. The commit that used to workA rule staysFreeze a note the parties already posted
2. States, not one roomA commit has to be a stepAccept an offer only after it is made
3. A move that never happensA box: every matching stepLet members write, and membership change only together
4. A finish that stays possibleReachabilityKeep a way to mark the offer done
5. The rule that looks rightA box and a diamondRequire a memo before an invoice changes
6. A key, not a person's nameWho signs is a posted keyTake turns
7. Two of threeA thresholdMove a treasury
8. Pay someoneCreate, send, receivePay an invoice
9. Too strong, then too weakA rule can miss the requestBreak a membership rule both ways, then repair it
10. On the testnetA sequenced commitLet a stranger open the contract
11. Get paidA wallet is a contractReceive and send MOD
12. Someone else's wordA fact has to be postedRelease an escrow after delivery is attested
13. Their state, in yoursA repost is a snapshotBind to a price they already posted
14. Commit, then showA hash, then the bodySeal terms, then open them
15. The program and the invariantA program computesSwap, inside the pool's rules
16. An agent may edit, and may not landThe rule binds the toolLand a change only on the path
17. Hand it overReplayCheck a log you did not write

Contract Hub, hub assets, and the JavaScript SDK are how you do the testnet and repost lessons with another person or from code.