Skip to main content

Decryption & Attestations

The is_validsignature function verifies Ed25519 signatures for attested decryption results from the covalidator network.

On-Chain Verification

How Attestation Works

Complete Attested Decryption Flow

Summary

  1. Request decryption: Client requests decryption of a handle they have access to
  2. Covalidator processes: The covalidator network decrypts the value in a TEE
  3. Sign attestation: Covalidator signs hash(handle + plaintext_value) with Ed25519
  4. Verify on-chain: Program verifies the signature using is_validsignature

Verification Parameters

ParameterDescription
expected_countNumber of signatures expected in the instruction
handlesVector of handle bytes being verified
plaintext_valuesVector of claimed plaintext values

Account Requirements

The verification requires access to the instructions sysvar:
The Ed25519 signature must be provided in a previous instruction in the same transaction. The is_validsignature function verifies against the instructions sysvar.

Client-Side Decryption

Decryption is initiated client-side using the JavaScript SDK. The SDK handles requesting decryption from the covalidator:
For on-chain verification of decrypted values, use the ed25519Instructions from the result to build a verification transaction. See Attested Decrypt for details.
See the JavaScript SDK Attested Decrypt documentation for complete usage and examples.