{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "wallet_addSubAccount",
  "params": [{
    "account": {
      "type": "create",
      "keys": [{
        "type": "p256",
        "publicKey": "0x0123456789abcdef..."
      }]
    }
  }]
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "address": "0x1234567890123456789012345678901234567890",
    "chainId": "0x2105"
  }
}
Experimental RPC method for creating sub accounts
Creates a new sub account associated with the main wallet account. Sub accounts allow for hierarchical account management and delegation.

Parameters

account
object
required
The account configuration object.

Returns

result
object
Sub account information including address and deployment details.
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "wallet_addSubAccount",
  "params": [{
    "account": {
      "type": "create",
      "keys": [{
        "type": "p256",
        "publicKey": "0x0123456789abcdef..."
      }]
    }
  }]
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "address": "0x1234567890123456789012345678901234567890",
    "chainId": "0x2105"
  }
}

Error Handling

CodeMessageDescription
4001User rejected the requestUser denied creating the sub account
4100Requested method not supportedThe method is not supported by the wallet
-32602Invalid paramsInvalid account configuration
This is an experimental feature and the API may change in future versions.