daitchain

x/pouw Real (skeleton)

Proof-of-Useful-Work credit accrual. Attested AI inference receipts mint non-transferable, decaying credits. Validator block rewards are weighted by the credits delegated to them. Soulbound credits (no bank seam exists by construction).

The credit formula

credit_i(epoch) = sum_jobs ( tokens_out_j
                            x model_weight(m_j)
                            x tee_attested_j
                            x (1 - audit_fail_rate_i) )

model_weight comes from the gov-curated model registry. tee_attested_j is 1 if x/tee_attest validated the receipt's attestation, 0 otherwise. audit_fail_rate_i is a rolling-window count maintained by the keeper.

Decay

credits(now) = credits(last) * 0.5 ^ (delta_blocks / half_life_blocks)

Default half-life: 14 days. The keeper's decayApprox walks integer half-lives (each one a LegacyDec multiplication) then linearly interpolates the residual fraction. Phase 1 may swap in a precomputed lookup table.

Effective stake (validator reward weighting)

effective_stake_i = stake_i * (1 + alpha * min(credits_i / stake_i, K))
defaults: alpha = 1.0, K = 4.0

K = 4.0 caps the multiplier at 5x: a validator with massive PoUW credit delegated to it cannot dominate beyond five times its bare stake share. This bounds the "compute farms taking over consensus" failure mode.

Commit-reveal flow

  1. Host produces a SPUR-IC receipt off-chain inside the TEE.
  2. Host broadcasts MsgCommitReceipt with commit_hash = sha256(canonicalize(receipt)). Persists indexed by reveal_by_height = ctx.BlockHeight() + Params.commit_reveal_window.
  3. Validators with the receipt in their mempool publish a VoteExtension referencing commit_hash. Any commit referenced by >=2/3 voting power MUST be force-included by the next proposer.
  4. After commit_reveal_window blocks, host broadcasts MsgRevealReceipt carrying the full receipt. Keeper verifies sha256(canonicalize(receipt)) == commit_hash, re-checks the attestation, looks up model_weight, and credits the host.

The commit-reveal window plus the force-include rule means a single colluding validator cannot censor a host's receipt past the next epoch.

Wire formats

Commit hash

commit_hash = sha256( canonicalize( Receipt{
    host, model_id, tokens_out, tee_attested, job_id, commit_height
} ) )

canonicalize is gogo-proto Marshal with deterministic field ordering (the cosmos-sdk default).

ABCI++ vote extension

VoteExtension = proto.Marshal(VoteExt{
    HostCommits: []ReceiptCommit{...}
})

Messages

MsgCommitReceipt   { signer (host), commit_hash, reveal_by_height }
MsgRevealReceipt   { signer, receipt }
MsgRegisterModel   { authority, model_id, weight, approved }   // gov-only
MsgUpdateParams    { authority, params }                       // gov-only

Queries

Distribution override

The keeper provides AllocateTokensOverride. App wiring wraps distrkeeper.RewardsAllocator so that per-validator shares are rewritten by PoUW effective_stake before the standard distribution pipeline pays out.

What's wired today

Real decayApprox, GetDecayedCredits, EffectiveStakeFor formula, soulbound credit accounting (no bank seam by construction), all read queries, MsgUpdateParams (gov-only), the read-side AllocateTokensOverride.

Phase 1 MsgCommitReceipt, MsgRevealReceipt, MsgRegisterModel, EndBlock commit-expiry pruning, ABCI++ ExtendVote body, distribution-override install in app.go, audit-counter rolling-window decrement.

See also