How do miners send blocks to network peers?

3

How do miners send blocks to network peers?

in array json format, Thus:

{
"hash":"000000000000000000a7b4999c723ed9f308425708577c76827ade51062e135a",
"ver":536870912,
"prev_block":"0000000000000000005ac8cd6b7f803c11a617b901a13e05318a155f8f215ea1",
"mrkl_root":"48915d048e3f3a8c19d3ab81ebdfc16278cd665637770305ae2e3cb2eaf97ccc",
"time":1512192330,
"bits":402706678,
"fee":0,
"nonce":2321456741,
"n_tx":1,
"size":266,
"block_index":1648336,
"main_chain":true,
"height":497152,
"received_time":1512192330,
"relayed_by":"0.0.0.0",
 "tx":[

 { "ver":1,
  "inputs":[
     {
        "sequence":1663,
        "witness":"",





 "script":   "030096072cfabe6d6d08d1c2f6d904f4e1cd10c6558f8e5aed5d6a89c43bb22862464ebb819dd8813404000000f09f909f104d696e6564206279206a6f73656d737200000000000000000000000000000000000000000000000000000000000000000000"
  }
   ],
  "weight":740,
  "relayed_by":"0.0.0.0",
   "out":[
    {
     "addr_tag_link":"https:\/\/www.f2pool.com",
     "addr_tag":"Discus Fish (F2Pool)",
     "spent":true,
     "tx_index":307162790,
     "type":0,
     "addr":"1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY",
     "value":1250000000,
     "n":0,
          "script":"76a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac"
  }
   ],
   "lock_time":953150447,
  "size":185,
   "rbf":true,
  "time":1512192330,
   "tx_index":307162790,
   "vin_sz":1,
  "hash":      "48915d048e3f3a8c19d3ab81ebdfc16278cd665637770305ae2e3cb2eaf97ccc",
   "vout_sz":1
 }]
 }

or hex format, Thus:

00000020a15e218f5f158a31053ea101b917a6113c807f6bcdc85a000000000000000000cc7cf9eab23c2eae050377375666cd7862c1dfeb81abd3198c3a3f8e045d91484a39225af6d00018659e5e8a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff64030096072cfabe6d6d08d1c2f6d904f4e1cd10c6558f8e5aed5d6a89c43bb22862464ebb819dd8813404000000f09f909f104d696e6564206279206a6f73656d7372000000000000000000000000000000000000000000000000000000000000000000007f06000001807c814a000000001976a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88acefebcf38

asd2791

Posted 2018-03-10T12:48:31.423

Reputation: 51

Answers

2

Blocks are usually sent using BIP152. This transmits blocks using an 80 byte header, 6 bytes per transation, plus the coinbase transaction. To give a concrete example block 000000000000000000117f0033fd8cff18a9fa4601da7f93e6eb3e084caab586 took 16244 bytes to transmit.

If sending to a peer that doesn't already know the transactions (or not supporting BIP152) the node sends the raw block, which is half the size of the hex. In the case of that block the raw block is 1,125,118 bytes long.

G. Maxwell

Posted 2018-03-10T12:48:31.423

Reputation: 6 039

0

Neither, it's a binary format on the wire.

The 'hex' format is the same as the binary format, it just takes 2x the space.

Anonymous

Posted 2018-03-10T12:48:31.423

Reputation: 10 054

-1

This bitcoind JSON-RPC function attempts to submit a new block to the network:

https://bitcoincore.org/en/doc/0.16.0/rpc/mining/submitblock/

Corbin

Posted 2018-03-10T12:48:31.423

Reputation: 115

Is that correct? {"id": 0, "method": "submitblock", "params": [ "00000020a15e218f5f158a31053ea101b917a6113c807f6bcd......", # header block "01000000010000000000000000000000000000000000000000......" #coinbase ]}')asd2791 2018-03-11T12:45:20.400