Skip to main content
A Derive account is owned by a single Ethereum L1 address — and that address can be a multi-sig or any smart contract, not just an EOA. The contract keeps custody and control on L1, while a delegated session key does the day-to-day trading.
All of the steps in this guide can be done through the UX or programmatically.

Why it works differently

Most of the API is driven by signed actions: your wallet produces a single-key EIP-712 signature and the protocol verifies it (see Action signing). A multi-sig or smart contract has no single private key, so it cannot produce that signature directly. Instead, a contract owner operates entirely through L1 onchain actions — transactions it sends to the OnchainActionManager contract. The exchange’s L1 listener picks each one up and applies it, authorized by the transaction’s msg.sender. Two building blocks are enough to run an account end to end:

Deposit

Creating and funding the account is already an L1 call — the same for every owner. See Programmatic Onboarding.

Set session key

Authorize an EOA session key from L1, then let that key sign trades, transfers, and vault operations offchain.
The account owner is whatever address you pass as owner when depositing, and the L1 listener authorizes onchain actions by the transaction’s msg.sender. So the same contract that owns the account must send the OnchainActionManager transactions — set the session key from the multi-sig itself, not from an unrelated EOA.

Set up and operate

1

Create and fund the account

The first deposit creates the account and its subaccounts automatically.Make sure that either
  • owner address you pass into OnchainActionMAnager.depositToNewSubaccount() is the multi-sig / smart contract, or
  • the wallet you send to public/register_deposit_address is the multi-sig / smart contract.
Deposit through the UX or see Programmatic Onboarding for more information.
An onchain Set Session Key is ignored if the account does not exist yet.
2

Authorize a session key via L1

Submit a Set Session Key onchain action from the owner contract. This registers an EOA session key with the protocol scopes you choose (see Access scopes).
3

Operate with the session key

From here everything is normal: the session key logs in and signs actions — trading, transfers, and creating or curating a vault — with no further L1 transactions.When connecting to the UX with the session key you will be prompted to choose between signing in as the session key or the smart contract.
4

Revoke

Remove a key by sending the same action with expiry 0 — the only way to delete a key (the offchain API has no revoke).

Session keys

What a session key is, its scopes, and its lifecycle.

Access scopes

The full protocol and off-chain scope catalog to scope a key tightly.

Programmatic Onboarding

Create and fund the account with an L1 deposit.

Create a Vault

Run a vault from the account with the session key.