Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article explores ERC7908, a proposal for hierarchical private key management and permission separation that helps enterprises and organizations manage their on-chain assets securely and efficiently.

This article translates, summarizes, and expands on the proposal below.

I also cover various EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

ERC7908 aims to standardize on-chain treasury management for enterprises and organizations. In particular, it addresses secure private key generation, hierarchical management, and separation of permissions between departments, with the goal of balancing asset security and transaction efficiency even in multichain environments.

ERC7908 defines a unified key derivation path (rules for generating and deriving keys) and security mechanisms to enable consistent operations across multiple blockchains. This allows organizations to manage their treasuries, including asset custody and transfers, more efficiently and securely.

In essence, ERC7908 proposes a set of rules for secure and efficient corporate asset management on blockchains. It brings disparate existing approaches together to reduce operational confusion and risk.

Motivation

As blockchains and decentralized finance (DeFi) evolve rapidly, secure management of on-chain assets is increasingly important. Unlike individual users, enterprises and institutions manage numerous assets and face complex operational workflows. Conventional approaches to managing individual private keys are therefore insufficient to meet their security requirements.

In particular, they face the following challenges:

Challenge Description
Lack of hierarchical key management Keys cannot be managed according to positions and departments within an organization, concentrating administrative authority.
Insufficient permission controls Fine-grained permissions for individual departments and employees are difficult to enforce, increasing the likelihood of operational mistakes and insider risks.
Need for multisignature functionality Transactions may need approval from multiple people before execution. Relying on a single private key entails significant risk.

ERC7908 is designed to address these issues. It enables hierarchical management of an organization's assets and explicitly separates departmental authority to improve security without sacrificing operational efficiency.

Even when operating on multiple blockchains, unified key management rules and transaction workflows can help maintain consistent security and usability. The resulting framework standardizes asset management across an organization so that it can operate according to the same security criteria on different chains.

Specification

Derivation path

The following hierarchical deterministic (HD) path is used to manage on-chain treasuries (organizational asset accounts) securely. HD derivation is a mechanism for deterministically deriving many child keys from a single parent key according to defined rules.

text
m/44'/60'/entity_id' / department_id' / account_index
Layer Role Requirement Description
m Master key SHALL The root private key of the HD wallet. It is not exposed externally.
44' BIP 44 alignment MUST The value 44' indicates the convention introduced by BIP 44. An apostrophe denotes hardened derivation, which prevents public derivation across that boundary.
60' Coin type SHALL The value 60' identifies Ethereum/EVM-style chains in this scheme.
entity_id' Entity identifier MUST A hardened index identifying a subsidiary or business unit. It is generated by hashing the name. It must not be reused across distinct entities.
department_id' Department identifier MUST A hardened index identifying a department within an entity. It is generated by hashing the name, using hardened derivation to separate departmental keys.
account_index Account number MUST A non-hardened index. It facilitates management of multiple accounts within a department.
The BIP 44 change layer

Because Ethereum/EVM uses an account model rather than a UTXO (unspent transaction output) model, omitting the BIP 44 change layer is recommended.

For more on BIP44, see the following article.

[BIP44] Hierarchical wallet structure

Hash conversion

entity_id and department_id are converted from strings into indices using SHA-256, a widely used hash function, and then mapped into the hardened range (2^31 and above). This provides deterministic indices under the same rules and reduces naming collisions, although truncating a hash to a 31-bit index cannot eliminate collisions.

Calculating the entity index (entity_id)
python
from hashlib import sha256

def entity_to_index(entity: str) -> int:
    entity_hash = sha256(f"ENTITY:{entity}".encode()).digest()
    # 先頭4バイトを整数化し、ハードンド(2^31〜)にする
    return int.from_bytes(entity_hash[:4], "big") | 0x80000000
  • Hash the string "ENTITY:{entity}" with SHA-256.
  • Convert the first four bytes into a 32-bit integer and OR it with 0x80000000 (2^31) to place it in [2^31, 2^32-1], ensuring hardened derivation.
Calculating the department index (department_id)
python
from hashlib import sha256

def department_to_index(entity_hash_bytes: bytes, department: str) -> int:
    dept_hash = sha256(f"DEPT:{entity_hash_bytes.hex()}:{department}".encode()).digest()
    return int.from_bytes(dept_hash[:4], "big") | 0x80000000
  • Include information from the entity hash in the department hash input, so identically named departments under different entities derive distinct hash inputs.
  • As above, map the result into [2^31, 2^32-1] to ensure hardened derivation.

The resulting entity_id and department_id must be integers in the 2^31 to 2^32-1 range (hardened).

