Bitcoin Developer Reference

·

Introduction

Bitcoin is a decentralized digital cryptocurrency created by pseudonymous developer Satoshi Nakamoto. The first paper on Bitcoin, also referred to as the original Bitcoin paper, was published by Nakamoto in 2008. It provides a brief description of the concepts and architecture schematics of the Bitcoin protocol.

Key Features:

Architecture

Central to Bitcoin's architecture is a public ledger called the blockchain, which stores all processed transactions in chronological order. Transactions are processed by a network of miners in a process called mining.

Blocks Structure:

Each block consists of:

  1. Header (containing metadata)
  2. Payload (containing transactions)
FieldTypeDescription
nVersionintBlock format version
HashPrevBlockuint256Hash of previous block
HashMerkleRootuint256Root of Merkle tree
nTimeunsigned intTimestamp
nBitsunsigned intTarget for proof of work
nNonceunsigned intNonce for proof of work

vtx | VarInt | Number of transactions

vtx[] | Transaction | Transaction vector

Transaction Types

There are two primary transaction types in Bitcoin:

1. Regular Transactions

Used to transfer existing Bitcoins between users.

2. Coinbase Transactions

Special transactions that introduce new Bitcoins into the system (miner rewards).

Bitcoin Ownership

Bitcoin utilizes cryptographic primitives for secure transaction authorization:

  1. Asymmetric Cryptography:

    • Public/private key pairs
    • Digital signatures for authentication
  2. Proof of Work:

    • Regulates coin supply
    • Rewards miners
    • Ensures block integrity

Standard Transaction Types:

  1. Pay-to-Pubkey (P2PK)
  2. Pay-to-PubkeyHash (P2PKH)
  3. Pay-to-ScriptHash (P2SH)
  4. Multisig
  5. Nulldata

Blockchain Structure

The blockchain provides:

Mining Process:

  1. Collect transactions
  2. Verify transactions
  3. Select most recent block
  4. Solve proof-of-work puzzle
  5. Broadcast solution

FAQ

Q: What is the purpose of the nonce in Bitcoin mining?

A: The nonce provides variability for miners to solve the proof-of-work puzzle by allowing different hash computations.

Q: How are Bitcoin addresses created?

A: Bitcoin addresses are hashes of public keys with built-in checksums, encoded in Base58 format.

Q: What's the difference between P2PKH and P2SH addresses?

A: P2PKH addresses are hashes of public keys, while P2SH addresses are hashes of redemption scripts, offering more flexibility in spending conditions.

👉 Learn more about Bitcoin technology
👉 Explore advanced Bitcoin concepts