- Push then read — submit the signed payload through
submit_data_update, then read the maintainedFeedaccount. - Verify directly — use the framework-independent
molpha-verifierRust crate with caller-supplied registry/node data.
molpha-verifier.
Read the latest result
TheFeed account holds the latest value accepted by submit_data_update. The Molpha program re-verifies the aggregate signature before writing, so a valid Feed account is the canonical maintained state. Gateway settlement records payments in round receipts; it does not write the feed.
With the SDK:
sdk.solana.readFeed for the maintained account. For a raw Anchor fetch without the SDK facade:
Pattern A — off-chain (TypeScript + Anchor)
Derive the feed PDA and fetch it. If you know the owner,apiConfigHash, and quorum, you can compute the feed address with no on-chain lookups:
Pattern B — from your Solana program
Pass theFeed PDA into your instruction and read it. Prefer typed deserialization: value is a Borsh Vec<u8> (4-byte length prefix + bytes), so fixed byte offsets after the discriminator are brittle.
Account scalars (
registry_version, canonical_timestamp) are little-endian Borsh. value is a length-prefixed byte vector (raw payload when ≤32 bytes, or a keccak digest when longer). Validate the PDA with seeds::program = MOLPHA_PROGRAM_ID so a caller can’t substitute a look-alike account. last_updated_slot is emitted on the FeedUpdated event, not stored on the Feed account.declare_program! against the IDL for typed CPI and account helpers.
Push then read
Use this when you want the SolanaFeed account to become the source of truth.
submit_data_update checks:
- aggregate Schnorr signature validity,
- signer bitmap and registry version,
- deterministic signer selection,
- monotonic
canonical_timestamp, - feed value encoding.
Verify directly with molpha-verifier
Use this when your Solana program, native Rust service, CLI, or test harness needs to verify a signed payload without writing it to the Molpha Feed account.
Install:
- account owner checks,
- account deserialization,
- node entry ordering,
- registry version selection,
- mapping
DataUpdateErrorinto your own error type.
Read vs. verify
Reading theFeed gives you the last accepted on-chain value. Direct verification checks a payload you already have. In both paths, your application still enforces freshness, replay protection, expected feedId, quorum, and value bounds.