{"eip":1581,"title":"Non-wallet usage of keys derived from BIP-32 trees","description":"A derivation path structure for BIP32 trees to generate key pairs not meant to hold crypto assets.","authors":["Michele Balistreri (@bitgamma)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2018-11-13","discussionsTo":"https://ethereum-magicians.org/t/non-wallet-usage-of-keys-derived-from-bip-32-trees/1817","repo":"ERCs","label":"ERC-1581","officialUrl":"https://eips.ethereum.org/EIPS/eip-1581","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1581.md","url":"https://eips.huatuo.xyz/eip-1581/","tldr":{"en":"Reserves a BIP-32 derivation branch, m/43'/60'/1581', for keys that are not wallet keys (messaging, encryption, identity), so apps can derive them from the same seed without reusing wallet keys.","ja":"ウォレット鍵ではない鍵（メッセージング、暗号化、アイデンティティ）のために BIP-32 の導出ブランチ m/43'/60'/1581' を予約し、アプリがウォレット鍵を流用せずに同じシードから導出できるようにする。","ko":"지갑 키가 아닌 키(메시징, 암호화, 신원)를 위해 BIP-32 파생 브랜치 m/43'/60'/1581'를 예약해, 앱이 지갑 키를 재사용하지 않고 같은 시드에서 파생할 수 있게 한다.","zh":"为非钱包密钥（消息传递、加密、身份）保留 BIP-32 派生分支 m/43'/60'/1581'，使应用可以从同一个种子派生这些密钥，而无需复用钱包密钥。"},"tags":["keys","bip32","hd-wallet","derivation"],"explainers":{"en":{"lang":"en","tldr":"Reserves a BIP-32 derivation branch, m/43'/60'/1581', for keys that are not wallet keys (messaging, encryption, identity), so apps can derive them from the same seed without reusing wallet keys.","tags":["keys","bip32","hd-wallet","derivation"],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1581/","markdown":"## What problem does it solve?\n\nApps often need extra key pairs alongside a wallet: for chat encryption, signing off-chain messages, or identity in some side protocol. There are two bad options:\n\n- **Reuse wallet keys.** Using a key that holds funds for unrelated cryptography increases risk if that other system leaks or misuses it.\n- **Use separate, random keys.** Safer, but now the user has more secrets to back up and migrate.\n\nERC-1581 gives a third option: derive the extra keys from the same BIP-32 master seed, but on a separate branch that never overlaps BIP-44 wallet paths. One backup covers everything, while the keys stay cryptographically independent.\n\n## How it works\n\nThe derivation path has five levels:\n\n```\nm / purpose' / coin_type' / subpurpose' / key_type' / key_index\n```\n\n- `purpose' / coin_type' / subpurpose'` is fixed at `43' / 60' / 1581'`: BIP-43, Ethereum, this EIP. Everything under this prefix is in scope.\n- `key_type'` (hardened) says what the key is for. Types should be generic, e.g. \"instant messaging\" rather than one specific product, so the same identity works across services.\n- `key_index` identifies the specific key. In the simple case it is a number `0` to `2^31-1`. Larger IDs (a hash or GUID) are split into 31-bit chunks across several levels, most significant first; all levels except the last are hardened, and the last uses normal (public) derivation.\n\nThe spec's example: key type `4'` with a 62-bit ID `0x2BCDEFFEDCBAABCD` becomes `m/43'/60'/1581'/4'/1469833213'/1555737549`.\n\n## Sample code\n\nDeriving a non-wallet key on this branch with ethers v6:\n\n```ts\nimport { HDNodeWallet, Mnemonic } from \"ethers\";\n\nconst mnemonic = Mnemonic.fromPhrase(process.env.MNEMONIC!);\nconst root = HDNodeWallet.fromSeed(mnemonic.computeSeed());\n\n// key_type 4', key_index 0 (last level non-hardened, as the spec requires)\nconst chatKey = root.derivePath(\"m/43'/60'/1581'/4'/0\");\n\nconsole.log(chatKey.publicKey);   // share this with the messaging service\n// chatKey.privateKey stays in the app; it is NOT one of the user's wallet accounts\n```\n\n## Things to know\n\n- Status is **Stagnant**. The registry of `key_type` values was never defined in the spec (it says \"TBD\"), so apps must agree on type numbers themselves.\n- These keys are ordinary secp256k1 keys. Nothing stops someone sending funds to the derived address, but wallets following BIP-44 (`m/44'/60'/...`) will not show it.\n- Any app that can derive these keys holds the master seed, so this improves key separation, not seed security.\n"},"ja":{"lang":"ja","tldr":"ウォレット鍵ではない鍵（メッセージング、暗号化、アイデンティティ）のために BIP-32 の導出ブランチ m/43'/60'/1581' を予約し、アプリがウォレット鍵を流用せずに同じシードから導出できるようにする。","tags":["keys","bip32","hd-wallet","derivation"],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1581/","markdown":"## 何を解決するのか\n\nアプリは、ウォレットとは別に鍵ペアを必要とすることがよくあります。チャットの暗号化、オフチェーンメッセージへの署名、何らかのサイドプロトコルでのアイデンティティなどです。悪い選択肢が 2 つあります。\n\n- **ウォレット鍵を流用する。** 資金を保持する鍵を無関係な暗号処理に使うと、その別のシステムが鍵を漏らしたり誤用したりした場合のリスクが高まります。\n- **別々のランダムな鍵を使う。** より安全ですが、ユーザーがバックアップや移行をしなければならない秘密が増えます。\n\nERC-1581 は第 3 の選択肢を提示します。追加の鍵を同じ BIP-32 マスターシードから、BIP-44 のウォレットパスと決して重ならない別のブランチで導出します。1 回のバックアップですべてをカバーしつつ、鍵は暗号学的に独立したままです。\n\n## 仕組み\n\n導出パスは 5 つのレベルから成ります。\n\n```\nm / purpose' / coin_type' / subpurpose' / key_type' / key_index\n```\n\n- `purpose' / coin_type' / subpurpose'` は `43' / 60' / 1581'` に固定されています。BIP-43、Ethereum、この EIP です。このプレフィックスの下にあるものはすべて対象範囲です。\n- `key_type'`（強化導出）は、その鍵の用途を示します。タイプは、特定の 1 製品ではなく「インスタントメッセージング」のように汎用的であるべきで、同じアイデンティティが複数のサービスで使えます。\n- `key_index` は具体的な鍵を識別します。単純な場合は `0` から `2^31-1` の数値です。それより大きな ID（ハッシュや GUID）は、31 ビットずつのチャンクに分け、上位から順に複数のレベルに割り当てます。最後を除くすべてのレベルは強化導出で、最後のレベルは通常の（公開）導出を使います。\n\n仕様の例: キータイプ `4'` と 62 ビットの ID `0x2BCDEFFEDCBAABCD` は、`m/43'/60'/1581'/4'/1469833213'/1555737549` になります。\n\n## サンプルコード\n\nethers v6 で、このブランチ上のウォレット以外の鍵を導出する:\n\n```ts\nimport { HDNodeWallet, Mnemonic } from \"ethers\";\n\nconst mnemonic = Mnemonic.fromPhrase(process.env.MNEMONIC!);\nconst root = HDNodeWallet.fromSeed(mnemonic.computeSeed());\n\n// key_type 4', key_index 0 (last level non-hardened, as the spec requires)\nconst chatKey = root.derivePath(\"m/43'/60'/1581'/4'/0\");\n\nconsole.log(chatKey.publicKey);   // share this with the messaging service\n// chatKey.privateKey stays in the app; it is NOT one of the user's wallet accounts\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。`key_type` の値のレジストリは仕様で定義されたことがなく（\"TBD\" とされています）、アプリ同士でタイプ番号を取り決める必要があります。\n- これらの鍵は通常の secp256k1 鍵です。導出されたアドレスに資金を送ること自体は妨げられませんが、BIP-44（`m/44'/60'/...`）に従うウォレットにはそのアドレスは表示されません。\n- これらの鍵を導出できるアプリはマスターシードを保持しているため、改善されるのは鍵の分離であり、シードのセキュリティではありません。\n"},"ko":{"lang":"ko","tldr":"지갑 키가 아닌 키(메시징, 암호화, 신원)를 위해 BIP-32 파생 브랜치 m/43'/60'/1581'를 예약해, 앱이 지갑 키를 재사용하지 않고 같은 시드에서 파생할 수 있게 한다.","tags":["keys","bip32","hd-wallet","derivation"],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1581/","markdown":"## 어떤 문제를 해결하나요?\n\n앱은 지갑 외에 추가 키 쌍이 필요한 경우가 많습니다. 채팅 암호화, 오프체인 메시지 서명, 어떤 사이드 프로토콜에서의 신원 등입니다. 좋지 않은 선택지가 둘 있습니다.\n\n- **지갑 키를 재사용한다.** 자금을 보관하는 키를 관련 없는 암호 용도에 쓰면, 그 다른 시스템이 키를 유출하거나 오용할 때 위험이 커집니다.\n- **별도의 무작위 키를 쓴다.** 더 안전하지만, 사용자가 백업하고 옮겨야 할 비밀이 늘어납니다.\n\nERC-1581은 세 번째 선택지를 줍니다. 추가 키를 같은 BIP-32 마스터 시드에서 파생하되, BIP-44 지갑 경로와 절대 겹치지 않는 별도의 브랜치에서 파생하는 것입니다. 백업 한 번으로 모든 것을 커버하면서도, 키들은 암호학적으로 독립적으로 유지됩니다.\n\n## 어떻게 동작하나요?\n\n파생 경로는 다섯 단계입니다.\n\n```\nm / purpose' / coin_type' / subpurpose' / key_type' / key_index\n```\n\n- `purpose' / coin_type' / subpurpose'`는 `43' / 60' / 1581'`로 고정되어 있습니다. BIP-43, 이더리움, 이 EIP입니다. 이 접두사 아래의 모든 것이 범위에 속합니다.\n- `key_type'`(강화, hardened)은 키의 용도를 나타냅니다. 타입은 특정 제품 하나가 아니라 \"인스턴트 메시징\"처럼 범용적이어야 같은 신원을 여러 서비스에서 쓸 수 있습니다.\n- `key_index`는 구체적인 키를 식별합니다. 단순한 경우에는 `0`부터 `2^31-1`까지의 숫자입니다. 더 큰 ID(해시나 GUID)는 31비트 조각으로 나누어, 가장 상위 조각부터 여러 단계에 걸쳐 배치합니다. 마지막을 제외한 모든 단계는 강화 파생이고, 마지막 단계는 일반(공개) 파생을 사용합니다.\n\n명세의 예: 키 타입 `4'`와 62비트 ID `0x2BCDEFFEDCBAABCD`는 `m/43'/60'/1581'/4'/1469833213'/1555737549`가 됩니다.\n\n## 샘플 코드\n\nethers v6로 이 브랜치에서 지갑이 아닌 키를 파생하기:\n\n```ts\nimport { HDNodeWallet, Mnemonic } from \"ethers\";\n\nconst mnemonic = Mnemonic.fromPhrase(process.env.MNEMONIC!);\nconst root = HDNodeWallet.fromSeed(mnemonic.computeSeed());\n\n// key_type 4', key_index 0 (last level non-hardened, as the spec requires)\nconst chatKey = root.derivePath(\"m/43'/60'/1581'/4'/0\");\n\nconsole.log(chatKey.publicKey);   // share this with the messaging service\n// chatKey.privateKey stays in the app; it is NOT one of the user's wallet accounts\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. `key_type` 값의 레지스트리는 명세에서 정의된 적이 없으므로(\"TBD\"라고 되어 있습니다), 앱들이 타입 번호를 직접 합의해야 합니다.\n- 이 키들은 평범한 secp256k1 키입니다. 누군가 파생된 주소로 자금을 보내는 것을 막을 수는 없지만, BIP-44(`m/44'/60'/...`)를 따르는 지갑에는 그 주소가 표시되지 않습니다.\n- 이 키들을 파생할 수 있는 앱은 마스터 시드를 가지고 있으므로, 이는 키 분리를 개선하는 것이지 시드의 보안을 개선하는 것이 아닙니다.\n"},"zh":{"lang":"zh","tldr":"为非钱包密钥（消息传递、加密、身份）保留 BIP-32 派生分支 m/43'/60'/1581'，使应用可以从同一个种子派生这些密钥，而无需复用钱包密钥。","tags":["keys","bip32","hd-wallet","derivation"],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1581/","markdown":"## 它解决什么问题？\n\n应用除了钱包之外，常常还需要额外的密钥对：用于聊天加密、签署链下消息，或在某个旁路协议中表示身份。有两种糟糕的选择：\n\n- **复用钱包密钥。** 把持有资金的密钥用于无关的密码学用途，一旦那个其他系统泄露或滥用它，风险就会增加。\n- **使用单独的随机密钥。** 更安全，但用户现在要备份和迁移的秘密更多了。\n\nERC-1581 给出了第三种选择：从同一个 BIP-32 主种子派生额外的密钥，但放在一个与 BIP-44 钱包路径永不重叠的独立分支上。一次备份即可涵盖所有内容，同时这些密钥在密码学上保持相互独立。\n\n## 它如何运作\n\n派生路径有五个层级：\n\n```\nm / purpose' / coin_type' / subpurpose' / key_type' / key_index\n```\n\n- `purpose' / coin_type' / subpurpose'` 固定为 `43' / 60' / 1581'`：BIP-43、以太坊、本 EIP。此前缀下的所有内容都在范围之内。\n- `key_type'`（硬化）说明该密钥的用途。类型应当是通用的，例如\"即时通讯\"，而不是某个具体产品，这样同一个身份可以跨服务使用。\n- `key_index` 标识具体的密钥。简单情形下它是 `0` 到 `2^31-1` 的数字。更大的 ID（哈希或 GUID）会被拆成 31 位的块，从最高位开始分布到多个层级；除最后一层外所有层级都是硬化的，最后一层使用普通（公开）派生。\n\n规范中的例子：密钥类型 `4'` 加上 62 位 ID `0x2BCDEFFEDCBAABCD`，得到 `m/43'/60'/1581'/4'/1469833213'/1555737549`。\n\n## 示例代码\n\n使用 ethers v6 在该分支上派生一个非钱包密钥：\n\n```ts\nimport { HDNodeWallet, Mnemonic } from \"ethers\";\n\nconst mnemonic = Mnemonic.fromPhrase(process.env.MNEMONIC!);\nconst root = HDNodeWallet.fromSeed(mnemonic.computeSeed());\n\n// key_type 4', key_index 0 (last level non-hardened, as the spec requires)\nconst chatKey = root.derivePath(\"m/43'/60'/1581'/4'/0\");\n\nconsole.log(chatKey.publicKey);   // share this with the messaging service\n// chatKey.privateKey stays in the app; it is NOT one of the user's wallet accounts\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。`key_type` 取值的注册表在规范中从未定义（写的是 \"TBD\"），因此应用必须自行约定类型编号。\n- 这些密钥是普通的 secp256k1 密钥。没有任何东西阻止别人向派生出的地址转入资金，但遵循 BIP-44（`m/44'/60'/...`）的钱包不会显示它。\n- 任何能派生这些密钥的应用都持有主种子，所以这改进的是密钥隔离，而不是种子的安全性。\n"}}}
