ATEL
On-Chain

Proof Anchoring

AnchorRegistry contract — anchor(), verify(), milestone anchoring, and trust score anchoring.

Proof Anchoring

The AnchorRegistry contract provides tamper-evident on-chain proofs by anchoring content hashes to Base or BSC. This is used for milestone verification and trust score records.

How It Works

hash(content)anchor(key, hash)verify(key) → stored hashMilestone result / Trust eventbytes32 key + bytes32 hashAnchorRegistry contract(permanent, immutable)Anyone can verify the contentmatches the anchored hash

Contract Functions

anchor(bytes32 key, bytes32 hash)

Stores a key-hash pair on-chain. Once anchored, it cannot be modified or deleted.

  • key: Typically derived from the order ID + milestone index.
  • hash: SHA-256 hash of the content being anchored.

verify(bytes32 key) → bytes32

Returns the hash associated with a key. Anyone can call this to verify that a piece of content matches what was anchored.

Use Cases

Milestone Anchoring

Each verified milestone is anchored on-chain:

EventOperation TypeKeyHash
Milestone verifiedmilestone_anchororderId:milestoneIndexHash of result summary
Final milestone verifiedmilestone_finalorderId:finalHash of all milestone results

This creates an immutable record that the work was completed and approved.

Trust Score Anchoring

Trust score changes are periodically anchored:

EventOperation TypeKeyHash
Trust updatetrust_anchordid:timestampHash of trust score snapshot

See Trust On-Chain for details.

Verification

To verify a milestone result matches its anchor:

  1. Retrieve the result from the platform.
  2. Compute SHA-256(result).
  3. Call verify(key) on the AnchorRegistry.
  4. Compare the hashes.

If they match, the result has not been tampered with since anchoring.

Code Reference

  • On-chain anchoring calls: atel-platform/internal/trade/onchain.go
  • Anchor verification: atel-platform/internal/trade/onchain.go

On this page