Role-based access extension

To separate keys by responsibilities such as approver and transaction initiator within a department, add another layer.

text
m/60'/entity_id' / department_id' / role_id' / account_index

role_id uses hardened derivation. This isolates keys by role even within the same department. Omitting 44' may reduce compatibility with mainstream wallets such as MetaMask. If this omission is chosen, a custom plugin that supports the resulting path must be implemented.

Simplified path for small organizations

Organizations without subsidiaries or with simple structures can use a simplified hierarchy.

text
m/44'/60' / department_id' / 0 / account_index

0 is used as a fixed intermediate layer to retain alignment with BIP 44. This structure is intended to retain compatibility with mainstream BIP 44 wallets, though actual wallet support depends on the derivation path.

Key derivation algorithm

The following outlines an implementation combining HD derivation (BIP 32) with index calculation. BIP 32 is a widely used HD derivation standard based on the secp256k1 elliptic curve; EVM refers here to chains compatible with the Ethereum Virtual Machine.

For more on BIP32, see the following article.

[BIP32] Hierarchical key derivation in HD wallets

python
# 用語:
# E: Map<entity, List[Department]>  例: {"ACME": ["Finance", "Ops"]}
# n: secp256k1 の曲線次数(実装側で参照するパラメータ)
# BIP32(): BIP-0032 による鍵派生(secp256k1)
# hash: SHA-256

def derive_treasury_keys(root_seed: bytes, E: dict[str, list[str]]):
    """
    root_seed: BIP32 マスター鍵生成に使うシード
    E: 事業体 -> 部門リスト
    戻り値: {(entity, department, account_index): child_key}
    """
    from hashlib import sha256
    # 1) ルート鍵(m)を作る
    root = BIP32_master_key(root_seed)  # 実装の BIP32 を利用

    results = {}

    for entity, departments in E.items():
        # 2) entity_id'(ハードンド)を計算
        e_hash = sha256(f"ENTITY:{entity}".encode()).digest()
        entity_index = int.from_bytes(e_hash[:4], "big") | 0x80000000

        # 3) パス m/44'/60'/entity_id' まで派生
        k44   = BIP32_ckd_priv(root, 44  | 0x80000000)
        k60   = BIP32_ckd_priv(k44,  60  | 0x80000000)
        k_ent = BIP32_ckd_priv(k60,  entity_index)

        for dept in departments:
            # 4) department_id'(ハードンド)を計算
            d_hash = sha256(f"DEPT:{e_hash.hex()}:{dept}".encode()).digest()
            dept_index = int.from_bytes(d_hash[:4], "big") | 0x80000000

            # 5) パス m/44'/60'/entity_id'/department_id' まで派生
            k_dept = BIP32_ckd_priv(k_ent, dept_index)

            # 6) account_index は非ハードンドで必要に応じて増やす
            for account_index in range(0, 3):  # 例として 0..2 を生成
                k_acct = BIP32_ckd_priv(k_dept, account_index)

                # 7) ルート鍵素材とハッシュを連結して最終鍵を強化(クロスレイヤ漏えい防止)
                final_material = k_acct.key + sha256(k_dept.key + k_ent.key).digest()
                final_key = sha256(final_material).digest()  # 実装で秘密鍵化

                results[(entity, dept, account_index)] = final_key

    return results

The keys are derived using BIP 32 (secp256k1). The proposal requires combining a hash with root key material to strengthen the final key against information leakage across derivation layers, such as attempts to infer higher-level keys from lower-level information.

Compatibility considerations

