--- eip: 8545 title: Restricted Cold Storage Vault description: A non-upgradeable vault holding ETH and ERC-20 as non-transferable claims, withdrawable only by the depositing address and only to itself. author: KOINI (@K0INI) discussions-to: https://ethereum-magicians.org/t/draft-erc-restricted-cold-storage-vault-non-transferable-claims-one-signature-per-lifecycle/30631 status: Draft type: Standards Track category: ERC created: 2026-12-05 requires: 20, 165, 1153, 3855 --- ## Abstract This standard defines a **Restricted Cold Storage Vault**: a singleton, non-upgradeable contract that holds ETH and standard [ERC-20](./eip-20.md) tokens and credits each deposit as a **non-transferable claim** bound to a named storage address. Claims cannot be transferred, approved, traded, or delegated. Deposits are **push-based**. A disposable funding address does all signing and approving and credits the storage address. The storage address never signs at entry, never grants an approval, and does not publish its public key until it exits. The only two operations are *deposit* (credit a named storage address) and *withdraw* (release to that address and no other). Signatures required from a storage address across the vault's entire lifecycle: **zero at entry, zero while held, one at exit.** ## Motivation The cold-storage thesis is that the safest address is one that has never signed. On Ethereum, an address holding assets directly must eventually sign, and every approval or contract interaction widens its attack surface. This standard gives Ethereum a receive-only storage primitive that holds to that discipline: - A storage address is credited by someone else's transaction and needs zero interactions until exit. - The claim is soulbound by construction: no transfer function to exploit, no approval to phish, no market to drain into. - A drained hot wallet, a phished signature, or a malicious dApp session cannot move vaulted funds. Release requires the storage key calling exactly one function, and the destination is fixed to that same address. - One invariant, stated in full: only the depositor, only to the depositor, only at exit. Existing patterns do not provide this. A multisig or smart-contract wallet still exposes a transferable, admin-governed surface and requires the controlling keys to sign to configure it. A plain externally-owned account must sign to do anything and publishes its public key on first spend. This standard isolates *custody* from *signing*: the funder signs and is discarded; the storage address signs once, at the end. ## Specification The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. ### Definitions | Term | Definition | |---|---| | Vault | The singleton contract implementing this standard. | | Storage address | The address credited by a deposit; the only address that can ever withdraw it. | | Funder | The disposable address that signs the deposit transaction; holds no claim and no rights. | | Claim | The internal record `(storageAddress, asset) → amount`; not a token. | | Asset | `address(0)` for ETH, otherwise the ERC-20 contract address. | ### Interface A compliant vault MUST implement the following interface and MUST implement [ERC-165](./eip-165.md), returning `true` for `type(IColdStorageVault).interfaceId`. ```solidity // SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.0; interface IColdStorageVault { // ---------- Errors ---------- error ZeroAmount(); // zero ETH value or zero token amount error ZeroAddress(); // zero storage address or token error InsufficientClaim(); // withdrawal exceeds the caller's claim error NonStandardToken(); // measured balance delta != amount error EthTransferFailed(); // low-level ETH send to the storage address failed error DirectSendRejected(); // bare ETH or unknown calldata with no deposit call // ---------- Events ---------- event Deposited( address indexed storageAddress, address indexed asset, uint256 amount, address indexed funder ); event Withdrawn( address indexed storageAddress, address indexed asset, uint256 amount ); // ---------- Deposit (push-based) ---------- function depositETHFor(address storageAddress) external payable; function depositERC20For(address storageAddress, address token, uint256 amount) external; // ---------- Withdraw ---------- function withdraw(address asset, uint256 amount) external; // ---------- Views ---------- function balanceOf(address storageAddress, address asset) external view returns (uint256); function totalAssets(address asset) external view returns (uint256); } ``` `type(IColdStorageVault).interfaceId` is `0x845d82f0`, computed over exactly the five declared functions (`depositETHFor`, `depositERC20For`, `withdraw`, `balanceOf`, `totalAssets`). `supportsInterface` is not part of `IColdStorageVault` and MUST NOT enter the computation. ### State and balance model A vault MUST maintain per-asset claims and a per-asset tracked total: ```solidity mapping(address storageAddress => mapping(address asset => uint256)) internal _claims; mapping(address asset => uint256) internal _totalAssets; ``` There is no per-address lifecycle. A claim is a number that increases on deposit and decreases on withdrawal; `0` and "never deposited" are indistinguishable and MUST be treated identically. A vault MUST NOT maintain any other per-depositor state, configuration, role, or timer. ### Invariants A compliant vault MUST uphold the following at the end of every transaction: - **I1 — Soulbound credit.** A deposit credits exactly the storage address named in the call. No function MAY transfer, move, or re-assign a claim to any other address. - **I2 — Two operations.** The externally callable state-changing surface is exactly two functions: deposit (which MAY have more than one entry point, e.g. ETH and ERC-20) and withdraw. Nothing else mutates claims. Read-only views and ERC-165's `supportsInterface` are outside this count. - **I3 — Exit destination is the storage address.** Withdrawal sends assets only to `msg.sender`, who MUST be the storage address holding the claim. The destination MUST NOT be a parameter and MUST NOT be influenceable by any caller. - **I4 — No approvals, no delegation.** The vault MUST NOT expose `approve`, `permit`, `transferFrom`, operator, or hook mechanisms on claims. - **I5 — No admin.** No owner, no upgradeability, no pause, no parameter governance, no rescue function. The deployed bytecode MUST be final. - **I6 — Conservation.** For every asset, the sum of all claims MUST equal the vault's tracked balance (`_totalAssets`) of that asset. A withdrawal MUST strictly decrease the claimant's balance by the amount sent. - **I7 — Zero signatures before exit.** No operation MUST require a signature, transaction, or approval from the storage address until it withdraws. - **I8 — No second party, ever.** There MUST be no beneficiary, recovery address, guardian, or timelock. No address other than the storage address MAY cause its assets to move, under any condition or delay. ### Deposit rules - `depositETHFor(storageAddress)` MUST credit `msg.value` to `_claims[storageAddress][address(0)]`. It MUST revert with `ZeroAmount` on zero value and `ZeroAddress` on a zero storage address. - `depositERC20For(storageAddress, token, amount)` MUST pull `amount` from `msg.sender` (the funder), measure the vault's token balance before and after, require the measured delta to equal `amount`, and credit the delta. It MUST revert with `NonStandardToken` if the delta differs from `amount`. Fee-on-transfer tokens are therefore rejected deterministically; rebasing tokens are unsupported and MAY strand value. Wallets SHOULD warn. - The ERC-20 approval MUST live on the funder, not the storage address. The funder is disposable and expected to be compromised eventually; it signs, approves, and is then discarded. - Anyone MAY credit any address. A hostile dust deposit is cosmetic: it creates a claim the recipient MAY ignore, puts no funds at risk, and cannot affect any other claim. ### Withdraw rules - `withdraw(asset, amount)` MUST require `_claims[msg.sender][asset] >= amount` and MUST revert with `InsufficientClaim` otherwise. - It MUST revert with `ZeroAmount` when `amount == 0`. A zero-amount success would emit `Withdrawn`, giving monitoring free, repeatable noise; no integration pattern needs zero-amount calls to succeed. - Effects (decrement claim, decrement total) MUST complete strictly before any external interaction (checks-effects-interactions). ETH MUST be sent by a low-level call that reverts with `EthTransferFailed` on failure; ERC-20 MUST be sent by a safe transfer. - The destination MUST be `msg.sender`. There MUST be no destination parameter anywhere in the contract. - A reentrancy guard is RECOMMENDED as defense in depth, but I6 MUST hold without it. ### Direct sends and accounting - `receive()` and `fallback()` MUST revert with `DirectSendRejected`. Bare ETH would otherwise strand funds with no claim and no owner. - `_totalAssets` MUST move only through the vault's own deposit and withdraw operations. Tokens sent directly without a deposit call are unreachable by design; a vault MUST NOT provide a sweep or rescue function, because any rescue path is an admin path and violates I5. ### Additional requirements - The vault MUST be deployed with no constructor-settable privileged roles and MUST NOT be deployed behind a proxy. - The vault MUST NOT implement ERC-20, [ERC-721](./eip-721.md), or [ERC-1155](./eip-1155.md) for its claims, and MUST NOT expose any function named `transfer`, `transferFrom`, `approve`, or `setApprovalForAll`. - The vault MUST NOT read `block.timestamp` or `block.number` for any authorization decision. - The vault MUST NOT call any external contract except the ERC-20 being deposited or withdrawn, and the storage address when sending ETH. - Compilers MUST use checked arithmetic (Solidity `^0.8.0` or an equivalent guarantee), with immutable, verified bytecode. ### Reference-implementation requirement (non-inherited) The reference implementation in this document uses a transient-storage reentrancy guard and therefore requires an EVM with [EIP-1153](./eip-1153.md) (transient storage) and [EIP-3855](./eip-3855.md) (`PUSH0`); its constructor executes a `TSTORE` so deployment reverts on any chain without EIP-1153. Alternative implementations using a storage-slot guard, or no guard (I6 MUST hold without one), do not inherit this restriction. ### Identity and smart-contract storage addresses Identity is the 20-byte address, not a key. Any address MAY be credited, contracts included. The claim binds to the contract address; if that contract is upgradeable, whoever controls the upgrade controls the exit, and the "same keys" guarantee degrades to "same governance." Under [EIP-7702](./eip-7702.md), an EOA with delegated code keeps its address and its claim, but any code it delegates to MAY call `withdraw` on its behalf — funds still reach only the storage address itself. Tooling SHOULD display the account type of the address being credited at deposit time. ## Rationale **Why push-based deposits.** Concentrating all signing, approvals, and gas in a disposable funder is the mechanism that lets the storage address stay unsigned. The funder is assumed to be compromised eventually; because it holds no claim, a funder compromise costs only what is still in the funder, never anything already vaulted. This also means a storage address never needs to hold ETH for gas until it exits. **Why no destination parameter.** I3 is enforced by construction rather than by a check. A withdrawal has nowhere to send funds except `msg.sender`, so there is no parameter for a compromised integration or a signature-replay to redirect. **Why no on-chain recovery (I8).** A recovery path is the only feature that would let a second address ever move the funds, breaking the single invariant that carries the design. It also introduces claim state, challenge windows, cancellation, anti-grief cooldowns, and a `block.timestamp` dependency, roughly doubling the audit surface of an otherwise tiny contract, and it creates attack paths that otherwise do not exist (a compromised beneficiary key, a hostile premature claim, file-and-cancel griefing). Every mechanism that can release funds without the storage key is a mechanism an attacker can aim at. Recovery is instead handled off-chain at the key layer, where it adds no on-chain attack surface. SLIP-39 (Shamir's Secret-Sharing for Mnemonic Codes) splits a wallet backup into N shares with an M-of-N threshold; fewer than M shares reveal nothing. A typical 3-of-4 scheme keeps two shares in the owner's own custody (below threshold) and distributes the rest to an heir and an estate attorney, so release is gated by the legal process that already governs estates rather than by a block timestamp. To the vault, an heir reconstructing the key is indistinguishable from the owner exiting: the same single signature that was always the plan. This must be chosen at address creation, before any deposit. **Why reject rather than credit non-standard tokens.** Crediting a measured delta for fee-on-transfer or rebasing tokens would make the vault an accounting oracle for non-standard tokens, which is out of scope for a cold-storage primitive. Rejecting deterministically keeps I6 exact. **Companion modules (non-normative).** A monitoring/watchtower service and a Chainlink CCIP cross-chain extension are specified separately and are not part of this standard. The governing boundary is that the vault is fully safe with zero alerts; monitoring only shortens reaction time, and no contract feature should ever be added "so that alerts can work." A cross-chain extension treats the cross-chain adapter as simply another funder and keys claims by `(chainSelector, address)` so that the same 20 bytes are not treated as the same owner across chains. ## Backwards Compatibility No backward compatibility issues found. This standard defines a new, self-contained contract type. It deliberately does **not** implement ERC-20, ERC-721, or ERC-1155 for its claims, so claims are invisible to existing token tooling as transferable objects; this is a design requirement (I4), not an incompatibility. Discovery is via ERC-165. Indexing is purely event-driven from `Deposited` and `Withdrawn`; the standard defines no metadata, enumeration, or registry. ## Test Cases The reference implementation is accompanied by a test suite covering, at minimum: - Every function against every revert path (`ZeroAmount`, `ZeroAddress`, `InsufficientClaim`, `NonStandardToken`, `EthTransferFailed`, `DirectSendRejected`). - Event emission including the indexed `funder`, and ERC-165 support for `0x845d82f0`. - The funder/storage separation: the funder of a deposit gains no claim and no capability, and the storage address signs nothing at entry. - Invariants I1, I3, I6, and I8 encoded as executable properties: `sum(claims[*][asset]) == totalAssets(asset)`; no actor sequence changes `balanceOf(a, t)` for an `a` that did not deposit or withdraw; assets leaving the vault arrive only at the debited claimant; no reachable state lets any address other than the claimant reduce a claim. - Adversarial tokens: reentrant (on `transfer` and `transferFrom`), fee-on-transfer (must revert), rebasing (documented behavior), plus an ETH-rejecting contract and an EIP-7702-delegated EOA as storage addresses, and a hostile funder attempting to credit and then reclaim. ## Reference Implementation The following implementation satisfies the invariants above. It uses an inlined minimal safe-ERC-20 helper (no external dependencies), checks-effects-interactions in `withdraw`, a transient-storage reentrancy guard as defense in depth, and a constructor canary that reverts deployment on chains without EIP-1153. ```solidity // SPDX-License-Identifier: CC0-1.0 pragma solidity 0.8.34; import {IColdStorageVault} from "./IColdStorageVault.sol"; contract ColdStorageVault is IColdStorageVault { // (storage address => asset => claim). asset == address(0) is ETH. mapping(address storageAddress => mapping(address asset => uint256)) internal _claims; // Internal accounting per asset; moves only through deposit/withdraw. mapping(address asset => uint256) internal _totalAssets; // Transient reentrancy lock slot: keccak256("ERC-XXXX.cold.vault.lock") - 1. bytes32 private constant _LOCK_SLOT = 0x4d01bb32fdf060f1a5e5499b4699070f83f30c5ff0f48270c7695a0657cbdc91; error Reentrancy(); // Deployment canary: reverts on any chain without EIP-1153 (transient storage). constructor() { assembly { tstore(_LOCK_SLOT, 0) } } modifier nonReentrant() { assembly { if tload(_LOCK_SLOT) { mstore(0x00, 0xab143c06) // Reentrancy() revert(0x1c, 0x04) } tstore(_LOCK_SLOT, 1) } _; assembly { tstore(_LOCK_SLOT, 0) } } function depositETHFor(address storageAddress) external payable { if (storageAddress == address(0)) revert ZeroAddress(); if (msg.value == 0) revert ZeroAmount(); _claims[storageAddress][address(0)] += msg.value; _totalAssets[address(0)] += msg.value; emit Deposited(storageAddress, address(0), msg.value, msg.sender); } function depositERC20For( address storageAddress, address token, uint256 amount ) external nonReentrant { if (storageAddress == address(0) || token == address(0)) revert ZeroAddress(); if (amount == 0) revert ZeroAmount(); uint256 before = _erc20BalanceOfSelf(token); _safeTransferFrom(token, msg.sender, address(this), amount); uint256 delta = _erc20BalanceOfSelf(token) - before; if (delta != amount) revert NonStandardToken(); _claims[storageAddress][token] += amount; _totalAssets[token] += amount; emit Deposited(storageAddress, token, amount, msg.sender); } function withdraw(address asset, uint256 amount) external nonReentrant { if (amount == 0) revert ZeroAmount(); uint256 claim = _claims[msg.sender][asset]; if (claim < amount) revert InsufficientClaim(); _claims[msg.sender][asset] = claim - amount; _totalAssets[asset] -= amount; emit Withdrawn(msg.sender, asset, amount); if (asset == address(0)) { (bool ok, ) = msg.sender.call{value: amount}(""); if (!ok) revert EthTransferFailed(); } else { _safeTransfer(asset, msg.sender, amount); } } function balanceOf(address storageAddress, address asset) external view returns (uint256) { return _claims[storageAddress][asset]; } function totalAssets(address asset) external view returns (uint256) { return _totalAssets[asset]; } function supportsInterface(bytes4 interfaceId) external pure returns (bool) { return interfaceId == type(IColdStorageVault).interfaceId || interfaceId == 0x01ffc9a7; // type(IERC165).interfaceId } receive() external payable { revert DirectSendRejected(); } fallback() external payable { revert DirectSendRejected(); } function _safeTransferFrom(address token, address from, address to, uint256 amount) private { (bool ok, bytes memory data) = token.call( abi.encodeWithSelector(0x23b872dd, from, to, amount) // transferFrom ); if (!ok || (data.length != 0 && !abi.decode(data, (bool))) || token.code.length == 0) { revert NonStandardToken(); } } function _safeTransfer(address token, address to, uint256 amount) private { (bool ok, bytes memory data) = token.call( abi.encodeWithSelector(0xa9059cbb, to, amount) // transfer ); if (!ok || (data.length != 0 && !abi.decode(data, (bool))) || token.code.length == 0) { revert NonStandardToken(); } } function _erc20BalanceOfSelf(address token) private view returns (uint256) { (bool ok, bytes memory data) = token.staticcall( abi.encodeWithSelector(0x70a08231, address(this)) // balanceOf ); if (!ok || data.length < 32) revert NonStandardToken(); return abi.decode(data, (uint256)); } } ``` ## Security Considerations - **Key theft is out of scope, deliberately.** The standard removes approval phishing, transfer-based theft, market draining, beneficiary compromise, and admin subversion. It cannot protect a storage address whose own key signs a legitimate withdrawal; nothing on-chain can distinguish a rightful key holder from a thief. - **Key loss is permanent.** There is no recovery path, by design (I8). Users MUST establish a multi-share backup (e.g. SLIP-39) before funding an address. - **The funder is assumed hostile-eventually.** A funder compromise costs only what is still in the funder. The approval a funder grants can move funder-held tokens into a claim and nothing else; it cannot touch an existing claim or redirect a withdrawal. - **Self-deposit silently forfeits the main property.** A storage address that calls the deposit function itself signs at entry and publishes its public key early. The contract permits this; tooling SHOULD discourage it and route deposits through a funder. - **Anyone can credit anyone.** This is harmless: no configuration to poison, no clock to reset, no cross-claim effect. A recipient MAY ignore an unwanted claim. - **Non-standard tokens.** Fee-on-transfer deposits revert. Rebasing drift strands value by design. If a non-standard token reduces the vault's real balance below the sum of claims, withdrawals exceeding the real balance revert at the token layer; partial withdrawals up to the real balance succeed, and last claimants bear the shortfall. There is no rescue function, because rescue implies privilege. - **Force-funded ETH.** A reverting `receive()` does not prevent ETH delivery via pre-funding the predictable CREATE2 address before deployment, `SELFDESTRUCT`, or validator-withdrawal/coinbase targeting. No claim is created or affected. Integrators and monitoring MUST NOT treat `address(vault).balance == totalAssets(address(0))` as an invariant; only `balance >= totalAssets(address(0))` is guaranteed. - **No pause, no admin, no upgrade.** A discovered vault bug cannot be patched. Mitigation is social (tooling stops offering deposits) plus every holder's unilateral ability to exit. Immutability is the product, not a limitation of it. - **No time dependence.** The contract reads no block timestamp or number for any authorization decision, so proposer/sequencer timestamp influence is irrelevant to it. - **Denial of service.** Claims are isolated per `(storage address, asset)`; no shared loops, no unbounded iteration. One user cannot block another's exit. - **Front-running.** Deposits and withdrawals are not sandwichable: no pricing, no shares, no exchange rate. This is deliberately not [ERC-4626](./eip-4626.md). ## Copyright Copyright and related rights waived via [CC0](../LICENSE.md).