diff --git a/docs/getting-started/Wallets.md b/docs/getting-started/Wallets.md index 46081c4..841ece8 100644 --- a/docs/getting-started/Wallets.md +++ b/docs/getting-started/Wallets.md @@ -14,6 +14,10 @@ A [hierarchical deterministic (HD) Wallet](https://learnmeabitcoin.com/technical } ``` +#### Configuration + +Wallet seeds are generated with a default mnemonic length of 12 words. The [BIP-39 specification](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) supports mnemonic lengths of 12, 15, 18, 21, and 24 words. To enhance your Wallet's security, you may consider opting for a longer mnemonic length. This optional `mnemonicLength` field can be set when creating a Wallet. It's important to note that once the Wallet seed is generated, the mnemonic is permanent and cannot be altered. + ## Accounts An account contains the directions for deriving a cryptographic key pair and corresponding address from a Wallet. In practice, this looks like: diff --git a/docs/integration-guides/export-wallets.md b/docs/integration-guides/export-wallets.md index eb77c26..4aa81bf 100644 --- a/docs/integration-guides/export-wallets.md +++ b/docs/integration-guides/export-wallets.md @@ -10,6 +10,7 @@ Turnkey's export functionality allows your end users to backup or transfer a [Wa Follow along with the guide below to set up Wallet Export for your end users. ## Before you start + Make sure you have created a wallet for your user. Check out our [Quickstart guide](../getting-started/Quickstart.md) if you need help getting started. @@ -44,7 +45,7 @@ Let's review these steps in detail: const iframeStamper = new IframeStamper({ iframeUrl: "https://export.turnkey.com", // Configure how the iframe element is inserted on the page - iframeContainerId: "your-container", + iframeContainer: yourContainer, iframeElementId: "turnkey-iframe", }); @@ -76,13 +77,13 @@ Let's review these steps in detail: iframeDisplay = "block"; ``` -Export is complete! The iframe now displays a numbered 3-column grid of words that form the mnemonic, directly to your end user. +Export is complete! The iframe now displays a sentence of words separated by spaces.
@@ -90,13 +91,18 @@ The exported wallet will remain stored within Turnkey’s infrastructure. In you ## UI customization -Everything is customizable in the export iframe except the 3-column grid of mnemonic words. Here's an example of how you can configure the styling of the iframe. +Everything is customizable in the export iframe except the sentence of mnemonic words, which is minimally styled: the text is left-aligned and the padding and margins are zero. Here's an example of how you can configure the styling of the iframe. ```js const iframeCss = ` iframe { + box-sizing: border-box; width: 400px; - height: 330px; - border: none; + height: 120px; + border-radius: 8px; + border-width: 1px; + border-style: solid; + border-color: rgba(216, 219, 227, 1); + padding: 20px; } `; @@ -107,9 +113,25 @@ return ( ); ``` -## Private Keys +## Export as Private Keys + +Turnkey also supports exporting Wallet Accounts and Private Keys as raw private keys. + +### Wallet Accounts +Follow the same steps above for exporting Wallets as mnemonics, but instead use the `EXPORT_WALLET_ACCOUNT` activity and the `injectKeyExportBundle` method from the [`@turnkey/iframe-stamper`](https://www.npmjs.com/package/@turnkey/iframe-stamper). + +### Private Keys +Follow the same steps above for exporting Wallets as mnemonics, but instead use the `EXPORT_PRIVATE_KEY` activity and the `injectKeyExportBundle` method from the [`@turnkey/iframe-stamper`](https://www.npmjs.com/package/@turnkey/iframe-stamper). + +
+ +
-Turnkey also supports exporting raw private keys. To implement export for private keys, follow the same steps above, but instead use the `EXPORT_PRIVATE_KEY` activity and the `injectKeyExportBundle` method from the [`@turnkey/iframe-stamper`](https://www.npmjs.com/package/@turnkey/iframe-stamper). At the end of a successful private key export, the iframe displays a hexadecimal-encoded raw private key. +At the end of a successful private key export, the iframe displays a hexadecimal-encoded raw private key. ## Cryptographic details @@ -128,7 +150,7 @@ It works by anchoring export in a **target encryption key** (TEK). This target e /> -The public part of this key pair is passed as a parameter inside of a signed `EXPORT_WALLET` or `EXPORT_PRIVATE_KEY` activity. +The public part of this key pair is passed as a parameter inside of a signed `EXPORT_WALLET`, `EXPORT_PRIVATE_KEY`, or `EXPORT_WALLET_ACCOUNT` activity. Our enclave encrypts the wallet's mnemonic or raw private key to the user's TEK using the **Hybrid Public Key Encryption standard**, also known as **HPKE** or [RFC 9180](https://datatracker.ietf.org/doc/rfc9180/). diff --git a/static/img/private_key_export.png b/static/img/private_key_export.png new file mode 100644 index 0000000..3ce6a88 Binary files /dev/null and b/static/img/private_key_export.png differ diff --git a/static/img/wallet_export_mnemonic.png b/static/img/wallet_export_mnemonic.png index 6a232a9..7021a4a 100644 Binary files a/static/img/wallet_export_mnemonic.png and b/static/img/wallet_export_mnemonic.png differ