<commit_before># Blockchain

Each transaction is broadcast to every node in the Bitcoin network and is then recorded in a public ledger after verification.

### Bitcoin

The Bitcoin blockchain is about 50 GB; it grew by 24 GB in 2015

- Distributed Consensus Algorithm: POW
- Replication: Full
- Communication Protocol: P2P Gossip

### BlockHeader

    type BlockHeader struct {
        Version int32       // currently it is always 4
        PrevBlock [32]byte  // sha32 hash of the the previous block
        MerkleRoot [32]byte
        Timestamp time.Time
        Bits uint32         // Difficulty target for the block
        Nonce uint32
    }<commit_msg>blockchain protocols<commit_after># Blockchain

Each transaction is broadcast to every node in the Bitcoin network and is then recorded in a public ledger after verification.

### Bitcoin

The Bitcoin blockchain is about 50 GB; it grew by 24 GB in 2015

- Distributed Consensus Algorithm: POW
- Replication: Full
- Communication Protocol: P2P Gossip

### BlockHeader

    type BlockHeader struct {
        Version int32       // currently it is always 4
        PrevBlock [32]byte  // sha32 hash of the the previous block
        MerkleRoot [32]byte
        Timestamp time.Time
        Bits uint32         // Difficulty target for the block
        Nonce uint32
    }

### Protocol

    CmdVersion     = "version"
    CmdVerAck      = "verack"
    CmdGetAddr     = "getaddr"
    CmdAddr        = "addr"
    CmdGetBlocks   = "getblocks"
    CmdInv         = "inv"
    CmdGetData     = "getdata"
    CmdNotFound    = "notfound"
    CmdBlock       = "block"
    CmdTx          = "tx"
    CmdGetHeaders  = "getheaders"
    CmdHeaders     = "headers"
    CmdPing        = "ping"
    CmdPong        = "pong"
    CmdAlert       = "alert"
    CmdMemPool     = "mempool"
    CmdFilterAdd   = "filteradd"
    CmdFilterClear = "filterclear"
    CmdFilterLoad  = "filterload"
    CmdMerkleBlock = "merkleblock"
    CmdReject      = "reject"
    CmdSendHeaders = "sendheaders"
{'fraction_non_alphanumeric': 0.06475531389026198, 'fraction_numerical': 0.021749876421156698, 'mean_word_length': 2.3454545454545452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6842831', 'n_tokens_mistral': 629, 'n_tokens_neox': 558, 'n_words': 208}