Prerequisites
- Node.js 22 or newer and npm
- Git
- One Tiramisu testnet wallet with a little GLM for the relayer to pay gas.
npm run setupcreates it; fund it from the Arkiv faucet.
1
Clone and build
2
Create the relayer wallet
.env (never printed) and shows each wallet’s
address and balance:relay-1 address from the faucet. The quickstart only uses that one.3
Start a relayer
Add two lines to Then start it:
.env:.env
MAX_WAIT_MS=15000 makes the relayer write a batch after 15 seconds even if fewer than 5 records
are waiting (the default is 60 seconds). Rate-limit tokens are off for the quickstart. With no
RELAYER_PRIVATE_KEY set, the relayer uses RELAYER_1_PRIVATE_KEY from npm run setup.4
Write a private record
In a second terminal:The record is owned by a one-time address,
myEntities() finds it from the wallet alone, and an
owner query on the wallet finds nothing.What happened
- The script’s wallet signed one EIP-712 message. The SDK derived a private root key from it.
- For this record the SDK made a fresh one-time owner
Sand an encrypted tag that only the root key can open, then signed the record withS. - The relayer waited for a batch, then created the record and transferred it to
Sin the same transaction. The record’s$creatoris the relayer. - The SDK read the whole batch back and checked the signature, so a relayer that edits a record or hands it to someone else is caught.
myEntities()downloaded the app’s tags and opened the ones that are yours locally.
Next steps
Add it to your app
The private client takes the same parameters as Arkiv’s
createEntity.Run the full network
Two relayers, rate-limit tokens and an OHTTP relay with Docker Compose.