Ethereum Address
finance.crypto.ethereum_addressEthereum 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
| Value | As VARCHAR |
|---|---|
| 0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2C | 0x742d35cc6634c0532925a3b844bc3e7c1f2b9c2c |
| 0x0000000000000000000000000000000000000000 | 0x0000000000000000000000000000000000000000 |
| 0xd9965507d3b0ce0ce6932b0337db0c11b85fcf7d | 0xd9965507d3b0ce0ce6932b0337db0c11b85fcf7d |
Shape
^0x[a-fA-F0-9]{40}$| Value | Length | Shape |
|---|---|---|
| 0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2C | 42 | matches |
| 0x0000000000000000000000000000000000000000 | 42 | matches |
| 0xd9965507d3b0ce0ce6932b0337db0c11b85fcf7d | 42 | matches |
| 0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2 | 41 | rejected: 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]
Sources
- [1]Ethereum - Wikipediasecondary source
- [2]Ethereum accountsdocumentation
- [3]ERC-55: Mixed-case checksum address encodingstandard
- [4]Documentationdocumentation
- [5]Dataset schemas | Blockchain Analytics | Google Cloud Documentationorganisation
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
$ finetype infer -i "0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2C" --mode column
→ finance.crypto.ethereum_address
SELECT ft_infer('0x742d35Cc6634C0532925a3b844Bc3e7c1f2B9C2C');
-- → 'finance.crypto.ethereum_address'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