OpaqueReputationVerifier (bundled address per chain).
Discovery
discoverTraitsV2(rows, options)
Use this for schema-bound V2 attestations created by issueAttestation. V2 announcements
use marker 0xB2, include 130 bytes of metadata, and are validated against the target
chain’s schema registry before the SDK returns them.
| Param | Type | Description |
|---|---|---|
rows | IndexerAnnouncement[] | Native announcement rows from fetchAnnouncementRows(chain) or your indexer |
options.chain | "ethereum" | "solana" | Chain whose schema registry validates the marker |
options.schemas | SchemaV2[] | Optional cached schema snapshot. The SDK fetches all schemas when omitted |
options.currentSlot | number | bigint | Optional block or slot for expiry checks |
options.trustedIssuers | string[] | Optional issuer allowlist in chain-native identity format |
Promise<DiscoveredTrait[]>.
For V2, DiscoveredTrait includes schemaId, schemaName, issuer, attestationUid,
dataHex, nonce, merkleLeafPreimage, isValid, and issuerAuthorized in addition
to the shared stealth address, tx hash, block/slot, discovery time, and ephemeral pubkey.
generateReputationProof consumes merkleLeafPreimage automatically.
Attestation metadata never arrives over the cross-chain UAB because the Wormhole payload
only carries a 24-byte metadata tail. Fetch trait rows natively on each chain.
discoverTraits(rows)
Legacy V1 discovery for 0xA7 metadata markers. New schema-bound attestations issued by
issueAttestation use V2, so call discoverTraitsV2 for current app flows.
Promise<DiscoveredTrait[]> with V1 fields: attestationId,
stealthAddress, txHash, blockNumber, discoveredAt, and ephemeralPubkey.
getReputationTraitsFromAnnouncements(rows)
Legacy alias for discoverTraits.
announcementsJsonForReputationWitness(rows)
Serialize announcements for the prover witness.
getStealthSignerPrivateKeyForReputationTrait(trait)
Reconstruct signing key for a discovered trait.
Proof generation
generateReputationProof(params)
Generate Groth16 proof bundle (requires snarkjs).
discoverTraitsV2, the prover reads issuerPkX, traitDataHash,
and nonce from trait.merkleLeafPreimage. You can still pass those fields manually to
override the trait context. If they are absent, the prover fills deterministic dev-mode
defaults.
Returns: ProofData: { proof, publicSignals, nullifier, attestationId }. The
public signals are [merkle_root, attestation_id, external_nullifier, nullifier_hash]
and nullifier carries nullifier_hash.
Merkle roots
fetchLatestValidReputationRoot()
Latest non-expired root from verifier rootHistory.
isReputationRootValid(root)
Whether the verifier currently accepts this root.
fetchReputationRootHistory()
Full root history with per-entry validity.
Verification
verifyReputationProofView(args)
Read-only on-chain view; does not consume the nullifier.
simulateReputationVerification(wallet, args)
Simulate verifyReputation for gas / revert checks (Ethereum).
submitReputationVerification(chain, args)
Broadcast the proof to the verifier. Consumes the nullifier on success.
ethereumWalletClient (EVM) or solanaWallet (Solana).
Static scope helpers
buildActionScope / externalNullifierFromScope from @opaquecash/psr-core.