> For the complete documentation index, see [llms.txt](/llms.txt).

- Snap
- Restricted

# snap_getBip32Entropy

Enables you to [manage users' non-EVM accounts](https://metamask-docs-git-imp-agt-scr-90-100-consensys-ddffed67.vercel.app/snaps/features/non-evm-networks/)by deriving the [SLIP-10](https://github.com/satoshilabs/slips/blob/master/slip-0010.md)keys specified by the `path` and `curve` parameters. The keys are derived using the entropy from the user's Secret Recovery Phrase.

If the keys you want to derive conform to the [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)structure, use [snap_getBip44Entropy](https://metamask-docs-git-imp-agt-scr-90-100-consensys-ddffed67.vercel.app/snaps/reference/snaps-api/snap%5Fgetbip44entropy)instead. Otherwise, use this method.

This method is designed to be used with the [@metamask/key-tree](https://npmjs.com/package/@metamask/key-tree)module. `@metamask/key-tree` can help you get the [extended private keys](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#extended-keys)for user addresses, but it's your responsibility to know how to use those keys to, for example, derive an address for the relevant protocol or sign a transaction for the user.

## Parameters[​](#parameters "Direct link to Parameters")

object

required

An object containing the parameters for the `snap_getBip32Entropy` method.

### curve

"ed25519" | "ed25519Bip32" | "secp256k1"

required

The curve to use for the derived key. This must be a curve supported by [@metamask/key-tree](https://npmjs.com/package/@metamask/key-tree).

### path

string[]

required

The derivation path to use for the derived key, represented as an array of path segments. For example, the path `m/44'/1'/0'/0/0` would be represented as `['m', "44'", "1'", "0'", '0', '0']`.

### source

string | null

The ID of the entropy source to use. If not specified, the primary entropy source will be used. For a list of available entropy sources, see the `snap_listEntropySources` method.

## Returns[​](#returns "Direct link to Returns")

object

A JSON-serializable SLIP-10 node containing the requested BIP-32 entropy.

### depth

number

The 0-indexed path depth of this node.

### masterFingerprint

number | null

The fingerprint of the master node, i.e., the node at depth 0. May be undefined if this node was created from an extended key.

### parentFingerprint

number

The fingerprint of the parent key, or 0 if this is a master node.

### index

number

The index of the node, or 0 if this is a master node.

### network

"mainnet" | "testnet" | null

The network for the node. This is only used for extended keys, and defaults to `mainnet`.

### privateKey

string | null

The (optional) private key of this node.

### publicKey

string

The public key of this node.

### chainCode

string

The chain code of this node.

### curve

"ed25519" | "ed25519Bip32" | "secp256k1"

The name of the curve used by the node.

## Example

- Manifest
- Usage

```
{
  "initialPermissions": {
    "snap_getBip32Entropy": [
      {
        "path": ["m", "44'", "3'"],
        "curve": "secp256k1" // Or "ed25519", "ed25519Bip32"
      }
    ]
  }
}

```

```
import { SLIP10Node } from '@metamask/key-tree'

// This example uses Dogecoin, which has a derivation path starting with
// m/44'/3'.
const dogecoinNode = await snap.request({
  method: 'snap_getBip32Entropy',
  params: {
    // The path and curve must be specified in the initial permissions.
    path: ['m', "44'", "3'"],
    curve: 'secp256k1',
  },
})

// Next, create an instance of a SLIP-10 node for the Dogecoin node.
const dogecoinSlip10Node = await SLIP10Node.fromJSON(dogecoinNode)

// m/44'/3'/0'
const accountKey0 = await dogecoinSlip10Node.derive(["bip32:0'"])

// m/44'/3'/1'
const accountKey1 = await dogecoinSlip10Node.derive(["bip32:1'"])

// Now, you can ask the user to sign transactions, etc.

```
