04 l1 bitcoin
04 — Bitcoin (L1)
A blockchain original. Designed como peertopeer electronic cash. Hoje primariamente *tore of value*+ settlement layer; L2s para payments.
1. Especificações fundamentais
| Spec | Valor |
|---|---|
| Launch | 2009 |
| Whitepaper | 2008 |
| Consensus | Proof |
| Block time | 10 minutos (target médio) |
| Block size | 1 MB base + witness (após SegWit), efetivo ~2-4 MB |
| Difficulty adjustment | Every 2016 blocks (~2 weeks) |
| Total supply | 21M BTC (asymptotic) |
| Halvings | A cada 210k blocos (~4 anos): 50 → 25 → 12.5 → 6.25 → 3.125 BTC |
| Smallest unit | 1 satoshi = 10⁻⁸ BTC |
| Address curva | secp256k1 (ECDSA legacy; Schnorr em Taproot) |
| Hash algoritmos | SHA |
| Tx model | UTXO |
| Native script | Bitcoin Script (não |
| Programming language (Core) | C++ |
| Reference impl | Bitcoin Core (github.com/bitcoin/bitcoin) |
2. Estrutura do bloco
Block header (80 bytes):
version (4 bytes)
prev_block (32 bytes)
merkle_root (32 bytes)
timestamp (4 bytes)
bits (4 bytes) // difficulty target encoded
nonce (4 bytes)
Tx count (varint)
TransactionsBlock hash = SHA256(SHA256(header)).
Merkle root
Hash da árvore de Merkle de SHA256(SHA256(txid_i)) das txs no bloco.
Permite SPV (Simplified Payment Verification): cliente light pode verificar inclusão de tx com \(O(\log n)\) data.
3. Transações
Estrutura
version (4 bytes)
input count (varint)
inputs:
prev_output (txid:vout) (36 bytes)
scriptSig length
scriptSig
sequence
output count (varint)
outputs:
value (8 bytes; satoshis)
scriptPubKey length
scriptPubKey
locktime (4 bytes)Script types
| Type | Opcode template | Address |
|---|---|---|
| *2PK (Pay |
<pubkey> OP_CHECKSIG |
(no address; raw pubkey) |
| *2PKH (Pay |
OP_DUP OP_HASH160 <hash> OP_EQUALVERIFY OP_CHECKSIG |
Base58 1... |
| *2SH (Pay |
OP_HASH160 <hash> OP_EQUAL |
Base58 3... |
| *2WPKH (Witness Pubkey Hash, SegWit)* | OP_0 <hash> |
Bech32 bc1q... (20 bytes) |
| *2WSH (Witness Script Hash, SegWit)* | OP_0 <hash> |
Bech32 bc1q... (32 bytes) |
| *2TR (Pay |
OP_1 <pubkey> |
Bech32m bc1p... |
Lock scripts (timelocks)
- *P_CHECKLOCKTIMEVERIFY (CLTV, BIP 65)* absolute timelock.
- *P_CHECKSEQUENCEVERIFY (CSV, BIP 112)* relative timelock.
Usado em Lightning, HTLCs.
4. Histórico de upgrades
BIPs (Bitcoin Improvement Proposals)
Process: BIP draft → community discussion → soft fork via miner signaling (BIP 9 / Speedy Trial).
Major upgrades
| Ano | Upgrade | BIP | Impacto |
|---|---|---|---|
| 2012 | *2SH* | BIP 16 | Pay |
| 2015 | *P_CLTV* | BIP 65 | Absolute timelocks |
| 2016 | *P_CSV* | BIP 112 | Relative timelocks |
| 2017-08 | *egWit* | BIP 141, 143, 144 | Separa signatures; fixes malleability; effective block size ↑ |
| 2017-08 | *ech32 addresses* | BIP 173 | Better error correction |
| 2021-11 | *aproot* | BIP 340, 341, 342 | Schnorr signatures, MAST, Tapscript |
| 2021-11 | *ech32m* | BIP 350 | Fix Bech32 last-char weakness |
SegWit (2017)
*egregated Witness*
- Separa script_sig (signature) para "witness" — não conta para 1 MB base block size.
- *eight units (WU)* bloco max 4M WU. Base tx data = 4 WUbyte, witness = 1 WUbyte.
- Effective block: ~1.5-2 MB com mix típico.
- Fix malleability: txid não inclui witness — Lightning Network viável.
Taproot (2021)
*chnorr signatures (BIP 340)*
- Mais simples que ECDSA, prova de segurança limpa em ROM.
- *inear* \(\sigma_1 + \sigma_2\) válido para \(P_1 + P_2\). Permite signature aggregation (*uSig2*.
- 64 bytes (vs 71-72 ECDSA).
*aproot (BIP 341)*
- Output: single 32-byte Schnorr pubkey.
- Single sig, multisig (via MuSig), e complex script — todos indistinguíveis on-chain quando happy path.
- Script revealed only se necessário (key path vs script path).
*apscript (BIP 342)*
- Modifica Script (adds OP_CHECKSIGADD; remove some legacy opcodes; clean signature behavior).
- 64-byte signatures.
5. Mining
Mecânica
- Miner constrói *lock template* collects mempool txs, adiciona coinbase tx (com block reward + fees).
- Computa Merkle root.
- Varia nonce + extranonce no coinbase até \(H(\text{header}) < \text{target}\).
- Broadcast bloco; peers verificam e propagam.
Difficulty adjustment
Cada 2016 blocos: $\(D_{\text{new}} = D_{\text{old}} \times \frac{T_{\text{expected}}}{T_{\text{actual}}}\)$
\(T_{\text{expected}} = 2016 \times 600\text{s}\). Bounded [1/4, 4]× per adjustment.
Hashrate
Total network hash power. ~700 EHs em mai2026 (vs ~1 TH/s em 2010).
Pools
| Pool | Share aprox 2026 |
|---|---|
| Foundry USA | 25% |
| AntPool | 20% |
| ViaBTC | 12% |
| F2Pool | 10% |
| Binance Pool | 8% |
| MARA Pool | 5% |
| Outros | 20% |
*entralization concern* top 2 pools ~45%. Mas pool ≠ miner; individual miners podem switch pools easily (Stratum V2 helps).
ASICs
Antminer S21 (~225 THs, 18 JTH efficient), Whatsminer M60S+. Bitmain, MicroBT, Canaan dominantes.
Mining geography
| País | Share aprox 2026 |
|---|---|
| EUA | 38% |
| Cazaquistão | 13% |
| Rússia | 12% |
| Canadá | 6% |
| Outros | 31% |
(China: <1% após ban 2021; recovery slow underground.)
6. Halving econômico
| Halving | Data | Reward antes → depois |
|---|---|---|
| #1 | 2012 |
50 → 25 BTC |
| #2 | 2016 |
25 → 12.5 BTC |
| #3 | 2020 |
12.5 → 6.25 BTC |
| #4 | 2024 |
6.25 → 3.125 BTC |
| #5 (expected) | 2028 | 3.125 → 1.5625 BTC |
*tocktoflow* Bitcoin scarcity narrative; modelo de *lanB*(2019) que posthalving price tracks. Modelo controvertido (overfit; ATH 2021 acima, 2022 abaixo).
*ining economics* cada halving comprime margin; bear markets pós-halving testam efficient miners.
7. Lightning Network (L2)
*oseph Poon + Thaddeus Dryja whitepaper 2015* Mainnet 2018.
Mecânica
*ayment channels* 2 parties open multisig channel; balance updated offchain via signed state; eventual on-chain settle.
*TLCs (Hashed Timelock Contracts)* enable multi-hop payments — payer reveals secret \(x\) such that \(H(x) = h\); intermediate hops conditionally pay.
*nion routing (Sphinx)* route encrypted; nodes só know prev+next hop.
Stats (~mai/2026)
- ~6000 BTC capacity total.
- ~14000 nodes ativos.
- Payments instantaneous, sub-cent fees.
Implementations
- *ND*(Lightning Labs, Go).
- *ore Lightning (CLN)*(Blockstream, C).
- *clair*(ACINQ, Scala).
- *DK (Lightning Dev Kit)*(Spiral, Rust library).
Limitations
- *iquidity routing* directional balance issues.
- *hannel rebalancing*needed.
- *atchtowers*required to prevent counterparty malfeasance during offline.
- *hannel jamming attacks*mitigated em pesquisa.
8. Stacks (Bitcoin L2 with smart contracts)
*uneeb Ali + Ryan Shea 2017* Anchored to Bitcoin via *roofofTransfer (PoX)*
- Clarity language (decidable, no Turing-completeness).
- sBTC: 2-way peg para Bitcoin via threshold signing.
- Native Bitcoin DeFi attempt.
9. Liquid Network
*lockstream* 2018. *idechain federada*com 15 functionaries.
- Confidential Transactions (Pedersen commitments).
- Issued assets (Tether USDt
Liquid, USDCLiquid). - 1
minute blocks, 2block finality. - L
BTC pegin/peg-out via federation.
10. Ordinals + Inscriptions
*asey Rodarmor 2023*
*rdinals theory* assign serial number to each satoshi based on order of mining. Allows non-fungibility ("rare sats").
*nscriptions* arbitrary data inscribed em witness data of Taproot tx. NFTs nativos em Bitcoin sem L2.
*RC-20* token standard usando inscriptions (text JSON). Controversial — bloated bloco; aumentou fees.
*unes*(Casey, 2024): mais eficiente token protocol. Lançado em halving 2024.
*tomicals* alternative protocol.
*tamps (SRC-20)* data em UTXOs (more permanent que witness, maior fee).
11. RGB
Smart contract layer "clientside validation" — state lives offchain, anchored em Bitcoin tx. Roadmap longo; recent traction limited.
12. Bitcoin DeFi (BTCFi)
Emerging 2024-2026:
- *abylon* stake BTC para securizar L2s (timestamping). Mainnet ago/2024.
- *oreDAO* EVM-compatible sidechain using BTC mining hash.
- *ouncebit* LRT em BTC.
- *rch Network* Bitcoin L2 EVM-like.
- *itVM* trustless bridge concept via fraud proofs (theoretical 2023, impl in progress 2024-2025).
- *itrea* ZK rollup em Bitcoin.
13. Privacy em Bitcoin
CoinJoin
Mixing protocol — múltiplos users combinam UTXOs em uma tx; quempagouquem ambíguo.
- *asabi Wallet*(Wassabi 2.0+).
- *amourai Whirlpool*— fundadores *resos em abr/2024*(US DOJ alleged money laundering).
- *oinMarket*
PayJoin (BIP 78)
Sender + receiver contribuem ambos inputs — quebra heuristic "common input ownership".
Silent Payments (BIP 352)
Reusable addresses sem on-chain reuse; receiver computes ECDH com sender. Native em Bitcoin Core 28.0 (2024).
14. Adoption + investment vehicles
Spot ETFs (US, jan/2024)
Approved by SEC:
- BlackRock IBIT
- Fidelity FBTC
- Grayscale GBTC (converted from trust)
- Bitwise BITB
- Ark/21Shares ARKB
- VanEck HODL
- WisdomTree BTCW
- Invesco BTCO
- Valkyrie BRRR
- Hashdex DEFI
- Franklin EZBC
AUM combined > US$ 100B by 2026.
Corporate treasuries
- *icroStrategy (MSTR)* ~500k BTC (Michael Saylor).
- *esla* ~10k BTC (sold partial 2022).
- *lock (Square)* ~8k BTC.
- *oinbase* ~9k BTC.
- *arathon Digital* *iot Platforms*miners: hold BTC.
Nation-state
- *l Salvador* legal tender desde set/2021. ~2700 BTC reserves.
- *hutan* secret BTC mining via Druk Holding (reveal 2024).
- *nited States Strategic Bitcoin Reserve* Executive Order 2025 — holds confiscated BTC (~200k BTC).
Bitcoin Cash + Bitcoin SV
Hard forks (2017, 2018). Marginal adoption. BCH still active community; BSV mostly Craig Wright (perjury convictions, COPA lawsuit 2024).
15. Software
| Client | Lang | Share |
|---|---|---|
| Bitcoin Core | C++ | ~95% |
| btcd (Lightning Labs) | Go | ~3% |
| Bcoin (Purse, agora discontinued) | JS | < 1% |
| Knots (Luke-Jr fork de Core) | C++ | minoria |
| libbitcoin | C++ | research |
16. Limitations e debates
Throughput
7 TPS sustainable. Lightning + sidechains escalate but with trust assumptions.
Energia
150 TWh/ano (Argentina). Defensores: renewable share crescente; estabiliza grid (Bitcoin Mining Council estima 60% renewable em 2024).
Quantum threat
Addresses reused (P2PK no Satoshi era) expostos. P2PKHP2SHSegWit/Taproot ocultam pubkey até spend — janela após broadcast (não confirmação) é window of vulnerability.
*itigation roadmap* BIP draft PQC signing (2024+, Westerbaan/Valsorda).
Censorship resistance
Mempool censorship via mining pool policy possible. Estados em pressão regulatory pode demand. Stratum V2 melhora (jobs created by miners, not pool).
Privacy
Pseudonymous, not anonymous. Chain analysis maduro.
17. Métricas
On-chain
- Daily tx: ~500k.
- Hash power: ~700 EH/s.
- UTXO set: ~120M.
- Full nodes: ~16k.
- Mempool fee market: ~50-200 sat/vB típico.
Macro
- Marketcap: ~US$ 2.5T (mai/2026).
- Circulating supply: 19.7M / 21M (94%).
- Dominance (% total crypto mcap): ~50%.
18. Bibliografia + recursos
- *ntonopoulos* Mastering Bitcoin, 3ª ed.
- *hitepaper*original
bitcoin.org/bitcoin.pdf. - *itcoin Optech newsletter*
- *itcoin Magazine*
- BIPs
github.com/bitcoin/bips. - Mempool space
mempool.space. - Glassnode, CryptoQuant para metrics.
- Conferences: Bitcoin Conference (Miami), Adopting Bitcoin (El Salvador), TABConf, BTCPrague.
19. Referência cruzada
- Cripto primitivas (secp256k1, Schnorr, SHA
256): `..cryptography05assimetrica.md,06hashe-mac.md`. - L2 scaling:
07-l2-scaling.md§Lightning. - Quantum migration:
../cryptography/08-pos-quantica.md. - Privacy techniques:
02-fundamentos.md§Endereços e privacy. - Bitcoin ETF context:
12-tokenomics.md,13-regulacao.md. - Mt. Gox, etc.:
14-incidentes.md.