SolanaNoirVerifier
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / SolanaNoirVerifier
Class: SolanaNoirVerifier
Section titled “Class: SolanaNoirVerifier”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17418
Solana Noir Verifier
Enables verification of Noir ZK proofs on Solana blockchain.
Example
Section titled “Example”const verifier = new SolanaNoirVerifier({ network: 'devnet', verbose: true,})
await verifier.initialize()
// Verify proof off-chain (no transaction)const valid = await verifier.verifyOffChain(proof)
// Or verify on-chain (submits transaction)const result = await verifier.verifyOnChain(proof, wallet)Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SolanaNoirVerifier(
config?):SolanaNoirVerifier
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17423
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”SolanaNoirVerifier
Accessors
Section titled “Accessors”isReady
Section titled “isReady”Get Signature
Section titled “Get Signature”get isReady():
boolean
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17431
Check if verifier is initialized
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”getConnection()
Section titled “getConnection()”getConnection():
Connection
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17427
Get the Solana connection
Returns
Section titled “Returns”Connection
getConfig()
Section titled “getConfig()”getConfig():
Readonly<SolanaNoirVerifierConfig>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17435
Get current configuration
Returns
Section titled “Returns”Readonly<SolanaNoirVerifierConfig>
getRpcUrl()
Section titled “getRpcUrl()”getRpcUrl():
string
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17439
Get RPC URL being used
Returns
Section titled “Returns”string
initialize()
Section titled “initialize()”initialize():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17445
Initialize the verifier
Loads verification keys for all circuit types.
Returns
Section titled “Returns”Promise<void>
generateVerificationKey()
Section titled “generateVerificationKey()”generateVerificationKey(
circuitType):Promise<SolanaVerificationKey>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17451
Generate verification key for a circuit type
Creates the cryptographic verification key needed to verify proofs.
Parameters
Section titled “Parameters”circuitType
Section titled “circuitType”Returns
Section titled “Returns”Promise<SolanaVerificationKey>
serializeProof()
Section titled “serializeProof()”serializeProof(
proof):SolanaSerializedProof
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17457
Serialize a proof for Solana
Converts a Noir proof into a format suitable for Solana transaction.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”verifyOffChain()
Section titled “verifyOffChain()”verifyOffChain(
proof):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17474
Verify a proof off-chain
Fast verification without submitting a transaction. Uses the local Noir backend for verification if @aztec/bb.js is available, otherwise falls back to mock verification.
Parameters
Section titled “Parameters”The proof to verify
Returns
Section titled “Returns”Promise<boolean>
true if valid, false otherwise
Remarks
Section titled “Remarks”For production use, install @aztec/bb.js as a dependency:
npm install @aztec/bb.jsverifyOnChain()
Section titled “verifyOnChain()”verifyOnChain(
proof,wallet):Promise<SolanaVerificationResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17500
Verify a proof on-chain
Submits a transaction to Solana to verify the proof using the Sunspot verifier.
Parameters
Section titled “Parameters”The proof to verify
wallet
Section titled “wallet”Wallet interface with signTransaction method
publicKey
Section titled “publicKey”{ toBase58: string; }
publicKey.toBase58
Section titled “publicKey.toBase58”signTransaction
Section titled “signTransaction”<T>(tx) => Promise<T>
Returns
Section titled “Returns”Promise<SolanaVerificationResult>
Verification result with transaction signature
createSunspotVerifyInstruction()
Section titled “createSunspotVerifyInstruction()”createSunspotVerifyInstruction(
proof,programId):TransactionInstruction
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17511
Create a Sunspot verifier instruction
Sunspot verifiers expect instruction data in format: proof_bytes || public_witness_bytes
Parameters
Section titled “Parameters”programId
Section titled “programId”string
Returns
Section titled “Returns”TransactionInstruction
serializeProofForSunspot()
Section titled “serializeProofForSunspot()”serializeProofForSunspot(
proof):Buffer
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17518
Serialize proof for Sunspot verifier
Sunspot expects: proof_bytes || public_witness_bytes where public_witness contains the number of public inputs followed by the values
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Buffer
createVerifyInstruction()
Section titled “createVerifyInstruction()”createVerifyInstruction(
proof):SolanaVerifyInstruction
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17524
Create a verify instruction for Solana
Builds the instruction data and account metas needed for verification.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”getProofStatistics()
Section titled “getProofStatistics()”getProofStatistics(
proof):ProofStatistics
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17530
Get proof statistics
Returns size and compute unit estimates for a proof.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”batchVerify()
Section titled “batchVerify()”batchVerify(
request):Promise<BatchVerificationResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17536
Batch verify multiple proofs
Verifies multiple proofs, optionally failing fast on first invalid.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<BatchVerificationResult>
getVerificationKey()
Section titled “getVerificationKey()”getVerificationKey(
circuitType):SolanaVerificationKey|undefined
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17540
Get verification key for a circuit type
Parameters
Section titled “Parameters”circuitType
Section titled “circuitType”Returns
Section titled “Returns”SolanaVerificationKey | undefined
destroy()
Section titled “destroy()”destroy():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17544
Destroy the verifier and free resources
Returns
Section titled “Returns”Promise<void>