nexus_getVaultState
Get vault state for a user.
Vault state including balances and pending withdrawals
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_getVaultState","params":["0x1234..."],"id":1}'
{
"jsonrpc": "2.0",
"result": {
"l1_balance": 100000,
"l2_balance": 50000,
"pending_withdrawals": [],
"vault_address": "bcrt1p..."
},
"id": 1
}
nexus_getVaultAddress
Get deposit vault address for an L2 address.
Vault address information
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_getVaultAddress","params":["bcrt1p..."],"id":1}'
{
"jsonrpc": "2.0",
"result": {
"vault_address": "bcrt1p...",
"l2_address": "bcrt1p...",
"protocol_key": "1234...",
"timelock": 2016
},
"id": 1
}
nexus_deriveVaultFromPubkey
Derive vault address from public key.
32-byte x-only public key (hex)
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_deriveVaultFromPubkey","params":["0x1234..."],"id":1}'
nexus_registerPubkey
Register a public key for vault derivation.
32-byte x-only public key (hex)
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_registerPubkey","params":["0x1234..."],"id":1}'
nexus_requestWithdrawal
Request a withdrawal from L2 to L1.
Bitcoin destination address
Withdrawal request result
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_requestWithdrawal","params":["0x1234...", "bcrt1p...", 10000],"id":1}'
Vault Architecture
NEXUS vaults use Taproot addresses with two spending paths:
Protocol Path
The protocol maintains L1 vault balances to always match L2 balances, ensuring 1:1 backing.
Escape Path
Users can recover funds after a timelock (default: 2016 blocks ≈ 2 weeks).
Vault Address (P2TR)
├── Protocol Path: <ProtocolKey> OP_CHECKSIG
└── Escape Path: <Timelock> OP_CSV OP_DROP <UserKey> OP_CHECKSIG
The escape path ensures users can always recover their funds, even if the protocol becomes unresponsive.