On-chain settlement (TON)
The optional economic layer: sharded, non-custodial Tolk contracts on TON. Only paid jobs touch chain — free jobs settle entirely off-chain. Contracts below are deployed and verified on testnet; the on-chain encodings are computed by the real settlement crate.
The settlement rules written as sharded smart contracts on the TON blockchain, so escrow, payouts and penalties are enforced by code instead of a trusted operator. These contracts are deployed and verified on testnet.
Impact: Escrow only releases when the agreed result is presented (HTLC), and stake is slashed automatically — no company can withhold pay or seize funds.
INSTALL duckton FROM community; LOAD duckton;
The on-chain 15% platform fee / 5% verifier commission split shown below is enforced by the deployed contracts; this client extension version is 0.6.1.
- platform_fee
- 1500 bps
- surcharge
- 500 bps
- participation κ
- 500 bps
- slash · wrong
- 1500 bps
- slash · cheat
- 10000 bps
- slash · downtime
- 200 bps
- slash · equivocation
- 5000 bps
- slash · failed-commit
- 1000 bps
- → challenger
- 4000 bps
- → redundancy
- 3000 bps
- → burn
- 2000 bps
- → treasury
- 1000 bps
- quorum / n_default
- 3 / 5
- unbonding / challenge
- 604800s / 86400s
- EcoParams cell hash
- ranking weights (q/s/p)
- 6000/3000/2500 bps
te6cckEBAQEASAAAjAXcAfQB9AXcJxAAyBOID6ALuAfQA+gFF0h26ABejUpRAAZa8xB6QAAACTqAAAFRgAMFCgMDF3ALuAnEA+gAAOpgAAAH0AXf3JY/Validated on-chain (validateEcoParams): split bps sum to 10000, κ ≤ 1000 bps, unbonding ≥ challenge_window, stake tiers ordered. Editable in place via UpdateParams (admin-only, bumps paramsVersion).
- HTLC lock = quorum result hash
- terms cell hash
- escrow B
- 100 TON
- paramsVersion bound
- 1
The address deterministically commits to hash(StateInit{code, data}) where data binds requester + arbiter + B + deadline + ^terms — so each job gets a distinct escrow. Settle is gated on presenting the agreed quorum hash and bounded by B (remainder refunded); refund-on-timeout returns the full balance to the requester. No platform key can seize funds.
Contract reference
storage · opcodes · get-methods · guards0x455343020x534b4b010x414e43010x47504101- from → to
- GlobalParams (codeVersion 1) → GlobalParamsV2 (codeVersion 2)
- address stable
- true
- new getter live
- get_surcharge_bps → 500
SETCODE swapped code in place — address unchanged, paramsVersion/fee/admin preserved.
- name / symbol / decimals
- Duckton / DUCKTON / 9
- transfer locked
- true
- balance
- 0.2 DUCKTON
A slashable accountability bond, not a liquid position — a transferable receipt would let a host sell it and dodge slashing, so outgoing transfers throw RECEIPT_LOCKED for the whole bond lifetime (mint → burn).
STAKE_BINDING_HASH=0x… acton script scripts/deploy_stake.tolk --net testnet ANCHOR_BOND_MIN=100000000 acton script scripts/deploy_anchor.tolk --net testnet ESCROW_AMOUNT=300000000 ESCROW_EXPECTED_HASH=0x… acton script scripts/deploy_escrow.tolk --net testnet GP_FEE_RECIPIENT=<addr> acton script scripts/deploy_global_params.tolk --net testnet
acton verify GlobalParams --address <addr> --net testnet acton verify RecordAnchor --address <addr> --net testnet acton verify JobEscrow --address <addr> --net testnet
cargo test -p p2p-settlement --features ton-live --test testnet_live -- --nocapture
globalparams_update::PASS::fee_bps=250::addr_stable=trueglobalparams_blocklist::PASS::blocked=true::cleared=falsestake_deposit::staked=120000000::eligible=truejetton::minted=120000000::staked=120000000::locked=trueduckton_metadata::PASS::name=Duckton::symbol=DUCKTON::decimals=9escrow_settle::settled=trueanchor_submit::epoch=3::prev_epoch=2inclusion::verified=truemultileaf_inclusion::PASS::epoch=4::included=true::tampered_rejected=truedispute::skippedDeployed StakeVault to kQCPKeaiuRjie18t7_epsxuF09rd8XyzS0-xCHXvTeb3-IVU
On-chain encodings (GlobalParams cell, escrow address, message BoCs) computed by p2p_settlementoffline. Addresses, code hashes, verification & gas read from the repo's deployment artifacts & testnet logs. real