Attested Compute
Attested Compute evaluates a comparison on an encrypted handle off-chain and returns a covalidator-signed result ("0" or "1") plus an Ed25519 instruction for on-chain verification.
Use this when you need a predicate (for example balance > 100) without decrypting the raw value, and optionally want to prove that result on-chain.
Only addresses that have been allowed on the handle can request attested compute. The covalidator checks the on-chain allowance PDA before decrypting.
Import
Basic Usage
How It Works
- Your wallet signs
${op}:${lhsHandle}:${rhsPlaintext}to prove control ofaddress - Covalidator verifies the signature and the on-chain allowance for
(handle, address) - Covalidator decrypts the handle, runs the comparison, and signs
SHA256(handle || result)(same attestation format as Attested Decrypt) - The SDK returns the boolean result and an
ed25519Instructionyou can prepend to an on-chain verification transaction
Supported Operations
rhsPlaintext is a scalar (bigint or boolean). Booleans are normalized to 1n / 0n.
Example: Credit Check Without Revealing the Score
creditScore >= 700 without ever revealing the raw score to the client as a plaintext integer.
React Integration
API Reference
attestedCompute(args, options)
Parameters:
args:AttestedComputeArgsoptions:AttestedComputeOptions
Promise<AttestedComputeResult>
Types
signMessage can come from a wallet adapter (wallet.signMessage) or, for tests:
Error Handling
Errors
Compute with Allowance Voucher / Session Key
Compute can be performed with a session key instead of the wallet usingattestedComputeWithVoucher():