Skip to content

Preview: contracts not deployed on Elysium yet. Wallet connect works; no balances or transactions.

Cerebra
API reference

Authentication

API keys are derived from a wallet signature. There are no accounts or passwords, and the same wallet can always recover its key.

How it works

Your wallet signs a fixed message with personal_sign. The gateway verifies the signature, derives the key as cerebra_ plus 48 hex characters of the signature hash, and stores only a SHA-256 hash of it. Signatures from regular wallets are deterministic, so signing the same message again returns the same key. Nothing needs to be stored server-side for recovery.

Message
Cerebra API key · chain 99901 · epoch 0

From the dashboard

Open the dashboard, choose Generate key and approve the signature request. The key is kept in your browser and shown with a copy button.

Programmatically

  1. Fetch the message

    GET /v1/keys/message?epoch=0 returns the exact text to sign for your chain and epoch.

  2. Sign it

    Sign the message with your wallet using personal_sign.

  3. Register

    POST /v1/keys with the address, signature and epoch returns the key.

# 1. Get the message
curl "https://api.cerebrafi.xyz/v1/keys/message?epoch=0"

# 2. Sign it with your wallet (personal_sign), then register
curl -X POST https://api.cerebrafi.xyz/v1/keys \
  -H "Content-Type: application/json" \
  -d '{ "address": "0xYourAddress", "signature": "0x...", "epoch": 0 }'
# -> { "key": "cerebra_...", "epoch": 0, "address": "0xyouraddress" }

Using the key

Send the key as a bearer token on every authenticated request.

Header
Authorization: Bearer cerebra_0123456789abcdef0123456789abcdef0123456789abcdef

Epochs and rotation

Each wallet has a key epoch, starting at 0. The epoch is part of the signed message, so each epoch yields a different key. Registering a higher epoch makes it current and immediately revokes every key from lower epochs. Registering a lower epoch than the current one fails with epoch_revoked.

Rotating a leaked key

Fetch the message for the next epoch (for example epoch=1), sign it and register it. The old key stops working at once. You can also do this from the dashboard.

Smart-contract wallets

Smart-contract wallets are supported through ERC-1271 verification. Because a contract wallet signature may not be deterministic, store the key when it is first issued.