A commitment contract on Tari Ootle
Lock some TARI against a private goal.
A person you already trust decides if you kept it. Only a hash of the goal goes on the chain — so a debt, a health goal, or a habit never sits on a public ledger, or on someone else’s server.
The simulation is the full product: create a stake, send a referee a link, rule, and see where the money goes. No wallet, no network. The on-chain path is ready once a template is published.
-
1
You write a goal
It stays on your device. The chain stores only a hash, with a random salt.
-
2
You lock an amount
You name a referee, a deadline, a place the money goes if you miss, and a default if nobody rules.
-
3
They rule, or time runs out
Met — the money comes back to you. Missed — it goes to the sink. Silence — your default runs.
Open a stake
This runs in your browser. Nothing is sent to a server. You can later do the same thing on-chain with a wallet.
How Stake works
A short, honest account of the product, the chain, and the limits.
Why Tari
People will put money on a goal. They will not always put the goal itself on a public chain, or in a company’s database. A weight target, a debt, a promise to quit something — that is private. Stake stores only sha256("stake/goal/v1" || goal text || 32-byte salt). Anyone with the text and the salt can check that they match the hash. Nobody else can read the goal from the chain.
The amount is public. It sits in a component vault, the same way many Ootle apps hold funds. The privacy claim is the goal, not the number.
The rules, on-chain
- Open. You lock a positive amount, a goal hash, a referee’s public key, your account (for a refund), a sink account, a deadline epoch, a grace period, and a timeout default. The deadline must be in the future. Both accounts must already exist and be able to receive a deposit — the template checks this, and rejects the transaction if they don’t. You are the transaction signer — the staker.
- Rule, success. Only the referee, and only before the timeout epoch (
deadline + grace). The funds are deposited back to your account. - Rule, fail. Only the referee, same window. The funds are deposited to the sink.
- Timeout. Anyone, at or after the timeout epoch, if nobody has ruled. The default you chose at the start runs: refund, or pay the sink.
A second ruling is rejected. A timeout before the window closes is rejected. A call from anyone but the referee is rejected. The template checks all of this; the engine tests cover each path.
What this will not do
- The referee can lie. There is no automatic evidence (no Strava, no photo proof that the chain will accept). Pick someone you trust, and who will actually answer.
- If you name yourself as referee, this is just a delayed refund button. That’s allowed, and not much of a commitment.
- Both the staker’s refund account and the sink account must already exist when you open the stake, and must be able to receive a deposit. The template checks this and will reject the transaction if they don’t, so funds cannot get stuck against an address that will never accept a deposit.
- The share link that includes your goal is secret only as long as you keep it. Treat it like the goal itself.
Verify a goal
Paste a hash, the original text, and the salt. This uses the same formula as the template. Leading and trailing spaces on the text are trimmed first, the same way they are when a stake is opened. You can do it here without opening a stake.
A documented test vector is: goal run a 5k before the year ends (lowercase, no full stop), salt 11 repeated 32 times, hash e812a457194e9f1907c959abd315848f538fb7029c5144fc064b76d23de22975. The “Fill in a sample” button on the New page uses this same wording.
Code and tests
The Rust template, the engine tests, and this page are in the same repository, MIT licensed. Run cargo test at the repo root (needs the wasm32-unknown-unknown target). Serve this folder with any static server, for example python3 -m http.server 8000.
On-chain
Talk to a published Stake template with the Sapient extension or Tari Universe. Until a template address is set, this page will not try to send a transaction — the simulation is the path for trying the product.