0x04 || X || Y) followed by a sequence of 32-bit integers (most significant byte first)Introduced in 4.0, this command performs an EC-DH key agreement between the key derived at the given path and the peer public key, without ever exposing the private key.
Derivation is refused unless the path belongs to one of the two agreed subtrees, at a depth of at least 5 components:
| Subtree | Prefix | Used by |
|---|---|---|
| NIP-44 | m/44'/1237'/… | Nostr encrypted direct messages |
| EIP-1581 | m/43'/60'/1581'/… | Keycard agreed-secret subtree |
Any other path returns SW 0x6985. This mirrors the rule EXPORT KEY applies to private key export: the transaction-signing subtree is never usable for key agreement.
The returned value is a raw shared secret, not an encryption key. Protocols are expected to run it through their own key derivation function host-side — NIP-44, for example, applies HKDF-extract with the salt "nip44-v2".