MeridianMERIDIAN

Ethereum Address

finance.crypto.ethereum_address

Ethereum wallet or contract address. 42 characters: 0x + 40 hex digits. May be EIP-55 checksummed (mixed case) or not.

Worked samples

DuckDB 1.5.5 · finetype 0.6.64

ValueAs VARCHAR
0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2C0x742d35cc6634c0532925a3b844bc3e7c1f2b9c2c
0x00000000000000000000000000000000000000000x0000000000000000000000000000000000000000
0xd9965507d3b0ce0ce6932b0337db0c11b85fcf7d0xd9965507d3b0ce0ce6932b0337db0c11b85fcf7d

Shape

Pattern
^0x[a-fA-F0-9]{40}$
ValueLengthShape
0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2C42matches
0x000000000000000000000000000000000000000042matches
0xd9965507d3b0ce0ce6932b0337db0c11b85fcf7d42matches
0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C241rejected: one character short

Background

Origin

Ethereum was conceived in 2013 by programmer Vitalik Buterin.[1] The Ethereum network went live on 30 July 2015.[1] An Ethereum account's public address is made by taking the last 20 bytes of the Keccak-256 hash of the account's public key and adding 0x to the beginning.[2] An externally owned account's address is 42 characters long: a 20-byte segment written as 40 hexadecimal characters, plus the 0x prefix.[2] Contract accounts also have a 42-character hexadecimal address.[2] A contract deployed with the CREATE operation gets an address derived from the creator's address and the number of transactions sent from that address, known as the nonce.[2] A contract deployed with CREATE2 gets an address derived from the creator's address, a salt the creator picks and a hash of the contract's creation code.[2]

The mixed-case form of the address is defined in ERC-55, Mixed-case checksum address encoding, created on 2016-01-14.[3] ERC-55 was written by Vitalik Buterin and Alex Van de Sande.[3] ERC-55 never changes the decimal digits 0 to 9, since they cannot be upper-cased.[3] ERC-55 keeps the address at 40 characters.[3] ERC-55 was designed to be backwards compatible with many hex parsers that accept mixed case, so that it could be introduced over time.[3] ERC-55 gives an average of 15 check bits per address, and puts the chance that a randomly mistyped address accidentally passes the check at 0.0247%.[3]

Use

The ethers library's getAddress function accepts non-checksum and checksum addresses and returns a normalized, checksummed address.[4] When an address passed to ethers' getAddress contains both upper-case and lower-case letters, the function validates its checksum and throws an error if the checksum fails.[4] The ethers documentation advises converting an address to lower case before passing it to getAddress if its checksum should be ignored.[4] Treat a mixed-case address that fails its checksum as suspect, since it may carry a typo, rather than silently lower-casing it. (Meridian's view)

Google's Blockchain Analytics documentation says addresses in its Ethereum dataset are indexed in all lowercase, and advises using LOWER() when working with mixed-case addresses.[5] Join and deduplicate on the lower-cased address, so that a checksummed copy and a lowercase copy of the same account match. (Meridian's view)

Where you'll meet it

Google's Blockchain Analytics lists Ethereum mainnet tables in BigQuery under bigquery-public-data.goog_blockchain_ethereum_mainnet_us.[5] Google's Ethereum dataset includes a transactions table, with materialized views clustered on its from_address and to_address columns.[5]

Detection notes

v1 migration: Was payment.ethereum_address. Transform lowercases. EIP-55 checksummed addresses use mixed case but lowercase canonical form is preferable for storage.

Use it

CLI · DuckDB
$ finetype infer -i "0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2C" --mode column
→ finance.crypto.ethereum_address

SELECT ft_infer('0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2C');
-- → 'finance.crypto.ethereum_address'
Cast expression
LOWER(CAST({col} AS VARCHAR))

Schema

https://meridian.online/schemas/finance.crypto.ethereum_address · Frictionless type string

finetype taxonomy finance.crypto.ethereum_address -o json-schema

Type Registry