Skip to content

feat(redeem): operator attests service when a holder won't receipt (anti-grief)#21

Merged
drewstone merged 1 commit into
mainfrom
feat/attested-redemption
Jun 13, 2026
Merged

feat(redeem): operator attests service when a holder won't receipt (anti-grief)#21
drewstone merged 1 commit into
mainfrom
feat/attested-redemption

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

The grief

A holder could open a redemption, consume its inference, then refuse to sign the receipt, let the deadline pass, and claimDefault — repaid + penalty from the issuer's collateral, with the operator slashed for serving honestly. Pure griefing against an honest operator.

The fix

The operator now vouches service through the issuing book's quorum (the same quorum that minted the lot — attested redemption is bound to lotBook, so it only applies to batch-minted lots; firm settleFills lots are NO_BOOK).

  • Chain client: settle_redemption_attested, finalize_attested, lot_book getter, and settle_batch_attested_with_lots (returns minted lot ids).
  • Operator pump: the redeem journal records the served work commitment + timestamp; a background pump reconciles each served-but-unreceipted redemption against on-chain state via a pure, unit-tested policy (redeem_attest_action):
    • Open + holder grace elapsed + settle can still beat the deadline → self-sign receiptDigest and post settleRedemptionAttested.
    • Contested + challenge window closed → finalizeAttested.
    • Settled/defaulted/gone → drop.
    • Self-sign completes a single-attester book; an N-of-M book additionally needs peer co-signs (the call reverts and retries until quorum) — the next increment.

Verification

  • settlement-e2e / e2e_anvil now proves attested redemption end-to-end on anvil WITH a time-warp: quorum vouches the receipt the holder never signed, evm_increaseTime past the challenge window, finalizeAttested settles — liability freed, no default. (Contract path also forge-tested in Redemption.t.sol.)
  • redeem_attest_action unit test covers Attest / Wait (grace) / Wait (deadline-margin) / Wait (nothing served) / Finalize / Wait (window open) / Drop.
  • operator 20 tests pass; chain + zk crates build; e2e PASS.

Notes

  • The pump self-signs with the operator's attester key; honest by construction (the holder still has the on-chain challenge window — challengeAttested — to void a false claim, backed by the operator's slashable bond).
  • Cherry-picked clean onto current main (merged with the new SURPLUS_ATTESTER_ONLY venue field).

…nti-grief)

A holder could consume a redemption's inference, refuse to sign the receipt,
let the deadline pass, and claimDefault — paid back + penalty from the issuer's
collateral, with the operator slashed for serving honestly. Close it: the
operator now vouches service through the issuing book's quorum.

- chain client: settle_redemption_attested, finalize_attested, lot_book getter,
  and settle_batch_attested_with_lots (returns minted lot ids).
- operator: a background attestation pump. The redeem journal records the served
  work commitment + timestamp; the pump reconciles each served-but-unreceipted
  redemption against on-chain state via a pure, unit-tested policy
  (redeem_attest_action): once the holder's grace passes (and the settle can
  still beat the deadline) it self-signs receiptDigest and posts
  settleRedemptionAttested; once the challenge window closes it finalizeAttested.
  Self-sign completes a single-attester book; an N-of-M book additionally needs
  peer co-signs (the call reverts and retries until quorum) — the next increment.
- e2e: settlement-e2e/e2e_anvil now proves attested redemption end to end on
  anvil WITH a time-warp — quorum vouches, challenge window elapses, finalize
  settles, liability freed, NO default. (The contract path is also forge-tested.)

operator: 20 tests pass (incl. attest_policy); settlement-e2e PASS incl. attested
redemption; zk + chain crates build.
@drewstone drewstone merged commit 77e60bb into main Jun 13, 2026
7 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