Bitcoin address format

A Bitcoin address is an identifier (like an account number), starting with 1, 3 or bc1 on the mainnet, containing 27-34 alphanumeric Latin characters and digits (except 0, O, I).

Full list of Bitcoin address prefixes

A Bitcoin address, or simply address, is an identifier of 27-34 alphanumeric characters, beginning with the number 1, 3 or bc1, that represents a possible destination for a bitcoin payment. Addresses can be generated at no cost by any user of Bitcoin. It is also possible to get a Bitcoin address using an account at an exchange or online wallet service. Also, you can generate it offline and store on paper or at any digital storage.
There are currently four address formats in use in Bitcoin mainnet:
  1. P2PKH (Pay 2 Public Key Hash) which begin with the number 1
  2. P2SH (Pay 2 Script Hash) type starting with the number 3.
  3. Bech32 type starting with bc1.
  4. Taproot type sarting with bc1p.
UseLeading symbol(s)Example
Pubkey hash (P2PKH address)117VZNX1SN5NtKa8UQFxw ...
Script hash (P2SH address)33EktnHQD7RiAE6uzMj2Z ...
SegWit mainnet (P2WPKH address)bc1bc1qw508d6qejxtdg4y5 ...
SegWit Testnet (P2WPKH address)tb1tb1qw508d6qejxtdg4y5 ...
SegWit mainnet (P2WSH address)bc1bc1qrp33g0q5c5txsp9a ...
SegWit Testnet (P2WSH address)tb1tb1qrp33g0q5c5txsp9a ...
Private key (WIF, uncompressed pubkey)55Hwgr3u458GLafKBgxts ...
Private key (WIF, compressed pubkey)K or LL1aW4aubDFB7yfras2S1 ...
BIP32 pubkeyxpubxpub661MyMwAqRbcEYS8 ...
BIP49 pubkeyypubypub6XiW9nhToS1gjVsF ...
BIP49 pubkeyzpubzpub6qeoQyhseR78SC69 ...
BIP32 private keyxprvxprv9s21ZrQH143K24Mf ...
Testnet pubkey hashm or nmipcBbFg9gMiCh81Kj8t ...
Testnet script hash22MzQwSSnBHWHqSAqtTVQ ...
Testnet Private key (WIF, uncompressed pubkey)992Pg46rUhgTT7romnV7i ...
Testnet Private key (WIF, compressed pubkey)ccNJFgo1driFnPcBdBX8B ...
Testnet BIP32 pubkeytpubtpubD6NzVbkrYhZ4WLcz ...
Testnet BIP32 private keytprvtprv8ZgxMBicQKsPcsbC ...

Hierarchical Deterministic Wallet

A HD wallet, or hierarchical deterministic wallet is a system of deriving keys from a single starting point known as a seed. The seed allows a user to easily back up and restore a wallet without needing any other information and can in some cases allow the creation of public addresses without the knowledge of the private key. Seeds are typically serialized into human-readable words in a Seed phrase.
Could also add bcrt1 for regtest
reply
Correct. But Regtest is a private local network which is used solely for testing. It is primarily used for the regression tests, hence the name regtest.
reply
Knowing Bitcoin address format helps you understand where an address send or receive BTC from
reply
Is there a difference in size between sending from a P2SH to a bc1, comparing to sending from a bc1 to a bc1? Why?
reply
The process for transferring Bitcoin starts when one user broadcasts a request to the network. This request includes the user's public address, the amount of Bitcoin being sent, and a transaction fee for the miners.
The TX size is a code generated from input and output addresses participating in this transaction
Next, miners process the transaction; information from both users is encrypted, which means the data is turned into a line of computer code called the transaction ID. At this point, the transaction is queued. Transactions are added to the queue until the block limit is reached and a block is created.
So yes, there's a difference in the amount of data required by the miner to "compose" a tx ID and that's why:
  • LEGACY (1) A legacy address is simply the hash of the public key to your private key. Back when Bitcoin launched in 2009, this was the only way to create an address. Today, this uses the most amount of space inside a transaction and is therefor the most expensive address type.
  • P2SH (3) In contrast to legacy addresses, pay-to-script-hash addresses are not the hash of the public key, but of a script that involves certain spending conditions, which stay hidden from the sender. These spending conditions can be very simple (owner of public key A can spend this bitcoin), or rather complex (owner of public key B can spend this bitcoin after X amount of time if he reveals a predetermined secret). Using this script, P2SH addresses can even make use of SegWit and save transaction fees. Sending to a P2SH address is roughly 26% cheaper than using a wallet with legacy addresses.
  • P2WPKH native SegWit (bc1q) This type of address reduces the amount of information stored in the transaction even more by not keeping the signature and script within the transaction, but in the witness. Hence the name "SEGWIT : SegregatedWitness". Using this type of address you can save additional 16% over the P2SH addresses, adding up to over 38% savings over legacy addresses

Why are segwit transactions cheaper?
Segregated witness transactions are cheaper because they are designed to be.
In legacy transactions, every byte has the same "cost"; they all count equally towards the 1000000 byte block limit. Segwit transactions on the contrary keep certain data (signatures etc) in a separate "witness" section, and that witness section is discounted: every witness byte only counts as 0.25 byte towards the block limit. Fees are determined by the market and not a system rule, but the fact that segwit transactions have some of their content discounted results in the market pricing them less.
reply
Can you highlight what is the difference on send/receive via 1, 3, and bc1?
In other words, should I care? whats in it for sender/receiver?
reply
Mainly tx fees:
AddressTypeFees
1(legacy)higher
3(P2SH)mid
bc1(SegWit)low
bcp1(Taproot)even lower
All address types are interoperale.
reply
Thats very helpful, thank YOU
reply
0 sats \ 0 replies \ @xz 5 Jan
To myself. I think one source of confusion is this. Please correct me if I'm wrong about this.
AddressTypeFunctional difference
bc1(Bech32)Prefix bc1 are output addresses that are not commonly used to store funds in a wallet, but may be used in transactions.
bc1q(Segwit)Prefix bc1q are output addresses that are commonly used to store funds and uses a simpler algorithm providing more flexibility to the end-user.
reply
I'm more conversate with the Script Hash Bitcoin Address Format
reply
ypubs get no love around here. jk of course. SLIP-132 was no good. Glad we have output descriptors
reply
Cool list!
Bookmarked!
reply
reply
How about nostr pubkey, isn't it also somehow derived from bitcoin keys?
reply
Yeah nostr keys are BIP 340 keys
reply
Don't think so. You can generate a private key with:
openssl rand -hex 32 > hexprivatekey.txt
Example output to text file: b86bdbc13deb52eb1172e7b2c9821b362r83973efc37cf2ee1cd56ceabdafda8b
You can then use a tool like key-convertr to convert the hex private key into bech32 encoded private key nsec...., if needed.
Here's a more detailed explanation about Nostr keys.
reply
I saw Deezy generating me an onchain address, that looked almost exactly same (except for prefix and last 5 characters) like my nostr npub... while i only logged with Alby and they couldn't see my nsec..
reply
I saw Deezy generating me an onchain address, that looked almost exactly same (except for prefix and last 5 characters) like my nostr npub... while i only logged with Alby and they couldn't see my nsec..
reply
deleted by author
reply
The ecosystem is slowly moving there. Some wallets are already offering them (Muun, Envoy), some others are still testing them and are only available in beta versions (ex. Coldcard). We are a couple of years away from wide adoption I believe.
Personally, I use taproot addresses for my day-to-day exchanges and every time I can, but wouldn’t put generational wealth in them yet.
reply
A curated list of wallets supporting Pay 2 Taproot (P2TR) is available here
Sadly, Taproot's major benefits (more privacy, lower fees, network efficency, etc.) will be seen only AFTER massive adoption.
reply
deleted by author
reply
I know nothing about BlueWallet ETA for Taproot support. This was tested as of v6.3.1 (October 2022).
If barely any wallets support it, then it will never have adoption from users...
I totally agree. And I can't make any plausible forecast about adoption.
reply
deleted by author
reply