On Sui #
What is new: where a shared, public referee helps, TensorChain's records are anchored on Sui as Move contracts. Everything here runs on Sui testnet only. TNZR is testnet only and not for sale; its rates are placeholders.
- Agent permissions and receipts: an issuer grants an agent one narrow capability (a scope, a budget, an expiry), and a job's receipt can be committed only once.
- Predictions before results: Ghost's predicted outcome is committed before a job runs. Only a verified pass can create credit, and that is a rule of the Move types, not a promise.
- TNZR, the prepaid unit for data and compute: it is minted in exactly one place, a deposit into a reserve vault, and burned when compute is spent.
- The compute pool: providers bond TNZR, customers escrow each job, and a wrong result is slashed.
- Open verification: any address that bonds TNZR can check a pool job. The sample is drawn by Sui's on-chain randomness, answers stay hidden until every check is committed, and the majority decides. No key of ours settles the job.
Why it matters: the record never needed a chain to be checked, but payment and permission need a referee that neither side controls. On Sui the rules are code everyone can read, and the verdict on an open-path job is no longer ours to give.
Chain transactions cannot run while this page builds. So the blocks below run what can be checked offline, on the real sources: the Move unit tests, the laws read from the Move source, the commitment arithmetic and the chain watchdog's checker. The live testnet run is reported as recorded, with its object ids.
The contracts' own tests #
import re, subprocess, tensorchain
from pathlib import Path
ROOT = Path(tensorchain.__file__).resolve().parents[2]
POOL = ROOT / "chain" / "sui" / "tc_pool"
import shutil
work = Path("move") # a scratch copy: the build writes here, never into the repo
for pkg in ("tc_pool", "tc_s2"): # tc_pool depends on ../tc_s2
shutil.copytree(ROOT / "chain" / "sui" / pkg, work / pkg, ignore=shutil.ignore_patterns("build"))
run = subprocess.run(["sui", "move", "test", "--build-env", "testnet"], cwd=work / "tc_pool", capture_output=True,
text=True, timeout=600)
out = run.stdout + run.stderr
result = re.search(r"Total tests: (\d+); passed: (\d+); failed: (\d+)", out)
assert result, out[-600:]
names = re.findall(r"\[ PASS\s+\] tc_pool::(\w+)::(\w+)", out)
print(result.group(0))
print("open verification:", ", ".join(n for m, n in names if m == "g6_tests")[:400], "...")
assert result and result.group(3) == "0" and int(result.group(2)) == int(result.group(1)) >= 21
assert any(n.startswith("a_cheating_provider_is_slashed") for _, n in names)
Total tests: 21; passed: 21; failed: 0 open verification: a_cheating_provider_is_slashed_to_the_honest_verifiers_and_the_customer_refunded, a_commitment_after_the_commit_window_is_refused, a_lying_verifier_loses_its_stake_and_the_provider_is_still_paid, a_ninth_verifier_is_refused, a_provider_who_never_reveals_is_slashed_and_the_customer_refunded, a_reveal_before_the_commit_window_ends_is_refused, a_reveal_that_does_not_match_its_commitment_is_refused, a ...
The laws, read from the source #
Some guarantees are about what the code can never do, so they are checked on the source itself.
pool = (POOL / "sources" / "pool.move").read_text()
tnzr = (ROOT / "chain" / "sui" / "tc_s2" / "sources" / "tnzr.move").read_text()
def body(src, name):
"""A Move function's source, from `fun name(` or `fun name<T>(` to its closing brace."""
i = re.search(r"\bfun %s[<(]" % name, src).start()
return src[i:src.index("\n}\n", i)]
sig = body(pool, "settle_open").split("{", 1)[0]
assert "Cap" not in sig and "Cap" not in body(pool, "settle_open") # settling needs no key of ours
assert pool.count("new_generator(") == 1 and "new_generator(r, ctx)" in body(pool, "draw") # the only sampler
assert re.search(r"^entry fun submit_open\(", pool, re.M) # a private entry: the draw can't be retried
assert tnzr.count("coin::mint(") == 1 and "coin::mint(" in body(tnzr, "deposit") # TNZR has exactly one mint
print("settle_open takes no cap; sui::random is the only sampler; TNZR is minted only in deposit")
settle_open takes no cap; sui::random is the only sampler; TNZR is minted only in deposit
Commit, then reveal #
A provider and every verifier first publish only sha256(value ‖ salt ‖ their own address), then reveal. Because the address is inside the hash, nobody can copy another's commitment, and because the values stay hidden until every commitment is in, nobody can copy another's answer. This is the same construction as pool::commitment.
import hashlib
def commitment(value, salt, address):
return hashlib.sha256(value + salt + bytes.fromhex(address[2:].rjust(64, "0"))).hexdigest()
answer = hashlib.sha256(b"the integer kernel's output").digest()
salt = bytes(range(16)) # in a real round each party draws a fresh random salt; fixed here, so the
# page is the same every time it is built
mine = commitment(answer, salt, "0x11")
print("commitment:", mine[:32], "...")
assert commitment(answer, salt, "0x11") == mine # the reveal checks out for its sender
assert commitment(answer, salt, "0x12") != mine # the same answer from another address does not
assert "std::bcs::to_bytes(&who)" in body(pool, "commitment") and "sha2_256" in body(pool, "commitment")
commitment: 17913cc59885560827b19fdaae65ea2d ...
The live run on testnet (recorded) #
Run on Sui testnet on 25 November 2026, with three new verifier keys. The provider and each verifier ran tc-node themselves, and committed the sha256 of the integer kernel's output.
| Job | Who did what | Outcome (sata) |
|---|---|---|
| honest | two verifiers replayed it and agreed | the provider was paid 900,000; each verifier earned 25,000 |
| the provider ran the wrong input | two verifiers replayed it honestly | slashed exactly 20,000,000, split between them; the customer was refunded |
| a verifier lied | it revealed another input's answer | it lost its 1,000,000 stake to the honest majority; the provider was paid |
| a verifier never revealed | it committed and went silent | its stake went to the treasury; the provider was paid |
Every job is conserved to the sata, all four settlements were sent by addresses that are not ours, and no verifier cap was used. The package is tc_pool version 2, 0x8d5bef7e47f9a308a74d14949ab184d1fb3856b14e3c34b4c11c5d3a4c808d90, and the full record is in POOL-PLAN (Result G6).
The chain, watched #
A read-only watchdog checks the live objects in every cycle:
- TNZR's supply equals what the vaults issued;
- every vault's reserves cover what it issued;
- no package changed without our record;
- every job's escrow is right.
This block runs its checker on a recorded-shape snapshot, then on the same snapshot with one sata of supply planted.
import copy, importlib.util
spec = importlib.util.spec_from_file_location("chain_watch", ROOT / "tools" / "chain_watch.py")
cw = importlib.util.module_from_spec(spec); spec.loader.exec_module(cw)
snap = {"mint": {"total_supply": 125_000_000},
"vaults": {"sui": {"reserve": 95_000_000, "staked": 30_000_000, "rate": 1, "issued": 125_000_000}},
"packages": {"tc_pool": {"expected_version": 2, "expected_package": "0x8d5b", "version": 2, "package": "0x8d5b"}},
"jobs": {"g6/a": {"state": 4, "escrow": 0, "price": 1_000_000}}}
bad = copy.deepcopy(snap); bad["mint"]["total_supply"] += 1
print("clean:", cw.check(snap)["ok"], "| one sata planted:", cw.check(bad)["problems"])
assert cw.check(snap)["ok"] and cw.check(bad)["problems"][0].startswith("supply:")
clean: True | one sata planted: ['supply: total 125000001 != issued 125000000']
What it does not do #
- Testnet only. No real money moves, and whether anything runs on mainnet has not been decided.
- Assignment is still ours. The open path takes away the verdict and the sampling, not the scheduler.
- A bond is the only cost of a verifier. A majority of colluding verifiers could still lie.
Back to the start: a workspace in thirty lines.