Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@metamask/bip44-example-snap) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@metamask/bip44-example-snap
This snap demonstrates the use of snap_getBip44Entropy to derive a BIP-44
private key from the user's secret recovery phrase.
Snap manifest
Note: Using
snap_getBip44Entropyrequires thesnap_getBip44Entropypermissions. Refer to the documentation for more information.
Along with other permissions, the manifest of this snap includes the
snap_getBip44Entropy permission:
{
"initialPermissions": {
"snap_getBip44Entropy": [
{
"coinType": 1
},
{
"coinType": 3
}
]
}
}Each of the coin types in the initialPermissions.snap_getBip44Entropy array
represents a BIP-44 coin type. The coin types in the array above represent
Bitcoin and Dogecoin, respectively. All coin types can be found in the SLIP-44
registry here.
Snap usage
This snap exposes an onRpcRequest handler, which supports the following
JSON-RPC methods:
getPublicKey: Get the public key for the givencoinTypeandaddressIndex.signMessage: Sign amessagewith the private key for the givencoinTypeandaddressIndex. For this particular example, we use theBLS12-381elliptic curve to sign the message.
For more information, you can refer to the end-to-end tests.