Skip to content

docs: add oracle and dispute threat-model and security-architecture document#597

Merged
greatest0fallt1me merged 2 commits into
Predictify-org:masterfrom
DevSolex:feature/threat-model-doc
Jun 19, 2026
Merged

docs: add oracle and dispute threat-model and security-architecture document#597
greatest0fallt1me merged 2 commits into
Predictify-org:masterfrom
DevSolex:feature/threat-model-doc

Conversation

@DevSolex

Copy link
Copy Markdown
Contributor

Summary

Adds docs/security/THREAT_MODEL.md — a single, code-grounded threat model tying the oracle-resolution and dispute subsystems' defences to their implementations.

Closes #594

Changes

  • docs/security/THREAT_MODEL.md (new) — enumerates oracle and dispute threats with mitigations, each citing the implementing module/function and Error variant from err.rs:
    • Oracle: feed poisoning (whitelist + DEFAULT_CONSENSUS_THRESHOLD = 66), stale-price exploitation (validate_oracle_data, DEFAULT_MAX_STALENESS_SECS = 60, EventOracleValidationConfig), low-confidence manipulation (DEFAULT_MAX_CONFIDENCE_BPS = 500), unavailability/DoS
    • Dispute: griefing/spam (MIN_DISPUTE_STAKE = 10_000_000), Sybil (calculate_stake_weighted_outcome), tie manipulation (exact-tie → oracle stands), double-dispute/double-vote, window expiry
    • Error code quick-reference table for all relevant Error variants
    • Known gaps: no cross-market dispute rate-limiting (tracked Document the oracle-resolution and dispute-attack threat model and security architecture #594), confidence checks Pyth-only, fixed voting window
    • Module/constant index with file:line citations for every claim
  • docs/README.md — adds link to THREAT_MODEL.md in the security section

Acceptance criteria checklist

  • THREAT_MODEL.md enumerates oracle and dispute threats with mitigations
  • Each threat cites the implementing module/function and Error variant
  • Known gaps listed and cross-linked to tracking issue
  • Document linked from docs/README.md
  • Cross-references (not duplicates) ATTACK-VECTORS.md and SECURITY_CONSIDERATIONS.md
  • All cited symbols verified to exist in contracts/predictify-hybrid/src

DevSolex added 2 commits June 18, 2026 16:29
- Update Gap Analysis doc-comment in queries.rs (supersedes 2026-04-23):
  mark every getter as Implemented / Stubbed / Planned with exact call path
- Update API_DOCUMENTATION.md 'Query Functions' section:
  replace flat bullet list with status tables covering all QueryManager
  functions plus out-of-manager getters (bet limits, config, dispute timeout,
  permissions_for_role)
- Flag stubbed metric fields in query_user_balance, query_market_pool, and
  query_contract_state and cross-link to issue Predictify-org#595
- Add grep-based verification method so status can be re-checked at any time

Closes Predictify-org#595
…ocument

- Add docs/security/THREAT_MODEL.md enumerating oracle and dispute threats
  with mitigations, each citing the implementing module/function and Error
  variant from err.rs
- Oracle defenses: whitelist (OracleWhitelist), multi-source consensus
  (OracleIntegrationManager, DEFAULT_CONSENSUS_THRESHOLD=66), staleness
  (validate_oracle_data, DEFAULT_MAX_STALENESS_SECS=60, EventOracleValidationConfig),
  confidence bounds (DEFAULT_MAX_CONFIDENCE_BPS=500), replay prevention
- Dispute defenses: minimum stake (MIN_DISPUTE_STAKE=10_000_000), voting
  window (DISPUTE_EXTENSION_HOURS=24), stake-weighted tally
  (calculate_stake_weighted_outcome), exact-tie -> oracle-stands rule,
  double-dispute prevention (AlreadyDisputed=404)
- Known gaps: no cross-market dispute rate-limiting (tracked Predictify-org#594),
  confidence checks only for providers that supply confidence field,
  fixed voting window
- Update docs/README.md to link THREAT_MODEL.md from security section
- Cross-references ATTACK-VECTORS.md and SECURITY_CONSIDERATIONS.md
  without duplicating content

Closes Predictify-org#594
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

really like this threat model, tying each mitigation back to the actual module/function makes it useful instead of hand-wavy. fyi the red check is the pre-existing test-compile issue in the repo, nothing to do with this docs change, so i'm merging. (closing #596 since this PR already contains it.)

@greatest0fallt1me greatest0fallt1me merged commit a37ec8f into Predictify-org:master Jun 19, 2026
1 check failed
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.

Document the oracle-resolution and dispute-attack threat model and security architecture

2 participants