Program Spec (Solana)
This is the canonical technical spec for the on-chain OmegaX protocol.
Implementation Status
v0.1is implemented in the current OmegaX on-chain program.v0.1uses SOL-lamport pool liquidity for deterministic end-to-end settlement.- SPL-token vaults, tranche mechanics, and advanced oracle/dispute modules are planned extensions.
Design Goals
- Permissionless pool creation and usage.
- Oracle-pluggable outcome verification.
- Deterministic and auditable payout settlement.
- Privacy-preserving identity linkage (no raw personal health data on-chain).
- Open composability for third-party frontends, backends, and SDKs.
Non-Goals
- No medical diagnosis logic on-chain.
- No storage of raw telemetry (wearable streams, biometrics, PHI).
- No requirement that OmegaX Health is the only oracle.
Permissionless Model
- Anyone can create a pool if they satisfy protocol rent/fee requirements.
- Any oracle can register and stake.
- Any frontend can integrate if it follows instruction contracts.
- Protocol governance controls global parameters, not pool-specific business policy.
Program Modules
core_pool: pool lifecycle, funding, budgets, windows.membership: enrollment, eligibility proofs, membership records.oracle_registry: oracle registration, stake, status, slashing hooks.attestation: attestation replay protection and verification checkpoints.claims: claim submission, validation, settlement state machine.payout: vault debits and wallet transfers.governance_hooks: protocol-level limits and emergency controls.
Core Accounts
| Account | Purpose | Owner/Authority |
|---|---|---|
ProtocolConfig | Global parameters and safety limits | Governance authority |
Pool | Pool metadata, policies, limits, status | Pool authority |
MembershipRecord | User enrollment and status per pool | Program |
OracleRegistryEntry | Oracle identity, key, status, stake config | Oracle + program |
OracleProfile | Structured oracle profile (org type, URLs, capabilities, claim state) | Oracle admin + oracle key + program |
PoolOracleApproval | Pool-specific oracle allowlist entry | Pool authority + program |
CoverageProduct | Reusable coverage template per pool (terms hash, schedule, pricing defaults) | Pool authority + program |
CoveragePolicy | Member-specific policy position for a pool (one per member per pool) | Program |
CoveragePolicyPositionNft | Optional linkage record for policy NFT metadata/mint | Program |
CycleOutcomeState | Per-member, per-cycle attestation aggregate | Program |
AttestationReplay | Replay-protection record keyed by replay hash | Program |
ClaimRecord | Claim lifecycle and final settlement outcome | Program |
Pool Config Model
A pool stores:
pool_idorganization_ref(opaque string/id, optional for permissionless pools)authority_pubkeypayout_lamports_per_pass(v0.1)membership_policy(open, token-gated, invite-permit, or composition)oracle_policy(single signer, allowlist, threshold quorum)payout_policy(caps, windows, per-outcome/per-member constraints)start_slot_or_ts,end_slot_or_tsstatus(draft | active | paused | exhausted | closed)metadata_uri
Membership Policy Model
Membership is policy-driven per pool:
open: any wallet may enroll.token_gate: wallet must hold minimum amount of configured SPL mint (example:$OMEGAX).invite_permit: wallet must submit a valid signed permit from issuer authority.composed:any_oforall_ofover rules above.
This supports:
- Employer/insurer private cohorts.
- Community pools.
- OmegaX consumer pools for
$OMEGAXholders.
Instruction Set (v0.1 implemented + planned)
| Instruction | Signers | Effect |
|---|---|---|
initialize_protocol | protocol admin | Initializes global config |
create_pool | pool authority | Creates Pool and PDA links |
fund_pool | funder | Funds pool account with lamports |
set_pool_status | pool authority | Pauses/resumes/ closes pool |
register_oracle | oracle key | Creates oracle registry entry |
register_oracle_v2 | admin wallet | Creates registry entry (if missing) + structured on-chain profile for an oracle pubkey |
claim_oracle_v2 | oracle key | Claims and activates the registered oracle pubkey |
update_oracle_profile_v2 | oracle key or profile admin | Updates structured oracle profile fields and capability hashes |
set_pool_oracle | pool authority | Approves/disables oracle for a specific pool |
enroll_member | member wallet (+ optional issuer) | Creates or updates MembershipRecord after policy checks |
register_coverage_product_v2 | pool authority | Creates reusable pool-scoped coverage product template |
update_coverage_product_v2 | pool authority | Updates product template metadata/terms/schedule |
subscribe_coverage_product_v2 | member wallet | Member subscribes to product and creates member policy position |
issue_coverage_policy_from_product_v2 | pool authority | Operator issues/renews member policy from selected product |
revoke_member | pool authority | Marks membership revoked |
submit_outcome_attestation | approved oracle key | Stores replay-safe attestation + updates cycle aggregate |
submit_claim | claimant wallet | Settles payout directly from pool liquidity when checks pass |
Planned in next versions:
stake_oracle,unstake_oracle,slash_oracle- SPL token vault payout path
- threshold quorum attestation verification
- dispute/challenge window and arbitration hooks
Claims and Payout State Machine
v0.1 state progression:
- Oracle submits one or more replay-safe attestations for
{member, pool, cycle}. CycleOutcomeStateaccumulatesattestation_countandpass_count.- Claimant submits claim transaction signed by wallet.
- Program transfers payout and marks cycle as claimed.
Deterministic rejection reasons include:
membership_inactivepolicy_mismatchattestation_invalidattestation_replaybudget_exhaustedwindow_expiredclaim_duplicate
Oracle and Attestation Contract
The on-chain program validates:
- Attestation signer identity against pool oracle policy.
- Attestation time window and nonce/domain fields.
- Uniqueness of attestation replay key.
- Outcome/event compatibility with pool payout policy.
The program does not require OmegaX-only formats; it requires canonical payload fields and signature validity.
Oracle Key Separation (Admin vs Oracle Signer)
register_oracle_v2 supports operational separation between:
- Admin wallet: registers the oracle identity/profile and manages organization metadata.
- Oracle signing key: cryptographic key that must call
claim_oracle_v2to activate itself.
This two-step flow prevents silent impersonation when registration and signer wallets differ, while preserving enterprise onboarding workflows where an operator provisions the profile before the oracle signer team completes claim/activation.
Coverage Primitives (v2)
Coverage is intentionally pool-scoped and modeled as:
- Health Plan (
Pool): capital + oracle policy + membership policy. - Coverage Product (
CoverageProduct): reusable template under a pool (terms hash, duration, premium cadence/grace, premium amount defaults). - Coverage Policy Position (
CoveragePolicy): member policy account created from a selected product. - Policy NFT Link (
CoveragePolicyPositionNft): optional metadata/mint linkage.
Design constraints:
- A single pool can host multiple product templates (shared liquidity context).
- A member has one active policy position per pool (policy PDA keyed by pool+member).
- Member path and operator path are both supported:
subscribe_coverage_product_v2(member self-subscribe)issue_coverage_policy_from_product_v2(operator issue/renew)
Security Invariants
- Pool funds can only move through protocol instructions.
- No payout without active membership + valid attestation + policy pass.
- Every payout must map to exactly one settled claim id.
- Replay keys are globally unique per attestation domain.
- Claim idempotency key is stable and cannot settle twice.
- Circuit breakers cap payout velocity per epoch.
Identity and Invite Bridging
- On-chain identity is wallet + opaque subject commitment.
- Invite flow remains off-chain in issuer/partner backends.
- Enrollment permit signatures bridge invite eligibility to on-chain membership without exposing email/PII on-chain.
See: protocol/identity-membership.
Oracle Separation of Duties
- Outcome attestations are signed by oracle/verifier keys.
- Claim transactions are signed by claimants (or their authorized custodial operator).
- Protocol verifies both trust boundaries separately.
Implementation Phasing
- v1: pool, membership, oracle registry, attestation refs, claim settlement.
- v1.1: threshold oracle quorums and challenge window.
- v1.2: tranche/share extensions and redemption windows.
- v2: coverage-style policy modules and secondary market primitives.
Compliance Boundary
Protocol remains neutral infrastructure. Regulatory wrappers are implemented by deployers/frontends as optional modules and policy constraints.