What is ROLA?
ROLA (Radix Off-Ledger Authentication) is a challenge-response protocol that lets your backend verify a user owns a Radix account or persona – without submitting any on-ledger transaction. It's the Radix equivalent of "Sign-In with Ethereum" but uses the native Radix Wallet.
How It Works
- Backend generates a challenge – a random 32-byte hex string stored with a 5-minute expiry
- Frontend requests proof – asks the Radix Wallet for accounts or a persona with proof, and the toolkit attaches the challenge it gets from the generator you registered
- User approves in wallet – the wallet does not sign the bare challenge. It signs a blake2b hash of the byte
R, the challenge, the length and text of your dApp definition address, and your website's origin, using the key behind each account or persona (Ed25519 or secp256k1). Binding the origin and dApp definition stops a proof captured on one site from logging anyone into another - Frontend sends proof to backend – the address, its type (
accountorpersona), the challenge, and the public key, signature and curve - Backend verifies –
verifySignedChallengerebuilds the same hash from theexpectedOriginanddAppDefinitionAddressyou configured, checks the signature, then asks the Gateway for the address'sowner_keysmetadata. That metadata holds hashes of public keys, so the check is that the hash of the presented key is among them. If the address has noowner_keysyet, which is the case for an account or persona that has never been touched on ledger, it passes only when the address is the one derived from the public key itself - Your code consumes the challenge – the package checks neither expiry nor reuse, and it never sees your challenge store. Before calling
verifySignedChallenge, look the challenge up and delete it in the same step, then reject the proof if the challenge was missing or expired, as the package's own example server does. The challenge is gone whether or not verification succeeds, so a replayed proof finds nothing to match
Implementation
1. Generate Challenges (Backend)
import crypto from 'crypto'
// Store challenges with expiry (use Redis, DB, or in-memory Map)
const challenges = new Map<string, { expires: number }>()
function createChallenge(): string {
const challenge = crypto.randomBytes(32).toString('hex')
challenges.set(challenge, {
expires: Date.now() + 5 * 60 * 1000 // 5 minutes
})
return challenge
}2. Request Proof (Frontend)
The challenge is never passed to the request builder. You give the Radix dApp Toolkit a generator function, and the toolkit calls that function itself each time it sends a request. withProof() is a flag on the builder, not a place to put the challenge.
import { DataRequestBuilder } from '@radixdlt/radix-dapp-toolkit'
// RDT calls this once per request and attaches the result to it
rdt.walletApi.provideChallengeGenerator(async () => {
const res = await fetch('/api/auth/challenge')
return (await res.json()).challenge
})
// withProof() takes an optional boolean, never the challenge string
rdt.walletApi.setRequestData(
DataRequestBuilder.accounts().atLeast(1).withProof(),
)
const result = await rdt.walletApi.sendRequest() // takes no arguments
if (result.isOk()) {
const { proofs } = result.value // one signed challenge per shared account or persona
}walletApi.sendRequest() accepts no arguments: the builders go to setRequestData() first, or to sendOneTimeRequest(...) if you do not want the request stored for later connections. Every entry in result.value.proofs already has the shape { address, type, challenge, proof }, the argument verifySignedChallenge expects in the next step, so you can pass one straight through without rebuilding it. The curve field is the string 'curve25519' or 'secp256k1', so do not test it against 'ed25519' even though Ed25519 is the signature scheme.
Proving a persona instead
A persona is the identity the user chose to show your dApp, and it stays the same when they share a different set of accounts later, so a session tied to it survives that change. The builder is DataRequestBuilder.persona().withProof(), and the entry it adds to proofs carries type: 'persona' and the persona's identity_rdx1… address, which verifySignedChallenge handles with no other change.
rdt.walletApi.setRequestData(
DataRequestBuilder.persona().withProof(),
DataRequestBuilder.accounts().atLeast(1).withProof(),
)To re-prove addresses the user has already shared, without asking them to pick again, the one-time builder has OneTimeDataRequestBuilder.proofOfOwnership().identity(identityAddress).accounts([accountAddress]), sent with sendOneTimeRequest(...).
When to Use ROLA
| Use Case | Auth Method |
|---|---|
| User login / session creation | ROLA |
| Prove account ownership to backend | ROLA |
| Transfer assets or call components | On-ledger transaction |
| Gate content by badge ownership | ROLA + Gateway query |
For token-gated access, verify ownership with ROLA, then query the account's resources via the Gateway SDK.
Reference Implementation and Maintenance Status (checked November 2026)
Every official piece around ROLA has stopped receiving updates.
- The examples repository is archived. radixdlt/rola-examples is marked archived on GitHub and its most recent commit is dated 8 September 2023. It pins
@radixdlt/radix-dapp-toolkitat0.5.1and setsnetworkId: 13, an id the Gateway SDK's ownRadixNetworkmap does not contain at all, since it goes from 12 straight to 14. The example also predates the@radixdlt/rolapackage: its server verifies proofs with a hand-written implementation underapps/server/src/rola/rather than the package this page recommends. - The package is frozen, and widely installed anyway. @radixdlt/rola is at version 2.1.0, published on 20 November 2024, and npm
latesthas not moved since. Its source repository has had no code change since then; its one 2026 commit, on 22 January, switched the npm publish step to OIDC. Downloads rose anyway, to about 6,400 in September 2026 (npm). - The toolkit is in the same position. The dated version of that story is on Radix dApp Toolkit: bug fixes only, on a volunteer basis, pending a community decision on who takes the libraries on.
Read the archived example for how the parts connect, and check every method name against the type definitions in the version you installed; the two disagree.
Next Steps
- dApp Definition and Wallet Verification – required before the Radix Wallet will accept your requests on Mainnet
External Links
- ROLA documentation
- @radixdlt/rola on npm
- ROLA examples repository – archived September 2023, pinned to RDT 0.5.1; read it for the shape, not for the API
