Skip to content
An attestation represents a verified claim or statement in the Solana Attestation System. Attestations are created by authorized signers under a credential and follow a specific schema. Each attestation contains the actual data of the claim and metadata about its creation and validity.

​Structure

The Attestation struct represents an attestation in the Solana Attestation System. Each attestation links to a credential, schema, and contains the attested data along with metadata about its creation and validity period.

​Type Definitions

​Attestation

​AttestationArgs

​Methods

​Fetching Attestations

MethodDescriptionParametersReturns
fetchAttestationFetches a single attestation by its addressrpc: RPC context, address: Attestation’s address, config?: Fetch configPromise<Account<Attestation>>
fetchMaybeAttestationSafely fetches an attestation, returns null if not foundrpc: RPC context, address: Attestation’s address, config?: Fetch configPromise<MaybeAccount<Attestation>>
fetchAllAttestationFetches multiple attestations by their addressesrpc: RPC context, addresses: Array of attestation addresses, config?: Fetch configPromise<Account<Attestation>[]>
fetchAllMaybeAttestationSafely fetches multiple attestations, skips not foundrpc: RPC context, addresses: Array of attestation addresses, config?: Fetch configPromise<MaybeAccount<Attestation>[]>

​Serialization

MethodDescriptionParametersReturns
getAttestationEncoderGets the encoder for attestation dataNoneEncoder<AttestationArgs>
getAttestationDecoderGets the decoder for attestation dataNoneDecoder<Attestation>
getAttestationCodecGets the codec for attestation dataNoneCodec<AttestationArgs, Attestation>

​Usage Examples

The examples use the rpc from Create a Client.

​Fetching a Single Attestation

​Fetching Multiple Attestations

​Safe Fetching

​Important Notes

  • The discriminator field is used internally and should not be modified
  • The nonce provides a unique identifier for each attestation
  • credential and schema fields link the attestation to its associated credential and schema
  • The data field contains the actual attestation data and should be properly encoded/decoded according to the schema
  • signer must be one of the authorized signers of the associated credential
  • expiry determines when the attestation becomes invalid
  • tokenAccount links the attestation to a specific token account
  • Attestations can only be created by authorized signers of the associated credential
  • The attestation data must conform to the structure defined by the associated schema