getPublicKey
Retrieves account public keys for any supported chain. Most chains return a single { keyPath, publicKey } for the path you asked for; Cardano on purpose 1852' returns its payment, stake and drep (governance) keys as a bundle in one call. This verb was split out of getAddress, which no longer returns Cardano's public-key bundle: getAddress returns the address plus a rewardAddress (stake address — Cardano only); a raw pubkey field may still appear on some networks. Use getPublicKey for public keys.
Cardano resolves two key trees from the same chainId, selected by the purpose segment of your keyPath. Send m/1852'/1815'/… (CIP-1852) to get the role bundle. On legacy m/44'/1815'/… this verb returns the single-key shape instead — that tree is plain-transfer only and has no usable stake / DRep key. See Cardano — Derivation purpose.
All families are supported. The response is a union of two shapes — Cardano on purpose 1852' returns the { payment, stake, drep } role bundle; everything else, including Cardano on purpose 44', returns a single { keyPath, publicKey } — except a purpose 44' path whose role segment is 2 or 3 (stake / DRep), which is refused with method_not_found (-32601) rather than returning a key. On purpose 44' only m/44'/1815'/<account>'/0/<index> or …/1/<index> (account hardened, role and index unhardened) returns a key; any other form (other than role 2 / 3 above) is rejected with param_error (-32602).
🔴 Branch on the response shape, not on chainId. The same Cardano chainId produces either shape depending on the keyPath purpose, so a chainId check will read parameter.stake as undefined on a legacy path. Test for the bundle with 'payment' in parameter. Previously this verb was Cardano-only and other chains returned method_not_found (-32601); that is no longer the case.
Requirements
Minimum firmware for each method. The two models are on different version lines, so DCENT Biometric Wallet and DCENT X are listed separately (the numbers are not comparable across models). Below this the request returns the firmware-update error (5005) and the bridge prompts to update.
🔴 Cardano purpose 1852' has its own floor. The device exposes the CIP-1852 tree as a separate coin entry, added in DCENT Biometric Wallet 2.36.2 / DCENT X 1.0.1. Below that the device does not report it at all, so every call on m/1852'/1815'/… fails with device_fw_incompatible (5005) — the method does not matter. Legacy m/44'/1815'/… is unaffected and keeps the older floor. See Cardano — Requirements.
| Method | DCENT Biometric Wallet | DCENT X |
|---|---|---|
getPublicKey | 2.35.0 or higher on Cardano (the WalletConnect capability floor); on other chains the bridge checks no extra floor (the chain's own minimum still applies), and the key is read with the device's WalletConnect key command. Cardano m/1852' is higher — see below | 1.0.0 or higher, same scope and same exception |
getPublicKey on Cardano purpose 1852' | 2.36.2 or higher | 1.0.1 or higher |
Parameters
| Field | Type | Required | Source | Description |
|---|---|---|---|---|
chainId | string | Required | App | CAIP-19 chain id of any supported chain — e.g. eip155:1/slip44:60, cip34:1-764824073 (Cardano) |
keyPath | string | Required | App | BIP32 path of the key to fetch. Must resolve to a currency for this chainId, otherwise -32602. Cardano: send m/1852'/1815'/0'/0/0 for the role bundle (m/44'/… returns the single-key shape) |
addressFormat | enum | Optional | App | Pass the same value you use on getAddress for that account. On Tezos (standard) and Algorand (ledger) it is the only thing that selects the second account, so omitting it selects the default account. |
Request
// Any family — single key
await dcent.getPublicKey({
chainId: 'eip155:1/slip44:60',
keyPath: "m/44'/60'/0'/0/0"
})
// Cardano — role bundle
await dcent.getPublicKey({
chainId: 'cip34:1-764824073',
keyPath: "m/1852'/1815'/0'/0/0"
})
Response — single key (all families, including Cardano on purpose 44')
| Field | Type | Description |
|---|---|---|
body.command | string | getPublicKey |
body.parameter.keyPath | string | The path you requested, returned verbatim (not re-derived) |
body.parameter.publicKey | string | Public key as 0x-prefixed hex. Length/encoding follow the key type — on DCENT X an ed25519 key is 32 bytes and a secp256k1 key is returned uncompressed (65 bytes, 0x04…) — except a Bitcoin Taproot (m/86') key, which is the 32-byte x-only key. The Cardano bundle keys below use the same 0x-prefixed form. |
{
"header": { "version": "1.0", "status": "success", "response_from": "getPublicKey" },
"body": {
"command": "getPublicKey",
"parameter": {
"keyPath": "m/44'/60'/0'/0/0",
"publicKey": "…"
}
}
}
Response — Cardano on purpose 1852' (role bundle)
Cardano is the only chain that returns a bundle — it needs three CIP-1852 roles at once (payment 0 / stake 2 / drep 3) so an App can build staking and governance requests. The keyPath of each role is re-derived from the account you passed.
| Field | Type | Description |
|---|---|---|
body.command | string | getPublicKey |
body.parameter.payment | { keyPath, publicKey } | Payment (spending) key — role 0 (…/0/0) |
body.parameter.stake | { keyPath, publicKey } | Stake (rewards / delegation) key — role 2 (…/2/0) |
body.parameter.drep | { keyPath, publicKey } | DRep governance key — role 3 (CIP-105 DRep role under the 1852' tree, …/3/0) |
{
"header": {
"version": "1.0",
"status": "success",
"response_from": "getPublicKey"
},
"body": {
"command": "getPublicKey",
"parameter": {
"payment": {
"keyPath": "m/1852'/1815'/0'/0/0",
"publicKey": "…"
},
"stake": {
"keyPath": "m/1852'/1815'/0'/2/0",
"publicKey": "…"
},
"drep": {
"keyPath": "m/1852'/1815'/0'/3/0",
"publicKey": "…"
}
}
}
}