Skip to content

feat(metadata): define canonical MarketMetadataV1 schema and JCS+NFC verification (#144) - #190

Open
ryder777777 wants to merge 1 commit into
OracleDesk:developfrom
ryder777777:feat/issue-144-canonical-market-metadata
Open

ryder777777 wants to merge 1 commit into
OracleDesk:developfrom
ryder777777:feat/issue-144-canonical-market-metadata

Conversation

@ryder777777

@ryder777777 ryder777777 commented Oct 20, 2026 •

Copy link
Copy Markdown

What this does

Adds the v1 market metadata schema (oracledesk.market-metadata/1) along with RFC 8785 JCS + Unicode NFC canonicalization in both TypeScript (agents/core/metadata.ts) and Python (model/market_metadata.py).

  • docs/market-metadata.md & docs/market-metadata-vectors.json: schema rules, field limits, and shared golden vectors (combining characters, astral emoji UTF-16 key ordering vs BMP U+FB00, control char escaping, nested spec).
  • agents/core/metadata.ts & model/market_metadata.py: validateMetadata, canonicalMetadataBytes, metadataHash, verifyMetadata (hashes raw received bytes before parsing and rejects non-canonical inputs), checkAgainstMarket, and LocalMetadataStore (ipfs://<cidv1>).
  • agents/bin/market-maker.ts, scripts/seed-market.sh, scripts/verify-market.sh, docs/frontend-integration.md: wire canonical metadata creation and verification into market creation flows.
    Tested with python3 model/market_metadata.py and cd agents && npm test && npm run build.

Closes #144

Checklist

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test pass
  • Soroban storage keys and checked integer arithmetic verified
  • No secrets or hardcoded keys included

How this was tested

Verified unit test cases covering nominal thresholds, boundary conditions, and deterministic state transitions.

@ryder777777
ryder777777 force-pushed the feat/issue-144-canonical-market-metadata branch from 399c42b to f12af04 Compare October 21, 2026 12:38
@ryder777777
ryder777777 force-pushed the feat/issue-144-canonical-market-metadata branch from f12af04 to 34f4289 Compare October 25, 2026 16:35
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.

Define a canonical market metadata schema and enforce question_hash verification

1 participant