# snap_getBip32PublicKey

> Reference documentation for the `snap_getBip32PublicKey` method of the Snaps API.

<SnapsAPIReference method={{"name":"snap_getBip32PublicKey","description":"Gets the [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)\npublic key for the derivation path specified by the `path` parameter. Note\nthat this returns the public key, not the extended public key (`xpub`), or\nEthereum address.","parameters":{"kind":"object","type":"{ curve: \"ed25519\" | \"ed25519Bip32\" | \"secp256k1\"; path: string[] } & { compressed?: boolean | null; source?: string | null }","description":"An object containing the parameters for the `snap_getBip32PublicKey` method.","required":true,"properties":[{"kind":"primitive","type":"\"ed25519\" | \"ed25519Bip32\" | \"secp256k1\"","description":"The curve to use for the derived key. This must be a curve supported by\n[`@metamask/key-tree`](https://npmjs.com/package/@metamask/key-tree).","name":"curve","required":true},{"kind":"array","type":"string[]","description":"The derivation path to use for the derived key, represented as an array of\npath segments. For example, the path `m/44'/1'/0'/0/0` would be represented\nas `['m', \"44'\", \"1'\", \"0'\", '0', '0']`.","element":{"kind":"primitive","type":"string","description":null},"name":"path","required":true},{"kind":"primitive","type":"boolean","description":"Whether to return the compressed public key. Defaults to `false`.","name":"compressed","required":false},{"kind":"primitive","type":"string | null","description":"The ID of the entropy source to use. If not specified, the primary entropy\nsource will be used. For a list of available entropy sources, see the\n`snap_listEntropySources` method.","name":"source","required":false}]},"result":{"kind":"primitive","type":"string","description":"The public key as hexadecimal string. May be compressed or uncompressed\ndepending on the `compressed` parameter provided in the request parameters."},"examples":[{"examples":[{"name":"Manifest","language":"json","content":"{\n  \"initialPermissions\": {\n    \"snap_getBip32PublicKey\": [\n      {\n        \"path\": [\"m\", \"44'\", \"3'\", \"0'\", \"0\", \"0\"],\n        \"curve\": \"secp256k1\"\n      }\n    ]\n  }\n}\n"},{"name":"Usage","language":"ts","content":"// This example uses Dogecoin, which has a derivation path starting with\n// \"m / 44' / 3'\".\nconst dogecoinPublicKey = await snap.request({\n  method: 'snap_getBip32PublicKey',\n  params: {\n    // The path and curve must be specified in the initial permissions.\n    path: ['m', \"44'\", \"3'\", \"0'\", '0', '0'],\n    curve: 'secp256k1',\n    compressed: false,\n  },\n})\n\n// '0x...'\nconsole.log(dogecoinPublicKey)\n"}]}],"subjectTypes":["snap"],"restricted":true}}  />
