---
eip: 2876
label: ERC-2876
title: Deposit contract and address standard
status: Stagnant
type: Standards Track
category: ERC
created: 2020-08-13
official: https://eips.ethereum.org/EIPS/eip-2876
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-2876.md
canonical: https://eips.huatuo.xyz/eip-2876/
lang: en
tldr: A 28-byte deposit address (contract address + 8-byte id with checksum) and a deposit(bytes8) contract interface, so exchanges can tell ETH deposits apart without one account per user.
tags: [payments, deposits, address-format, exchange, erc]
---

# ERC-2876: Deposit contract and address standard

> This ERC defines a simple contract interface for managing deposits. It also defines a new address format that encodes the extra data passed into the interface's main deposit function.

**TL;DR:** A 28-byte deposit address (contract address + 8-byte id with checksum) and a deposit(bytes8) contract interface, so exchanges can tell ETH deposits apart without one account per user.

## What problem does it solve?

Exchanges and merchants need to know who sent each ETH deposit. The usual approach is a fresh address per user or invoice, which forces a bad trade-off:

- Externally owned deposit addresses must be hot wallets, or someone has to sweep thousands of cold accounts by hand.
- Deploying a contract per deposit address costs tens of thousands of gas each.

ERC-2876 lets one contract receive all deposits and identifies each depositor by an 8-byte id carried in the calldata. The id is packed into a longer "deposit address" so users still just paste one string into their wallet.

## How it works

**Deposit address format (28 bytes):**

```
<20-byte contract address> <5-byte nonce> <3-byte checksum>
```

The checksum is the first 3 bytes of `keccak256(address ++ nonce)`. The nonce plus checksum together form the 8-byte `id`.

**Contract interface:**

```solidity
interface DepositEIP {
    function deposit(bytes8 id) external payable returns (bool);
}
```

- The contract must revert on plain ETH transfers with empty calldata.
- `deposit` returns `true` when the payment is complete, `false` when it keeps the funds but the deposit is not yet complete (e.g. a partial invoice payment), and reverts if it does not want the funds.
- It should verify the checksum inside the id.

**Wallet behaviour:** when given a 28-byte deposit address, a wallet must verify the checksum, send to the first 20 bytes, and set calldata to the `deposit(bytes8)` selector `0x3ef8e69a` followed by the 8-byte id, right-padded to 32 bytes. It must refuse if the user also supplied custom data.

## Sample code

Turning a deposit address into a transaction (ethers v6):

```ts
import { keccak256, getBytes, hexlify, concat, zeroPadBytes } from "ethers";

function parseDepositAddress(dep: string) {
  const b = getBytes(dep);
  if (b.length !== 28) throw new Error("not a deposit address");
  const addr = b.slice(0, 20), nonce = b.slice(20, 25), chk = b.slice(25, 28);
  const expected = getBytes(keccak256(concat([addr, nonce]))).slice(0, 3);
  if (hexlify(expected) !== hexlify(chk)) throw new Error("bad checksum");
  const id = b.slice(20, 28);
  return {
    to: hexlify(addr),
    data: concat(["0x3ef8e69a", zeroPadBytes(id, 32)]),
  };
}

// Test vector from the spec
const tx = parseDepositAddress("0x433e064c42e87325fb6ffa9575a34862e0052f26913fd924f056cd15");
// tx.to   = 0x433e064c42e87325fb6ffa9575a34862e0052f26
// tx.data = 0x3ef8e69a913fd924f056cd15000000000000000000000000000000000000000000000000
await signer.sendTransaction({ ...tx, value: amount });
```

## Things to know

- Status is **Stagnant**. Mainstream wallets do not recognise 28-byte deposit addresses.
- It handles native ETH only, not ERC-20 tokens. The author argues separate mechanisms per currency are acceptable.
- Because the contract rejects plain transfers, a wallet that strips the address to 20 bytes and sends without calldata will fail rather than lose funds.
- The 24-bit checksum is stronger than the roughly 15-bit average of [EIP-55](/eip-55/) mixed-case checksums.
- The spec recommends forwarding funds to a hard-coded or `immutable` cold wallet, and using a kill switch that reverts deposits rather than `selfdestruct` when shutting down.


---

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