Skip to content

Proposal: WAVS-attested TEE resolution for binary-market and cw-reality #12

Description

@Dragonmonk111

Context

Your GOAL.md and ADR-017 already pin the Juno Agents DAO core (juno18k65at7fkf8elhece0fnhsvuxggqg6cved6trp5fyk3lftfn93xsmpeaac) as the v1 verdict_authority. We built that DAO core (the �gent-company contract) with OutcomeCreate/OutcomeResolve proposal kinds and a WAVS+TEE attestation system for trustless resolution.

We'd like to contribute the integration layer that makes this connection real, tested, and verifiable.

What We Have

  • agent-company contract (v7, live on uni-7, Code ID 80) with:
    • OutcomeCreate — creates verifiable outcome markets, emits WAVS trigger events
    • OutcomeResolve — resolves with attested outcome + �ttestation_hash
    • SubmitAttestation — stores TEE-attested results on-chain
  • WAVS bridge — off-chain WASI component execution inside TEE, with on-chain attestation verification
  • WAVS invoke API — prototype with 15/15 smoke tests passing
  • Cross-platform determinism — proven byte-identical across AMD EPYC builds (3/3)
  • TEE deployment plan — finalized for production (GCP Spot / Akash SEV-SNP)

Proposed Contributions (3 PRs, issue-first per CONTRIBUTING.md)

1. Integration Tests — agent-company as verdict_authority (lowest risk)

Prove the existing architectural integration works end-to-end:

  • cw-multi-test setup with both �gent-company and �inary-market
  • Test: create market trade challenge DAO proposal vote execute GovernanceVerdict resolve redeem
  • Edge cases: stale verdict, wrong sender, double resolution

Files: contracts/binary-market/tests/verdict_authority_integration.rs (new)

2. Optional �ttestation_hash on GovernanceVerdict (core value-add)

Add an optional �ttestation_hash: Option field to the GovernanceVerdict execute message. When present:

  • Binary-market cross-queries �gent-company for the attestation
  • If verified, emits a wavs_verified_verdict event
  • Creates a hardware-sealed receipt for every resolution — the verifiable outcome market

Files: contracts/binary-market/src/{msg.rs, contract.rs, state.rs}, new tests

3. WAVS-attested answer path for cw-reality (deep integration)

Add SubmitAttestedAnswer to cw-reality:

  • TEE-attested WAVS operator submits answers with hardware proof
  • Reduced bond requirement for attested answers (higher trust)
  • Bond escalation still works as the challenge layer on top
  • Best for objective questions (price feeds, block heights, sports scores)

Files: contracts/cw-reality/src/{msg.rs, contract.rs, state.rs}, new tests

Architecture

`
market-factory binary-market cw-reality (oracle)

          verdict_authority (agent-company / Juno Agents DAO core)
                  
          WAVS bridge  TEE-sealed WASI component
                  
          SubmitAttestation (on-chain attestation registry)

`

Safety Posture

  • All changes are additive — existing flows (bond escalation, DAO verdict without attestation) remain unchanged
  • No deployed behavior modified without separate approval
  • New fields are Option — backward compatible
  • Integration tests are non-deployable (cw-multi-test only)

What We're Not Proposing

  • No changes to ADRs (that's your call)
  • No changes to deployed contract behavior without approval
  • No changes to protocol parameters or collateral types
  • WAVS/TEE attestation is an optional path, not a replacement for bond escalation

Questions for Review

  1. Is the optional �ttestation_hash on GovernanceVerdict acceptable, or would you prefer a separate adapter contract?
  2. For cw-reality's attested answer path — should it be a new message variant or a flag on SubmitAnswer?
  3. Should we start with integration tests (PR 1) to prove the basic connection before proposing contract changes?

Happy to adjust scope based on your preferences. We have a working PR (#11) for the liveness keeper tool that's already open for review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions