TeachMeBitcoin

Bits vs. Bytes vs. Words

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

Bits vs. Bytes vs. Words

To build a blockchain, you need more than just individual bytes. You need to combine them into larger structures called Words. Bitcoin uses specific word lengths to represent different types of data efficiently.

1. The Hierarchy of Data

Term Size (Bytes) Bitcoin Usage
Byte 1 OP_Codes, Small Constants
Word (Short) 2 Port Numbers (e.g., 8333)
DWord (Double) 4 Block Height, Version, Time
QWord (Quad) 8 Transaction Amount (Sats)
Hash256 32 TXIDs, Public Keys, Merkle Roots

2. 32-bit Words (Uint32)

Most of the "Metadata" in Bitcoin is stored in 4-byte (32-bit) words.

3. 64-bit Words (Uint64)

Because there will eventually be 2.1 quadrillion Satoshis in existence, a 32-bit word isn't large enough to store a Bitcoin balance.

4. The 256-bit Standard

Bitcoin is built on the 256-bit security level.

5. Signed vs. Unsigned Words

Understanding these units allows you to see the "Grid" that Bitcoin data fits into. If a field is supposed to be a Uint32 and you find 5 bytes, you know the data is corrupted.

In the next section, we will discuss Data Capacity & vBytes.

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!