@adunai/sdk quickstart
Full install, init, signIn, attestations API, and a wallet-builder walkthrough.
Open quickstart →One handshake. Two SDK surfaces. Sign in with Adunai is the OAuth-shaped grant flow that powers both integration patterns — builders deploying contracts on the substrate, and institutional relying parties verifying African user identity without deploying contracts.
From a user's perspective, the flow is identical to any OAuth handshake: tap, consent in the aID client, return authenticated. Underneath, the grant is recorded on Base; the receiving application reads cryptographically verified attestations directly from the on-chain registries.
adunai.signIn() with clientId + scopes.@adunai/sdkProtocol builders use @adunai/sdk to call signIn on the substrate. The SDK handles the on-chain grant write, scope encoding, and returns a typed grant object.
// Builder · OAuth-shaped grant flow on protocol substrate. import { Adunai } from "@adunai/sdk"; const adunai = new Adunai({ network: "base" }); const grant = await adunai.signIn({ clientId: "com.nimba.app"scopes: [ "identity:handle""attestation:kyc-tier-2""attestation:residency"], }); // Read on-chain attestations for the granted DID. const claims = await adunai.attestations(grant.did); console.log(grant.handle); // @aminata console.log(claims.kyc); // tier-2, verified
@adunai/verifyInstitutional relying parties use @adunai/verify. The package handles the same grant flow but never writes to the substrate — the relying party verifies issuer signatures locally against a trust policy file.
// Relying party · verify a signed attestation locally. import { Adunai, verify } from "@adunai/verify"; const adunai = new Adunai({ network: "base" }); 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 each issuer signature against the trust policy. const ok = grant.attestations.every(verify); // ok === true \u2192 application admitted in seconds
The trust policy is a JSON file local to the relying party. It enumerates which attesters the relying party trusts for which attestation types. 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 · KYC tier 1 (illustrative)
"0xB12...77E9" // Pan-African Bank · KYC tier 1
],
"attestation:residency": [
"0x… attester address" // a national ID authority (illustrative)
],
"attestation:employment": "any-accredited"
}
An any-accredited value accepts any attester in AttesterRegistry for that attestation type. Specific addresses lock the trust set to a curated list.
Scopes follow the pattern <type>:<variant>. Below are the launch-set scopes; full set in the SDK reference.
| Scope | Reads | Tier |
|---|---|---|
identity:handle | User's @handle and DID | Public |
identity:did | DID only (no handle) | Public |
attestation:kyc-tier-1 | Government ID + face match | Baseline |
attestation:kyc-tier-2 | Tier 1 + address + liveness | Enhanced |
attestation:residency | Government-issued residency proof | Enhanced |
attestation:bank-statement-90d | Bank-statement window attestation | Enhanced |
attestation:employment | Employment verification | Enhanced |
attestation:tax-compliance | Tax-authority compliance status | Enhanced |
Architecturally enabled at mainnet. Sign in with Adunai is implemented end-to-end on Base testnet today. Operational institutional ecosystem — the specific list of accredited attesters and the trust-policy boilerplates for major institutions — activates through Phase 1+ as the partnership track matures.
@adunai/sdk quickstartFull install, init, signIn, attestations API, and a wallet-builder walkthrough.
Open quickstart →@adunai/verify quickstartInstall, init, signIn, verify-against-trust-policy, and a relying-party walkthrough.
Open quickstart →