EIPs Explained

ERC-7908 · Final · ERC · 2025-03-07

ERC-7908: HD wallet In Treasury Management

A BIP-44-style HD derivation path for institutional treasuries that gives each subsidiary and department its own hardened key branch, derived by hashing their names.

What problem does it solve?

A company holding crypto usually needs many accounts: per subsidiary, per department, sometimes per role. Generating unrelated keys for each is hard to back up and audit, while sharing one key across teams removes all isolation.

ERC-7908 standardizes how an organization lays out a single hierarchical deterministic (HD) wallet so that:

  • the group administrator can derive every account from one master key,
  • a subsidiary or department can be handed its own branch without exposing others,
  • auditors can be given an extended public key and see all of a department's addresses without being able to spend.

How it works

The required path is:

m / 44' / 60' / entity_id' / department_id' / account_index
  • 44' and 60' are the usual BIP-44 purpose and Ethereum coin type.
  • entity_id' and department_id' are hardened indices computed by hashing names, so a leaked department key cannot be used to reach siblings or the parent.
  • account_index is non-hardened, so a department's xpub can derive all its addresses.
  • BIP-44's change level is dropped because Ethereum is account-based.

Index derivation uses SHA-256 and keeps the top bit set (range 2^31 to 2^32 − 1):

  • entity_index = first4bytes(sha256("ENTITY:" + entity)) | 0x80000000
  • dept_index = first4bytes(sha256("DEPT:" + entity_hash + ":" + department)) | 0x80000000

Chaining the entity hash into the department hash means "Finance" in two subsidiaries gets two different indices.

The spec also describes an optional extra role_id' level and a simplified m/44'/60'/department_id'/0/account_index path for organizations without subsidiaries.

Sample code

Computing the indices in Python, following the reference implementation (which hex-encodes the entity hash):

import hashlib

def treasury_path(entity: str, department: str, account: int = 0) -> str:
    entity_hash = hashlib.sha256(f"ENTITY:{entity}".encode()).digest()
    e_idx = int.from_bytes(entity_hash[:4], "big") | 0x80000000

    dept_hash = hashlib.sha256(f"DEPT:{entity_hash.hex()}:{department}".encode()).digest()
    d_idx = int.from_bytes(dept_hash[:4], "big") | 0x80000000

    # e_idx / d_idx already include the hardened bit
    return f"m/44'/60'/{e_idx - 0x80000000}'/{d_idx - 0x80000000}'/{account}"

print(treasury_path("GroupA", "Finance", 0))

Feed the resulting path to any BIP-32 library (secp256k1) to get the key and address.

Things to know

  • Status is Final.
  • The spec text writes the department input as DEPT:{entity_hash} while the reference code uses entity_hash.hex(). Pick one encoding and document it, or indices will not match between tools.
  • Hardened indices this large are valid BIP-32 but some wallet UIs do not let you type custom paths; the extended role path (which omits 44') is explicitly noted as incompatible with standard wallets.
  • Everything hangs off one master secret. The spec calls for extra protection of it, such as splitting the mnemonic or master key.
  • Handing out a department xprv gives full spending power over that branch; share the xpub for audit-only access.

#wallet #hd-wallet #bip-44 #treasury #key-management

Details

Authors
Xiaoyu Liu (@elizabethxiaoyu) <[email protected]>, Yuxiang Fu (@tmac4096) <[email protected]>, Yanyi Liang <[email protected]>, Hao Zou (@BruceZH0915) <[email protected]>, Siyuan Zheng (@andrewcoder666) <[email protected]>, yuanshanhshan (@xunayuan) <[email protected]>
Status
Final
Type
Standards Track / ERC
Created
2025-03-07

Machine-readable: Markdown · JSON