Skip to content

Feature/onchain commitments - #4

Merged
SYMBAxx merged 2 commits into
mainfrom
feature/onchain-commitments
Nov 6, 2026
Merged

SYMBAxx merged 2 commits into
mainfrom
feature/onchain-commitments

Conversation

@SYMBAxx

@SYMBAxx SYMBAxx commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Each validator can run as its own process, holding one key share and an identity key behind an authenticated HTTP API (npm run validators:dev starts 5).
  • The coordinator is treated as hostile: all DKG messages are signed and session-bound, so transport-key swaps, forged complaints, dropped-message share harvesting, tampering, replays and re-keying are all blocked.
  • The backend runs the DKG over HTTP on first start, reuses shares on restart, and tolerates up to n−t validators being down.

Verified

  • 5 real validator processes: the DKG ran over HTTP, and a signed-in client's order was decrypted and settled.
  • With 2 validators killed and the backend restarted: same key, order still settled.
  • 55 backend tests, including 7 malicious-coordinator and 6 remote-validator tests.

Still trusted (documented)

Validators don't yet check on-chain that a batch is sealed before releasing shares. That's next: committing ciphertext hashes on-chain.

- Batch commitment is now sha256 over the batch's ciphertexts in
  settlement order (domain-separated, length-prefixed), recorded via
  order-vault.create_batch before any decryption. It previously hashed
  sorted order ids. Batches store content_hash and commitment_tx.
- Each validator reads get_batch from Soroban itself (read-only
  simulation) and refuses shares unless the count and hash match the
  exact ordered ciphertexts it's asked to decrypt. A pending order can't
  be decrypted early, even by a coordinator holding every validator
  token, and nothing can be added, dropped or reordered after sealing.
- No silent fallback: validators without a ledger refuse to decrypt.
  Separate processes must set VALIDATOR_ORDER_VAULT_CONTRACT or opt out
  explicitly with VALIDATOR_INSECURE_SKIP_COMMITMENT_CHECK=1. Without a
  contract, the in-process dev ledger stands in.
- Settlement keeps the sealed order of the batch.
- Batch monitor shows each batch's seal, linked to its transaction.
- Works with the already-deployed order-vault (no redeploy).

14 new tests (commitment encoding, sealing-check rejections, Soroban
record decoding, early-decrypt and late-insert attacks). 70 backend
tests pass.
…tion

Document the batch commitment, the validator-side check, and the
no-fallback rule. Narrow the trust section to what remains: the
coordinator choosing batch composition, settlement not yet bound to the
seal, and validators trusting their RPC endpoint. New contributor issues
cover a validator batch policy and binding settle_batch to the seal.
@SYMBAxx
SYMBAxx merged commit b2d7181 into main Nov 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant