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

createPrivateClient

Derives the user’s keys (one wallet signature, checked twice), contacts the relayers and, when a relayer requires tokens, starts fetching the day’s tokens.

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, and the token issuance request when tokens are needed. Either this or vault is required.
Vault
A ready key vault (KeyVault or WorkerVault) instead of wallet, for example random-root mode.
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 with wallet at session start when a relayer requires them.
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.
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

Last modified on October 12, 2026