Skip to main content
On Solana you can consume Molpha data three ways: Program ID: MoLF3pgVA9MENSuEujxNNSMaTo71aLyewaH5nrWfUZs on devnet (see Deployments). Accounts, instructions and epoch settlement are documented in Solana program.

Read a feed

A Feed account holds the latest attestation one submitter wrote for a source and quorum. The program verified it before writing, so reading it is safe as long as you check the account’s address and its age. Field meanings are in Solana feed account.

From TypeScript

submitter defaults to the SDK’s wallet. To compute the address yourself, use feedPda(deriveSourceId(apiConfig), signaturesRequired, submitter, MOLPHA_PROGRAM_ID) from @molpha/sdk and fetch it with Anchor and MOLPHA_IDL.

From your program

Pass the Feed PDA into your instruction and constrain its seeds, so a caller can’t substitute a look-alike account. Every field has a fixed size, so offsets after the 8-byte discriminator are constant.
Account integers are little-endian Borsh. For typed access, use Anchor’s declare_program! with the Molpha IDL.

Submit an attestation

submit_attestation is permissionless: any keeper, backend or user can submit, and the program verifies before writing. Each submitter writes its own Feed, created on the first submit.
The program accepts the write only if:
  • the registry version is current, or superseded but still inside its grace period;
  • timestamp / 1000 is within the settlement window and no more than 60 seconds ahead of the cluster clock;
  • signaturesRequired is at least the protocol min_signers;
  • the signers are inside the derived selection set and the aggregate signature verifies;
  • for an existing feed: the same quorum, a strictly newer timestamp, and a registry version no older than the stored one;
  • with raw_value: at most 256 bytes and hashing to the signed value.
Accounts are the submitter (payer), the Registry PDA for the payload’s version, the Feed, ProtocolConfig and the system program, then one signer Node account per set bit of signersBitmap in ascending bit order. A legacy transaction fits up to 19 signers; larger sets need a v0 transaction with an address lookup table. To submit several attestations of one feed in one transaction, use submitAttestations.

Verify directly with molpha-verifier

The molpha-verifier crate is the same verification code the program uses, without the program around it.
Each has a *_with_coalition_key variant that takes the precomputed sum of the signer keys; coalition_key(&signers) computes it.
What the crate leaves to you:
  • Quorum. It does not reject signaturesRequired = 0. Enforce your own minimum.
  • Time. It takes no clock: no freshness, registry activation or grace-period checks.
  • Replay. It keeps no state.
  • Accounts. With default features it reads no accounts: you owner-check and deserialize them and order the node entries. With feature solana, solana::verify_attestation checks the owner, discriminator and length of the Registry and Node accounts and binds each signer to its registry position; you still check that the registry account is the PDA for the payload’s version.

Errors

Common errors from submit_attestation: