Skip to main content
Peer dependencies in the updated SDK: @arkiv-network/sdk 0.8.1 and viem 2.57.4. Works in browsers and Node.js 22+.

createPrivateClient

Derives the user’s keys (one wallet signature; two the first time on a device), contacts the relayers and, when a relayer requires tokens, starts fetching the day’s tokens. Configuring Semaphore skips automatic token acquisition; membership authorizes records for the configured group project.

Options

string
required
Namespace for key derivation. Different apps get independent keys. Also the default project.
viem or Arkiv SDK wallet client
Signs the derivation message. Either this or vault is required.
true | PasskeyOptions
Sign in with an existing passkey (WebAuthn PRF) instead of a wallet: one biometric or PIN prompt. Create it first with WorkerVault.createPasskey(app, opts?). See passkeys.
boolean
default:"false"
Also find records others wrote to your inbox address. Costs one curve multiplication per record in the app when listing.
number
default:"500"
Apps with at most this many records are downloaded whole when reading, so nothing says which are yours. 0 always fetches batches plus cover batches.
Vault
A ready key vault (KeyVault or WorkerVault) instead of wallet, for example random-root mode.
SemaphoreOptions
Optional group descriptor and snarkArtifacts. The group project must match the client project. Uses recoverable group-specific proofs through the normal record API. Requires a build containing arkognito/semaphore and a relayer configured for that group. See anonymous group permissions.
string
default:"app"
Value of the project attribute on this app’s records. Reads and writes are scoped to it.
string[]
Relayer URLs. Omitted: discover live relayers from their heartbeat entities on Arkiv.
string
Send every relayer call through this Oblivious HTTP relay. Gateway keys are read from heartbeats.
boolean
default:"true in browsers"
Keep keys in a Web Worker. If the worker cannot start, the client warns and keeps keys in-process.
Arkiv public client
default:"public Tiramisu client"
Reader used for all Arkiv queries. Pass your own to use a different RPC or a proxy.
[number, number]
default:"[0, 20000]"
Random delay before each submission, in milliseconds.
number
default:"1"
Smallest batch a record may land in. Above 1, the relayer holds the record until a batch that large forms, or fails it.
number
default:"600000 when minAnonymity is set"
How long the relayer may hold a record for minAnonymity.
number
Give up on a relayer when its queue position has not improved for this long.
number
default:"2000"
Status polling interval.
boolean
default:"false"
Refuse a write when check() returns any warning.
number
default:"3"
Warn when fewer than this many existing records share a record’s attribute values. 0 disables it.
number
default:"2"
Extra random batches fetched alongside your own when reading.
"auto" | TokenSource
default:"\"auto\""
"auto" fetches tokens at session start when a relayer requires them, using tokenIdentity. Semaphore clients skip automatic acquisition and do not redeem a blind token for a membership write.
"derived" | "wallet"
default:"\"derived\""
Who asks the issuer for tokens. "derived": an address derived from the user’s keys for this app, so asking opens no wallet prompt and the issuer never sees the wallet. "wallet": the wallet signs each request, for issuers that key quotas to known wallets.
"first-use" | "always" | "never"
default:"\"first-use\""
When to check that the wallet signs deterministically. "first-use": twice the first time a device sees the wallet for this app, then once against a stored fingerprint.
{ get(key), set(key, value) }
default:"localStorage, else memory"
Where "first-use" remembers verified wallets.
TokenStore
default:"memoryStore()"
Where auto mode keeps unspent tokens. browserTokenStore() keeps them across sessions.
string
One-time attestation code for issuers that require one.
boolean
default:"false"
Count a record as the app’s only if a known relayer created it.
typeof fetch
Custom fetch for relayer and issuer calls.

Client

createEntity

Uint8Array
required
The record’s data.
string
required
Your content type, kept inside the envelope.
AttributeInputs
Queryable attributes. Names must be lowercase.
ExpirationTime | number
required
A relative lifetime, rounded up to 1 h, 1 d, 7 d, 30 d or 90 d.
string
Write under a scope: all records in it share one owner.
boolean
default:"false"
Encrypt the payload so only you can read it.
Hex
Arkiv entity key.
Address
The one-time owner.
Hex
The batch transaction.
string
The relayer that wrote it (empty when recovered).
number
Records in the batch, including this one and any cover records.
number
How many of them the relayer added as cover (COVER_MIN_BATCH).
boolean
The relayer did not answer but the record had landed; nothing was written twice.
CheckWarning[]
Fingerprinting and rarity warnings.

MyRecord

Returned by myEntities(): key, entityKey, owner, creator, app, contentType, data (decrypted), toText(), toJson(), attributes, createdAt, expiresAt, expSeconds, envelope, ref.

Vaults

Every vault implements Vault: newRecord(), scopeRecord(name), openTags(tags), addressOf(ref), signer(ref), encrypt(ref, data), decrypt(ref, data). A signer (ArkognitoSigner) exposes only address, signEnvelope(body, attributes) and signProof(body). Related: derivationTypedData(app, chainId?), DERIVATION_PURPOSE ("arkognito key v1"), scopeRef(name), TAG_BYTES (44).

Verification and proofs

Reading

Tokens

Fingerprinting

Envelopes and attributes

sealEnvelope, parseEnvelope, envelopeSigner, envelopeDigest, padEnvelope, expiryBucket(seconds), expirySeconds(expires), toBase64, fromBase64; canonicalAttributes, toWire, fromWire, nameProblem(name), assertNodeSafeNames(attributes). See the protocol reference for formats.

Oblivious HTTP

Constants

Protocol types are exported too: SubmitRequest, StatusResponse, InfoResponse, TokenRedemption, IssueRequest, IssueResponse.

Errors

Semaphore writes stop automatic failover after submission starts. ArkognitoError may expose txHash, requestId and nullifier for reconciliation; never infer that an error means no write. The optional module exports MembershipInvalid and VerificationUnavailable. See Semaphore reference for group, proof, reader and coordinator exports.
Last modified on October 17, 2026