Onchain Verifier Contracts
Pluto’s onchain verifier contract allows you to verify cryptographic proofs directly on the blockchain. This enables trustless verification of signatures and data integrity in your decentralized applications.
Current Deployment Status: Our verifier is currently only available on testnet. We’re using Base Sepolia testnet (an Ethereum L2).
Contract Address: 0x2d386a1ed0a1d21d6e2b68bdfa480944a316b6ea
Source Code: Verified on Basescan
How It Works
The verification process follows these steps:
- Obtain output from the Pluto prover
- Format the proof data for onchain verification
- Call the
verifyNotarySignature
function on the contract
Our example GitHub repository provides helper functions to simplify this process:
import { sendProofTx, awaitProofTx } from "../onchain.js";
// Proof data received from the prover
onSuccess: async (proofData) => {
// Send the proof transaction
const result = await sendProofTx(proofData);
// Wait for transaction confirmation
const { verified, error } = await awaitProofTx(result);
};
Contract Documentation
Verifier Contract
The main contract responsible for verifying signatures and managing notaries.
contract Verifier is Ownable {
mapping(address => bool) public isNotary;
mapping(bytes32 => address) public digests;
// ... error definitions ...
constructor(address notaryAddress) Ownable(msg.sender) {
isNotary[notaryAddress] = true;
}
// ... functions ...
}
Key Functions
verifyNotarySignature
function verifyNotarySignature(
bytes32 digest,
uint8 v,
bytes32 r,
bytes32 s,
address signer,
bytes32 manifest,
bytes32 value
) external returns (bool)
This is the primary function for verifying signatures. It:
- Checks if the signer is a registered notary
- Verifies the digest is correctly formed from the manifest and value
- Recovers the signer address from the signature components (v, r, s)
- Ensures the proof hasn’t been used before
- Records the proof as used by associating it with the sender’s address
Parameters:
digest
: The hash of the data that was signedv
: The recovery ID (27 or 28)r
: The R value of the signatures
: The S value of the signaturesigner
: The address that signed the datamanifest
: The manifest of the datavalue
: The value of the data
Returns:
bool
: True if verification succeeds
Notary Management
The contract includes functions for managing trusted notaries:
function addNotary(address notaryAddress) external onlyOwner
function removeNotary(address notaryAddress) external onlyOwner
These functions allow the contract owner to add or remove notaries from the trusted list.
Internal Verification
function verify_digest(bytes32 digest, bytes32 manifest, bytes32 value) internal pure returns (bool)
This internal function verifies that the digest is correctly formed as a merkle root of the keccak256 hash of the value and manifest.