Bitcoin Address
finance.crypto.bitcoin_addressBitcoin wallet address. P2PKH format starts with 1, P2SH with 3, P2WPKH with bc1. 26-35 characters. Base58Check encoding.
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As VARCHAR | address_type |
|---|---|---|
| 1A1z7agoat2GPFH7pPPPP... | 1A1z7agoat2GPFH7pPPPP... | P2PKH |
| 3J98t1WpEZ73CNmYviecrnyiWrnqRhWNLy | 3J98t1WpEZ73CNmYviecrnyiWrnqRhWNLy | P2SH |
| bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 | bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 | P2WPKH |
Shape
^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^bc1[a-z0-9]{39,59}$| Value | Length | Shape |
|---|---|---|
| 1A1z7agoat2GPFH7pPPPP... | 24 | rejected |
| 3J98t1WpEZ73CNmYviecrnyiWrnqRhWNLy | 34 | matches |
| bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 | 42 | matches |
| 1A1z7agoat2GPFH7pPPPP.. | 23 | rejected: one character short |
Background
Origin
Base58Check addresses with version byte 0x00 are pay-to-pubkey-hash addresses, and they begin with the digit 1.[1]
BIP 13, Address Format for pay-to-script-hash, was written by Gavin Andresen.[2] BIP 13 sets the version byte to 5 for a main-network address, which becomes the leading character 3.[2] BIP 13 gives its motivation as enabling end-to-end secure wallets and payments to fund escrow transactions or other complex transactions.[2]
BIP 173 uses the human-readable part bc for mainnet addresses and tb for testnet.[3] BIP 173 argues that Base58 needs a lot of space in QR codes.[3] BIP 173 also argues that the mixed case in Base58 makes addresses inconvenient to write down, type on mobile keyboards or read out loud.[3] BIP 350 was written because inserting or deleting q characters just before a final p can leave a Bech32 checksum valid.[4]
Use
The Bitcoin Wiki says new-style bech32 addresses are case-insensitive.[5] BIP 173 says decoders must not accept strings that mix uppercase and lowercase characters.[3] BIP 173 says encoders must output lowercase.[3] BIP 173 recommends uppercase inside QR codes, because it permits the more compact alphanumeric mode.[3]
The Bitcoin Wiki says some characters of an address act as a checksum, so that typographical errors can be found and rejected automatically.[5] The Bitcoin Wiki says addresses are not intended to be used more than once.[5] Expect one person or business to sit behind many addresses, and do not read a count of distinct addresses as a count of owners. (Meridian's view)
Where you'll meet it
OFAC's Specially Designated Nationals List gives each digital currency address its own field, labelled for Bitcoin as Digital Currency Address - XBT.[6]
Sources
- [1]Base58Check encodingsecondary source
- [2]BIP 13: Address Format for pay-to-script-hashstandard
- [3]BIP 173: Base32 address format for native v0-16 witness outputsstandard
- [4]BIP 350: Bech32m format for v1+ witness addressesstandard
- [5]Invoice addresssecondary source
- [6]563 | Office of Foreign Assets Controlorganisation
Detection notes
v1 migration: Was payment.bitcoin_address. Pattern covers P2PKH (1..), P2SH (3..), P2WPKH (bc1...). Addresses are not case-sensitive but typically use mixed case for checksums.
Use it
$ finetype infer -i "1A1z7agoat2GPFH7pPPPP..." --mode column
→ finance.crypto.bitcoin_address
SELECT ft_infer('1A1z7agoat2GPFH7pPPPP...');
-- → 'finance.crypto.bitcoin_address'CAST({col} AS VARCHAR)Schema
https://meridian.online/schemas/finance.crypto.bitcoin_address · Frictionless type string
finetype taxonomy finance.crypto.bitcoin_address -o json-schema