ERC7908 draws on BIP 44 (m/purpose'/coin_type'/account'/change/address_index), with the following adjustments.

  • Omit the change layer for Ethereum-style chains This accommodates the account model.
  • Extend beyond five layers according to organizational needs This supports practical access separation, for example by adding a role layer (role_id').

If a configuration omits 44', it may not align with mainstream wallets, so a custom plugin for the relevant chain or wallet is required.

Implementation steps

  1. Choose entity and department names Names should be stable. Renaming them later can require key migration.
  2. Calculate entity_id' and department_id' Convert them into indices of at least 2^31 using the specified SHA-256 rules.
  3. Construct the HD path Use the standard form (m/44'/60'/entity_id'/department_id'/account_index) or insert a role layer if needed.
  4. Derive keys using BIP 32 (secp256k1) Derive each layer in order and increment account_index (non-hardened) for additional accounts.
  5. Strengthen key material Combine parent-layer key material with a hash to generate the final key and make inference across layers more difficult.
  6. Verify compatibility Check that recovery, signing, and address generation behave as expected in existing wallets and internal tools.
  7. Establish operational policies and auditing Define transaction initiation permissions for each entity, department, and role, along with approval workflows (multisig) and audit log retention.

Example code (index calculation and path construction)

The following is a minimal utility implementation. Replace the BIP 32 implementation placeholders (bip32_*) with an actual library.

python
from hashlib import sha256
from dataclasses import dataclass

HARDENED = 0x80000000

def hardened32(x: int) -> int:
    return (x & 0x7fffffff) | HARDENED

def entity_index(entity: str) -> int:
    h = sha256(f"ENTITY:{entity}".encode()).digest()
    return hardened32(int.from_bytes(h[:4], "big"))

def department_index(entity_hash: bytes, department: str) -> int:
    h = sha256(f"DEPT:{entity_hash.hex()}:{department}".encode()).digest()
    return hardened32(int.from_bytes(h[:4], "big"))

@dataclass
class Path:
    purpose: int = 44 | HARDENED
    coin: int = 60 | HARDENED
    entity_h: int = 0
    dept_h: int = 0
    account: int = 0

    def to_str(self) -> str:
        return f"m/{self.purpose & 0x7fffffff}'/{self.coin & 0x7fffffff}'/{self.entity_h & 0x7fffffff}'/{self.dept_h & 0x7fffffff}'/{self.account}"

def build_path(entity_name: str, dept_name: str, account_index_n: int) -> str:
    e_hash = sha256(f"ENTITY:{entity_name}".encode()).digest()
    e_idx = hardened32(int.from_bytes(e_hash[:4], "big"))
    d_idx = department_index(e_hash, dept_name)
    return Path(entity_h=e_idx, dept_h=d_idx, account=account_index_n).to_str()

# 例:
print(build_path("ACME", "Finance", 0))  # m/44'/60'/...'/...'/0

Additional considerations

Separation between enterprises and departments

ERC7908 supports the creation of distinct on-chain accounts for each subsidiary and department. A derivation path produces different keys for each entity and department, allowing organizational units to operate within separate key boundaries. Consequently, a leaked departmental private key need not compromise other departments or subsidiaries when hardened boundaries and proper key custody are maintained.

The hierarchical derivation path functions as a security boundary. Keys are separated at the departmental level, providing isolated exposure and making large-scale organizational operations safer.

Centralized management authority across the group

The group-wide administrator, such as the CFO of a holding company, holds the master private key. This key allows the private keys for all subsidiaries to be derived.

The administrator can therefore act as the highest-level authority, able to view assets and initiate transactions for subsidiaries and departments. Individual subsidiaries or departments hold only their lower-level keys and can access assets within their own scope.

This structure combines group-wide control with operational autonomy. The group administrator can monitor overall assets and risks as needed, while each local unit's authority is explicitly limited.

Sharing private keys for departmental management

Consider Alice, an administrator of subsidiary A, who wants to share account management with Bob, a newly appointed administrator. In this case, Alice need only share subsidiary A's master private key (the relevant extended private key material).

All of A's departmental accounts, such as finance and development, can be derived from this key. Bob can use the master key received from Alice to reconstruct all asset accounts within A. The key for A does not grant access to subsidiaries B or C.

This simplifies key management while retaining the flexibility to share only the necessary scope. When sharing or transferring departmental management responsibilities, there is no need to share individual account keys one by one.

Sharing public keys with auditors

If auditors want to examine on-chain transactions associated with a particular department, share that department's extended public key.

For its non-hardened descendants, this extended public key allows auditors to derive public keys and track transaction histories for the corresponding addresses. The extended public key alone cannot derive the corresponding private keys, so auditors can inspect transactions without being able to execute them.

This uses blockchain transparency to grant the read-only access required for internal and external audits. Audit logs and transaction histories can be queried in real time, making audit workflows easier to automate and more efficient.

Compatibility

ERC7908 is designed to work with BIP 39, BIP 32, and BIP 44 conventions, subject to support for its modified paths.

For more on BIP39, see the following article.

[BIP39] Recovering a wallet with mnemonic words

Reference implementation

py
"""
Secure Treasury Management System
Enterprise-grade hierarchical deterministic wallet implementation compliant with BIP-44
"""

import hashlib
import logging
from typing import Tuple, Dict
from bip32utils import BIP32Key
from eth_account import Account
from mnemonic import Mnemonic  # Add BIP39 support

# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("TreasurySystem")

class TreasurySystem:
    def __init__(self, mnemonic: str):
        """
        Initialize the treasury system
        :param mnemonic: BIP-39 mnemonic (12/24 words)
        """
        if not Mnemonic("english").check(mnemonic):
            raise ValueError("Invalid BIP-39 mnemonic")
        
        # Generate seed using standard BIP-39
        self.seed = Mnemonic.to_seed(mnemonic, passphrase="")
        self.root_key = BIP32Key.fromEntropy(self.seed)
        
        logger.info("Treasury system initialized. Master key fingerprint: %s", 
                  self.root_key.Fingerprint().hex())

    @staticmethod
    def _hierarchical_hash(entity: str, department: str) -> Tuple[int, int]:
        """
        Hierarchical hash calculation (compliant with proposal spec)
        Returns: (entity_index, department_index)
        """
        # Entity hash
        entity_hash = hashlib.sha256(f"ENTITY:{entity}".encode()).digest()
        entity_index = int.from_bytes(entity_hash[:4], 'big') | 0x80000000
        
        # Department hash (chained)
        dept_input = f"DEPT:{entity_hash.hex()}:{department}".encode()
        dept_hash = hashlib.sha256(dept_input).digest()
        dept_index = int.from_bytes(dept_hash[:4], 'big') | 0x80000000
        
        return entity_index, dept_index

    def _derive_key(self, path: list) -> BIP32Key:
        """General key derivation method"""
        current_key = self.root_key
        for index in path:
            if not isinstance(index, int):
                raise TypeError(f"Invalid derivation index type: {type(index)}")
            current_key = current_key.ChildKey(index)
        return current_key

    def generate_account(self, entity: str, department: str, 
                        account_idx: int = 0) -> Dict[str, str]:
        """
        Generate department account (BIP44 5-layer structure)
        Path: m/44'/60'/entity'/dept'/account_idx
        """
        e_idx, d_idx = self._hierarchical_hash(entity, department)
        
        # BIP-44 standard path
        derivation_path = [
            0x8000002C,  # 44' (hardened)
            0x8000003C,  # 60' (Ethereum)
            e_idx,       # entity_index (hardened)
            d_idx,       # department_index (hardened)
            account_idx  # address index
        ]
        
        key = self._derive_key(derivation_path)
        priv_key = key.PrivateKey().hex()
        
        return {
            'path': f"m/44'/60'/{e_idx}'/{d_idx}'/{account_idx}",
            'private_key': priv_key,  # Warning: Never expose this in production
            'address': Account.from_key(priv_key).address
        }

    def get_audit_xpub(self, entity: str, department: str) -> str:
        """
        Retrieve department-level extended public key (for auditing)
        Path: m/44'/60'/entity'/dept'
        """
        e_idx, d_idx = self._hierarchical_hash(entity, department)
        path = [
            0x8000002C,  # 44'
            0x8000003C,  # 60'
            e_idx,       # entity'
            d_idx        # dept'
        ]
        return self._derive_key(path).ExtendedKey()

    def get_dept_xprv(self, entity: str, department: str) -> str:
        """
        Get department-level extended private key (strictly controlled)
        Path: m/44'/60'/entity'/dept'
        """
        e_idx, d_idx = self._hierarchical_hash(entity, department)
        path = [
            0x8000002C,  # 44'
            0x8000003C,  # 60'
            e_idx,       # entity'
            d_idx        # dept'
        ]
        return self._derive_key(path).ExtendedKey()


    @staticmethod
    def derive_addresses_from_xpub(xpub: str, count: int = 20) -> list:
        """Derive addresses from extended public key (audit use)"""
        audit_key = BIP32Key.fromExtendedKey(xpub)
        return [
            Account.from_key(
                audit_key
                        .ChildKey(i)   # Address index
                        .PrivateKey()
            ).address
            for i in range(count)
        ]


if __name__ == "__main__":
    # Example usage (remove private key printing in production)
    try:
        # Use standard mnemonic
        mnemo = Mnemonic("english")
        mnemonic = mnemo.generate(strength=256)
        treasury = TreasurySystem(mnemonic)
        print(f"mnemonic: {mnemonic}")
        
        print("\n=== Finance Department Account Generation ===")
        finance_acc1 = treasury.generate_account("GroupA", "Finance", 0)
        finance_acc2 = treasury.generate_account("GroupA", "Finance", 1)
        print(f"Account1 path: {finance_acc1['path']}")
        print(f"Account1 address: {finance_acc1['address']}")
        print(f"Account1 private key: {finance_acc1['private_key']}")
        print(f"Account2 path: {finance_acc2['path']}")
        print(f"Account2 address: {finance_acc2['address']}")
        print(f"Account2 private key: {finance_acc2['private_key']}")

        print("\n=== Audit Verification Test===")
        audit_xpub = treasury.get_audit_xpub("GroupA", "Finance")
        print(f"Audit xpub: {audit_xpub}")
        audit_addresses = TreasurySystem.derive_addresses_from_xpub(audit_xpub, 2)
        print(f"Audit-derived addresses: {audit_addresses}")
        
        assert finance_acc1['address'] in audit_addresses, "Audit verification failed"
        assert finance_acc2['address'] in audit_addresses, "Audit verification failed"
        print("✅ Audit verification successful")

        print("\n=== Department Isolation Test ===")
        other_dept_acc = treasury.generate_account("GroupA", "Audit", 0)
        print(f"Account3 path: {other_dept_acc['path']}")
        print(f"Account3 address: {other_dept_acc['address']}")
        assert other_dept_acc['address'] not in audit_addresses, "Isolation breach"
        print("✅ Department isolation effective")


        print("\n=== Department Private Key Sharing Test ===")
        # Gets the department layer extension private key
        dept_xprv = treasury.get_audit_xpub("GroupA", "Finance").replace('xpub', 'xprv')  # 实际应通过专用方法获取
        print(f"Fiance xprv: {dept_xprv}")
        # Derive the account private key from the extension private key
        dept_key = BIP32Key.fromExtendedKey(dept_xprv)
        derived_acc0_key = dept_key.ChildKey(0).PrivateKey().hex()
        derived_acc1_key = dept_key.ChildKey(1).PrivateKey().hex()
        print(f"Fiance derived_acc0_key: {derived_acc0_key}")
        print(f"Fiance derived_acc1_key: {derived_acc1_key}")
        # Verify the private key derivation capability
        assert derived_acc0_key == finance_acc1['private_key'], \
            "Account 0 private key derivation failed"
        assert derived_acc1_key == finance_acc2['private_key'], \
            "Account 1 private key derivation failed"
        print("✅ Private key derivation from department xprv successful")

    except Exception as e:
        logger.error("System error: %s", e, exc_info=True)

Security

Hierarchical deterministic wallets (HD wallets) are particularly useful for treasury administrators responsible for an organization's on-chain assets. An HD wallet can systematically derive numerous child keys from a single master key, centralizing key management across departments, subsidiaries, and roles. That convenience comes with a significant responsibility to protect the master key.

The importance of the master key

The master key is the root of the entire HD wallet. If it is compromised, all child keys derived from it, and therefore the associated asset accounts, may also be compromised. In other words, compromise of the master key can put all assets at risk; losing all copies without a backup can also make them inaccessible. If the master key is stored safely, lower-level keys can be regenerated, simplifying backup and recovery.

Additional protective measures

Master keys and their associated mnemonic phrases (human-readable sequences typically consisting of 12 to 24 words) require additional protection. Possible measures include the following.

Protective measure Description
Split key storage (such as Shamir's Secret Sharing) Divide the master key into multiple shares held by different people or in different locations. A threshold number of shares is needed to reconstruct the key. This avoids exposing all assets through the compromise of a single person or location.
Offline storage (cold storage) Store the master key or mnemonic in an environment that is not connected to a network. Maintain physical security and reduce exposure to online attacks.
Multisignature operation Distribute transaction approval among multiple signers so that one person cannot move assets independently. This requires a separate multisignature or threshold authorization mechanism; an HD derivation path alone does not enforce it.
Encrypted backups Protect mnemonics and key data with strong encryption and access controls.

Combining these measures can improve security without sacrificing usability.

Citation

Xiaoyu Liu (@elizabethxiaoyu) jiushi.lxy@antgroup.com, Yuxiang Fu (@tmac4096) kunfu.fyx@antgroup.com, Yanyi Liang eason.lyy@antgroup.com, Hao Zou (@BruceZH0915) situ.zh@antgroup.com, Siyuan Zheng (@andrewcoder666) zhengsiyuan.zsy@antgroup.com, yuanshanhshan (@xunayuan) yuanshanshan.yss@antgroup.com, "ERC-7908: HD wallet In Treasury Management [DRAFT]," Ethereum Improvement Proposals, no. 7908, March 2025. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7908.

Conclusion

This article explored ERC7908, which proposes hierarchical private key management and separation of authority to help enterprises and organizations manage their on-chain assets securely and efficiently. I hope this explanation was useful.

If you have questions, feel free to send me a DM on Twitter.

Twitter @cardene777

I also share information on other platforms; feel free to explore them.

https://chaldene.net/