Skip to content

About

ICRC-126 for motoko

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

icrc126-mo

Source: https://github.com/icdevsorg/icrc126-mo · Package: https://mops.one/icrc126-mo

mops add icrc126-mo

ICRC-126 — wasm verification — for Motoko. Anyone may publish a wasm; an attestation is what gives it standing. This package records verification requests, attestations and divergence reports, and answers one question: is this wasm verified, and on whose word?

include ICRC126Mixin({
  // Whose single attestation is enough on its own. Empty means "nobody -- quorum only".
  privilegedAttesters = [Principal.fromText("xcn6l-iqaaa-aaaai-raq6q-cai")];
  quorum = 3;                       // ...or this many independent attesters agreeing on a hash
  addRecord = ?addRecord;           // ICRC-3 block sink; null keeps the log in memory only
});

Three things the standard leaves open, and what this package does

ICRC-126 specifies the calls and the block types but not wasm_id, not who may attest, and not how verification is decided. Those are the interesting parts, so they are stated here rather than left to each deployment to guess differently.

wasm_id is the lowercase hex of the wasm hash. It is derivable by anyone holding the bytes, needs no registry lookup, and cannot drift from the artifact it names. A wasm_id that were an opaque counter would make an attestation unverifiable by a third party, which defeats the point.

Anyone may attest. An attestation is a public claim, and refusing to record claims does not make them false — it just moves the argument off-chain. The policy decides whose claim counts.

Verification is a policy over the claims, evaluated on read:

verified(id)  :=  some attestation from a PRIVILEGED attester whose 126hash matches
              ∨   at least QUORUM distinct attesters agreeing on one 126hash
divergent(id) :=  any divergence report, ever

Divergence is sticky and wins. A wasm that one auditor says is wrong is not "verified with a footnote"; it is disputed, and a caller must see that before installing it. Clearing a dispute is an explicit act (icrc126_resolve_divergence), recorded as its own block.

Why one privileged attestation can be enough

The intended privileged attester is a compiler canister: it built the wasm, it is a canister, so its claim is checkable by anyone who can call it. That is a stronger statement than N humans agreeing, and it is why the policy has two independent routes rather than one quorum.

About

ICRC-126 for motoko

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages