<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bitcoinsv.io/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Connor+Murray</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bitcoinsv.io/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Connor+Murray"/>
	<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php/Special:Contributions/Connor_Murray"/>
	<updated>2026-05-27T20:13:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Peer-To-Peer_Protocol&amp;diff=3095</id>
		<title>Peer-To-Peer Protocol</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Peer-To-Peer_Protocol&amp;diff=3095"/>
		<updated>2023-01-09T16:41:34Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the Bitcoin Network Protocol used by nodes running the BitcoinSV node client to communicate transaction and block information on the BitcoinSV network. This is a current standard means for nodes to communicate information about  the ledger between each other including valid transactions, block discovery messages and more.&lt;br /&gt;
&lt;br /&gt;
For protocol used in mining, see [[Getminingcandidate]].&lt;br /&gt;
&lt;br /&gt;
There have been a number of P2P protocol changes made since 2020. These changes are published on the [https://github.com/bitcoin-sv-specs/protocol/tree/master/p2p Bitcoin SV Node Github repository]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Message structure ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || magic || uint32_t || Magic value indicating message origin network, and used to seek to next message when stream state is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 12 || command || char[12] || ASCII string identifying the packet content, NULL padded (non-NULL padding results in packet rejected)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || length || uint32_t || Length of payload in number of bytes&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha256(sha256(payload))&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || uchar[] || The actual data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known magic values:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Network !! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| mainnet || 0xE8F3E1E3 || E3 E1 F3 E8&lt;br /&gt;
|-&lt;br /&gt;
| testnet 3 || 0xF4F3E5F4 || F4 E5 F3 F4&lt;br /&gt;
|-&lt;br /&gt;
| scaling testnet|| 0xF9C4CEFB || FB CE C4 F9&lt;br /&gt;
|-&lt;br /&gt;
| regtest || 0xFABFB5DA || DA B5 BF FA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Variable length integer ===&lt;br /&gt;
&lt;br /&gt;
Integer can be encoded depending on the represented value to save space.&lt;br /&gt;
Variable length integers always precede an array/vector of a type of data that may vary in length.&lt;br /&gt;
Longer numbers are encoded in little endian.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Storage length !! Format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 0xFD || 1 || uint8_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xFFFF || 3 || 0xFD followed by the length as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xFFFF FFFF || 5 || 0xFE followed by the length as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xFF followed by the length as uint64_t&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you're reading the Satoshi client code (BitcoinQT) it refers to this encoding as a &amp;quot;CompactSize&amp;quot;. Modern BitcoinQT also has the CVarInt class which implements an even more compact integer for the purpose of local storage (which is incompatible with &amp;quot;CompactSize&amp;quot; described here). CVarInt is not a part of the protocol.&lt;br /&gt;
&lt;br /&gt;
=== Variable length string ===&lt;br /&gt;
&lt;br /&gt;
Variable length string can be stored using a variable length integer followed by the string itself.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || length || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Length of the string&lt;br /&gt;
|-&lt;br /&gt;
| ? || string || char[] || The string itself (can be empty)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Network address ===&lt;br /&gt;
&lt;br /&gt;
When a network address is needed somewhere, this structure is used. Network addresses are not prefixed with a timestamp in the version message.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || time || uint32 || the Time (version &amp;gt;= 31402). '''Not present in version message.'''&lt;br /&gt;
|-&lt;br /&gt;
| 8 || services || uint64_t || same service(s) listed in [[#version|version]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || IPv6/4 || char[16] || IPv6 address. Network byte order. The original client only supported IPv4 and only read the last 4 bytes to get the IPv4 address. However, the IPv4 address is written into the message as a 16 byte [http://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses IPv4-mapped IPv6 address]&lt;br /&gt;
(12 bytes ''00 00 00 00  00 00 00 00  00 00 FF FF'', followed by the 4 bytes of the IPv4 address).&lt;br /&gt;
|-&lt;br /&gt;
| 2 || port || uint16_t || port number, network byte order&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Hexdump example of Network address structure&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................&lt;br /&gt;
0010   00 00 FF FF 0A 00 00 01  20 8D                    ........ .&lt;br /&gt;
&lt;br /&gt;
Network address:&lt;br /&gt;
 01 00 00 00 00 00 00 00                         - 1 (NODE_NETWORK: see services listed under version command)&lt;br /&gt;
 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 - IPv6: ::ffff:a00:1 or IPv4: 10.0.0.1&lt;br /&gt;
 20 8D                                           - Port 8333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Inventory Vectors ===&lt;br /&gt;
&lt;br /&gt;
Inventory vectors are used for notifying other nodes about objects they have or data which is being requested.&lt;br /&gt;
&lt;br /&gt;
Inventory vectors consist of the following data format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || type || uint32_t || Identifies the object type linked to this inventory&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The object type is currently defined as one of the following possibilities:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ERROR || Any data of with this number may be ignored&lt;br /&gt;
|-&lt;br /&gt;
| 1 || MSG_TX || Hash is related to a transaction&lt;br /&gt;
|-&lt;br /&gt;
| 2 || MSG_BLOCK || Hash is related to a data block&lt;br /&gt;
|-&lt;br /&gt;
| 3 || MSG_FILTERED_BLOCK || Hash of a block header; identical to MSG_BLOCK.  Only to be used in getdata message. Indicates the reply should be a merkleblock message rather than a block message; this only works if a bloom filter has been set.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || MSG_CMPCT_BLOCK || Hash of a block header; identical to MSG_BLOCK.  Only to be used in getdata message. Indicates the reply should be a cmpctblock message. See BIP 152 for more info.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other Data Type values are considered reserved for future implementations.&lt;br /&gt;
&lt;br /&gt;
=== Block Headers ===&lt;br /&gt;
&lt;br /&gt;
Block headers are sent in a headers packet in response to a getheaders message.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A timestamp recording when this block was created (Will overflow in 2106&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Unix_time#Notable_events_in_Unix_time&amp;lt;/ref&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated difficulty target being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || txn_count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of transaction entries, this value is always 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
cf. [[Block hashing algorithm]]&lt;br /&gt;
&lt;br /&gt;
=== Differential encoding === &lt;br /&gt;
Several uses of CompactSize below are &amp;quot;differentially encoded&amp;quot;. For these, instead of using raw indexes, the number encoded is the difference between the current index and the previous index, minus one. For example, a first index of 0 implies a real index of 0, a second index of 0 thereafter refers to a real index of 1, etc.&lt;br /&gt;
&lt;br /&gt;
=== PrefilledTransaction ===&lt;br /&gt;
&lt;br /&gt;
A PrefilledTransaction structure is used in HeaderAndShortIDs to provide a list of a few transactions explicitly.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| index || [[Protocol#Variable_length_integer|CompactSize]] || 1, 3 bytes || Compact Size, differentially encoded since the last PrefilledTransaction in a list || The index into the block at which this transaction is&lt;br /&gt;
|-&lt;br /&gt;
| tx || Transaction || variable || As encoded in [[Protocol#tx|tx messages]] || The transaction which is in the block at index index.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== HeaderAndShortIDs ===&lt;br /&gt;
&lt;br /&gt;
A HeaderAndShortIDs structure is used to relay a block header, the short transactions IDs used for matching already-available transactions, and a select few transactions which we expect a peer may be missing.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header || Block header || 80 bytes || First 80 bytes of the block as defined by the encoding used by &amp;quot;block&amp;quot; messages	|| The header of the block being provided&lt;br /&gt;
|-&lt;br /&gt;
| nonce	|| uint64_t || 8 bytes || Little Endian || A nonce for use in short transaction ID calculations&lt;br /&gt;
|-&lt;br /&gt;
| shortids_length || [[Protocol#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of short transaction IDs in shortids (ie block tx count - prefilledtxn_length)&lt;br /&gt;
|-&lt;br /&gt;
| shortids || List of 6-byte integers || 6*shortids_length bytes || Little Endian || The [[Protocol#Short_transaction_ID|short transaction IDs]] calculated from the transactions which were not provided explicitly in prefilledtxn&lt;br /&gt;
|-&lt;br /&gt;
| prefilledtxn_length || [[Protocol#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of prefilled transactions in prefilledtxn (ie block tx count - shortids_length)&lt;br /&gt;
|-&lt;br /&gt;
| prefilledtxn || List of PrefilledTransactions || variable size*prefilledtxn_length || As defined by [[Protocol#PrefilledTransaction|PrefilledTransaction]] definition, above || Used to provide the coinbase transaction and a select few which we expect a peer may be missing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== BlockTransactionsRequest ===&lt;br /&gt;
&lt;br /&gt;
A BlockTransactionsRequest structure is used to list transaction indexes in a block being requested.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blockhash || Binary blob || 32 bytes || The output from a double-SHA256 of the block header, as used elsewhere || The blockhash of the block which the transactions being requested are in&lt;br /&gt;
|-&lt;br /&gt;
| indexes_length || [[Protocol#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of transactions being requested&lt;br /&gt;
|-&lt;br /&gt;
| indexes || List of [[Protocol#Variable_length_integer|CompactSizes]] || 1 or 3 bytes*indexes_length || [[Protocol#Differential_encoding|Differentially encoded]] || The indexes of the transactions being requested in the block&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== BlockTransactions ===&lt;br /&gt;
&lt;br /&gt;
A BlockTransactions structure is used to provide some of the transactions in a block, as requested.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blockhash || Binary blob || 32 bytes || The output from a double-SHA256 of the block header, as used elsewhere || The blockhash of the block which the transactions being provided are in&lt;br /&gt;
|-&lt;br /&gt;
| transactions_length || [[Protocol#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of transactions provided&lt;br /&gt;
|-&lt;br /&gt;
| transactions || List of Transactions || variable || As encoded in [[Protocol#tx|tx messages]] || The transactions provided&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Short transaction ID ===&lt;br /&gt;
&lt;br /&gt;
Short transaction IDs are used to represent a transaction without sending a full 256-bit hash. They are calculated by:&lt;br /&gt;
&lt;br /&gt;
# single-SHA256 hashing the block header with the nonce appended (in little-endian)&lt;br /&gt;
# Running SipHash-2-4 with the input being the transaction ID and the keys (k0/k1) set to the first two little-endian 64-bit integers from the above hash, respectively.&lt;br /&gt;
# Dropping the 2 most significant bytes from the SipHash output to make it 6 bytes.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately [[Version Handshake|advertise]] its version. The remote node will respond with its version. No further communication is possible until both peers have exchanged their version.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Identifies protocol version being used by the node&lt;br /&gt;
|-&lt;br /&gt;
| 8 || services || uint64_t || bitfield of features to be enabled for this connection&lt;br /&gt;
|-&lt;br /&gt;
| 8 || timestamp || int64_t || standard UNIX timestamp in seconds&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_recv || [[#Network address|net_addr]] || The network address of the node receiving this message&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;| Fields below require version ≥ 106&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || [[#Network address|net_addr]] || The network address of the node emitting this message&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Node random nonce, randomly generated every time a version packet is sent. This nonce is used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| ? || user_agent || [[#Variable length string|var_str]] || [https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki User Agent] (0x00 if string is 0 bytes long)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || start_height || int32_t || The last block received by the emitting node&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;| Fields below require version ≥ 70001&lt;br /&gt;
|-&lt;br /&gt;
| 1 || relay || bool || Whether the remote peer should announce relayed transactions or not, see [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 0037]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;verack&amp;quot; packet shall be sent if the version packet was accepted.&lt;br /&gt;
&lt;br /&gt;
The following services are currently assigned:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || NODE_NETWORK || This node can be asked for full blocks instead of just headers.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_GETUTXO || See [https://github.com/bitcoin/bips/blob/master/bip-0064.mediawiki BIP 0064]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NODE_BLOOM   || See [https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki BIP 0111]&lt;br /&gt;
|-&lt;br /&gt;
| 1024 || NODE_NETWORK_LIMITED   || See [https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki BIP 0159]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Hexdump example of version message (OBSOLETE EXAMPLE: This example lacks a checksum and user-agent):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 76 65 72 73  69 6F 6E 00 00 00 00 00   ....version.....&lt;br /&gt;
0010   55 00 00 00 9C 7C 00 00  01 00 00 00 00 00 00 00   U....|..........&lt;br /&gt;
0020   E6 15 10 4D 00 00 00 00  01 00 00 00 00 00 00 00   ...M............&lt;br /&gt;
0030   00 00 00 00 00 00 00 00  00 00 FF FF 0A 00 00 01   ................&lt;br /&gt;
0040   20 8D 01 00 00 00 00 00  00 00 00 00 00 00 00 00   ................&lt;br /&gt;
0050   00 00 00 00 FF FF 0A 00  00 02 20 8D DD 9D 20 2C   .......... ... ,&lt;br /&gt;
0060   3A B4 57 13 00 55 81 01  00                        :.W..U...&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                                                                   - Main network magic bytes&lt;br /&gt;
 76 65 72 73 69 6F 6E 00 00 00 00 00                                           - &amp;quot;version&amp;quot; command&lt;br /&gt;
 55 00 00 00                                                                   - Payload is 85 bytes long&lt;br /&gt;
                                                                               - No checksum in version message until 20 February 2012. See https://bitcointalk.org/index.php?topic=55852.0&lt;br /&gt;
Version message:&lt;br /&gt;
 9C 7C 00 00                                                                   - 31900 (version 0.3.19)&lt;br /&gt;
 01 00 00 00 00 00 00 00                                                       - 1 (NODE_NETWORK services)&lt;br /&gt;
 E6 15 10 4D 00 00 00 00                                                       - Mon Dec 20 21:50:14 EST 2010&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 20 8D - Recipient address info - see Network Address&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 02 20 8D - Sender address info - see Network Address&lt;br /&gt;
 DD 9D 20 2C 3A B4 57 13                                                       - Node random unique ID&lt;br /&gt;
 00                                                                            - &amp;quot;&amp;quot; sub-version string (string is 0 bytes long)&lt;br /&gt;
 55 81 01 00                                                                   - Last block sending node has is block #98645&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here's a modern (60002) protocol version client advertising itself to a local peer...&lt;br /&gt;
&lt;br /&gt;
Newer protocol includes the checksum now, this is from a mainline (satoshi) client during &lt;br /&gt;
an outgoing connection to another local client, notice that it does not fill out the &lt;br /&gt;
address information at all when the source or destination is &amp;quot;unroutable&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0000   f9 be b4 d9 76 65 72 73 69 6f 6e 00 00 00 00 00  ....version.....&lt;br /&gt;
0010   64 00 00 00 35 8d 49 32 62 ea 00 00 01 00 00 00  d...5.I2b.......&lt;br /&gt;
0020   00 00 00 00 11 b2 d0 50 00 00 00 00 01 00 00 00  .......P........&lt;br /&gt;
0030   00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff  ................&lt;br /&gt;
0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................&lt;br /&gt;
0050   00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00  ................&lt;br /&gt;
0060   3b 2e b3 5d 8c e6 17 65 0f 2f 53 61 74 6f 73 68  ;..]...e./Satosh&lt;br /&gt;
0070   69 3a 30 2e 37 2e 32 2f c0 3e 03 00              i:0.7.2/.&amp;gt;..&lt;br /&gt;
&lt;br /&gt;
Message Header:&lt;br /&gt;
 F9 BE B4 D9                                                                   - Main network magic bytes&lt;br /&gt;
 76 65 72 73 69 6F 6E 00 00 00 00 00                                           - &amp;quot;version&amp;quot; command&lt;br /&gt;
 64 00 00 00                                                                   - Payload is 100 bytes long&lt;br /&gt;
 35 8d 49 32                                                                   - payload checksum (little endian)&lt;br /&gt;
&lt;br /&gt;
Version message:&lt;br /&gt;
 62 EA 00 00                                                                   - 60002 (protocol version 60002)&lt;br /&gt;
 01 00 00 00 00 00 00 00                                                       - 1 (NODE_NETWORK services)&lt;br /&gt;
 11 B2 D0 50 00 00 00 00                                                       - Tue Dec 18 10:12:33 PST 2012&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 - Recipient address info - see Network Address&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 - Sender address info - see Network Address&lt;br /&gt;
 3B 2E B3 5D 8C E6 17 65                                                       - Node ID&lt;br /&gt;
 0F 2F 53 61 74 6F 73 68 69 3A 30 2E 37 2E 32 2F                               - &amp;quot;/Satoshi:0.7.2/&amp;quot; sub-version string (string is 15 bytes long)&lt;br /&gt;
 C0 3E 03 00                                                                   - Last block sending node has is block #212672&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''[[#version|version]]''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Hexdump of the verack message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 76 65 72 61  63 6B 00 00 00 00 00 00   ....verack......&lt;br /&gt;
0010   00 00 00 00 5D F6 E0 E2                            ........&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                          - Main network magic bytes&lt;br /&gt;
 76 65 72 61  63 6B 00 00 00 00 00 00 - &amp;quot;verack&amp;quot; command&lt;br /&gt;
 00 00 00 00                          - Payload is 0 bytes long&lt;br /&gt;
 5D F6 E0 E2                          - Checksum (little endian)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addr ===&lt;br /&gt;
&lt;br /&gt;
Provide information on known nodes of the network. Non-advertised nodes should be forgotten after typically 3 hours&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 30x? || addr_list || (uint32_t + [[#Network address|net_addr]])[] || Address of other nodes on the network. version &amp;lt; 209 will only read the first one. The uint32_t is a timestamp (see note below).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note''': Starting version 31402, addresses are prefixed with a timestamp. If no timestamp is present, the addresses should not be relayed to other peers, unless it is indeed confirmed they are up.&lt;br /&gt;
&lt;br /&gt;
Hexdump example of ''addr'' message:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 61 64 64 72  00 00 00 00 00 00 00 00   ....addr........&lt;br /&gt;
0010   1F 00 00 00 ED 52 39 9B  01 E2 15 10 4D 01 00 00   .....R9.....M...&lt;br /&gt;
0020   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 FF   ................&lt;br /&gt;
0030   FF 0A 00 00 01 20 8D                               ..... .&lt;br /&gt;
&lt;br /&gt;
Message Header:&lt;br /&gt;
 F9 BE B4 D9                                     - Main network magic bytes&lt;br /&gt;
 61 64 64 72  00 00 00 00 00 00 00 00            - &amp;quot;addr&amp;quot;&lt;br /&gt;
 1F 00 00 00                                     - payload is 31 bytes long&lt;br /&gt;
 ED 52 39 9B                                     - payload checksum (little endian)&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
 01                                              - 1 address in this message&lt;br /&gt;
&lt;br /&gt;
Address:&lt;br /&gt;
 E2 15 10 4D                                     - Mon Dec 20 21:50:10 EST 2010 (only when version is &amp;gt;= 31402)&lt;br /&gt;
 01 00 00 00 00 00 00 00                         - 1 (NODE_NETWORK service - see version message)&lt;br /&gt;
 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 - IPv4: 10.0.0.1, IPv6: ::ffff:10.0.0.1 (IPv4-mapped IPv6 address)&lt;br /&gt;
 20 8D                                           - port 8333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== inv ===&lt;br /&gt;
&lt;br /&gt;
Allows a node to advertise its knowledge of one or more objects. It can be received unsolicited, or in reply to ''getblocks''.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum 50,000 entries, which is just over 1.8 megabytes):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== getdata ===&lt;br /&gt;
&lt;br /&gt;
getdata is used in response to inv, to retrieve the content of a specific object, and is usually sent after receiving an ''inv'' packet, after filtering known elements. It can be used to retrieve transactions, but only if they are in the memory pool or relay set - arbitrary access to transactions in the chain is not allowed to avoid having clients start to depend on nodes having full transaction indexes (which modern nodes do not).&lt;br /&gt;
&lt;br /&gt;
Payload (maximum 50,000 entries, which is just over 1.8 megabytes):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== notfound ===&lt;br /&gt;
&lt;br /&gt;
notfound is a response to a getdata, sent if any requested data items could not be relayed, for example, because the requested transaction was not in the memory pool or relay set.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== getblocks ===&lt;br /&gt;
&lt;br /&gt;
Return an ''inv'' packet containing the list of blocks starting right after the last known hash in the block locator object, up to hash_stop or 500 blocks, whichever comes first. &lt;br /&gt;
&lt;br /&gt;
The locator hashes are processed by a node in the order as they appear in the message. If a block hash is found in the node's main chain, the list of its children is returned back via the ''inv'' message and the remaining locators are ignored, no matter if the requested limit was reached, or not.&lt;br /&gt;
&lt;br /&gt;
To receive the next blocks hashes, one needs to issue getblocks again with a new block locator object. Keep in mind that some clients may provide blocks which are invalid if the block locator object contains a hash on the invalid branch.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || uint32_t || the protocol version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || number of block locator hash entries&lt;br /&gt;
|-&lt;br /&gt;
| 32+ || block locator hashes || char[32] || block locator object; newest back to genesis block (dense to start, but then sparse)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash_stop || char[32] || hash of the last desired block; set to zero to get as many blocks as possible (500)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To create the block locator hashes, keep pushing hashes until you go back to the genesis block. After pushing 10 hashes back, the step backwards doubles every loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// From libbitcoin which is under AGPL&lt;br /&gt;
std::vector&amp;lt;size_t&amp;gt; block_locator_indexes(size_t top_height)&lt;br /&gt;
{&lt;br /&gt;
    std::vector&amp;lt;size_t&amp;gt; indexes;&lt;br /&gt;
&lt;br /&gt;
    // Modify the step in the iteration.&lt;br /&gt;
    int64_t step = 1;&lt;br /&gt;
&lt;br /&gt;
    // Start at the top of the chain and work backwards.&lt;br /&gt;
    for (auto index = (int64_t)top_height; index &amp;gt; 0; index -= step)&lt;br /&gt;
    {&lt;br /&gt;
        // Push top 10 indexes first, then back off exponentially.&lt;br /&gt;
        if (indexes.size() &amp;gt;= 10)&lt;br /&gt;
            step *= 2;&lt;br /&gt;
&lt;br /&gt;
        indexes.push_back((size_t)index);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //  Push the genesis block index.&lt;br /&gt;
    indexes.push_back(0);&lt;br /&gt;
    return indexes;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that it is allowed to send in fewer known hashes down to a minimum of just one hash. However, the purpose of the block locator object is to detect a wrong branch in the caller's main chain. If the peer detects that you are off the main chain, it will send in block hashes which are earlier than your last known block. So if you just send in your last known hash and it is off the main chain, the peer starts over at block #1.&lt;br /&gt;
&lt;br /&gt;
=== getheaders ===&lt;br /&gt;
&lt;br /&gt;
Return a ''headers'' packet containing the headers of blocks starting right after the last known hash in the block locator object, up to hash_stop or 2000 blocks, whichever comes first. To receive the next block headers, one needs to issue getheaders again with a new block locator object. Keep in mind that some clients may provide headers of blocks which are invalid if the block locator object contains a hash on the invalid branch.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || uint32_t || the protocol version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || number of block locator hash entries&lt;br /&gt;
|-&lt;br /&gt;
| 32+ || block locator hashes || char[32] || block locator object; newest back to genesis block (dense to start, but then sparse)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash_stop || char[32] || hash of the last desired block header; set to zero to get as many blocks as possible (2000)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For the block locator object in this packet, the same rules apply as for the [[Protocol#getblocks|getblocks]] packet.&lt;br /&gt;
&lt;br /&gt;
=== tx ===&lt;br /&gt;
&lt;br /&gt;
''tx'' describes a bitcoin transaction, in reply to ''[[#getdata|getdata]]''. When a bloom filter is applied ''tx'' objects are sent automatically for matching transactions following the &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Transaction data format version (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || tx_in count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of Transaction inputs (never zero)&lt;br /&gt;
|-&lt;br /&gt;
| 41+ || tx_in || tx_in[] || A list of 1 or more transaction inputs or sources for coins&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || tx_out count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of Transaction outputs&lt;br /&gt;
|-&lt;br /&gt;
| 9+ || tx_out || tx_out[] || A list of 1 or more transaction outputs or destinations for coins&lt;br /&gt;
|-&lt;br /&gt;
| 4 || lock_time || uint32_t || The block number or timestamp at which this transaction is unlocked:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Not locked&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 500000000  || Block number at which this transaction is unlocked&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;= 500000000 || UNIX timestamp at which this transaction is unlocked&lt;br /&gt;
|}&lt;br /&gt;
If all TxIn inputs have final (0xffffffff) sequence numbers then lock_time is irrelevant. Otherwise, the transaction may not be added to a block until after lock_time (see [[NLockTime]]).&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TxIn consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 36 || previous_output || outpoint || The previous output transaction reference, as an OutPoint structure&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || script length || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || The length of the signature script&lt;br /&gt;
|-&lt;br /&gt;
| ? || signature script || uchar[] || Computational Script for confirming transaction authorization&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [http://bitcoin.stackexchange.com/q/2025/323 sequence] || uint32_t || Transaction version as defined by the sender. Intended for &amp;quot;replacement&amp;quot; of transactions when information is updated before inclusion into a block.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The OutPoint structure consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash || char[32] || The hash of the referenced transaction.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || uint32_t || The index of the specific output in the transaction. The first output is 0, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Script structure consists of a series of pieces of information and operations related to the value of the transaction.&lt;br /&gt;
&lt;br /&gt;
(Structure to be expanded in the future… see script.h and script.cpp and [[Script]] for more information)&lt;br /&gt;
&lt;br /&gt;
The TxOut structure consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || value || int64_t || Transaction Value&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || pk_script length || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Length of the pk_script&lt;br /&gt;
|-&lt;br /&gt;
| ? || pk_script || uchar[] || Contains the ScriptPubKey setting up conditions to claim this output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example ''tx'' message:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
000000	F9 BE B4 D9 74 78 00 00  00 00 00 00 00 00 00 00   ....tx..........&lt;br /&gt;
000010	02 01 00 00 E2 93 CD BE  01 00 00 00 01 6D BD DB   .............m..&lt;br /&gt;
000020	08 5B 1D 8A F7 51 84 F0  BC 01 FA D5 8D 12 66 E9   .[...Q........f.&lt;br /&gt;
000030	B6 3B 50 88 19 90 E4 B4  0D 6A EE 36 29 00 00 00   .;P......j.6)...&lt;br /&gt;
000040	00 8B 48 30 45 02 21 00  F3 58 1E 19 72 AE 8A C7   ..H0E.!..X..r...&lt;br /&gt;
000050	C7 36 7A 7A 25 3B C1 13  52 23 AD B9 A4 68 BB 3A   .6zz%;..R#...h.:&lt;br /&gt;
000060	59 23 3F 45 BC 57 83 80  02 20 59 AF 01 CA 17 D0   Y#?E.W... Y.....&lt;br /&gt;
000070	0E 41 83 7A 1D 58 E9 7A  A3 1B AE 58 4E DE C2 8D   .A.z.X.z...XN...&lt;br /&gt;
000080	35 BD 96 92 36 90 91 3B  AE 9A 01 41 04 9C 02 BF   5...6..;...A....&lt;br /&gt;
000090	C9 7E F2 36 CE 6D 8F E5  D9 40 13 C7 21 E9 15 98   .~.6.m...@..!...&lt;br /&gt;
0000A0	2A CD 2B 12 B6 5D 9B 7D  59 E2 0A 84 20 05 F8 FC   *.+..].}Y... ...&lt;br /&gt;
0000B0	4E 02 53 2E 87 3D 37 B9  6F 09 D6 D4 51 1A DA 8F   N.S..=7.o...Q...&lt;br /&gt;
0000C0	14 04 2F 46 61 4A 4C 70  C0 F1 4B EF F5 FF FF FF   ../FaJLp..K.....&lt;br /&gt;
0000D0	FF 02 40 4B 4C 00 00 00  00 00 19 76 A9 14 1A A0   ..@KL......v....&lt;br /&gt;
0000E0	CD 1C BE A6 E7 45 8A 7A  BA D5 12 A9 D9 EA 1A FB   .....E.z........&lt;br /&gt;
0000F0	22 5E 88 AC 80 FA E9 C7  00 00 00 00 19 76 A9 14   &amp;quot;^...........v..&lt;br /&gt;
000100	0E AB 5B EA 43 6A 04 84  CF AB 12 48 5E FD A0 B7   ..[.Cj.....H^...&lt;br /&gt;
000110	8B 4E CC 52 88 AC 00 00  00 00                     .N.R......&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                                       - main network magic bytes&lt;br /&gt;
 74 78 00 00 00 00 00 00 00 00 00 00               - &amp;quot;tx&amp;quot; command&lt;br /&gt;
 02 01 00 00                                       - payload is 258 bytes long&lt;br /&gt;
 E2 93 CD BE                                       - payload checksum (little endian)&lt;br /&gt;
&lt;br /&gt;
Transaction:&lt;br /&gt;
 01 00 00 00                                       - version&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
 01                                                - number of transaction inputs&lt;br /&gt;
&lt;br /&gt;
Input 1:&lt;br /&gt;
 6D BD DB 08 5B 1D 8A F7  51 84 F0 BC 01 FA D5 8D  - previous output (outpoint)&lt;br /&gt;
 12 66 E9 B6 3B 50 88 19  90 E4 B4 0D 6A EE 36 29&lt;br /&gt;
 00 00 00 00&lt;br /&gt;
&lt;br /&gt;
 8B                                                - script is 139 bytes long&lt;br /&gt;
&lt;br /&gt;
 48 30 45 02 21 00 F3 58  1E 19 72 AE 8A C7 C7 36  - signature script (scriptSig)&lt;br /&gt;
 7A 7A 25 3B C1 13 52 23  AD B9 A4 68 BB 3A 59 23&lt;br /&gt;
 3F 45 BC 57 83 80 02 20  59 AF 01 CA 17 D0 0E 41&lt;br /&gt;
 83 7A 1D 58 E9 7A A3 1B  AE 58 4E DE C2 8D 35 BD&lt;br /&gt;
 96 92 36 90 91 3B AE 9A  01 41 04 9C 02 BF C9 7E&lt;br /&gt;
 F2 36 CE 6D 8F E5 D9 40  13 C7 21 E9 15 98 2A CD&lt;br /&gt;
 2B 12 B6 5D 9B 7D 59 E2  0A 84 20 05 F8 FC 4E 02&lt;br /&gt;
 53 2E 87 3D 37 B9 6F 09  D6 D4 51 1A DA 8F 14 04&lt;br /&gt;
 2F 46 61 4A 4C 70 C0 F1  4B EF F5&lt;br /&gt;
&lt;br /&gt;
 FF FF FF FF                                       - sequence&lt;br /&gt;
&lt;br /&gt;
Outputs:&lt;br /&gt;
 02                                                - 2 Output Transactions&lt;br /&gt;
&lt;br /&gt;
Output 1:&lt;br /&gt;
 40 4B 4C 00 00 00 00 00                           - 0.05 BTC (5000000)&lt;br /&gt;
 19                                                - pk_script is 25 bytes long&lt;br /&gt;
&lt;br /&gt;
 76 A9 14 1A A0 CD 1C BE  A6 E7 45 8A 7A BA D5 12  - pk_script&lt;br /&gt;
 A9 D9 EA 1A FB 22 5E 88  AC&lt;br /&gt;
&lt;br /&gt;
Output 2:&lt;br /&gt;
 80 FA E9 C7 00 00 00 00                           - 33.54 BTC (3354000000)&lt;br /&gt;
 19                                                - pk_script is 25 bytes long&lt;br /&gt;
&lt;br /&gt;
 76 A9 14 0E AB 5B EA 43  6A 04 84 CF AB 12 48 5E  - pk_script&lt;br /&gt;
 FD A0 B7 8B 4E CC 52 88  AC&lt;br /&gt;
&lt;br /&gt;
Locktime:&lt;br /&gt;
 00 00 00 00                                       - lock time&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== block ===&lt;br /&gt;
&lt;br /&gt;
The '''block''' message is sent in response to a getdata message which requests transaction information from a block hash.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A Unix timestamp recording when this block was created (Currently limited to dates before the year 2106!)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated [[Difficulty|difficulty target]] being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || txn_count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of transaction entries&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || tx[] || Block transactions, in format of &amp;quot;tx&amp;quot; command&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The SHA256 hash that identifies each block (and which must have a run of 0 bits) is calculated from the first 6 fields of this structure (version, prev_block, merkle_root, timestamp, bits, nonce, and standard SHA256 padding, making two 64-byte chunks in all) and ''not'' from the complete block. To calculate the hash, only two chunks need to be processed by the SHA256 algorithm. Since the ''nonce'' field is in the second chunk, the first chunk stays constant during mining and therefore only the second chunk needs to be processed. However, a Bitcoin hash is the hash of the hash, so two SHA256 rounds are needed for each mining iteration.&lt;br /&gt;
See [[Block hashing algorithm]] for details and an example.&lt;br /&gt;
&lt;br /&gt;
=== headers ===&lt;br /&gt;
&lt;br /&gt;
The ''headers'' packet returns block headers in response to a ''getheaders'' packet. &lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of block headers&lt;br /&gt;
|-&lt;br /&gt;
| 81x? || headers || [[Protocol#Block_Headers|block_header]][] || [[Protocol#Block_Headers|Block headers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the block headers in this packet include a transaction count (a var_int, so there can be more than 81 bytes per header) as opposed to the block headers that are hashed by miners.&lt;br /&gt;
&lt;br /&gt;
=== getaddr ===&lt;br /&gt;
&lt;br /&gt;
The getaddr message sends a request to a node asking for information about known active peers to help with finding potential nodes in the network. The response to receiving this message is to transmit one or more addr messages with one or more peers from a database of known active peers. The typical presumption is that a node is likely to be active if it has been sending a message within the last three hours.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
=== mempool ===&lt;br /&gt;
&lt;br /&gt;
The mempool message sends a request to a node asking for information about transactions it has verified but which have not yet confirmed. The response to receiving this message is an inv message containing the transaction hashes for all the transactions in the node's mempool.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
It is specified in [https://github.com/bitcoin/bips/blob/master/bip-0035.mediawiki BIP 35]. Since [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 37], if a [[Protocol#filterload.2C_filteradd.2C_filterclear.2C_merkleblock|bloom filter]] is loaded, only transactions matching the filter are replied.&lt;br /&gt;
&lt;br /&gt;
=== checkorder ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== submitorder ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== reply ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== ping ===&lt;br /&gt;
&lt;br /&gt;
The ''ping'' message is sent primarily to confirm that the TCP/IP connection is still valid. An error in transmission is presumed to be a closed connection and the address is removed as a current peer.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || random nonce&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pong ===&lt;br /&gt;
&lt;br /&gt;
The ''pong'' message is sent in response to a ''ping'' message. In modern protocol versions, a ''pong'' response is generated using a nonce included in the ping.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || nonce from ping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== reject===&lt;br /&gt;
&lt;br /&gt;
The ''reject'' message is sent when messages are rejected.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || message || var_str || type of message rejected&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ccode || char || code relating to rejected message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || reason || var_str || text version of reason for rejection&lt;br /&gt;
|-&lt;br /&gt;
| 0+ || data || char || Optional extra data provided by some errors.  Currently, all errors which provide this field fill it with the TXID or block header hash of the object being rejected, so the field is 32 bytes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
CCodes&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || REJECT_MALFORMED|| &lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || REJECT_INVALID ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || REJECT_OBSOLETE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || REJECT_DUPLICATE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || REJECT_NONSTANDARD ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || REJECT_DUST ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || REJECT_INSUFFICIENTFEE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || REJECT_CHECKPOINT ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== filterload, filteradd, filterclear, merkleblock ===&lt;br /&gt;
&lt;br /&gt;
These messages are related to Bloom filtering of connections and are defined in [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 0037].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt; command is defined as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || filter || uint8_t[] || The filter itself is simply a bit field of arbitrary byte-aligned size. The maximum size is 36,000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nHashFuncs || uint32_t || The number of hash functions to use in this filter. The maximum value allowed in this field is 50.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nTweak || uint32_t || A random value to add to the seed value in the hash function used by the bloom filter.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || nFlags || uint8_t || A set of flags that control how matched items are added to the filter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See below for a description of the Bloom filter algorithm and how to select nHashFuncs and filter size for a desired false positive rate.&lt;br /&gt;
&lt;br /&gt;
Upon receiving a &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt; command, the remote peer will immediately restrict the broadcast transactions it announces (in inv packets) to transactions matching the filter, where the matching algorithm is specified below. The flags control the update behaviour of the matching algorithm.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filteradd&amp;lt;/code&amp;gt; command is defined as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || data || uint8_t[] || The data element to add to the current filter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data field must be smaller than or equal to 520 bytes in size (the maximum size of any potentially matched object).&lt;br /&gt;
&lt;br /&gt;
The given data element will be added to the Bloom filter. A filter must have been previously provided using &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt;. This command is useful if a new key or script is added to a clients wallet whilst it has connections to the network open, it avoids the need to re-calculate and send an entirely new filter to every peer (though doing so is usually advisable to maintain anonymity).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filterclear&amp;lt;/code&amp;gt; command has no arguments at all.&lt;br /&gt;
&lt;br /&gt;
After a filter has been set, nodes don't merely stop announcing non-matching transactions, they can also serve filtered blocks. A filtered block is defined by the &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt; message and is defined like this:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information, based upon the software version creating this block (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A timestamp recording when this block was created (Limited to 2106!)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated difficulty target being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 4 || total_transactions || uint32_t || Number of transactions in the block (including unmatched ones)&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash_count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || The number of hashes to follow&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || hashes || char[32] || Hashes in depth-first order&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || flag_bytes || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || The size of flags (in bytes) to follow&lt;br /&gt;
|-&lt;br /&gt;
| ? || flags || byte[] || Flag bits, packed per 8 in a byte, least significant bit first. Extra 0 bits are padded on to reach full byte size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After a &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt;, transactions matching the bloom filter are automatically sent in ''[[#tx|tx]]'' messages.&lt;br /&gt;
&lt;br /&gt;
A guide to creating a bloom filter, loading a merkle block, and parsing a partial merkle block tree can be found in the [https://bitcoin.org/en/developer-examples#creating-a-bloom-filter Developer Examples].&lt;br /&gt;
&lt;br /&gt;
=== sendheaders ===&lt;br /&gt;
&lt;br /&gt;
Request for Direct headers announcement. &lt;br /&gt;
&lt;br /&gt;
Upon receipt of this message, the node is be permitted, but not required, to announce new blocks by '''headers''' command (instead of '''inv''' command).&lt;br /&gt;
&lt;br /&gt;
This message is supported by the protocol version &amp;gt;= 70012 or Bitcoin Core version &amp;gt;= 0.12.0.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki BIP 130] for more information.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== feefilter ===&lt;br /&gt;
&lt;br /&gt;
The payload is always 8 bytes long and it encodes 64 bit integer value (LSB / little endian) of '''feerate'''.&lt;br /&gt;
The value represents a minimal fee and is expressed in satoshis per 1000 bytes.&lt;br /&gt;
&lt;br /&gt;
Upon receipt of a &amp;quot;feefilter&amp;quot; message, the node will be permitted, but not required, to filter transaction invs for transactions that fall below the feerate provided in the feefilter message interpreted as satoshis per kilobyte.&lt;br /&gt;
&lt;br /&gt;
The fee filter is additive with a bloom filter for transactions so if an SPV client were to load a bloom filter and send a feefilter message, transactions would only be relayed if they passed both filters.&lt;br /&gt;
&lt;br /&gt;
Inv's generated from a mempool message are also subject to a fee filter if it exists.&lt;br /&gt;
&lt;br /&gt;
Feature discovery is enabled by checking protocol version &amp;gt;= 70013&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki BIP 133] for more information.&lt;br /&gt;
&lt;br /&gt;
=== sendcmpct ===&lt;br /&gt;
&lt;br /&gt;
# The sendcmpct message is defined as a message containing a 1-byte integer followed by a 8-byte integer where pchCommand == &amp;quot;sendcmpct&amp;quot;.&lt;br /&gt;
# The first integer SHALL be interpreted as a boolean (and MUST have a value of either 1 or 0)&lt;br /&gt;
# The second integer SHALL be interpreted as a little-endian version number. Nodes sending a sendcmpct message MUST currently set this value to 1.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the first and second integers set to 1, the node SHOULD announce new blocks by sending a cmpctblock message.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the first integer set to 0, the node SHOULD NOT announce new blocks by sending a cmpctblock message, but SHOULD announce new blocks by sending invs or headers, as defined by BIP130.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the second integer set to something other than 1, nodes MUST treat the peer as if they had not received the message (as it indicates the peer will provide an unexpected encoding in &lt;br /&gt;
# cmpctblock, and/or other, messages). This allows future versions to send duplicate sendcmpct messages with different versions as a part of a version handshake for future versions.&lt;br /&gt;
# Nodes SHOULD check for a protocol version of &amp;gt;= 70014 before sending sendcmpct messages.&lt;br /&gt;
# Nodes MUST NOT send a request for a MSG_CMPCT_BLOCK object to a peer before having received a sendcmpct message from that peer.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== cmpctblock ===&lt;br /&gt;
&lt;br /&gt;
# The cmpctblock message is defined as as a message containing a serialized [[Protocol#HeaderAndShortIDs|HeaderAndShortIDs]] message and pchCommand == &amp;quot;cmpctblock&amp;quot;.&lt;br /&gt;
# Upon receipt of a cmpctblock message after sending a sendcmpct message, nodes SHOULD calculate the [[Protocol#Short_transaction_ID|short transaction ID]] for each unconfirmed transaction they have available (ie in their mempool) and compare each to each short transaction ID in the cmpctblock message.&lt;br /&gt;
# After finding already-available transactions, nodes which do not have all transactions available to reconstruct the full block SHOULD request the missing transactions using a getblocktxn message.&lt;br /&gt;
# A node MUST NOT send a cmpctblock message unless they are able to respond to a getblocktxn message which requests every transaction in the block.&lt;br /&gt;
# A node MUST NOT send a cmpctblock message without having validated that the header properly commits to each transaction in the block, and properly builds on top of the existing chain with a valid proof-of-work. A node MAY send a cmpctblock before validating that each transaction in the block validly spends existing UTXO set entries.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== getblocktxn ===&lt;br /&gt;
&lt;br /&gt;
# The getblocktxn message is defined as as a message containing a serialized [[Protocol#BlockTransactionsRequest|BlockTransactionsRequest]] message and pchCommand == &amp;quot;getblocktxn&amp;quot;.&lt;br /&gt;
# Upon receipt of a properly-formatted getblocktxnmessage, nodes which recently provided the sender of such a message a cmpctblock for the block hash identified in this message MUST respond with an appropriate [[Protocol#blocktxn|blocktxn]] message. Such a blocktxn message MUST contain exactly and only each transaction which is present in the appropriate block at the index specified in the getblocktxn indexes list, in the order requested.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== blocktxn ===&lt;br /&gt;
&lt;br /&gt;
# The blocktxn message is defined as as a message containing a serialized [[Protocol#BlockTransactions|BlockTransactions]] message and pchCommand == &amp;quot;blocktxn&amp;quot;.&lt;br /&gt;
# Upon receipt of a properly-formatted requested blocktxn message, nodes SHOULD attempt to reconstruct the full block by:&lt;br /&gt;
# Taking the prefilledtxn transactions from the original [[Protocol#cmpctblock|cmpctblock]] and placing them in the marked positions.&lt;br /&gt;
# For each short transaction ID from the original [[Protocol#cmpctblock|cmpctblock]], in order, find the corresponding transaction either from the blocktxn message or from other sources and place it in the first available position in the block.&lt;br /&gt;
# Once the block has been reconstructed, it shall be processed as normal, keeping in mind that short transaction IDs are expected to occasionally collide, and that nodes MUST NOT be penalized for such collisions, wherever they appear.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
See [[Advanced Bitcoin Scripting]].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Network]]&lt;br /&gt;
&lt;br /&gt;
==Attribution==&lt;br /&gt;
This content is based on content sourced from https://en.bitcoin.it/wiki/Protocol_documentation under [https://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0]. Although it may have been extensively revised and updated we acknowledge the original authors.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Peer-To-Peer_Protocol&amp;diff=3094</id>
		<title>Peer-To-Peer Protocol</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Peer-To-Peer_Protocol&amp;diff=3094"/>
		<updated>2023-01-09T16:38:27Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the Bitcoin Network Protocol used by nodes running the BitcoinSV node client to communicate transaction and block information on the BitcoinSV network. This is a current standard means for nodes to communicate information about  the ledger between each other including valid transactions, block discovery messages and more.&lt;br /&gt;
&lt;br /&gt;
For protocol used in mining, see [[Getminingcandidate]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Message structure ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || magic || uint32_t || Magic value indicating message origin network, and used to seek to next message when stream state is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 12 || command || char[12] || ASCII string identifying the packet content, NULL padded (non-NULL padding results in packet rejected)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || length || uint32_t || Length of payload in number of bytes&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha256(sha256(payload))&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || uchar[] || The actual data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known magic values:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Network !! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| mainnet || 0xE8F3E1E3 || E3 E1 F3 E8&lt;br /&gt;
|-&lt;br /&gt;
| testnet 3 || 0xF4F3E5F4 || F4 E5 F3 F4&lt;br /&gt;
|-&lt;br /&gt;
| scaling testnet|| 0xF9C4CEFB || FB CE C4 F9&lt;br /&gt;
|-&lt;br /&gt;
| regtest || 0xFABFB5DA || DA B5 BF FA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Variable length integer ===&lt;br /&gt;
&lt;br /&gt;
Integer can be encoded depending on the represented value to save space.&lt;br /&gt;
Variable length integers always precede an array/vector of a type of data that may vary in length.&lt;br /&gt;
Longer numbers are encoded in little endian.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Storage length !! Format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 0xFD || 1 || uint8_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xFFFF || 3 || 0xFD followed by the length as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xFFFF FFFF || 5 || 0xFE followed by the length as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xFF followed by the length as uint64_t&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you're reading the Satoshi client code (BitcoinQT) it refers to this encoding as a &amp;quot;CompactSize&amp;quot;. Modern BitcoinQT also has the CVarInt class which implements an even more compact integer for the purpose of local storage (which is incompatible with &amp;quot;CompactSize&amp;quot; described here). CVarInt is not a part of the protocol.&lt;br /&gt;
&lt;br /&gt;
=== Variable length string ===&lt;br /&gt;
&lt;br /&gt;
Variable length string can be stored using a variable length integer followed by the string itself.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || length || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Length of the string&lt;br /&gt;
|-&lt;br /&gt;
| ? || string || char[] || The string itself (can be empty)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Network address ===&lt;br /&gt;
&lt;br /&gt;
When a network address is needed somewhere, this structure is used. Network addresses are not prefixed with a timestamp in the version message.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || time || uint32 || the Time (version &amp;gt;= 31402). '''Not present in version message.'''&lt;br /&gt;
|-&lt;br /&gt;
| 8 || services || uint64_t || same service(s) listed in [[#version|version]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || IPv6/4 || char[16] || IPv6 address. Network byte order. The original client only supported IPv4 and only read the last 4 bytes to get the IPv4 address. However, the IPv4 address is written into the message as a 16 byte [http://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses IPv4-mapped IPv6 address]&lt;br /&gt;
(12 bytes ''00 00 00 00  00 00 00 00  00 00 FF FF'', followed by the 4 bytes of the IPv4 address).&lt;br /&gt;
|-&lt;br /&gt;
| 2 || port || uint16_t || port number, network byte order&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Hexdump example of Network address structure&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................&lt;br /&gt;
0010   00 00 FF FF 0A 00 00 01  20 8D                    ........ .&lt;br /&gt;
&lt;br /&gt;
Network address:&lt;br /&gt;
 01 00 00 00 00 00 00 00                         - 1 (NODE_NETWORK: see services listed under version command)&lt;br /&gt;
 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 - IPv6: ::ffff:a00:1 or IPv4: 10.0.0.1&lt;br /&gt;
 20 8D                                           - Port 8333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Inventory Vectors ===&lt;br /&gt;
&lt;br /&gt;
Inventory vectors are used for notifying other nodes about objects they have or data which is being requested.&lt;br /&gt;
&lt;br /&gt;
Inventory vectors consist of the following data format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || type || uint32_t || Identifies the object type linked to this inventory&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The object type is currently defined as one of the following possibilities:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ERROR || Any data of with this number may be ignored&lt;br /&gt;
|-&lt;br /&gt;
| 1 || MSG_TX || Hash is related to a transaction&lt;br /&gt;
|-&lt;br /&gt;
| 2 || MSG_BLOCK || Hash is related to a data block&lt;br /&gt;
|-&lt;br /&gt;
| 3 || MSG_FILTERED_BLOCK || Hash of a block header; identical to MSG_BLOCK.  Only to be used in getdata message. Indicates the reply should be a merkleblock message rather than a block message; this only works if a bloom filter has been set.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || MSG_CMPCT_BLOCK || Hash of a block header; identical to MSG_BLOCK.  Only to be used in getdata message. Indicates the reply should be a cmpctblock message. See BIP 152 for more info.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other Data Type values are considered reserved for future implementations.&lt;br /&gt;
&lt;br /&gt;
=== Block Headers ===&lt;br /&gt;
&lt;br /&gt;
Block headers are sent in a headers packet in response to a getheaders message.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A timestamp recording when this block was created (Will overflow in 2106&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Unix_time#Notable_events_in_Unix_time&amp;lt;/ref&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated difficulty target being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || txn_count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of transaction entries, this value is always 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
cf. [[Block hashing algorithm]]&lt;br /&gt;
&lt;br /&gt;
=== Differential encoding === &lt;br /&gt;
Several uses of CompactSize below are &amp;quot;differentially encoded&amp;quot;. For these, instead of using raw indexes, the number encoded is the difference between the current index and the previous index, minus one. For example, a first index of 0 implies a real index of 0, a second index of 0 thereafter refers to a real index of 1, etc.&lt;br /&gt;
&lt;br /&gt;
=== PrefilledTransaction ===&lt;br /&gt;
&lt;br /&gt;
A PrefilledTransaction structure is used in HeaderAndShortIDs to provide a list of a few transactions explicitly.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| index || [[Protocol#Variable_length_integer|CompactSize]] || 1, 3 bytes || Compact Size, differentially encoded since the last PrefilledTransaction in a list || The index into the block at which this transaction is&lt;br /&gt;
|-&lt;br /&gt;
| tx || Transaction || variable || As encoded in [[Protocol#tx|tx messages]] || The transaction which is in the block at index index.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== HeaderAndShortIDs ===&lt;br /&gt;
&lt;br /&gt;
A HeaderAndShortIDs structure is used to relay a block header, the short transactions IDs used for matching already-available transactions, and a select few transactions which we expect a peer may be missing.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header || Block header || 80 bytes || First 80 bytes of the block as defined by the encoding used by &amp;quot;block&amp;quot; messages	|| The header of the block being provided&lt;br /&gt;
|-&lt;br /&gt;
| nonce	|| uint64_t || 8 bytes || Little Endian || A nonce for use in short transaction ID calculations&lt;br /&gt;
|-&lt;br /&gt;
| shortids_length || [[Protocol#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of short transaction IDs in shortids (ie block tx count - prefilledtxn_length)&lt;br /&gt;
|-&lt;br /&gt;
| shortids || List of 6-byte integers || 6*shortids_length bytes || Little Endian || The [[Protocol#Short_transaction_ID|short transaction IDs]] calculated from the transactions which were not provided explicitly in prefilledtxn&lt;br /&gt;
|-&lt;br /&gt;
| prefilledtxn_length || [[Protocol#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of prefilled transactions in prefilledtxn (ie block tx count - shortids_length)&lt;br /&gt;
|-&lt;br /&gt;
| prefilledtxn || List of PrefilledTransactions || variable size*prefilledtxn_length || As defined by [[Protocol#PrefilledTransaction|PrefilledTransaction]] definition, above || Used to provide the coinbase transaction and a select few which we expect a peer may be missing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== BlockTransactionsRequest ===&lt;br /&gt;
&lt;br /&gt;
A BlockTransactionsRequest structure is used to list transaction indexes in a block being requested.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blockhash || Binary blob || 32 bytes || The output from a double-SHA256 of the block header, as used elsewhere || The blockhash of the block which the transactions being requested are in&lt;br /&gt;
|-&lt;br /&gt;
| indexes_length || [[Protocol#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of transactions being requested&lt;br /&gt;
|-&lt;br /&gt;
| indexes || List of [[Protocol#Variable_length_integer|CompactSizes]] || 1 or 3 bytes*indexes_length || [[Protocol#Differential_encoding|Differentially encoded]] || The indexes of the transactions being requested in the block&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== BlockTransactions ===&lt;br /&gt;
&lt;br /&gt;
A BlockTransactions structure is used to provide some of the transactions in a block, as requested.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blockhash || Binary blob || 32 bytes || The output from a double-SHA256 of the block header, as used elsewhere || The blockhash of the block which the transactions being provided are in&lt;br /&gt;
|-&lt;br /&gt;
| transactions_length || [[Protocol#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of transactions provided&lt;br /&gt;
|-&lt;br /&gt;
| transactions || List of Transactions || variable || As encoded in [[Protocol#tx|tx messages]] || The transactions provided&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Short transaction ID ===&lt;br /&gt;
&lt;br /&gt;
Short transaction IDs are used to represent a transaction without sending a full 256-bit hash. They are calculated by:&lt;br /&gt;
&lt;br /&gt;
# single-SHA256 hashing the block header with the nonce appended (in little-endian)&lt;br /&gt;
# Running SipHash-2-4 with the input being the transaction ID and the keys (k0/k1) set to the first two little-endian 64-bit integers from the above hash, respectively.&lt;br /&gt;
# Dropping the 2 most significant bytes from the SipHash output to make it 6 bytes.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately [[Version Handshake|advertise]] its version. The remote node will respond with its version. No further communication is possible until both peers have exchanged their version.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Identifies protocol version being used by the node&lt;br /&gt;
|-&lt;br /&gt;
| 8 || services || uint64_t || bitfield of features to be enabled for this connection&lt;br /&gt;
|-&lt;br /&gt;
| 8 || timestamp || int64_t || standard UNIX timestamp in seconds&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_recv || [[#Network address|net_addr]] || The network address of the node receiving this message&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;| Fields below require version ≥ 106&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || [[#Network address|net_addr]] || The network address of the node emitting this message&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Node random nonce, randomly generated every time a version packet is sent. This nonce is used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| ? || user_agent || [[#Variable length string|var_str]] || [https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki User Agent] (0x00 if string is 0 bytes long)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || start_height || int32_t || The last block received by the emitting node&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;| Fields below require version ≥ 70001&lt;br /&gt;
|-&lt;br /&gt;
| 1 || relay || bool || Whether the remote peer should announce relayed transactions or not, see [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 0037]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;verack&amp;quot; packet shall be sent if the version packet was accepted.&lt;br /&gt;
&lt;br /&gt;
The following services are currently assigned:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || NODE_NETWORK || This node can be asked for full blocks instead of just headers.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_GETUTXO || See [https://github.com/bitcoin/bips/blob/master/bip-0064.mediawiki BIP 0064]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NODE_BLOOM   || See [https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki BIP 0111]&lt;br /&gt;
|-&lt;br /&gt;
| 1024 || NODE_NETWORK_LIMITED   || See [https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki BIP 0159]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Hexdump example of version message (OBSOLETE EXAMPLE: This example lacks a checksum and user-agent):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 76 65 72 73  69 6F 6E 00 00 00 00 00   ....version.....&lt;br /&gt;
0010   55 00 00 00 9C 7C 00 00  01 00 00 00 00 00 00 00   U....|..........&lt;br /&gt;
0020   E6 15 10 4D 00 00 00 00  01 00 00 00 00 00 00 00   ...M............&lt;br /&gt;
0030   00 00 00 00 00 00 00 00  00 00 FF FF 0A 00 00 01   ................&lt;br /&gt;
0040   20 8D 01 00 00 00 00 00  00 00 00 00 00 00 00 00   ................&lt;br /&gt;
0050   00 00 00 00 FF FF 0A 00  00 02 20 8D DD 9D 20 2C   .......... ... ,&lt;br /&gt;
0060   3A B4 57 13 00 55 81 01  00                        :.W..U...&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                                                                   - Main network magic bytes&lt;br /&gt;
 76 65 72 73 69 6F 6E 00 00 00 00 00                                           - &amp;quot;version&amp;quot; command&lt;br /&gt;
 55 00 00 00                                                                   - Payload is 85 bytes long&lt;br /&gt;
                                                                               - No checksum in version message until 20 February 2012. See https://bitcointalk.org/index.php?topic=55852.0&lt;br /&gt;
Version message:&lt;br /&gt;
 9C 7C 00 00                                                                   - 31900 (version 0.3.19)&lt;br /&gt;
 01 00 00 00 00 00 00 00                                                       - 1 (NODE_NETWORK services)&lt;br /&gt;
 E6 15 10 4D 00 00 00 00                                                       - Mon Dec 20 21:50:14 EST 2010&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 20 8D - Recipient address info - see Network Address&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 02 20 8D - Sender address info - see Network Address&lt;br /&gt;
 DD 9D 20 2C 3A B4 57 13                                                       - Node random unique ID&lt;br /&gt;
 00                                                                            - &amp;quot;&amp;quot; sub-version string (string is 0 bytes long)&lt;br /&gt;
 55 81 01 00                                                                   - Last block sending node has is block #98645&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here's a modern (60002) protocol version client advertising itself to a local peer...&lt;br /&gt;
&lt;br /&gt;
Newer protocol includes the checksum now, this is from a mainline (satoshi) client during &lt;br /&gt;
an outgoing connection to another local client, notice that it does not fill out the &lt;br /&gt;
address information at all when the source or destination is &amp;quot;unroutable&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0000   f9 be b4 d9 76 65 72 73 69 6f 6e 00 00 00 00 00  ....version.....&lt;br /&gt;
0010   64 00 00 00 35 8d 49 32 62 ea 00 00 01 00 00 00  d...5.I2b.......&lt;br /&gt;
0020   00 00 00 00 11 b2 d0 50 00 00 00 00 01 00 00 00  .......P........&lt;br /&gt;
0030   00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff  ................&lt;br /&gt;
0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................&lt;br /&gt;
0050   00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00  ................&lt;br /&gt;
0060   3b 2e b3 5d 8c e6 17 65 0f 2f 53 61 74 6f 73 68  ;..]...e./Satosh&lt;br /&gt;
0070   69 3a 30 2e 37 2e 32 2f c0 3e 03 00              i:0.7.2/.&amp;gt;..&lt;br /&gt;
&lt;br /&gt;
Message Header:&lt;br /&gt;
 F9 BE B4 D9                                                                   - Main network magic bytes&lt;br /&gt;
 76 65 72 73 69 6F 6E 00 00 00 00 00                                           - &amp;quot;version&amp;quot; command&lt;br /&gt;
 64 00 00 00                                                                   - Payload is 100 bytes long&lt;br /&gt;
 35 8d 49 32                                                                   - payload checksum (little endian)&lt;br /&gt;
&lt;br /&gt;
Version message:&lt;br /&gt;
 62 EA 00 00                                                                   - 60002 (protocol version 60002)&lt;br /&gt;
 01 00 00 00 00 00 00 00                                                       - 1 (NODE_NETWORK services)&lt;br /&gt;
 11 B2 D0 50 00 00 00 00                                                       - Tue Dec 18 10:12:33 PST 2012&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 - Recipient address info - see Network Address&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 - Sender address info - see Network Address&lt;br /&gt;
 3B 2E B3 5D 8C E6 17 65                                                       - Node ID&lt;br /&gt;
 0F 2F 53 61 74 6F 73 68 69 3A 30 2E 37 2E 32 2F                               - &amp;quot;/Satoshi:0.7.2/&amp;quot; sub-version string (string is 15 bytes long)&lt;br /&gt;
 C0 3E 03 00                                                                   - Last block sending node has is block #212672&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''[[#version|version]]''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Hexdump of the verack message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 76 65 72 61  63 6B 00 00 00 00 00 00   ....verack......&lt;br /&gt;
0010   00 00 00 00 5D F6 E0 E2                            ........&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                          - Main network magic bytes&lt;br /&gt;
 76 65 72 61  63 6B 00 00 00 00 00 00 - &amp;quot;verack&amp;quot; command&lt;br /&gt;
 00 00 00 00                          - Payload is 0 bytes long&lt;br /&gt;
 5D F6 E0 E2                          - Checksum (little endian)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addr ===&lt;br /&gt;
&lt;br /&gt;
Provide information on known nodes of the network. Non-advertised nodes should be forgotten after typically 3 hours&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 30x? || addr_list || (uint32_t + [[#Network address|net_addr]])[] || Address of other nodes on the network. version &amp;lt; 209 will only read the first one. The uint32_t is a timestamp (see note below).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note''': Starting version 31402, addresses are prefixed with a timestamp. If no timestamp is present, the addresses should not be relayed to other peers, unless it is indeed confirmed they are up.&lt;br /&gt;
&lt;br /&gt;
Hexdump example of ''addr'' message:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 61 64 64 72  00 00 00 00 00 00 00 00   ....addr........&lt;br /&gt;
0010   1F 00 00 00 ED 52 39 9B  01 E2 15 10 4D 01 00 00   .....R9.....M...&lt;br /&gt;
0020   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 FF   ................&lt;br /&gt;
0030   FF 0A 00 00 01 20 8D                               ..... .&lt;br /&gt;
&lt;br /&gt;
Message Header:&lt;br /&gt;
 F9 BE B4 D9                                     - Main network magic bytes&lt;br /&gt;
 61 64 64 72  00 00 00 00 00 00 00 00            - &amp;quot;addr&amp;quot;&lt;br /&gt;
 1F 00 00 00                                     - payload is 31 bytes long&lt;br /&gt;
 ED 52 39 9B                                     - payload checksum (little endian)&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
 01                                              - 1 address in this message&lt;br /&gt;
&lt;br /&gt;
Address:&lt;br /&gt;
 E2 15 10 4D                                     - Mon Dec 20 21:50:10 EST 2010 (only when version is &amp;gt;= 31402)&lt;br /&gt;
 01 00 00 00 00 00 00 00                         - 1 (NODE_NETWORK service - see version message)&lt;br /&gt;
 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 - IPv4: 10.0.0.1, IPv6: ::ffff:10.0.0.1 (IPv4-mapped IPv6 address)&lt;br /&gt;
 20 8D                                           - port 8333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== inv ===&lt;br /&gt;
&lt;br /&gt;
Allows a node to advertise its knowledge of one or more objects. It can be received unsolicited, or in reply to ''getblocks''.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum 50,000 entries, which is just over 1.8 megabytes):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== getdata ===&lt;br /&gt;
&lt;br /&gt;
getdata is used in response to inv, to retrieve the content of a specific object, and is usually sent after receiving an ''inv'' packet, after filtering known elements. It can be used to retrieve transactions, but only if they are in the memory pool or relay set - arbitrary access to transactions in the chain is not allowed to avoid having clients start to depend on nodes having full transaction indexes (which modern nodes do not).&lt;br /&gt;
&lt;br /&gt;
Payload (maximum 50,000 entries, which is just over 1.8 megabytes):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== notfound ===&lt;br /&gt;
&lt;br /&gt;
notfound is a response to a getdata, sent if any requested data items could not be relayed, for example, because the requested transaction was not in the memory pool or relay set.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== getblocks ===&lt;br /&gt;
&lt;br /&gt;
Return an ''inv'' packet containing the list of blocks starting right after the last known hash in the block locator object, up to hash_stop or 500 blocks, whichever comes first. &lt;br /&gt;
&lt;br /&gt;
The locator hashes are processed by a node in the order as they appear in the message. If a block hash is found in the node's main chain, the list of its children is returned back via the ''inv'' message and the remaining locators are ignored, no matter if the requested limit was reached, or not.&lt;br /&gt;
&lt;br /&gt;
To receive the next blocks hashes, one needs to issue getblocks again with a new block locator object. Keep in mind that some clients may provide blocks which are invalid if the block locator object contains a hash on the invalid branch.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || uint32_t || the protocol version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || number of block locator hash entries&lt;br /&gt;
|-&lt;br /&gt;
| 32+ || block locator hashes || char[32] || block locator object; newest back to genesis block (dense to start, but then sparse)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash_stop || char[32] || hash of the last desired block; set to zero to get as many blocks as possible (500)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To create the block locator hashes, keep pushing hashes until you go back to the genesis block. After pushing 10 hashes back, the step backwards doubles every loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// From libbitcoin which is under AGPL&lt;br /&gt;
std::vector&amp;lt;size_t&amp;gt; block_locator_indexes(size_t top_height)&lt;br /&gt;
{&lt;br /&gt;
    std::vector&amp;lt;size_t&amp;gt; indexes;&lt;br /&gt;
&lt;br /&gt;
    // Modify the step in the iteration.&lt;br /&gt;
    int64_t step = 1;&lt;br /&gt;
&lt;br /&gt;
    // Start at the top of the chain and work backwards.&lt;br /&gt;
    for (auto index = (int64_t)top_height; index &amp;gt; 0; index -= step)&lt;br /&gt;
    {&lt;br /&gt;
        // Push top 10 indexes first, then back off exponentially.&lt;br /&gt;
        if (indexes.size() &amp;gt;= 10)&lt;br /&gt;
            step *= 2;&lt;br /&gt;
&lt;br /&gt;
        indexes.push_back((size_t)index);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //  Push the genesis block index.&lt;br /&gt;
    indexes.push_back(0);&lt;br /&gt;
    return indexes;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that it is allowed to send in fewer known hashes down to a minimum of just one hash. However, the purpose of the block locator object is to detect a wrong branch in the caller's main chain. If the peer detects that you are off the main chain, it will send in block hashes which are earlier than your last known block. So if you just send in your last known hash and it is off the main chain, the peer starts over at block #1.&lt;br /&gt;
&lt;br /&gt;
=== getheaders ===&lt;br /&gt;
&lt;br /&gt;
Return a ''headers'' packet containing the headers of blocks starting right after the last known hash in the block locator object, up to hash_stop or 2000 blocks, whichever comes first. To receive the next block headers, one needs to issue getheaders again with a new block locator object. Keep in mind that some clients may provide headers of blocks which are invalid if the block locator object contains a hash on the invalid branch.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || uint32_t || the protocol version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || number of block locator hash entries&lt;br /&gt;
|-&lt;br /&gt;
| 32+ || block locator hashes || char[32] || block locator object; newest back to genesis block (dense to start, but then sparse)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash_stop || char[32] || hash of the last desired block header; set to zero to get as many blocks as possible (2000)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For the block locator object in this packet, the same rules apply as for the [[Protocol#getblocks|getblocks]] packet.&lt;br /&gt;
&lt;br /&gt;
=== tx ===&lt;br /&gt;
&lt;br /&gt;
''tx'' describes a bitcoin transaction, in reply to ''[[#getdata|getdata]]''. When a bloom filter is applied ''tx'' objects are sent automatically for matching transactions following the &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Transaction data format version (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || tx_in count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of Transaction inputs (never zero)&lt;br /&gt;
|-&lt;br /&gt;
| 41+ || tx_in || tx_in[] || A list of 1 or more transaction inputs or sources for coins&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || tx_out count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of Transaction outputs&lt;br /&gt;
|-&lt;br /&gt;
| 9+ || tx_out || tx_out[] || A list of 1 or more transaction outputs or destinations for coins&lt;br /&gt;
|-&lt;br /&gt;
| 4 || lock_time || uint32_t || The block number or timestamp at which this transaction is unlocked:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Not locked&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 500000000  || Block number at which this transaction is unlocked&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;= 500000000 || UNIX timestamp at which this transaction is unlocked&lt;br /&gt;
|}&lt;br /&gt;
If all TxIn inputs have final (0xffffffff) sequence numbers then lock_time is irrelevant. Otherwise, the transaction may not be added to a block until after lock_time (see [[NLockTime]]).&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TxIn consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 36 || previous_output || outpoint || The previous output transaction reference, as an OutPoint structure&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || script length || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || The length of the signature script&lt;br /&gt;
|-&lt;br /&gt;
| ? || signature script || uchar[] || Computational Script for confirming transaction authorization&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [http://bitcoin.stackexchange.com/q/2025/323 sequence] || uint32_t || Transaction version as defined by the sender. Intended for &amp;quot;replacement&amp;quot; of transactions when information is updated before inclusion into a block.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The OutPoint structure consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash || char[32] || The hash of the referenced transaction.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || uint32_t || The index of the specific output in the transaction. The first output is 0, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Script structure consists of a series of pieces of information and operations related to the value of the transaction.&lt;br /&gt;
&lt;br /&gt;
(Structure to be expanded in the future… see script.h and script.cpp and [[Script]] for more information)&lt;br /&gt;
&lt;br /&gt;
The TxOut structure consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || value || int64_t || Transaction Value&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || pk_script length || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Length of the pk_script&lt;br /&gt;
|-&lt;br /&gt;
| ? || pk_script || uchar[] || Contains the ScriptPubKey setting up conditions to claim this output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example ''tx'' message:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
000000	F9 BE B4 D9 74 78 00 00  00 00 00 00 00 00 00 00   ....tx..........&lt;br /&gt;
000010	02 01 00 00 E2 93 CD BE  01 00 00 00 01 6D BD DB   .............m..&lt;br /&gt;
000020	08 5B 1D 8A F7 51 84 F0  BC 01 FA D5 8D 12 66 E9   .[...Q........f.&lt;br /&gt;
000030	B6 3B 50 88 19 90 E4 B4  0D 6A EE 36 29 00 00 00   .;P......j.6)...&lt;br /&gt;
000040	00 8B 48 30 45 02 21 00  F3 58 1E 19 72 AE 8A C7   ..H0E.!..X..r...&lt;br /&gt;
000050	C7 36 7A 7A 25 3B C1 13  52 23 AD B9 A4 68 BB 3A   .6zz%;..R#...h.:&lt;br /&gt;
000060	59 23 3F 45 BC 57 83 80  02 20 59 AF 01 CA 17 D0   Y#?E.W... Y.....&lt;br /&gt;
000070	0E 41 83 7A 1D 58 E9 7A  A3 1B AE 58 4E DE C2 8D   .A.z.X.z...XN...&lt;br /&gt;
000080	35 BD 96 92 36 90 91 3B  AE 9A 01 41 04 9C 02 BF   5...6..;...A....&lt;br /&gt;
000090	C9 7E F2 36 CE 6D 8F E5  D9 40 13 C7 21 E9 15 98   .~.6.m...@..!...&lt;br /&gt;
0000A0	2A CD 2B 12 B6 5D 9B 7D  59 E2 0A 84 20 05 F8 FC   *.+..].}Y... ...&lt;br /&gt;
0000B0	4E 02 53 2E 87 3D 37 B9  6F 09 D6 D4 51 1A DA 8F   N.S..=7.o...Q...&lt;br /&gt;
0000C0	14 04 2F 46 61 4A 4C 70  C0 F1 4B EF F5 FF FF FF   ../FaJLp..K.....&lt;br /&gt;
0000D0	FF 02 40 4B 4C 00 00 00  00 00 19 76 A9 14 1A A0   ..@KL......v....&lt;br /&gt;
0000E0	CD 1C BE A6 E7 45 8A 7A  BA D5 12 A9 D9 EA 1A FB   .....E.z........&lt;br /&gt;
0000F0	22 5E 88 AC 80 FA E9 C7  00 00 00 00 19 76 A9 14   &amp;quot;^...........v..&lt;br /&gt;
000100	0E AB 5B EA 43 6A 04 84  CF AB 12 48 5E FD A0 B7   ..[.Cj.....H^...&lt;br /&gt;
000110	8B 4E CC 52 88 AC 00 00  00 00                     .N.R......&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                                       - main network magic bytes&lt;br /&gt;
 74 78 00 00 00 00 00 00 00 00 00 00               - &amp;quot;tx&amp;quot; command&lt;br /&gt;
 02 01 00 00                                       - payload is 258 bytes long&lt;br /&gt;
 E2 93 CD BE                                       - payload checksum (little endian)&lt;br /&gt;
&lt;br /&gt;
Transaction:&lt;br /&gt;
 01 00 00 00                                       - version&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
 01                                                - number of transaction inputs&lt;br /&gt;
&lt;br /&gt;
Input 1:&lt;br /&gt;
 6D BD DB 08 5B 1D 8A F7  51 84 F0 BC 01 FA D5 8D  - previous output (outpoint)&lt;br /&gt;
 12 66 E9 B6 3B 50 88 19  90 E4 B4 0D 6A EE 36 29&lt;br /&gt;
 00 00 00 00&lt;br /&gt;
&lt;br /&gt;
 8B                                                - script is 139 bytes long&lt;br /&gt;
&lt;br /&gt;
 48 30 45 02 21 00 F3 58  1E 19 72 AE 8A C7 C7 36  - signature script (scriptSig)&lt;br /&gt;
 7A 7A 25 3B C1 13 52 23  AD B9 A4 68 BB 3A 59 23&lt;br /&gt;
 3F 45 BC 57 83 80 02 20  59 AF 01 CA 17 D0 0E 41&lt;br /&gt;
 83 7A 1D 58 E9 7A A3 1B  AE 58 4E DE C2 8D 35 BD&lt;br /&gt;
 96 92 36 90 91 3B AE 9A  01 41 04 9C 02 BF C9 7E&lt;br /&gt;
 F2 36 CE 6D 8F E5 D9 40  13 C7 21 E9 15 98 2A CD&lt;br /&gt;
 2B 12 B6 5D 9B 7D 59 E2  0A 84 20 05 F8 FC 4E 02&lt;br /&gt;
 53 2E 87 3D 37 B9 6F 09  D6 D4 51 1A DA 8F 14 04&lt;br /&gt;
 2F 46 61 4A 4C 70 C0 F1  4B EF F5&lt;br /&gt;
&lt;br /&gt;
 FF FF FF FF                                       - sequence&lt;br /&gt;
&lt;br /&gt;
Outputs:&lt;br /&gt;
 02                                                - 2 Output Transactions&lt;br /&gt;
&lt;br /&gt;
Output 1:&lt;br /&gt;
 40 4B 4C 00 00 00 00 00                           - 0.05 BTC (5000000)&lt;br /&gt;
 19                                                - pk_script is 25 bytes long&lt;br /&gt;
&lt;br /&gt;
 76 A9 14 1A A0 CD 1C BE  A6 E7 45 8A 7A BA D5 12  - pk_script&lt;br /&gt;
 A9 D9 EA 1A FB 22 5E 88  AC&lt;br /&gt;
&lt;br /&gt;
Output 2:&lt;br /&gt;
 80 FA E9 C7 00 00 00 00                           - 33.54 BTC (3354000000)&lt;br /&gt;
 19                                                - pk_script is 25 bytes long&lt;br /&gt;
&lt;br /&gt;
 76 A9 14 0E AB 5B EA 43  6A 04 84 CF AB 12 48 5E  - pk_script&lt;br /&gt;
 FD A0 B7 8B 4E CC 52 88  AC&lt;br /&gt;
&lt;br /&gt;
Locktime:&lt;br /&gt;
 00 00 00 00                                       - lock time&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== block ===&lt;br /&gt;
&lt;br /&gt;
The '''block''' message is sent in response to a getdata message which requests transaction information from a block hash.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A Unix timestamp recording when this block was created (Currently limited to dates before the year 2106!)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated [[Difficulty|difficulty target]] being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || txn_count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of transaction entries&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || tx[] || Block transactions, in format of &amp;quot;tx&amp;quot; command&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The SHA256 hash that identifies each block (and which must have a run of 0 bits) is calculated from the first 6 fields of this structure (version, prev_block, merkle_root, timestamp, bits, nonce, and standard SHA256 padding, making two 64-byte chunks in all) and ''not'' from the complete block. To calculate the hash, only two chunks need to be processed by the SHA256 algorithm. Since the ''nonce'' field is in the second chunk, the first chunk stays constant during mining and therefore only the second chunk needs to be processed. However, a Bitcoin hash is the hash of the hash, so two SHA256 rounds are needed for each mining iteration.&lt;br /&gt;
See [[Block hashing algorithm]] for details and an example.&lt;br /&gt;
&lt;br /&gt;
=== headers ===&lt;br /&gt;
&lt;br /&gt;
The ''headers'' packet returns block headers in response to a ''getheaders'' packet. &lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || Number of block headers&lt;br /&gt;
|-&lt;br /&gt;
| 81x? || headers || [[Protocol#Block_Headers|block_header]][] || [[Protocol#Block_Headers|Block headers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the block headers in this packet include a transaction count (a var_int, so there can be more than 81 bytes per header) as opposed to the block headers that are hashed by miners.&lt;br /&gt;
&lt;br /&gt;
=== getaddr ===&lt;br /&gt;
&lt;br /&gt;
The getaddr message sends a request to a node asking for information about known active peers to help with finding potential nodes in the network. The response to receiving this message is to transmit one or more addr messages with one or more peers from a database of known active peers. The typical presumption is that a node is likely to be active if it has been sending a message within the last three hours.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
=== mempool ===&lt;br /&gt;
&lt;br /&gt;
The mempool message sends a request to a node asking for information about transactions it has verified but which have not yet confirmed. The response to receiving this message is an inv message containing the transaction hashes for all the transactions in the node's mempool.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
It is specified in [https://github.com/bitcoin/bips/blob/master/bip-0035.mediawiki BIP 35]. Since [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 37], if a [[Protocol#filterload.2C_filteradd.2C_filterclear.2C_merkleblock|bloom filter]] is loaded, only transactions matching the filter are replied.&lt;br /&gt;
&lt;br /&gt;
=== checkorder ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== submitorder ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== reply ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== ping ===&lt;br /&gt;
&lt;br /&gt;
The ''ping'' message is sent primarily to confirm that the TCP/IP connection is still valid. An error in transmission is presumed to be a closed connection and the address is removed as a current peer.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || random nonce&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pong ===&lt;br /&gt;
&lt;br /&gt;
The ''pong'' message is sent in response to a ''ping'' message. In modern protocol versions, a ''pong'' response is generated using a nonce included in the ping.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || nonce from ping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== reject===&lt;br /&gt;
&lt;br /&gt;
The ''reject'' message is sent when messages are rejected.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || message || var_str || type of message rejected&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ccode || char || code relating to rejected message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || reason || var_str || text version of reason for rejection&lt;br /&gt;
|-&lt;br /&gt;
| 0+ || data || char || Optional extra data provided by some errors.  Currently, all errors which provide this field fill it with the TXID or block header hash of the object being rejected, so the field is 32 bytes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
CCodes&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || REJECT_MALFORMED|| &lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || REJECT_INVALID ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || REJECT_OBSOLETE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || REJECT_DUPLICATE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || REJECT_NONSTANDARD ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || REJECT_DUST ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || REJECT_INSUFFICIENTFEE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || REJECT_CHECKPOINT ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== filterload, filteradd, filterclear, merkleblock ===&lt;br /&gt;
&lt;br /&gt;
These messages are related to Bloom filtering of connections and are defined in [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 0037].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt; command is defined as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || filter || uint8_t[] || The filter itself is simply a bit field of arbitrary byte-aligned size. The maximum size is 36,000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nHashFuncs || uint32_t || The number of hash functions to use in this filter. The maximum value allowed in this field is 50.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nTweak || uint32_t || A random value to add to the seed value in the hash function used by the bloom filter.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || nFlags || uint8_t || A set of flags that control how matched items are added to the filter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See below for a description of the Bloom filter algorithm and how to select nHashFuncs and filter size for a desired false positive rate.&lt;br /&gt;
&lt;br /&gt;
Upon receiving a &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt; command, the remote peer will immediately restrict the broadcast transactions it announces (in inv packets) to transactions matching the filter, where the matching algorithm is specified below. The flags control the update behaviour of the matching algorithm.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filteradd&amp;lt;/code&amp;gt; command is defined as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || data || uint8_t[] || The data element to add to the current filter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data field must be smaller than or equal to 520 bytes in size (the maximum size of any potentially matched object).&lt;br /&gt;
&lt;br /&gt;
The given data element will be added to the Bloom filter. A filter must have been previously provided using &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt;. This command is useful if a new key or script is added to a clients wallet whilst it has connections to the network open, it avoids the need to re-calculate and send an entirely new filter to every peer (though doing so is usually advisable to maintain anonymity).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filterclear&amp;lt;/code&amp;gt; command has no arguments at all.&lt;br /&gt;
&lt;br /&gt;
After a filter has been set, nodes don't merely stop announcing non-matching transactions, they can also serve filtered blocks. A filtered block is defined by the &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt; message and is defined like this:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information, based upon the software version creating this block (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A timestamp recording when this block was created (Limited to 2106!)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated difficulty target being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 4 || total_transactions || uint32_t || Number of transactions in the block (including unmatched ones)&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash_count || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || The number of hashes to follow&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || hashes || char[32] || Hashes in depth-first order&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || flag_bytes || [[Peer-To-Peer_Protocol#Variable_length_integer|var_int]] || The size of flags (in bytes) to follow&lt;br /&gt;
|-&lt;br /&gt;
| ? || flags || byte[] || Flag bits, packed per 8 in a byte, least significant bit first. Extra 0 bits are padded on to reach full byte size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After a &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt;, transactions matching the bloom filter are automatically sent in ''[[#tx|tx]]'' messages.&lt;br /&gt;
&lt;br /&gt;
A guide to creating a bloom filter, loading a merkle block, and parsing a partial merkle block tree can be found in the [https://bitcoin.org/en/developer-examples#creating-a-bloom-filter Developer Examples].&lt;br /&gt;
&lt;br /&gt;
=== sendheaders ===&lt;br /&gt;
&lt;br /&gt;
Request for Direct headers announcement. &lt;br /&gt;
&lt;br /&gt;
Upon receipt of this message, the node is be permitted, but not required, to announce new blocks by '''headers''' command (instead of '''inv''' command).&lt;br /&gt;
&lt;br /&gt;
This message is supported by the protocol version &amp;gt;= 70012 or Bitcoin Core version &amp;gt;= 0.12.0.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki BIP 130] for more information.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== feefilter ===&lt;br /&gt;
&lt;br /&gt;
The payload is always 8 bytes long and it encodes 64 bit integer value (LSB / little endian) of '''feerate'''.&lt;br /&gt;
The value represents a minimal fee and is expressed in satoshis per 1000 bytes.&lt;br /&gt;
&lt;br /&gt;
Upon receipt of a &amp;quot;feefilter&amp;quot; message, the node will be permitted, but not required, to filter transaction invs for transactions that fall below the feerate provided in the feefilter message interpreted as satoshis per kilobyte.&lt;br /&gt;
&lt;br /&gt;
The fee filter is additive with a bloom filter for transactions so if an SPV client were to load a bloom filter and send a feefilter message, transactions would only be relayed if they passed both filters.&lt;br /&gt;
&lt;br /&gt;
Inv's generated from a mempool message are also subject to a fee filter if it exists.&lt;br /&gt;
&lt;br /&gt;
Feature discovery is enabled by checking protocol version &amp;gt;= 70013&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki BIP 133] for more information.&lt;br /&gt;
&lt;br /&gt;
=== sendcmpct ===&lt;br /&gt;
&lt;br /&gt;
# The sendcmpct message is defined as a message containing a 1-byte integer followed by a 8-byte integer where pchCommand == &amp;quot;sendcmpct&amp;quot;.&lt;br /&gt;
# The first integer SHALL be interpreted as a boolean (and MUST have a value of either 1 or 0)&lt;br /&gt;
# The second integer SHALL be interpreted as a little-endian version number. Nodes sending a sendcmpct message MUST currently set this value to 1.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the first and second integers set to 1, the node SHOULD announce new blocks by sending a cmpctblock message.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the first integer set to 0, the node SHOULD NOT announce new blocks by sending a cmpctblock message, but SHOULD announce new blocks by sending invs or headers, as defined by BIP130.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the second integer set to something other than 1, nodes MUST treat the peer as if they had not received the message (as it indicates the peer will provide an unexpected encoding in &lt;br /&gt;
# cmpctblock, and/or other, messages). This allows future versions to send duplicate sendcmpct messages with different versions as a part of a version handshake for future versions.&lt;br /&gt;
# Nodes SHOULD check for a protocol version of &amp;gt;= 70014 before sending sendcmpct messages.&lt;br /&gt;
# Nodes MUST NOT send a request for a MSG_CMPCT_BLOCK object to a peer before having received a sendcmpct message from that peer.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== cmpctblock ===&lt;br /&gt;
&lt;br /&gt;
# The cmpctblock message is defined as as a message containing a serialized [[Protocol#HeaderAndShortIDs|HeaderAndShortIDs]] message and pchCommand == &amp;quot;cmpctblock&amp;quot;.&lt;br /&gt;
# Upon receipt of a cmpctblock message after sending a sendcmpct message, nodes SHOULD calculate the [[Protocol#Short_transaction_ID|short transaction ID]] for each unconfirmed transaction they have available (ie in their mempool) and compare each to each short transaction ID in the cmpctblock message.&lt;br /&gt;
# After finding already-available transactions, nodes which do not have all transactions available to reconstruct the full block SHOULD request the missing transactions using a getblocktxn message.&lt;br /&gt;
# A node MUST NOT send a cmpctblock message unless they are able to respond to a getblocktxn message which requests every transaction in the block.&lt;br /&gt;
# A node MUST NOT send a cmpctblock message without having validated that the header properly commits to each transaction in the block, and properly builds on top of the existing chain with a valid proof-of-work. A node MAY send a cmpctblock before validating that each transaction in the block validly spends existing UTXO set entries.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== getblocktxn ===&lt;br /&gt;
&lt;br /&gt;
# The getblocktxn message is defined as as a message containing a serialized [[Protocol#BlockTransactionsRequest|BlockTransactionsRequest]] message and pchCommand == &amp;quot;getblocktxn&amp;quot;.&lt;br /&gt;
# Upon receipt of a properly-formatted getblocktxnmessage, nodes which recently provided the sender of such a message a cmpctblock for the block hash identified in this message MUST respond with an appropriate [[Protocol#blocktxn|blocktxn]] message. Such a blocktxn message MUST contain exactly and only each transaction which is present in the appropriate block at the index specified in the getblocktxn indexes list, in the order requested.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== blocktxn ===&lt;br /&gt;
&lt;br /&gt;
# The blocktxn message is defined as as a message containing a serialized [[Protocol#BlockTransactions|BlockTransactions]] message and pchCommand == &amp;quot;blocktxn&amp;quot;.&lt;br /&gt;
# Upon receipt of a properly-formatted requested blocktxn message, nodes SHOULD attempt to reconstruct the full block by:&lt;br /&gt;
# Taking the prefilledtxn transactions from the original [[Protocol#cmpctblock|cmpctblock]] and placing them in the marked positions.&lt;br /&gt;
# For each short transaction ID from the original [[Protocol#cmpctblock|cmpctblock]], in order, find the corresponding transaction either from the blocktxn message or from other sources and place it in the first available position in the block.&lt;br /&gt;
# Once the block has been reconstructed, it shall be processed as normal, keeping in mind that short transaction IDs are expected to occasionally collide, and that nodes MUST NOT be penalized for such collisions, wherever they appear.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
See [[Advanced Bitcoin Scripting]].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Network]]&lt;br /&gt;
&lt;br /&gt;
==Attribution==&lt;br /&gt;
This content is based on content sourced from https://en.bitcoin.it/wiki/Protocol_documentation under [https://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0]. Although it may have been extensively revised and updated we acknowledge the original authors.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Protocol&amp;diff=3093</id>
		<title>Protocol</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Protocol&amp;diff=3093"/>
		<updated>2022-12-19T15:20:48Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: /* Immutable Rules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Bitcoin Protocol Rules==&lt;br /&gt;
The rules of the Bitcoin protocol are the rules that precisely define the Bitcoin system.&lt;br /&gt;
&lt;br /&gt;
There are different classes of rule in the Bitcoin system including:&lt;br /&gt;
*[[Immutable]] rules&lt;br /&gt;
*Mutable rules&lt;br /&gt;
**Local Policies&lt;br /&gt;
**Standard Policies&lt;br /&gt;
*Communication rules&lt;br /&gt;
&lt;br /&gt;
== Immutable Rules ==&lt;br /&gt;
The [[immutable]] rules are codified into Bitcoin node clients and must be strictly adhered to, in order to implement the Bitcoin specification in software [1]. They are a set of rules that define the format and constraints that transactions and blocks must follow.&lt;br /&gt;
&lt;br /&gt;
These include:&lt;br /&gt;
&lt;br /&gt;
*The sum of the value of the inputs of a transaction must be greater than or equal to the sum of the values of the outputs.&lt;br /&gt;
*The [[Block subsidy|block subsidy]] will drop by half at a scheduled rate of every 210,000 blocks, starting with a subsidy of 5,000,000,000 [[satoshis]] per block from the genesis block.&lt;br /&gt;
*The network will adjust the [[target]] for the [[difficulty]] of the [[Proof of Work]] needed for a valid block to maintain an approximate 10 minute block discovery rate.&lt;br /&gt;
*Only blocks that add to the [[blockchain]] formed by building upon the [[Genesis block]] are valid.&lt;br /&gt;
*The structure of the Bitcoin database as a timestamp server validating chains of transaction outputs.&lt;br /&gt;
*Transaction data formatting, including sizes of certain fields and their encoding schema.&lt;br /&gt;
*Block structure and header information including sizes of certain fields and their encoding schema.&lt;br /&gt;
* The [[Advanced Bitcoin Scripting|Bitcoin scripting language]] and its specification including:&lt;br /&gt;
**Lists of opcodes that are usable in script and the exact outcome of their execution&lt;br /&gt;
&lt;br /&gt;
Forced changes to these protocol rules in the past have resulted in duplications of the Bitcoin database. In doing so, creating BTC which implemented 'Segregated Witness', removing the requirement for Bitcoin to be a chain of digital signatures. BCH enforced a transaction ordering schema onto the timestamping function of the system, and modified the scripting language to add op codes, with functionality outside the scope of the original design.&lt;br /&gt;
&lt;br /&gt;
The Bitcoin SV philosophy is, where aspects of these rules have been changed in the past, they should be returned to be as close to the original rules as possible and then “set in stone”. Only changes needed to protect the security of the network such as, the migration to a new hash function should SHA256 be broken, will be allowed, with this rule being enforced through [[Nakamoto Consensus]].&lt;br /&gt;
&lt;br /&gt;
== Mutable Rules ==&lt;br /&gt;
Mutable rules are consensus rules that mining clients implement but which are not hard coded into the BitcoinSV node client. Miners can change these at any time provided there is enough agreement among Miners to do so under [[Nakamoto Consensus]]. Miners who do not maintain these settings in-line with the rest of the network, risk having their blocks invalidated.&lt;br /&gt;
Examples of these include:&lt;br /&gt;
*The maximum script memory usage rule which governs how much memory a transaction can consume during the execution of its script.&lt;br /&gt;
*The maximum block-size rule.&lt;br /&gt;
*Transaction script rules such as the rule preventing the use of opcodes other than pushdata in ScriptSig.&lt;br /&gt;
It is important to note that these rules can be violated in special cases by Miners, through a negotiation process that ends with a transaction or block that violates these rules being accepted and built upon. This can only be achieved through Nakamoto consensus. No examples of this happening have yet been encountered.&lt;br /&gt;
&lt;br /&gt;
When modifying these rules, Miners tend to act as a collective, changing a particular rule all at once (e.g. maximum transaction memory limits and maximum block size). Since the [[Genesis upgrade]], these changes no longer require hard forks or scheduled network upgrades, and the settings that govern these changes available to Miners through node client configuration tools. All that is required is a loose agreement between Miners to change the settings across the network at a particular date and time.&lt;br /&gt;
&lt;br /&gt;
This means that Miners must be aware of the actions being taken by the rest of the network, lest they find themselves rejecting transactions or blocks that a majority of the network is accepting and become stuck on a non-productive chain-tip while the remainder of the network move forward.&lt;br /&gt;
&lt;br /&gt;
===Local rules===&lt;br /&gt;
These rules are “local” by definition. They apply to the instance of software that is running, they do not apply to the validation of blocks, or the transactions within a block. A block accepted from another Miner may contain transactions that do not conform to local rules.&lt;br /&gt;
Local rules include:&lt;br /&gt;
*The “minimum fee” rule, which specifies that the node will only accept and/or relay unconfirmed transactions that pay above a certain fee.&lt;br /&gt;
*Dust rules which specify the smallest value output a transaction can contain that the node will accept and/or relay.&lt;br /&gt;
*Rules relating to inbound and outbound connections on the network, such as RPC responses, specific IP addresses to connect to, and more.&lt;br /&gt;
&lt;br /&gt;
===Standard Policies===&lt;br /&gt;
Standard policies are local rules that are used by a significant proportion of network nodes. They are defined as a &amp;quot;Standard&amp;quot; to facilitate common application across independent software implementations, but it is important to note that, it is not required that software implement or adhere to these policies.&lt;br /&gt;
&lt;br /&gt;
Bitcoin users who transact within the guidelines of standard policy will face the least issues with their transactions on the network. Some Miners can enact local rules outside of the standard policies however this can cause issues for the Miner, who may be attempting to mine blocks that carry large numbers of transactions which other Miners have rejected. This can lead to [[Orphan Block|orphan blocks]] due to slow propagation.&lt;br /&gt;
&lt;br /&gt;
==Communication Rules==&lt;br /&gt;
The communication rules govern how transaction and block data is propagated across the Bitcoin network. Commonly referred to as the Bitcoin [[Peer-To-Peer Protocol|Peer-To-Peer (P2P) Protocol]], this current version is well defined method and used by the majority of Bitcoin nodes in the network to communicate. The P2P Protocol can be changed and there are plans among Miners to modify the implementation in future. It is conceivable that at a certain point, several different inter-node communication protocols may be in-use to propagate block and transaction information between Miners, and optimising this aspect of the network is strongly incentivised by the economics of Bitcoin mining. A large amount of the innovation that scales Bitcoin SV has been and will, in future, be done by improving the P2P protocol.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[The Bitcoin Network]]&lt;br /&gt;
* [[Nakamoto Consensus]]&lt;br /&gt;
* [[P2P Network]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
[1] - https://github.com/bitcoin-sv-specs/protocol/blob/master/updates/genesis-spec.md&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Metanet_Protocol&amp;diff=3071</id>
		<title>Metanet Protocol</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Metanet_Protocol&amp;diff=3071"/>
		<updated>2022-07-27T12:39:47Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Metanet_graph.png|thumb|A typical Metanet graph.]]&lt;br /&gt;
&lt;br /&gt;
The '''Metanet Protocol''' is a layer-2 overlay protocol that defines a method for creating data structure over Bitcoin SV. The protocol utilises [[Metanet_Protocol#Node and Edge Structure|nodes and edges]] to specify directed acyclic graph (DAG) data structures on the Bitcoin SV ledger. The Metanet protocol can be used to construct diverse systems such as file systems, internet domains, ownership structures and code repositories.&lt;br /&gt;
&lt;br /&gt;
There are tools available to write and read Metanet graphs, and a growing range of projects that use the Metanet protocol to structure their application data.&lt;br /&gt;
&lt;br /&gt;
==Node and Edge Structure==&lt;br /&gt;
&lt;br /&gt;
The Metanet Protocol (MNP) is a protocol for creating graph structures comprising nodes and edges on the ledger. In the Metanet protocol the following definitions of node and edge are used:&lt;br /&gt;
&lt;br /&gt;
* '''Metanet Node''' - A transaction using the Metanet protocol format.&lt;br /&gt;
* '''Metanet Edge''' - An input signature linking two Metanet nodes.&lt;br /&gt;
&lt;br /&gt;
A Metanet node is a transaction that conforms to the Metanet transaction format specified in [https://www.bitcoinsv.io/files/metanet.pdf Metanet technical summary] document produced by nChain. The basic components of a Metanet transaction include a protocol flag, Metanet-specific data attributes, and any content data that is to be stored by a Metanet node transaction. &lt;br /&gt;
&lt;br /&gt;
The protocol flag is a 4-byte [[hexadecimal]] prefix that signifies that a transaction is using the format of the Metanet protocol. The hexadecimal value of the prefix was chosen to be the hexademical encoding 0x4d455441 of the string 'meta' by [https://twitter.com/BitcoinAssn/status/1136232235798016001?s=20 public poll] on June 5th 2019.&lt;br /&gt;
&lt;br /&gt;
The Metanet-specific data attributes of a Metanet node transaction include the following:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;''' - the public key defining the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;TxID_{node}&amp;lt;/math&amp;gt;''' - the unique transaction ID of the node. &lt;br /&gt;
* '''&amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;''' - the public key defining a parent of the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;''' - a signature created using the private key associated with the public key defining a parent of the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt;''' - the unique transaction ID of the parent of the node.&lt;br /&gt;
&lt;br /&gt;
The Metanet-specific data attributes listed above are used collectively to define a Metanet node and its position within a larger graph structure of multiple Metanet nodes, known as a ''Metanet graph''. &lt;br /&gt;
&lt;br /&gt;
It is possible that a node does not have any parents and such a node is termed a ''root node''. A root node will have null values for any &amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt; attributes, and can therefore use a valid signature from any public key in its input(s).&lt;br /&gt;
&lt;br /&gt;
A Metanet transaction is defined as a transaction that contains an OP_FALSE OP_RETURN payload containing:&lt;br /&gt;
&lt;br /&gt;
* The Metanet flag&lt;br /&gt;
[[File:Metanet_node.png|thumb|A Metanet node transaction.]]&lt;br /&gt;
* A node public key '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;'''&lt;br /&gt;
* A parent transaction ID '''&amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt;''' (null if a root node).&lt;br /&gt;
&lt;br /&gt;
In order to qualify as a Metanet-valid node, the transaction must also be signed by the public key corresponding to its parent '''&amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
Any content data and its encoding can be included following these core Metanet attributes in the OP_FALSE OP_RETURN payload. The Metanet protocol does not specify the use of any one scheme for content data and additional attributes, and any valued usage of the Metanet protocol attributes above constitute a Metanet node transaction.&lt;br /&gt;
&lt;br /&gt;
A basic example of a Metanet node transaction that conforms to this format is shown in the diagram on the right.&lt;br /&gt;
&lt;br /&gt;
The Metanet graph is formed by creating edges between parent Metanet nodes and child Metanet nodes. An edge is created between a parent and child by the creation and insertion of the signature '''&amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;''' in the child node, using the parent public key. [[File:Metanet_edge.png|thumb|The creation of a Metanet edge.]]&lt;br /&gt;
&lt;br /&gt;
The fact that this signature is in a transaction input means that the signature itself may be validated by Miners. This means that attempts to spoof a Metanet node can be mitigated either by validating the signature explicitly or by confirming that the node is spending an appropriate previous output.&lt;br /&gt;
&lt;br /&gt;
== Rules of the Metanet Protocol==&lt;br /&gt;
&lt;br /&gt;
The Metanet protocol specifies a simple and extensible rule set for creating Metanet graphs and data structures. The base rule set is the following:&lt;br /&gt;
&lt;br /&gt;
* Nodes are transactions.&lt;br /&gt;
* Edges are created by signatures.&lt;br /&gt;
* Each node is uniquely identified by the pair of attributes: '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;''', '''&amp;lt;math&amp;gt;TxID_{node}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
* Each node must specify the node ID of itself and its parent: '''&amp;lt;math&amp;gt;ID_{node}&amp;lt;/math&amp;gt;''', '''&amp;lt;math&amp;gt;ID_{parent}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
The unique node identifier for a node is defined mathematically as '''&amp;lt;math&amp;gt;H(P_{node}||TxID_{node})&amp;lt;/math&amp;gt;''', where '''&amp;lt;math&amp;gt;H()&amp;lt;/math&amp;gt;''' is a cryptographic hash function.&lt;br /&gt;
&lt;br /&gt;
Metanet graph structures may be created using this base rule set alone. It is also possible to impose additional rules to Metanet graph structures to achieve different properties for data structures.&lt;br /&gt;
&lt;br /&gt;
A simple extension of the rule set is to impose the following [[constraint]]s:&lt;br /&gt;
[[File:Metanet_rules.png|thumb|A simple Metanet rule set.]]&lt;br /&gt;
&lt;br /&gt;
* The [[in-degree]] of a node should be 0 (no parent) or 1 (one parent).&lt;br /&gt;
* The [[out-degree]] of a node should be a free parameter.&lt;br /&gt;
&lt;br /&gt;
These additional rules allow domain-like structures to emerge as Metanet DAGs, which can be used to structure websites and file systems which inherit the permission structure of a Metanet graph.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Metanet_Protocol&amp;diff=3070</id>
		<title>Metanet Protocol</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Metanet_Protocol&amp;diff=3070"/>
		<updated>2022-07-27T12:39:30Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Metanet_graph.png|thumb|A typical Metanet graph.]]&lt;br /&gt;
&lt;br /&gt;
The '''Metanet Protocol''' is a layer-2 overlay protocol that defines a method for creating data structure over Bitcoin SV. The protocol utilises [[Metanet_Protocol#Node and Edge Structure|nodes and edges]] to specify directed acyclic graph (DAG) data structures on the Bitcoin SV ledger. The Metanet protocol can be used to construct diverse systems such as file systems, internet domains, ownership structures and code repositories.&lt;br /&gt;
&lt;br /&gt;
There are tools available to write and read Metanet graphs, and a growing range of projects that use the Metanet protocol to structure their application data.&lt;br /&gt;
&lt;br /&gt;
==Node and Edge Structure==&lt;br /&gt;
&lt;br /&gt;
The Metanet Protocol (MNP) is a protocol for creating graph structures comprising nodes and edges on the ledger. In the Metanet protocol the following definitions of node and edge are used:&lt;br /&gt;
&lt;br /&gt;
* '''Metanet Node''' - A transaction using the Metanet protocol format.&lt;br /&gt;
* '''Metanet Edge''' - An input signature linking two Metanet nodes.&lt;br /&gt;
&lt;br /&gt;
A Metanet node is a transaction that conforms to the Metanet transaction format specified in [https://www.bitcoinsv.io/files/metanet.pdff Metanet technical summary] document produced by nChain. The basic components of a Metanet transaction include a protocol flag, Metanet-specific data attributes, and any content data that is to be stored by a Metanet node transaction. &lt;br /&gt;
&lt;br /&gt;
The protocol flag is a 4-byte [[hexadecimal]] prefix that signifies that a transaction is using the format of the Metanet protocol. The hexadecimal value of the prefix was chosen to be the hexademical encoding 0x4d455441 of the string 'meta' by [https://twitter.com/BitcoinAssn/status/1136232235798016001?s=20 public poll] on June 5th 2019.&lt;br /&gt;
&lt;br /&gt;
The Metanet-specific data attributes of a Metanet node transaction include the following:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;''' - the public key defining the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;TxID_{node}&amp;lt;/math&amp;gt;''' - the unique transaction ID of the node. &lt;br /&gt;
* '''&amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;''' - the public key defining a parent of the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;''' - a signature created using the private key associated with the public key defining a parent of the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt;''' - the unique transaction ID of the parent of the node.&lt;br /&gt;
&lt;br /&gt;
The Metanet-specific data attributes listed above are used collectively to define a Metanet node and its position within a larger graph structure of multiple Metanet nodes, known as a ''Metanet graph''. &lt;br /&gt;
&lt;br /&gt;
It is possible that a node does not have any parents and such a node is termed a ''root node''. A root node will have null values for any &amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt; attributes, and can therefore use a valid signature from any public key in its input(s).&lt;br /&gt;
&lt;br /&gt;
A Metanet transaction is defined as a transaction that contains an OP_FALSE OP_RETURN payload containing:&lt;br /&gt;
&lt;br /&gt;
* The Metanet flag&lt;br /&gt;
[[File:Metanet_node.png|thumb|A Metanet node transaction.]]&lt;br /&gt;
* A node public key '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;'''&lt;br /&gt;
* A parent transaction ID '''&amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt;''' (null if a root node).&lt;br /&gt;
&lt;br /&gt;
In order to qualify as a Metanet-valid node, the transaction must also be signed by the public key corresponding to its parent '''&amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
Any content data and its encoding can be included following these core Metanet attributes in the OP_FALSE OP_RETURN payload. The Metanet protocol does not specify the use of any one scheme for content data and additional attributes, and any valued usage of the Metanet protocol attributes above constitute a Metanet node transaction.&lt;br /&gt;
&lt;br /&gt;
A basic example of a Metanet node transaction that conforms to this format is shown in the diagram on the right.&lt;br /&gt;
&lt;br /&gt;
The Metanet graph is formed by creating edges between parent Metanet nodes and child Metanet nodes. An edge is created between a parent and child by the creation and insertion of the signature '''&amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;''' in the child node, using the parent public key. [[File:Metanet_edge.png|thumb|The creation of a Metanet edge.]]&lt;br /&gt;
&lt;br /&gt;
The fact that this signature is in a transaction input means that the signature itself may be validated by Miners. This means that attempts to spoof a Metanet node can be mitigated either by validating the signature explicitly or by confirming that the node is spending an appropriate previous output.&lt;br /&gt;
&lt;br /&gt;
== Rules of the Metanet Protocol==&lt;br /&gt;
&lt;br /&gt;
The Metanet protocol specifies a simple and extensible rule set for creating Metanet graphs and data structures. The base rule set is the following:&lt;br /&gt;
&lt;br /&gt;
* Nodes are transactions.&lt;br /&gt;
* Edges are created by signatures.&lt;br /&gt;
* Each node is uniquely identified by the pair of attributes: '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;''', '''&amp;lt;math&amp;gt;TxID_{node}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
* Each node must specify the node ID of itself and its parent: '''&amp;lt;math&amp;gt;ID_{node}&amp;lt;/math&amp;gt;''', '''&amp;lt;math&amp;gt;ID_{parent}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
The unique node identifier for a node is defined mathematically as '''&amp;lt;math&amp;gt;H(P_{node}||TxID_{node})&amp;lt;/math&amp;gt;''', where '''&amp;lt;math&amp;gt;H()&amp;lt;/math&amp;gt;''' is a cryptographic hash function.&lt;br /&gt;
&lt;br /&gt;
Metanet graph structures may be created using this base rule set alone. It is also possible to impose additional rules to Metanet graph structures to achieve different properties for data structures.&lt;br /&gt;
&lt;br /&gt;
A simple extension of the rule set is to impose the following [[constraint]]s:&lt;br /&gt;
[[File:Metanet_rules.png|thumb|A simple Metanet rule set.]]&lt;br /&gt;
&lt;br /&gt;
* The [[in-degree]] of a node should be 0 (no parent) or 1 (one parent).&lt;br /&gt;
* The [[out-degree]] of a node should be a free parameter.&lt;br /&gt;
&lt;br /&gt;
These additional rules allow domain-like structures to emerge as Metanet DAGs, which can be used to structure websites and file systems which inherit the permission structure of a Metanet graph.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Pruning&amp;diff=3069</id>
		<title>Pruning</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Pruning&amp;diff=3069"/>
		<updated>2022-04-27T19:30:06Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;Pruning is a data compression technique for Merkle trees that reduces the size of the trees by removing sections of the tree that are non-critical and redundant.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pruning is a data compression technique for Merkle trees that reduces the size of the trees by removing sections of the tree that are non-critical and redundant.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Provenance&amp;diff=3068</id>
		<title>Provenance</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Provenance&amp;diff=3068"/>
		<updated>2022-04-27T19:29:35Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;Provenance is the chronology of the ownership, custody or location of a particular object.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Provenance is the chronology of the ownership, custody or location of a particular object.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Pre-image&amp;diff=3067</id>
		<title>Pre-image</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Pre-image&amp;diff=3067"/>
		<updated>2022-04-27T19:28:29Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;The pre-image of a hash function is the set of all values that produce a specific hash when passed as an input into a hashing function.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The pre-image of a hash function is the set of all values that produce a specific hash when passed as an input into a hashing function.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Predicate&amp;diff=3066</id>
		<title>Predicate</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Predicate&amp;diff=3066"/>
		<updated>2022-04-27T19:28:04Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;A predicate is a logical function that upon evaluation by a computer resolves to either a 'true' or 'false' as the output of the function.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A predicate is a logical function that upon evaluation by a computer resolves to either a 'true' or 'false' as the output of the function.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Poisson_Distribution&amp;diff=3065</id>
		<title>Poisson Distribution</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Poisson_Distribution&amp;diff=3065"/>
		<updated>2022-04-27T19:27:35Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;A discrete probability function that means the variable can only take specific values in a given list of numbers, probably infinite.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A discrete probability function that means the variable can only take specific values in a given list of numbers, probably infinite.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Public_key_infrastructure&amp;diff=3064</id>
		<title>Public key infrastructure</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Public_key_infrastructure&amp;diff=3064"/>
		<updated>2022-04-27T19:26:59Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;A public key infrastructure (PKI) is a set of roles, policies, hardware, software and procedures needed to create, manage, distribute, use, store and revoke digital certificat...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A public key infrastructure (PKI) is a set of roles, policies, hardware, software and procedures needed to create, manage, distribute, use, store and revoke digital certificates and manage public-key encryption.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Payment_host&amp;diff=3063</id>
		<title>Payment host</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Payment_host&amp;diff=3063"/>
		<updated>2022-04-27T19:25:22Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;The provider of the Point Of Sale device and network in order for a merchant to be able to receive particular payment types.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The provider of the Point Of Sale device and network in order for a merchant to be able to receive particular payment types.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Payments_in_Bitcoin&amp;diff=3062</id>
		<title>Payments in Bitcoin</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Payments_in_Bitcoin&amp;diff=3062"/>
		<updated>2022-04-27T19:25:08Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The term ''payments'' in a Bitcoin context generally refers the process of a purchaser paying for a good or service from a vendor. Payments are an important aspect of Bitcoin and it is crucial that comprehensive standards exist that enable parties and software systems to process payments in ways that cover a wide variety of use cases.&lt;br /&gt;
&lt;br /&gt;
There are several standards defined for Bitcoin SV that cover methods of requesting and performing payments.&lt;br /&gt;
&lt;br /&gt;
==BIP270==&lt;br /&gt;
[https://github.com/moneybutton/bips/blob/master/bip-0270.mediawiki BIP270] is a streamlined version of the [https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki BIP70 Payment Protocol] introduced in 2013. It is a protocol for communication between a [[payment host]] (usually either a merchant, a payment processor, or simply the recipient's wallet) and their customer (the sender of the funds). It enables:&lt;br /&gt;
* Improved user experience&lt;br /&gt;
* Simpler wallet infrastructure&lt;br /&gt;
* Multiple outputs&lt;br /&gt;
* Improved security against man-in-the-middle attacks&lt;br /&gt;
&lt;br /&gt;
BIP270 is designed for wallets that use [[Simplified Payment Verification]] to achieve huge improvements at scale. Transactions can be exchanged partially or in iterations. This is far faster when done peer to peer directly between the payer and the payee, writing to the ledger only at the end to settle the transaction(s).&lt;br /&gt;
&lt;br /&gt;
This BIP is an optimisation of BIP70. Changes include:&lt;br /&gt;
* Moves all signature exchange and validation to the communication later (usually HTTPS)&lt;br /&gt;
* Add multiple outputs&lt;br /&gt;
* A library optimised for peer to peer transaction management&lt;br /&gt;
&lt;br /&gt;
==BSVAlias==&lt;br /&gt;
[[BSVAlias]] is a set of standards for using email type identities with Bitcoin SV, with making and receiving payments as one of its first use-cases.&lt;br /&gt;
&lt;br /&gt;
[[Paymail]] is the first practical implementation of BSVAlias.&lt;br /&gt;
&lt;br /&gt;
==Payment Channels==&lt;br /&gt;
[[Payment Channels]] are a mechanism where two or more parties can directly exchange and update a transaction. The mechanism includes: methods for establishing, or opening, updating, and finalising or closing the payment channel. The mechanism also covers the possibility of any of the parties becoming unresponsive, usually by enabling the recovery of funds after a fixed time.&lt;br /&gt;
&lt;br /&gt;
Payment channels support extremely rapid transaction updates with only the final closing transaction being confirmed in the blockchain.&lt;br /&gt;
&lt;br /&gt;
Payment channels can be useful for streaming data, operating a sequence of events, or operating with a live dataset in applications such as gaming and more.&lt;br /&gt;
&lt;br /&gt;
==Legacy Payment Protocols==&lt;br /&gt;
Many of the legacy payment protocols used a mechanism where the payer is asked to broadcast a transaction to the network, and the payee would scan the network for relevant transactions rather than handling the transaction directly peer-to-peer as with [[Simplified_Payment_Verification|SPV]]. This mechanism does not scale when transaction volume increases and is inefficient.&lt;br /&gt;
&lt;br /&gt;
===IP to IP payments===&lt;br /&gt;
The original version of the Bitcoin node client had the facility to conduct IP to IP payments where a receiver could give a payer their IP address. The payer's client would reach out to the payee's client and request a public key for the payment to be addressed to.&lt;br /&gt;
This payment method had valid security concerns, but rather than addressing these concerns, the mechanism was removed.&lt;br /&gt;
New payment processes are in development which draw from this original idea and will allow network peers to interact securely using cryptographically verified IP addresses.&lt;br /&gt;
&lt;br /&gt;
===BIP21===&lt;br /&gt;
[https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki BIP21] has been one of the predominant means of making mobile payments in Bitcoin throughout its history. Almost all QR code based payment gateways used within Bitcoin are, or are an extension of, BIP21. BIP21 itself is an extension of [https://tools.ietf.org/html/rfc3986 RFC-3986], the RFC standard for URIs (Universal Resource Identifiers).&lt;br /&gt;
&lt;br /&gt;
===BIP70===&lt;br /&gt;
[https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki BIP70] was a payment protocol for reaching out to receivers using an extension of BIP21 that added a URL. The URL directed the device to reach out to a server which would provide it with a script, or an address linked to the QR code.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Out-degree&amp;diff=3061</id>
		<title>Out-degree</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Out-degree&amp;diff=3061"/>
		<updated>2022-04-27T19:00:34Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;The number of edges that go out of a node.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The number of edges that go out of a node.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Metanet_Protocol&amp;diff=3060</id>
		<title>Metanet Protocol</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Metanet_Protocol&amp;diff=3060"/>
		<updated>2022-04-27T19:00:21Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Metanet_graph.png|thumb|A typical Metanet graph.]]&lt;br /&gt;
&lt;br /&gt;
The '''Metanet Protocol''' is a layer-2 overlay protocol that defines a method for creating data structure over Bitcoin SV. The protocol utilises [[Metanet_Protocol#Node and Edge Structure|nodes and edges]] to specify directed acyclic graph (DAG) data structures on the Bitcoin SV ledger. The Metanet protocol can be used to construct diverse systems such as file systems, internet domains, ownership structures and code repositories.&lt;br /&gt;
&lt;br /&gt;
There are tools available to write and read Metanet graphs, and a growing range of projects that use the Metanet protocol to structure their application data.&lt;br /&gt;
&lt;br /&gt;
==Node and Edge Structure==&lt;br /&gt;
&lt;br /&gt;
The Metanet Protocol (MNP) is a protocol for creating graph structures comprising nodes and edges on the ledger. In the Metanet protocol the following definitions of node and edge are used:&lt;br /&gt;
&lt;br /&gt;
* '''Metanet Node''' - A transaction using the Metanet protocol format.&lt;br /&gt;
* '''Metanet Edge''' - An input signature linking two Metanet nodes.&lt;br /&gt;
&lt;br /&gt;
A Metanet node is a transaction that conforms to the Metanet transaction format specified in [https://bitcoinsv.io/wp-content/uploads/2020/10/The-Metanet-Technical-Summary-v1.0.pdf Metanet technical summary] document produced by nChain. The basic components of a Metanet transaction include a protocol flag, Metanet-specific data attributes, and any content data that is to be stored by a Metanet node transaction. &lt;br /&gt;
&lt;br /&gt;
The protocol flag is a 4-byte [[hexadecimal]] prefix that signifies that a transaction is using the format of the Metanet protocol. The hexadecimal value of the prefix was chosen to be the hexademical encoding 0x4d455441 of the string 'meta' by [https://twitter.com/BitcoinAssn/status/1136232235798016001?s=20 public poll] on June 5th 2019.&lt;br /&gt;
&lt;br /&gt;
The Metanet-specific data attributes of a Metanet node transaction include the following:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;''' - the public key defining the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;TxID_{node}&amp;lt;/math&amp;gt;''' - the unique transaction ID of the node. &lt;br /&gt;
* '''&amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;''' - the public key defining a parent of the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;''' - a signature created using the private key associated with the public key defining a parent of the node.&lt;br /&gt;
* '''&amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt;''' - the unique transaction ID of the parent of the node.&lt;br /&gt;
&lt;br /&gt;
The Metanet-specific data attributes listed above are used collectively to define a Metanet node and its position within a larger graph structure of multiple Metanet nodes, known as a ''Metanet graph''. &lt;br /&gt;
&lt;br /&gt;
It is possible that a node does not have any parents and such a node is termed a ''root node''. A root node will have null values for any &amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt; attributes, and can therefore use a valid signature from any public key in its input(s).&lt;br /&gt;
&lt;br /&gt;
A Metanet transaction is defined as a transaction that contains an OP_FALSE OP_RETURN payload containing:&lt;br /&gt;
&lt;br /&gt;
* The Metanet flag&lt;br /&gt;
[[File:Metanet_node.png|thumb|A Metanet node transaction.]]&lt;br /&gt;
* A node public key '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;'''&lt;br /&gt;
* A parent transaction ID '''&amp;lt;math&amp;gt;TxID_{parent}&amp;lt;/math&amp;gt;''' (null if a root node).&lt;br /&gt;
&lt;br /&gt;
In order to qualify as a Metanet-valid node, the transaction must also be signed by the public key corresponding to its parent '''&amp;lt;math&amp;gt;P_{parent}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
Any content data and its encoding can be included following these core Metanet attributes in the OP_FALSE OP_RETURN payload. The Metanet protocol does not specify the use of any one scheme for content data and additional attributes, and any valued usage of the Metanet protocol attributes above constitute a Metanet node transaction.&lt;br /&gt;
&lt;br /&gt;
A basic example of a Metanet node transaction that conforms to this format is shown in the diagram on the right.&lt;br /&gt;
&lt;br /&gt;
The Metanet graph is formed by creating edges between parent Metanet nodes and child Metanet nodes. An edge is created between a parent and child by the creation and insertion of the signature '''&amp;lt;math&amp;gt;SigP_{parent}&amp;lt;/math&amp;gt;''' in the child node, using the parent public key. [[File:Metanet_edge.png|thumb|The creation of a Metanet edge.]]&lt;br /&gt;
&lt;br /&gt;
The fact that this signature is in a transaction input means that the signature itself may be validated by Miners. This means that attempts to spoof a Metanet node can be mitigated either by validating the signature explicitly or by confirming that the node is spending an appropriate previous output.&lt;br /&gt;
&lt;br /&gt;
== Rules of the Metanet Protocol==&lt;br /&gt;
&lt;br /&gt;
The Metanet protocol specifies a simple and extensible rule set for creating Metanet graphs and data structures. The base rule set is the following:&lt;br /&gt;
&lt;br /&gt;
* Nodes are transactions.&lt;br /&gt;
* Edges are created by signatures.&lt;br /&gt;
* Each node is uniquely identified by the pair of attributes: '''&amp;lt;math&amp;gt;P_{node}&amp;lt;/math&amp;gt;''', '''&amp;lt;math&amp;gt;TxID_{node}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
* Each node must specify the node ID of itself and its parent: '''&amp;lt;math&amp;gt;ID_{node}&amp;lt;/math&amp;gt;''', '''&amp;lt;math&amp;gt;ID_{parent}&amp;lt;/math&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
The unique node identifier for a node is defined mathematically as '''&amp;lt;math&amp;gt;H(P_{node}||TxID_{node})&amp;lt;/math&amp;gt;''', where '''&amp;lt;math&amp;gt;H()&amp;lt;/math&amp;gt;''' is a cryptographic hash function.&lt;br /&gt;
&lt;br /&gt;
Metanet graph structures may be created using this base rule set alone. It is also possible to impose additional rules to Metanet graph structures to achieve different properties for data structures.&lt;br /&gt;
&lt;br /&gt;
A simple extension of the rule set is to impose the following [[constraint]]s:&lt;br /&gt;
[[File:Metanet_rules.png|thumb|A simple Metanet rule set.]]&lt;br /&gt;
&lt;br /&gt;
* The [[in-degree]] of a node should be 0 (no parent) or 1 (one parent).&lt;br /&gt;
* The [[out-degree]] of a node should be a free parameter.&lt;br /&gt;
&lt;br /&gt;
These additional rules allow domain-like structures to emerge as Metanet DAGs, which can be used to structure websites and file systems which inherit the permission structure of a Metanet graph.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Digital_signatures_in_Bitcoin&amp;diff=3059</id>
		<title>Digital signatures in Bitcoin</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Digital_signatures_in_Bitcoin&amp;diff=3059"/>
		<updated>2022-04-27T18:55:28Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [https://bitcoinsv.io/bitcoin.pdf Bitcoin whitepaper] describes an electronic coin as a chain of digital [[signatures]]. These digital signatures confer practical control, and in most cases, ownership over the coins held in any given script, and can be used as a record of custodial control to trace transfers of control back through the history of the ledger.&lt;br /&gt;
&lt;br /&gt;
[[File:Chain_of_Signatures.png|frame|centre|alt=Electronic coins are defined as a chain of digital signatures]]&lt;br /&gt;
&lt;br /&gt;
A digital signature isn't merely a message signed using a given keypair, but is a link to an identity. The European Union legislation on digital signatures states that signatures correspond to “data in electronic form which are attached to or logically associated with other electronic data and which serve as a method of authentication”. For more information, see [https://craigwright.net/blog/law-regulation/how-digital-signatures-work/ this article] from Dr Craig Wright.&lt;br /&gt;
&lt;br /&gt;
Bitcoin script allows users to lock/unlock their bitcoin in different ways.&lt;br /&gt;
&lt;br /&gt;
==Elliptical Curve Digital Signature Algorithm (ECDSA) ==&lt;br /&gt;
[[Elliptic Curve Digital Signature Algorithm]] is the most commonly used signature type in Bitcoin. It makes use of the elliptic curve cryptography keypairs referenced in [[Bitcoin address|Bitcoin addresses]] to generate secure signatures from a given message hash.&lt;br /&gt;
&lt;br /&gt;
Using Bitcoin Script, it is possible to create novel systems that use elliptical curve digital signatures, including [[R-Puzzles]], [[multisignature scripts]] and [[Threshold Signatures]].&lt;br /&gt;
&lt;br /&gt;
==Threshold Signatures==&lt;br /&gt;
There have also been practical implementations of [[Threshold Signatures]] in Bitcoin wallets and libraries, which extend Elliptic Curve signatures to enable multiple parties to participate in the creation of a signature, created from a private key that is never explicitly calculated or previously existed. When used in a transaction, a Threshold Signature is no different to a normal ECDSA signature and can be validated using [[OP_CHECKSIG]] and related signature check opcodes.&lt;br /&gt;
&lt;br /&gt;
==Rabin Signatures==&lt;br /&gt;
Researchers at nChain have begun developing methods of validating [https://nchain.com/app/uploads/2018/09/Rabin-Signatures-in-Bitcoin-Cash-v2.pdf Rabin signatures] in Bitcoin script. These signatures could theoretically allow for data collected outside the Bitcoin SV ledger to be evaluated and signed, allowing [[oracle]] functionality within Bitcoin transactions.&lt;br /&gt;
Currently no practical implementation of a Rabin signature in Bitcoin Script exists.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Oracle&amp;diff=3058</id>
		<title>Oracle</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Oracle&amp;diff=3058"/>
		<updated>2022-04-27T18:55:03Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;An oracle is an abstract machine that can study behaviour from decision problems and provide information from these problems as input that can be interpreted within a Turing c...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An oracle is an abstract machine that can study behaviour from decision problems and provide information from these problems as input that can be interpreted within a Turing complete system.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Open_BSV_License&amp;diff=3057</id>
		<title>Open BSV License</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Open_BSV_License&amp;diff=3057"/>
		<updated>2022-04-27T18:54:42Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;A license that grants permission to any person obtaining a copy of particular software and associated documentation files, to deal in the software without restriction subject...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A license that grants permission to any person obtaining a copy of particular software and associated documentation files, to deal in the software without restriction subject to certain conditions which includes that it can only be used on the Bitcoin SV blockchain.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Compression_function&amp;diff=3056</id>
		<title>Compression function</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Compression_function&amp;diff=3056"/>
		<updated>2022-04-27T18:51:55Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;A one-way compression function is a function that transforms two fixed-length inputs into a fixed-length output.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A one-way compression function is a function that transforms two fixed-length inputs into a fixed-length output.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=RIPEMD-160&amp;diff=3055</id>
		<title>RIPEMD-160</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=RIPEMD-160&amp;diff=3055"/>
		<updated>2022-04-27T18:51:23Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;RIPEMD-160 is a cryptographic hash function based upon the Merkle–Damgård construction. It is used in the Bitcoin standard. It is a strengthened version of the RIPEMD algorithm which produces a 128 bit hash digest while the RIPEMD-160 algorithm produces a 160-bit output. The compression function is made up of 80 stages, made up of 5 blocks, that run 16 times each. This pattern runs twice, with the results being combined at the bottom using modulo 32 addition.&lt;br /&gt;
&lt;br /&gt;
==Padding==&lt;br /&gt;
&lt;br /&gt;
The [[compression function]] works upon 16 32-bit unsigned words. This requires the message to be padded to a multiple of 512 bits and the byte stream input to be padded into 32-bit words. The padding scheme is identical to MD4 using Merkle–Damgård strengthening to prevent length extension attacks. This consists of a one being added to the end of the message, and the length of the message (in bits) being added to the end of the block. The bytes are pushed into the word low end first. Here are 4 examples of messages being padded into a word to show the possible patterns for different message lengths:&lt;br /&gt;
&lt;br /&gt;
[[File:Ripemd padding.png|300px|center|alt=Padding|]]&lt;br /&gt;
&lt;br /&gt;
The length of the message should then be added to the second-to-last element (the length is saved as a 64-bit value across the last 2 words, but it is unlikely the message will be this long; 32-bits will certainly suffice for Bitcoin software.)&lt;br /&gt;
&lt;br /&gt;
==Compression Function==&lt;br /&gt;
&lt;br /&gt;
[[File:RIPEMD160 block.png|thumb|upright=1.2|alt=Sub block.|Sub block of the compression function.]]&lt;br /&gt;
[[File:RIPEMD160 compression function.png|thumb|upright=1.2|alt=Compression function.|The full compression function.]]&lt;br /&gt;
&lt;br /&gt;
The compression function is made up of a variable sub block that the message block is passed through 16 times. There are 5 different variations for a total of 80 runs. This process occurs twice, with the data meeting at the bottom, to be moved on to the next block (if there is one), or added to the hash register if there isn't. The sub block can be varied by the design of, a nonlinear function, the order in which the message block is read in per round, the amount of a left rotate and a k constant. The design of the sub block and the overall layout of the compression function is shown to the right. &lt;br /&gt;
&lt;br /&gt;
Pseudocode for the process:&lt;br /&gt;
&lt;br /&gt;
 for(i := 0 to blocks - 1) {&lt;br /&gt;
     aLeft := h0&lt;br /&gt;
     bLeft := h1&lt;br /&gt;
     cLeft := h2&lt;br /&gt;
     dLeft := h3&lt;br /&gt;
     eLeft := h4&lt;br /&gt;
 &lt;br /&gt;
     aRight := h0&lt;br /&gt;
     bRight := h1&lt;br /&gt;
     cRight := h2&lt;br /&gt;
     dRight := h3&lt;br /&gt;
     eRight := h4&lt;br /&gt;
 &lt;br /&gt;
     for(int j := 0 to 79) {&lt;br /&gt;
         t := rotleft(s[j]) (aLeft + f(bLeft, cLeft, dLeft) + X[r[i]]) + eLeft&lt;br /&gt;
         aLeft := eLeft;&lt;br /&gt;
         eLeft := dLeft&lt;br /&gt;
         dLeft := rotleft(10) (c)&lt;br /&gt;
         cLeft := bLeft&lt;br /&gt;
         bLeft := t&lt;br /&gt;
 &lt;br /&gt;
         Do same for right&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     t := h1 + cLeft + dRight&lt;br /&gt;
     h1 := h2 + dLeft + eRight&lt;br /&gt;
     h2 := h3 + eLeft + aRight&lt;br /&gt;
     h3 := h4 + aLeft + bRight&lt;br /&gt;
     h4 := h0 + bLeft + cRight&lt;br /&gt;
     h0 := t&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The nonlinear functions are applied in the opposite directions, up and down the left and right lines. The design of the functions from top to bottom, on the left, and bottom to top, on the right, are (Java syntax for operations):&lt;br /&gt;
&lt;br /&gt;
# x ^ y ^ z&lt;br /&gt;
# (x &amp;amp; y) | (~x &amp;amp; z)&lt;br /&gt;
# (x | ~y) ^ z&lt;br /&gt;
# (x &amp;amp; z) | (y &amp;amp; ~z)&lt;br /&gt;
# z ^ (y | ~z)&lt;br /&gt;
&lt;br /&gt;
The k values for left, from top to bottom are:&lt;br /&gt;
&lt;br /&gt;
# 0x00000000&lt;br /&gt;
# 0x5A827999&lt;br /&gt;
# 0x6ED9EBA1&lt;br /&gt;
# 0X8F1BBCDC&lt;br /&gt;
# 0XA953FD4E&lt;br /&gt;
&lt;br /&gt;
The k values for right, from top to bottom are:&lt;br /&gt;
&lt;br /&gt;
# 0x50A28BE6&lt;br /&gt;
# 0x5C4DD124&lt;br /&gt;
# 0x6D703EF3&lt;br /&gt;
# 0x7A6D76E9&lt;br /&gt;
# 0x00000000&lt;br /&gt;
&lt;br /&gt;
The order in which the words should be selected from the block array X for the left-hand-side are (each sub array within the 2D array represents a round. The array at the top, represents the round at the top, and the array at the bottom, represents the round at the bottom):&lt;br /&gt;
&lt;br /&gt;
 {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, //Round 1&lt;br /&gt;
 {7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8}, //Round 2&lt;br /&gt;
 {3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12}, //Round 3&lt;br /&gt;
 {1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2}, //Round 4&lt;br /&gt;
 {4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13}} //Round 5&lt;br /&gt;
&lt;br /&gt;
The order in which the words should be selected from the array X for the right-hand-side are (following the same pattern as above):&lt;br /&gt;
&lt;br /&gt;
 {{5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12}, //Round 1&lt;br /&gt;
 {6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2}, //Round 2&lt;br /&gt;
 {15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13}, //Round 3&lt;br /&gt;
 {8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14}, //Round 4&lt;br /&gt;
 {12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11}} //Round 5&lt;br /&gt;
&lt;br /&gt;
The order of the left rotates on the left-hand-side are:&lt;br /&gt;
 &lt;br /&gt;
 {{11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8}, //Round 1&lt;br /&gt;
 {7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12}, //Round 2&lt;br /&gt;
 {11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5}, //Round 3&lt;br /&gt;
 {11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12}, //Round 4&lt;br /&gt;
 {9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6}} //Round 5&lt;br /&gt;
&lt;br /&gt;
The order of the left rotates on the right-hand-side are:&lt;br /&gt;
&lt;br /&gt;
 {{8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6}, //Round 1&lt;br /&gt;
 {9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11}, //Round 2&lt;br /&gt;
 {9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5}, //Round 3&lt;br /&gt;
 {15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8}, //Round 4&lt;br /&gt;
 {8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11}}; //Round 5&lt;br /&gt;
&lt;br /&gt;
==Attribution==&lt;br /&gt;
This content is based on content sourced from https://en.bitcoin.it/wiki/RIPEMD-160 under [https://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0]. Although it may have been extensively revised and updated, we acknowledge the original authors.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Numeric_Value_Size&amp;diff=3054</id>
		<title>Numeric Value Size</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Numeric_Value_Size&amp;diff=3054"/>
		<updated>2022-04-27T18:48:44Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;A rule introduced in the Genesis upgrade whereby for a byte sequence to validly represent a numeric value, the length of the byte sequence must be less than or equal to 750,00...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rule introduced in the Genesis upgrade whereby for a byte sequence to validly represent a numeric value, the length of the byte sequence must be less than or equal to 750,000 bytes.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Genesis_upgrade&amp;diff=3053</id>
		<title>Genesis upgrade</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Genesis_upgrade&amp;diff=3053"/>
		<updated>2022-04-27T18:48:04Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Genesis was a major update to the BitcoinSV mining client used by the majority of Miners on the BitcoinSV network at the time. Genesis went into effect at block height [https://whatsonchain.com/block-height/620538 620538] which was mined with a timestamp of 01:35:06 UTC on the 4th of February 2020.&lt;br /&gt;
&lt;br /&gt;
The upgrade restored many aspects of the Bitcoin protocol that had been modified in previous software updates including the removal of most limit based consensus rules, replacing them with Miner configurable settings that give node operators the autonomy needed to set their own limits as they determine are practical. &lt;br /&gt;
&lt;br /&gt;
The upgrade was locked in when [https://whatsonchain.com/tx/4ec3b63d764558303eda720e8e51f69bbcfe81376075657313fb587306f8a9b0 this transaction] was mined at block height 620539. The transaction uses a script that would previously have been considered to violate the protocol rules and rejected by network nodes running the BitcoinSV node client.&lt;br /&gt;
&lt;br /&gt;
Further details on the changes made in the upgrade can be found [https://bitcoinsv.io/2020/01/15/changes-for-the-genesis-upgrade/ here] and the full specification is available [https://github.com/bitcoin-sv-specs/protocol/blob/master/updates/genesis-spec.md here].&lt;br /&gt;
&lt;br /&gt;
==Block Consensus Rules==&lt;br /&gt;
These consensus rules apply to blocks that are produced after Genesis activation.&lt;br /&gt;
&lt;br /&gt;
* [[Block Size Rule]] - The consensus rule that restricts the maximum size of a block to a specific number of bytes has been converted into a configurable consensus rule. The size of a block is the size in bytes of the serialised form of the block including the block header and all of the transactions confirmed by the block. MINERS ARE EXPECTED TO REACH CONSENSUS ON THIS VALUE AND CONFIGURE IT MANUALLY.&lt;br /&gt;
	&lt;br /&gt;
* Number of CheckSig Operations per MB of Block Space - The consensus rule that limits the number of checksig operations per megabyte of block space has been removed.&lt;br /&gt;
&lt;br /&gt;
==Transaction Consensus Rules==&lt;br /&gt;
These consensus rules apply to transactions that are confirmed in blocks after Genesis activation.&lt;br /&gt;
&lt;br /&gt;
* Maximum Transaction Size - The size of a transaction is the size in bytes of the serialised form of the transaction. The maximum size of a transaction is 1GB (1,000,000,000 bytes). This limitation is expected to be lifted in the future.&lt;br /&gt;
	&lt;br /&gt;
* Maximum Number of CheckSig Operations per Transaction - The consensus rule that limits the number of checksig operations per transaction has been removed.&lt;br /&gt;
	&lt;br /&gt;
* nLockTime and nSequence - After Genesis activation, the functionality of the nLockTime field of a transaction and the nSequence fields of transaction inputs revert to their original purpose. The rules defined here only apply to transactions that are confirmed after Genesis activation.&lt;br /&gt;
&lt;br /&gt;
==Script Language Rules==&lt;br /&gt;
This section contains changes to the Script Language Rules. &lt;br /&gt;
Bitcoin Script is the programming language that is used to lock and unlock transaction outputs.  More can be found at: [https://wiki.bitcoinsv.io/index.php/Advanced_Bitcoin_Scripting Advanced Bitcoin Scripting]. The rules defined here apply to locking and unlocking scripts for transaction outputs that are created after the Genesis activation. The previous rules apply to transaction outputs created prior to Genesis activation.&lt;br /&gt;
&lt;br /&gt;
===OP_RETURN Functionality===&lt;br /&gt;
&lt;br /&gt;
The functionality of the OP_RETURN operation is being restored. OP_RETURN will cause termination of the script and the validity of the script is determined by the value of the top item on the stack. See [https://wiki.bitcoinsv.io/index.php/OP_RETURN OP_RETURN].&lt;br /&gt;
&lt;br /&gt;
===Data Types===&lt;br /&gt;
&lt;br /&gt;
All data items in Bitcoin Script are a byte sequence. Some operations interpret their parameters as numeric or boolean values and require the item to fulfill the requirements of those types. Some operations produce items on the stack which are valid numeric or boolean values.&lt;br /&gt;
&lt;br /&gt;
===Bitcoin Script Formal Grammar===&lt;br /&gt;
&lt;br /&gt;
Formal grammar has been defined for Bitcoin Script. More can be found at: [https://wiki.bitcoinsv.io/index.php/Opcodes_used_in_Bitcoin_Script Opcodes used in Bitcoin Scripting].&lt;br /&gt;
&lt;br /&gt;
* Validity of Script Consensus Rule - The locking and unlocking scripts for every input of a transaction must be grammatically valid, as defined by the formal grammar above.&lt;br /&gt;
&lt;br /&gt;
* PUSHDATA Only in Unlocking Script Consensus Rule - After Genesis activation, the unlocking scripts used in transaction inputs may only contain PUSHDATA operations, as defined by the formal grammar. In contrast to all the other updates in this section, this consensus rule is activated for all inputs of transactions that are, or will be, confirmed in a block after Genesis activation, regardless of the height of the UTXO being spent. This rule is a subset of the Validity of Script Consensus Rule defined above but is included separately because the activation conditions are different.&lt;br /&gt;
&lt;br /&gt;
===Consensus Rule Replacement===&lt;br /&gt;
&lt;br /&gt;
Functionality provided by these consensus rules is now covered by the Stack Memory Usage Consensus Rule.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Consensus Rule&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Script Element Size&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Limits the maximum size of a script element.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Stack Size&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Limits the combined number of elements that can be placed on the stack and the altstack.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Script Size*&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;The maximum size of the script&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Number of Non-Push Operations per Script&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Limits the number &lt;br /&gt;
 of non-push operations per script. Other capabilities manage the cost of execution.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
*functionality also covered by the Maximum Transaction Size Consensus Rule.&lt;br /&gt;
&lt;br /&gt;
===Consensus Rule Changes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Consensus Rule&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Numeric Value Size]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;For a byte sequence to represent validly a numeric value, the length of the byte sequence must be less than or equal to 750,000 bytes. A byte sequence that is larger than this is a valid byte sequence but is not a valid numeric value.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Number of Public Keys per Multisig Consensus Rule&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Limits the number of public keys per multisig has been changed to be 2^31-1 (INT32_MAX).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Stack Memory Usage&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Limits the amount of memory that can be used on the stacks. This rule is evaluated against the sum of the memory used by the stack and the memory used by the altstack.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Sunsetting===&lt;br /&gt;
&lt;br /&gt;
* P2SH, OP_CHECKLOCKTIMEVERIFY, and OP_CHECKSEQUENCEVERIFY - The P2SH capability is being removed by the Genesis upgrade and the presence of a P2SH script template in an output will invalidate a transaction. The opcode operations revert to NOPs, which have no effect.&lt;br /&gt;
&lt;br /&gt;
* Disabling Operations Consensus Rule - OP_2MUL, OP_2DIV, OP_VERIF, OP_VERNOTIF. If they are present in un-executed script, the script execution may succeed.&lt;br /&gt;
&lt;br /&gt;
==Standard Local Policies==&lt;br /&gt;
&lt;br /&gt;
Policies are settings that are configured by software operators. These settings are generally required by software implementations.&lt;br /&gt;
&lt;br /&gt;
Policies control which transactions the software will propagate across the P2P network or include in a block. However, policies are not Bitcoin Rules or Consensus Rules and are not used to determine the validity of blocks or the transactions confirmed by the block.&lt;br /&gt;
&lt;br /&gt;
Standard Local Transaction Policies	&lt;br /&gt;
* Maximum Acceptable Transaction Size Policy - The maximum acceptable transaction size is a standard policy that configures the largest transactions that the software will propagate across the P2P network or include in a block.&lt;br /&gt;
* Transaction Evaluation Timeout - The transaction evaluation timeout is a standard policy that defines the maximum amount of time that the software will allow for the evaluation of a transaction, before terminating the evaluation and rejecting the it. This setting is always defined with a time unit and the default value 1 second.&lt;br /&gt;
&lt;br /&gt;
Standard Local Script Language Policies&lt;br /&gt;
* Numeric Value Length - the length of numeric value policy defines the maximum length of a byte sequence to be considered a valid numeric value. The default value for this value is 250,000 bytes.&lt;br /&gt;
* Stack Memory Usage - The stack memory usage policy limits the amount of memory that can be used on the stacks. This policy is evaluated against the sum of memory used by the stack and the altstack.&lt;br /&gt;
&lt;br /&gt;
Standard Local P2P Network Policies&lt;br /&gt;
* Propagation of non-Standard Transactions - After Genesis activation, the default setting for this policy is that non-standard transactions will be propagated across the P2P network. Before Genesis activation, the default setting for this policy was non-standard transactions were not propagated by the P2P Network. Policies such as Maximum Acceptable Transaction Size Policy still apply.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=NFT&amp;diff=3052</id>
		<title>NFT</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=NFT&amp;diff=3052"/>
		<updated>2022-04-27T18:46:46Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;A Non-Fungible Token (NFT) is a token with a unique attribute, creation and existence. It cannot be substituted for any other token.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Non-Fungible Token (NFT) is a token with a unique attribute, creation and existence. It cannot be substituted for any other token.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Non-custodial&amp;diff=3051</id>
		<title>Non-custodial</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Non-custodial&amp;diff=3051"/>
		<updated>2022-04-27T16:34:22Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;A service or client that stores a digital asset for which either no one, or only you have access to the private keys that can sign transactions and messages or generate a rece...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A service or client that stores a digital asset for which either no one, or only you have access to the private keys that can sign transactions and messages or generate a receiving alias.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Custodial&amp;diff=3050</id>
		<title>Custodial</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Custodial&amp;diff=3050"/>
		<updated>2022-04-27T16:34:06Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A custodial service is a service that stores a digital asset on your behalf for which you can send and receive transactions from it, yet cannot access the [[private key]]s.&lt;br /&gt;
&lt;br /&gt;
This differs from a [[non-custodial]] service in which the service or client that stores the digital asset cannot access the keys, but provides a service from which users can send and receive transactions.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Block_chain&amp;diff=2736</id>
		<title>Block chain</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Block_chain&amp;diff=2736"/>
		<updated>2022-01-08T15:05:05Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Bitcoin '''blockchain''' is the transaction database that is extended by nodes participating in the [[mining]] process on the Bitcoin network.  The blockchain contains [[transactions]] validated and processed by nodes on the network. Using the blockchain anyone can add and verify a record of all of the [[confirmation|confirmed]] transactions that have taken place on the ledger up until the most recent block was found.&lt;br /&gt;
&lt;br /&gt;
Every [[block]] contains a reference to the block it builds upon. This has the effect of creating a chain of blocks from the [[genesis block]] to the current block. Modifying blocks that have been added to is an economic consideration that becomes impractical once they have been extended for longer periods of time due to the amount of [[Proof of Work|work]] that would need to be regenerated.&lt;br /&gt;
&lt;br /&gt;
Nodes extend the blockchain by building on what they consider to be the most recent valid block, in the longest chain of proof of work. Nodes can dispute blocks by choosing ''not'' to build upon them. Any block that does not become part of the longest chain of work is referred to as an [[Orphan Block]].&lt;br /&gt;
&lt;br /&gt;
For any block on the chain, there is only one path back to the genesis block. Coming from the genesis block, however, there can be divergence in the chain. Forks are created from time to time when two valid blocks are created just a few seconds apart, sparking what's known as an orphan race. When this occurs, each node will attempt to build a new block upon whichever of the competing blocks they received first. This has the effect of creating a very strong incentive for nodes to form a [[Nearly Complete Graph]] as a means to minimise the propagation time of blocks. When a new block is found, the block it was built upon has a much greater chance of becoming part of the longest chain and orphaning its competitor.&lt;br /&gt;
&lt;br /&gt;
If a node detects the creation of a longer chain than the one it is working on, all valid transactions of the block template inside the shorter chain are re-added to the pool of queued transactions to be included in a new block. The reward for the blocks on the shorter chain will not be present in the longest chain, so they will be practically lost, which is why a network-enforced 100-block maturation time for spending [[coinbase|coinbase transactions]] exists.&lt;br /&gt;
&lt;br /&gt;
Because the protocol specifies that a block must only reference one previous block, it is impossible for two forked chains to merge.&lt;br /&gt;
&lt;br /&gt;
Blocks are broadcast to all nodes on the network using the [[Bitcoin Network]] protocol.&lt;br /&gt;
&lt;br /&gt;
==Attribution==&lt;br /&gt;
This content is based on content sourced from https://en.bitcoin.it/wiki/Block_chain under [https://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0]. Although it may have been extensively revised and updated, we acknowledge the original authors.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Dust_Limit&amp;diff=2732</id>
		<title>Dust Limit</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Dust_Limit&amp;diff=2732"/>
		<updated>2021-07-20T19:34:26Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In Bitcoin’s past developers implemented a protective mechanism for Bitcoin transactions called the Dust Limit. This limit was put in place as an attempt to prevent people from creating outputs that could become unspendable. In short, the Dust Limit is a threshold of satoshis that cannot be spent in an output.&lt;br /&gt;
&lt;br /&gt;
A typical Bitcoin transaction looks something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Bitcoin_transaction_example.png|centre|alt=Bitcoin transaction with multiple inputs and outputs]]&lt;br /&gt;
&lt;br /&gt;
In this typical Bitcoin transaction, the values paid (in satoshis) is very large in comparison to the fee. Microtransactions are possible in Bitcoin because the fee paid is so low that small outputs can be created that are still large in proportion to the fees paid. However, there does exist a lower bound to what makes sense economically when creating outputs in transactions. If an output is small enough, any fee required to spend that output could be higher than the amount of satoshis in the output:&lt;br /&gt;
&lt;br /&gt;
[[File:Dust_limit_transaction.png|centre|alt=Dust Limit Transaction Not Allowed]]&lt;br /&gt;
&lt;br /&gt;
In the above example, the dust limit, set by the node to be higher than 10 satoshis, prevents 10 satoshi outputs from being created to prevent a situation where an output is unspendable due to fee requirements. The dust limit is entirely set by miner policy, meaning it is not a consensus limitation, but instead is configurable by miners.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Consolidation Transactions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beginning in Bitcoin SV Node software v1.0.5, the software automatically allows for the creation of “consolidation transactions” where dust outputs can be consolidated for free into larger usable inputs. Outputs below the dust limit are accepted if the node parameter acceptnonstdconsolidationinput is set to 1. &lt;br /&gt;
&lt;br /&gt;
[[File:Consolidation_transaction_example.png|centre|alt=Consolidation Transaction Example]]&lt;br /&gt;
&lt;br /&gt;
Because miners have to store the entire UTXO set, it is in their interest to reduce the size of the UTXO set whenever possible. It is for this reason that allowing these transactions without a fee is in both the customer and miners' interests. &lt;br /&gt;
&lt;br /&gt;
In the above example we see a normal transaction with additional 10 satoshi outputs attached. The recipient of these outputs simply collects enough of them to meet the criteria for a free consolidation transaction then converts the collective value of 1000 inputs into a single, higher-value output. The size of the UTXO database is reduced by 999 entries.&lt;br /&gt;
&lt;br /&gt;
In order for a transaction to be classified as consolidation by the Bitcoin SV software, some strict conditions must be met. A consolidation transaction is a transaction that reduces the number of UTXO’s by a margin that is more valuable for the network than the implied fee. Hence we allow consolidation transactions free from any fees.&lt;br /&gt;
&lt;br /&gt;
The conditions for a consolidation transaction are as follows:&lt;br /&gt;
&lt;br /&gt;
*The scriptPubKey sizes from the transaction outputs spent are compared to the scriptPubKey sizes of the consolidation transaction. The sum of the former must be greater than the sum of the latter multiplied by the consolidation factor (configuration parameter: minconsolidationfactor)&lt;br /&gt;
&lt;br /&gt;
*The transaction input count must be greater than the transaction outputs count multiplied by minconsolidationfactor&lt;br /&gt;
&lt;br /&gt;
*All inputs must have a confirmation count of at least minconsolidationinputmaturity.&lt;br /&gt;
&lt;br /&gt;
*scriptSig sizes of the consolidation transaction have an upper limit of  maxconsolidationinputscriptsize bytes long to prevent gaming.&lt;br /&gt;
&lt;br /&gt;
*Inputs spent in consolidation transactions must meet the old test of isStandard() if acceptnonstdconsolidationinput equals 0&lt;br /&gt;
&lt;br /&gt;
*The default value for maxconsolidationinputscriptsize is 150 bytes.&lt;br /&gt;
&lt;br /&gt;
*The default value for minconsolidationfactor is 20&lt;br /&gt;
&lt;br /&gt;
*The default value for minconsolidationinputmaturity is 6 (equivalent to one hour)&lt;br /&gt;
&lt;br /&gt;
*The default value for acceptnonstdconsolidationinput is 0 meaning only standard inputs allowed&lt;br /&gt;
&lt;br /&gt;
*Setting minconsolidationfactor to 0 disables the free consolidation transactions feature&lt;br /&gt;
&lt;br /&gt;
The condition as the formula is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       c = minconsolidationfactor&lt;br /&gt;
       m = minconsolidationinputmaturity&lt;br /&gt;
       s = maxconsolidationinputscriptsize&lt;br /&gt;
       a = acceptnonstdconsolidationinput&lt;br /&gt;
       isFree =  nInputs &amp;gt;= c * nOutputs&lt;br /&gt;
              &amp;amp;&amp;amp; confirmationCount(input) &amp;gt;= m for all inputs &lt;br /&gt;
              &amp;amp;&amp;amp; sum(inputTxScriptPubKeyBytesLen[]) &amp;gt;= c * sum(outputTxScripPubKeytBytesLen[])&lt;br /&gt;
              &amp;amp;&amp;amp; inputTxScriptSig &amp;lt;= s for all inputTxScriptSig&lt;br /&gt;
              &amp;amp;&amp;amp; isStandardInput(input) for all inputs unless a == 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a general rule of thumb:&lt;br /&gt;
&lt;br /&gt;
*Consolidate at least 100 inputs to one output.&lt;br /&gt;
&lt;br /&gt;
*Only use standard p2pkh inputs or bare multisig with no more than 2 signatures.&lt;br /&gt;
&lt;br /&gt;
*Only use inputs confirmed for at least 6 blocks.&lt;br /&gt;
&lt;br /&gt;
**This rule can be gotten around simply by constructing the transaction using all available inputs but not broadcasting it until 6 blocks after you made it.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Dust_Limit&amp;diff=2731</id>
		<title>Dust Limit</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Dust_Limit&amp;diff=2731"/>
		<updated>2021-07-20T19:33:54Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In Bitcoin’s past developers implemented a protective mechanism for Bitcoin transactions called the Dust Limit. This limit was put in place as an attempt to prevent people from creating outputs that could become unspendable. In short, the Dust Limit is a threshold of satoshis that cannot be spent in an output.&lt;br /&gt;
&lt;br /&gt;
A typical Bitcoin transaction looks something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Bitcoin_transaction_example.png|centre|alt=Bitcoin transaction with multiple inputs and outputs]]&lt;br /&gt;
&lt;br /&gt;
In this typical Bitcoin transaction, the values paid (in satoshis) is very large in comparison to the fee. Microtransactions are possible in Bitcoin because the fee paid is so low that small outputs can be created that are still large in proportion to the fees paid. However, there does exist a lower bound to what makes sense economically when creating outputs in transactions. If an output is small enough, any fee required to spend that output could be higher than the amount of satoshis in the output:&lt;br /&gt;
&lt;br /&gt;
[[File:Dust_limit_transaction.png|centre|alt=Dust Limit Transaction Not Allowed]]&lt;br /&gt;
&lt;br /&gt;
In the above example, the dust limit, set by the node to be higher than 10 satoshis, prevents 10 satoshi outputs from being created to prevent a situation where an output is unspendable due to fee requirements. The dust limit is entirely set by miner policy, meaning it is not a consensus limitation, but instead is configurable by miners.  &lt;br /&gt;
&lt;br /&gt;
Consolidation Transactions&lt;br /&gt;
&lt;br /&gt;
Beginning in Bitcoin SV Node software v1.0.5, the software automatically allows for the creation of “consolidation transactions” where dust outputs can be consolidated for free into larger usable inputs. Outputs below the dust limit are accepted if the node parameter acceptnonstdconsolidationinput is set to 1. &lt;br /&gt;
&lt;br /&gt;
[[File:Consolidation_transaction_example.png|centre|alt=Consolidation Transaction Example]]&lt;br /&gt;
&lt;br /&gt;
Because miners have to store the entire UTXO set, it is in their interest to reduce the size of the UTXO set whenever possible. It is for this reason that allowing these transactions without a fee is in both the customer and miners' interests. &lt;br /&gt;
&lt;br /&gt;
In the above example we see a normal transaction with additional 10 satoshi outputs attached. The recipient of these outputs simply collects enough of them to meet the criteria for a free consolidation transaction then converts the collective value of 1000 inputs into a single, higher-value output. The size of the UTXO database is reduced by 999 entries.&lt;br /&gt;
&lt;br /&gt;
In order for a transaction to be classified as consolidation by the Bitcoin SV software, some strict conditions must be met. A consolidation transaction is a transaction that reduces the number of UTXO’s by a margin that is more valuable for the network than the implied fee. Hence we allow consolidation transactions free from any fees.&lt;br /&gt;
&lt;br /&gt;
The conditions for a consolidation transaction are as follows:&lt;br /&gt;
&lt;br /&gt;
*The scriptPubKey sizes from the transaction outputs spent are compared to the scriptPubKey sizes of the consolidation transaction. The sum of the former must be greater than the sum of the latter multiplied by the consolidation factor (configuration parameter: minconsolidationfactor)&lt;br /&gt;
&lt;br /&gt;
*The transaction input count must be greater than the transaction outputs count multiplied by minconsolidationfactor&lt;br /&gt;
&lt;br /&gt;
*All inputs must have a confirmation count of at least minconsolidationinputmaturity.&lt;br /&gt;
&lt;br /&gt;
*scriptSig sizes of the consolidation transaction have an upper limit of  maxconsolidationinputscriptsize bytes long to prevent gaming.&lt;br /&gt;
&lt;br /&gt;
*Inputs spent in consolidation transactions must meet the old test of isStandard() if acceptnonstdconsolidationinput equals 0&lt;br /&gt;
&lt;br /&gt;
*The default value for maxconsolidationinputscriptsize is 150 bytes.&lt;br /&gt;
&lt;br /&gt;
*The default value for minconsolidationfactor is 20&lt;br /&gt;
&lt;br /&gt;
*The default value for minconsolidationinputmaturity is 6 (equivalent to one hour)&lt;br /&gt;
&lt;br /&gt;
*The default value for acceptnonstdconsolidationinput is 0 meaning only standard inputs allowed&lt;br /&gt;
&lt;br /&gt;
*Setting minconsolidationfactor to 0 disables the free consolidation transactions feature&lt;br /&gt;
&lt;br /&gt;
The condition as the formula is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       c = minconsolidationfactor&lt;br /&gt;
       m = minconsolidationinputmaturity&lt;br /&gt;
       s = maxconsolidationinputscriptsize&lt;br /&gt;
       a = acceptnonstdconsolidationinput&lt;br /&gt;
       isFree =  nInputs &amp;gt;= c * nOutputs&lt;br /&gt;
              &amp;amp;&amp;amp; confirmationCount(input) &amp;gt;= m for all inputs &lt;br /&gt;
              &amp;amp;&amp;amp; sum(inputTxScriptPubKeyBytesLen[]) &amp;gt;= c * sum(outputTxScripPubKeytBytesLen[])&lt;br /&gt;
              &amp;amp;&amp;amp; inputTxScriptSig &amp;lt;= s for all inputTxScriptSig&lt;br /&gt;
              &amp;amp;&amp;amp; isStandardInput(input) for all inputs unless a == 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a general rule of thumb:&lt;br /&gt;
&lt;br /&gt;
*Consolidate at least 100 inputs to one output.&lt;br /&gt;
&lt;br /&gt;
*Only use standard p2pkh inputs or bare multisig with no more than 2 signatures.&lt;br /&gt;
&lt;br /&gt;
*Only use inputs confirmed for at least 6 blocks.&lt;br /&gt;
&lt;br /&gt;
**This rule can be gotten around simply by constructing the transaction using all available inputs but not broadcasting it until 6 blocks after you made it.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Dust_Limit&amp;diff=2730</id>
		<title>Dust Limit</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Dust_Limit&amp;diff=2730"/>
		<updated>2021-07-20T19:33:07Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In Bitcoin’s past developers implemented a protective mechanism for Bitcoin transactions called the Dust Limit. This limit was put in place as an attempt to prevent people from creating outputs that could become unspendable. In short, the Dust Limit is a threshold of satoshis that cannot be spent in an output.&lt;br /&gt;
&lt;br /&gt;
A typical Bitcoin transaction looks something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Bitcoin_transaction_example.png|centre|alt=Bitcoin transaction with multiple inputs and outputs]]&lt;br /&gt;
&lt;br /&gt;
In this typical Bitcoin transaction, the values paid (in satoshis) is very large in comparison to the fee. Microtransactions are possible in Bitcoin because the fee paid is so low that small outputs can be created that are still large in proportion to the fees paid. However, there does exist a lower bound to what makes sense economically when creating outputs in transactions. If an output is small enough, any fee required to spend that output could be higher than the amount of satoshis in the output:&lt;br /&gt;
&lt;br /&gt;
[[File:Dust_limit_example.png|centre|alt=Dust Limit Transaction Not Allowed]]&lt;br /&gt;
&lt;br /&gt;
In the above example, the dust limit, set by the node to be higher than 10 satoshis, prevents 10 satoshi outputs from being created to prevent a situation where an output is unspendable due to fee requirements. The dust limit is entirely set by miner policy, meaning it is not a consensus limitation, but instead is configurable by miners.  &lt;br /&gt;
&lt;br /&gt;
Consolidation Transactions&lt;br /&gt;
&lt;br /&gt;
Beginning in Bitcoin SV Node software v1.0.5, the software automatically allows for the creation of “consolidation transactions” where dust outputs can be consolidated for free into larger usable inputs. Outputs below the dust limit are accepted if the node parameter acceptnonstdconsolidationinput is set to 1. &lt;br /&gt;
&lt;br /&gt;
[[File:Consolidation_transaction_example.png|centre|alt=Consolidation Transaction Example]]&lt;br /&gt;
&lt;br /&gt;
Because miners have to store the entire UTXO set, it is in their interest to reduce the size of the UTXO set whenever possible. It is for this reason that allowing these transactions without a fee is in both the customer and miners' interests. &lt;br /&gt;
&lt;br /&gt;
In the above example we see a normal transaction with additional 10 satoshi outputs attached. The recipient of these outputs simply collects enough of them to meet the criteria for a free consolidation transaction then converts the collective value of 1000 inputs into a single, higher-value output. The size of the UTXO database is reduced by 999 entries.&lt;br /&gt;
&lt;br /&gt;
In order for a transaction to be classified as consolidation by the Bitcoin SV software, some strict conditions must be met. A consolidation transaction is a transaction that reduces the number of UTXO’s by a margin that is more valuable for the network than the implied fee. Hence we allow consolidation transactions free from any fees.&lt;br /&gt;
&lt;br /&gt;
The conditions for a consolidation transaction are as follows:&lt;br /&gt;
&lt;br /&gt;
*The scriptPubKey sizes from the transaction outputs spent are compared to the scriptPubKey sizes of the consolidation transaction. The sum of the former must be greater than the sum of the latter multiplied by the consolidation factor (configuration parameter: minconsolidationfactor)&lt;br /&gt;
&lt;br /&gt;
*The transaction input count must be greater than the transaction outputs count multiplied by minconsolidationfactor&lt;br /&gt;
&lt;br /&gt;
*All inputs must have a confirmation count of at least minconsolidationinputmaturity.&lt;br /&gt;
&lt;br /&gt;
*scriptSig sizes of the consolidation transaction have an upper limit of  maxconsolidationinputscriptsize bytes long to prevent gaming.&lt;br /&gt;
&lt;br /&gt;
*Inputs spent in consolidation transactions must meet the old test of isStandard() if acceptnonstdconsolidationinput equals 0&lt;br /&gt;
&lt;br /&gt;
*The default value for maxconsolidationinputscriptsize is 150 bytes.&lt;br /&gt;
&lt;br /&gt;
*The default value for minconsolidationfactor is 20&lt;br /&gt;
&lt;br /&gt;
*The default value for minconsolidationinputmaturity is 6 (equivalent to one hour)&lt;br /&gt;
&lt;br /&gt;
*The default value for acceptnonstdconsolidationinput is 0 meaning only standard inputs allowed&lt;br /&gt;
&lt;br /&gt;
*Setting minconsolidationfactor to 0 disables the free consolidation transactions feature&lt;br /&gt;
&lt;br /&gt;
The condition as the formula is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       c = minconsolidationfactor&lt;br /&gt;
       m = minconsolidationinputmaturity&lt;br /&gt;
       s = maxconsolidationinputscriptsize&lt;br /&gt;
       a = acceptnonstdconsolidationinput&lt;br /&gt;
       isFree =  nInputs &amp;gt;= c * nOutputs&lt;br /&gt;
              &amp;amp;&amp;amp; confirmationCount(input) &amp;gt;= m for all inputs &lt;br /&gt;
              &amp;amp;&amp;amp; sum(inputTxScriptPubKeyBytesLen[]) &amp;gt;= c * sum(outputTxScripPubKeytBytesLen[])&lt;br /&gt;
              &amp;amp;&amp;amp; inputTxScriptSig &amp;lt;= s for all inputTxScriptSig&lt;br /&gt;
              &amp;amp;&amp;amp; isStandardInput(input) for all inputs unless a == 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a general rule of thumb:&lt;br /&gt;
&lt;br /&gt;
*Consolidate at least 100 inputs to one output.&lt;br /&gt;
&lt;br /&gt;
*Only use standard p2pkh inputs or bare multisig with no more than 2 signatures.&lt;br /&gt;
&lt;br /&gt;
*Only use inputs confirmed for at least 6 blocks.&lt;br /&gt;
&lt;br /&gt;
**This rule can be gotten around simply by constructing the transaction using all available inputs but not broadcasting it until 6 blocks after you made it.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=File:Consolidation_transaction_example.png&amp;diff=2729</id>
		<title>File:Consolidation transaction example.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=File:Consolidation_transaction_example.png&amp;diff=2729"/>
		<updated>2021-07-20T19:32:57Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Consolidation Transaction Example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Consolidation Transaction Example&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=File:Dust_limit_transaction.png&amp;diff=2728</id>
		<title>File:Dust limit transaction.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=File:Dust_limit_transaction.png&amp;diff=2728"/>
		<updated>2021-07-20T19:31:40Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Dust Limit Transaction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Dust Limit Transaction&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=File:Bitcoin_transaction_example.png&amp;diff=2727</id>
		<title>File:Bitcoin transaction example.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=File:Bitcoin_transaction_example.png&amp;diff=2727"/>
		<updated>2021-07-20T19:30:20Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Example Bitcoin transaction with multiple inputs and outputs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example Bitcoin transaction with multiple inputs and outputs&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Dust_Limit&amp;diff=2726</id>
		<title>Dust Limit</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Dust_Limit&amp;diff=2726"/>
		<updated>2021-07-20T19:29:06Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;In Bitcoin’s past developers implemented a protective mechanism for Bitcoin transactions called the Dust Limit. This limit was put in place as an attempt to prevent people f...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In Bitcoin’s past developers implemented a protective mechanism for Bitcoin transactions called the Dust Limit. This limit was put in place as an attempt to prevent people from creating outputs that could become unspendable. In short, the Dust Limit is a threshold of satoshis that cannot be spent in an output.&lt;br /&gt;
&lt;br /&gt;
A typical Bitcoin transaction looks something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this typical Bitcoin transaction, the values paid (in satoshis) is very large in comparison to the fee. Microtransactions are possible in Bitcoin because the fee paid is so low that small outputs can be created that are still large in proportion to the fees paid. However, there does exist a lower bound to what makes sense economically when creating outputs in transactions. If an output is small enough, any fee required to spend that output could be higher than the amount of satoshis in the output:&lt;br /&gt;
&lt;br /&gt;
In the above example, the dust limit, set by the node to be higher than 10 satoshis, prevents 10 satoshi outputs from being created to prevent a situation where an output is unspendable due to fee requirements. The dust limit is entirely set by miner policy, meaning it is not a consensus limitation, but instead is configurable by miners.  &lt;br /&gt;
&lt;br /&gt;
Consolidation Transactions&lt;br /&gt;
&lt;br /&gt;
Beginning in Bitcoin SV Node software v1.0.5, the software automatically allows for the creation of “consolidation transactions” where dust outputs can be consolidated for free into larger usable inputs. Outputs below the dust limit are accepted if the node parameter acceptnonstdconsolidationinput is set to 1. &lt;br /&gt;
&lt;br /&gt;
Because miners have to store the entire UTXO set, it is in their interest to reduce the size of the UTXO set whenever possible. It is for this reason that allowing these transactions without a fee is in both the customer and miners' interests. &lt;br /&gt;
&lt;br /&gt;
In the above example we see a normal transaction with additional 10 satoshi outputs attached. The recipient of these outputs simply collects enough of them to meet the criteria for a free consolidation transaction then converts the collective value of 1000 inputs into a single, higher-value output. The size of the UTXO database is reduced by 999 entries.&lt;br /&gt;
&lt;br /&gt;
In order for a transaction to be classified as consolidation by the Bitcoin SV software, some strict conditions must be met. A consolidation transaction is a transaction that reduces the number of UTXO’s by a margin that is more valuable for the network than the implied fee. Hence we allow consolidation transactions free from any fees.&lt;br /&gt;
&lt;br /&gt;
The conditions for a consolidation transaction are as follows:&lt;br /&gt;
&lt;br /&gt;
*The scriptPubKey sizes from the transaction outputs spent are compared to the scriptPubKey sizes of the consolidation transaction. The sum of the former must be greater than the sum of the latter multiplied by the consolidation factor (configuration parameter: minconsolidationfactor)&lt;br /&gt;
&lt;br /&gt;
*The transaction input count must be greater than the transaction outputs count multiplied by minconsolidationfactor&lt;br /&gt;
&lt;br /&gt;
*All inputs must have a confirmation count of at least minconsolidationinputmaturity.&lt;br /&gt;
&lt;br /&gt;
*scriptSig sizes of the consolidation transaction have an upper limit of  maxconsolidationinputscriptsize bytes long to prevent gaming.&lt;br /&gt;
&lt;br /&gt;
*Inputs spent in consolidation transactions must meet the old test of isStandard() if acceptnonstdconsolidationinput equals 0&lt;br /&gt;
&lt;br /&gt;
*The default value for maxconsolidationinputscriptsize is 150 bytes.&lt;br /&gt;
&lt;br /&gt;
*The default value for minconsolidationfactor is 20&lt;br /&gt;
&lt;br /&gt;
*The default value for minconsolidationinputmaturity is 6 (equivalent to one hour)&lt;br /&gt;
&lt;br /&gt;
*The default value for acceptnonstdconsolidationinput is 0 meaning only standard inputs allowed&lt;br /&gt;
&lt;br /&gt;
*Setting minconsolidationfactor to 0 disables the free consolidation transactions feature&lt;br /&gt;
&lt;br /&gt;
The condition as the formula is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       c = minconsolidationfactor&lt;br /&gt;
       m = minconsolidationinputmaturity&lt;br /&gt;
       s = maxconsolidationinputscriptsize&lt;br /&gt;
       a = acceptnonstdconsolidationinput&lt;br /&gt;
       isFree =  nInputs &amp;gt;= c * nOutputs&lt;br /&gt;
              &amp;amp;&amp;amp; confirmationCount(input) &amp;gt;= m for all inputs &lt;br /&gt;
              &amp;amp;&amp;amp; sum(inputTxScriptPubKeyBytesLen[]) &amp;gt;= c * sum(outputTxScripPubKeytBytesLen[])&lt;br /&gt;
              &amp;amp;&amp;amp; inputTxScriptSig &amp;lt;= s for all inputTxScriptSig&lt;br /&gt;
              &amp;amp;&amp;amp; isStandardInput(input) for all inputs unless a == 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a general rule of thumb:&lt;br /&gt;
&lt;br /&gt;
*Consolidate at least 100 inputs to one output.&lt;br /&gt;
&lt;br /&gt;
*Only use standard p2pkh inputs or bare multisig with no more than 2 signatures.&lt;br /&gt;
&lt;br /&gt;
*Only use inputs confirmed for at least 6 blocks.&lt;br /&gt;
&lt;br /&gt;
**This rule can be gotten around simply by constructing the transaction using all available inputs but not broadcasting it until 6 blocks after you made it.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Ancestor_Limit&amp;diff=2725</id>
		<title>Ancestor Limit</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Ancestor_Limit&amp;diff=2725"/>
		<updated>2021-07-20T18:03:35Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the first iteration of the Bitcoin software, bitcoind v0.1.0 handled the creation of blocks fairly simply. Once a second or so, the software would take a memory map of all the transactions it had received, check any new ones to ensure they met the minimum fee requirement set for the node and if so, add them to the block template which was basically an ordered list of valid transactions. It would then calculate a merkle tree from that set of transactions and build a block header to start doing proof of work upon.&lt;br /&gt;
&lt;br /&gt;
Because of the arbitrary 1MB block size limit imposed on the software at a later time, the software was then optimized to select transactions for block building with the highest fee rates until the 1MB block size limit was filled. Due to this accounting and other policy based limitations, the software inefficiently added transactions to block templates.&lt;br /&gt;
&lt;br /&gt;
This inefficiency manifested in a big way when creating long chains of descendant transactions prior to a block being found. Descendant transactions refers to transactions that are added to a node's mempool that are dependent on previous transactions that are also in that node's mempool. Because the older Bitcoin software was designed around 1MB blocks, situations arose where these long chains of transactions had to be split across multiple blocks. &lt;br /&gt;
&lt;br /&gt;
Starting in October 2015, the BTC Core developers introduced a rule in bitcoin v0.12 to account for this inefficiency by limiting the number of descendants a coin could have to 25. This limit, also called the Ancestor Limit, rejected any transactions that violated this rule with error code 64: too-long-mempool-chain. Bitcoin SV Node v1.0.7 raised this default limit to 1000, and plan to remove the limit entirely soon. Since this restriction is miner policy, miners are free to raise this limit themselves as well.&lt;br /&gt;
&lt;br /&gt;
[[File:ancestor_limit.gif|centre|alt=Ancestor Limit Performance Comparison for Bitcoin SV Node 1.0.7]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In the above graphic, you can see the performance increase for long chain submission to the node software in v1.0.7.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=File:Ancestor_limit.gif&amp;diff=2724</id>
		<title>File:Ancestor limit.gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=File:Ancestor_limit.gif&amp;diff=2724"/>
		<updated>2021-07-20T18:01:17Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Comparisons when submitting long chains of transactions to the mempool in Bitcoin SV Node v1.0.7&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Comparisons when submitting long chains of transactions to the mempool in Bitcoin SV Node v1.0.7&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Ancestor_Limit&amp;diff=2723</id>
		<title>Ancestor Limit</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Ancestor_Limit&amp;diff=2723"/>
		<updated>2021-07-20T18:00:17Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;In the first iteration of the Bitcoin software, bitcoind v0.1.0 handled the creation of blocks fairly simply. Once a second or so, the software would take a memory map of all...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the first iteration of the Bitcoin software, bitcoind v0.1.0 handled the creation of blocks fairly simply. Once a second or so, the software would take a memory map of all the transactions it had received, check any new ones to ensure they met the minimum fee requirement set for the node and if so, add them to the block template which was basically an ordered list of valid transactions. It would then calculate a merkle tree from that set of transactions and build a block header to start doing proof of work upon.&lt;br /&gt;
&lt;br /&gt;
Because of the arbitrary 1MB block size limit imposed on the software at a later time, the software was then optimized to select transactions for block building with the highest fee rates until the 1MB block size limit was filled. Due to this accounting and other policy based limitations, the software inefficiently added transactions to block templates.&lt;br /&gt;
&lt;br /&gt;
This inefficiency manifested in a big way when creating long chains of descendant transactions prior to a block being found. Descendant transactions refers to transactions that are added to a node's mempool that are dependent on previous transactions that are also in that node's mempool. Because the older Bitcoin software was designed around 1MB blocks, situations arose where these long chains of transactions had to be split across multiple blocks. &lt;br /&gt;
&lt;br /&gt;
Starting in October 2015, the BTC Core developers introduced a rule in bitcoin v0.12 to account for this inefficiency by limiting the number of descendants a coin could have to 25. This limit, also called the Ancestor Limit, rejected any transactions that violated this rule with error code 64: too-long-mempool-chain. Bitcoin SV Node v1.0.7 raised this default limit to 1000, and plan to remove the limit entirely soon. Since this restriction is miner policy, miners are free to raise this limit themselves as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In the above graphic, you can see the performance increase for long chain submission to the node software in v1.0.7.&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitcoinsv.io/index.php?title=Home_Page&amp;diff=2722</id>
		<title>Home Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitcoinsv.io/index.php?title=Home_Page&amp;diff=2722"/>
		<updated>2021-07-20T03:39:29Z</updated>

		<summary type="html">&lt;p&gt;Connor Murray: Created page with &amp;quot;Here we aim to provide a correct and up-to date set of information on the Bitcoin network and its features and functionality.  ===What is Bitcoin?===  '''Bitcoin''' is a peer...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here we aim to provide a correct and up-to date set of information on the Bitcoin network and its features and functionality.&lt;br /&gt;
&lt;br /&gt;
===What is Bitcoin?===&lt;br /&gt;
&lt;br /&gt;
'''Bitcoin''' is a peer to peer electronic cash system created by [https://craigwright.net/ Dr. Craig Wright] under the pseudonym [[Satoshi Nakamoto]].  It was first detailed in the [https://bitcoinsv.io/bitcoin.pdf Bitcoin Whitepaper] in October 2008, and the source code was [https://www.mail-archive.com/cryptography@metzdowd.com/msg10142.html released] in January 2009. The Bitcoin ledger and [[Block chain]] were established with the generation of the [[Genesis block]] on the 3rd of January 2009 and the mining of Block 1 six days later on the 9th of January 2009.&lt;br /&gt;
&lt;br /&gt;
Bitcoin allows electronic payments to be sent directly from one party to another, without requiring a central institution or server to process transactions and/or store funds. &lt;br /&gt;
 &lt;br /&gt;
The leaderless structure of the network is viewed as a resolution to [[The Byzantine Generals Problem]] allowing disconnected entities to follow a common direction without centralised instruction. This solves several issues previously seen as unsolvable in distributed networks, including the problem of preventing [[Double-spending]] of coins.&lt;br /&gt;
&lt;br /&gt;
Bitcoin Satoshi Vision (Bitcoin SV) was created to maintain the integrity of the Bitcoin public ledger by reverting back to the original Bitcoin protocol with the intention of keeping it stable and secure, and allowing it to scale massively in order to accommodate global demand for open public ledger technology.&lt;br /&gt;
&lt;br /&gt;
BitcoinSV will maintain the vision set out by Satoshi Nakamoto’s visionary 2008 white paper titled Bitcoin: A Peer-to-Peer Electronic Cash System which includes:&lt;br /&gt;
*Scaling network systems and developing robust mining client software in order to accommodate global demand for ledger space.&lt;br /&gt;
&lt;br /&gt;
*Allowing a distributed small world network to form at the center of a Mandala network connecting billions of people through their devices.&lt;br /&gt;
&lt;br /&gt;
*Elevating Miners into their role as service provider.&lt;br /&gt;
&lt;br /&gt;
*Generating on-chain economic activity sufficient to allow transaction fees to supplant block subsidies as their primary funding mechanism.&lt;br /&gt;
&lt;br /&gt;
*Driving a culture of using transaction fees to price transactions as a service.&lt;br /&gt;
&lt;br /&gt;
*Leveraging economic incentives to build network security.&lt;br /&gt;
&lt;br /&gt;
*Allowing the Bitcoin network to become a global infrastructure platform for financial and information exchange processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| id=&amp;quot;mp-right&amp;quot; style=&amp;quot;width:100%; vertical-align:top; background:#ffdb65;&amp;quot;&lt;br /&gt;
! style=&amp;quot;padding:2px&amp;quot; | &amp;lt;h2 id=&amp;quot;mp-otd-h2&amp;quot; style=&amp;quot;margin:3px; background:#eab300; font-size:120%; font-weight:bold; border:1px solid #a3b0bf; text-align:center; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;Topic central&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000;padding:2px 5px 5px&amp;quot; | &amp;lt;div id=&amp;quot;mp-otd&amp;quot;&amp;gt;&lt;br /&gt;
{|cellpadding=&amp;quot;2&amp;quot; style=&amp;quot;background-color: inherit;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 750px;&amp;quot; |&lt;br /&gt;
* '''Wallets&lt;br /&gt;
** Handcash&lt;br /&gt;
** Moneybutton&lt;br /&gt;
** Centbee&lt;br /&gt;
** RelayX&lt;br /&gt;
** Simply Cash&lt;br /&gt;
** ElectrumSV&lt;br /&gt;
* '''Node Software&lt;br /&gt;
** [https://bitcoinsv.io Bitcoin SV]&lt;br /&gt;
* '''Development Tools&lt;br /&gt;
** bsv JS library&lt;br /&gt;
** gobitcoinsv.com&lt;br /&gt;
| scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 750px;&amp;quot; |&lt;br /&gt;
* '''Helpful Links&lt;br /&gt;
** [[Opcodes used in Bitcoin Script]]&lt;br /&gt;
** [[Bitcoin Transactions]]&lt;br /&gt;
** Bitcoin Whitepaper&lt;br /&gt;
** Block Explorers&lt;br /&gt;
*** Whatsonchain&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Connor Murray</name></author>
		
	</entry>
</feed>