@adunai/verify · integrate pattern.
For institutional relying parties. Banks, embassies, employers, government agencies, educational institutions, healthcare providers. Sign in with Adunai, scoped attestation reads, local issuer-signature verification against a trust policy. No on-chain writes. No contract deployment.
Planned Phase 1 package, not yet published. The methods below are the target API for the relying-party release. Verification against the live Base Sepolia registries works today via @adunai/sdk in the protocol repository.
Install
# @adunai/verify is a planned Phase 1 package, not yet published. # Today: read the live registries via @adunai/sdk (in the protocol repo).
Peer dependencies: viem ^2.x. Node 18+ or any modern bundler. No wallet, no private key — @adunai/verify is read-only against the substrate.
Initialize
import { Adunai } from "@adunai/verify"; const adunai = new Adunai({ network: "base"rpc: "https://sepolia.base.org"});
Sign in · signIn()
Same OAuth-shaped flow as the builder pattern. The user reviews scopes in their aID client and approves or denies the grant. Returns a typed Grant with attached attestations.
const grant = await adunai.signIn({ clientId: "gov.republic.visa"scopes: [ "attestation:kyc-tier-1""attestation:bank-statement-90d""attestation:employment""attestation:tax-compliance"], trustPolicy: "./trust-policy.json"});
Verify · verify(attestation)
The grant returns the granted attestations. Each carries its issuer signature. verify() checks the issuer signature against the trust policy — locally, no network call.
import { verify } from "@adunai/verify"; const ok = grant.attestations.every(verify); if (ok) { // All issuer signatures match the trust policy. Application admitted. } else { const bad = grant.attestations.filter(a => !verify(a)); // Inspect bad[].issuer, bad[].type, typically an attester not in the trust policy. }
Trust policy
The trust policy is a JSON file local to your application. It maps attestation types to the attesters you trust for that type. The protocol does not run a global trust list — each relying party chooses its own attester set.
{
"attestation:kyc-tier-1": [
"0x… attester address"// Ndiga ID (illustrative)
"0xB12...77E9" // Pan-African Bank
],
"attestation:bank-statement-90d": [
"0xB12...77E9""0x4F1...C228"
],
"attestation:employment": "any-accredited""attestation:tax-compliance": [
"0x… attester address" // Government tax authority
]
}
Trust-policy values
| Value | Means |
|---|---|
["0x...", "0x..."] | Accept only this curated list of attester addresses. |
"any-accredited" | Accept any attester registered in AttesterRegistry for this attestation type. |
"any" | Accept any signature whatsoever. Not recommended. |
Walkthrough · visa application portal
End-to-end example: an embassy receives a visa application. Applicant signs in via aID and grants KYC, bank-statement, employment, and tax-compliance scopes. Embassy verifies each cryptographically; the application is admitted in seconds.
import { Adunai, verify } from "@adunai/verify"; const adunai = new Adunai({ network: "base" }); async function handleVisaApplication(req) { const grant = await adunai.signIn({ clientId: "gov.republic.visa"scopes: [ "attestation:kyc-tier-1""attestation:bank-statement-90d""attestation:employment""attestation:tax-compliance"], trustPolicy: "./trust-policy.json"}); if (!grant.attestations.every(verify)) { return { decision: "manual-review" }; } const { kyc, bank, employment, tax } = grant.claims; if (kyc.tier >= 1 && bank.averageBalance > 5000 && employment.durationMonths >= 12 && tax.status === "compliant") { return { decision: "admit"applicant: grant.did }; } return { decision: "manual-review" }; }
The whole flow returns a decision in seconds. No paper, no callbacks, no cross-border verification phone calls.
What you do not need
| Capability | Required for @adunai/verify? |
|---|---|
| Deploy a smart contract | No |
| Hold a wallet / private key | No |
| Hold tokens of any kind | No |
| Sign anything on-chain | No |
| Run a node | No (RPC suffices) |
| NDA with Adunai Foundation | No (open SDK; partnership for verifier accreditation only) |
Verifier accreditation · for trusted verifiers
Any institution can use @adunai/verify against public attestations without accreditation. Verifier accreditation is a separate, optional process for institutions whose verification decisions need to carry weight back into the substrate (for example, a bank's KYC outcome flowing forward to other institutions). See [email protected] and the /governance §8.1 accreditation gates.