---
eip: 7908
label: ERC-7908
title: HD wallet In Treasury Management
status: Final
type: Standards Track
category: ERC
created: 2025-03-07
official: https://eips.ethereum.org/EIPS/eip-7908
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7908.md
canonical: https://eips.huatuo.xyz/eip-7908/
lang: en
tldr: 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.
tags: [wallet, hd-wallet, bip-44, treasury, key-management]
---

# ERC-7908: HD wallet In Treasury Management

> Hierarchical deterministic (HD) wallets for treasury systems, isolating entities via cryptographic key paths.

**TL;DR:** 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:

```text
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):

```python
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.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7908
