{"number":61,"title":"Reject P2P message","authors":["Gavin Andresen"],"status":"Deployed","type":"Specification","layer":"Peer Services","created":"2014-06-18","requires":[],"replaces":[],"replacedBy":[],"discussion":[],"comments":"https://github.com/bitcoin/bips/wiki/Comments:BIP-0061","abstract":"This BIP describes a new message type for the Bitcoin peer-to-peer network.","eli5":"Adds a \"reject\" message so a node can tell a peer why it refused a transaction or block. This made troubleshooting easier for wallet and node developers, though Bitcoin Core later removed the message.","categories":["network","transactions"],"filename":"bip-0061.mediawiki","githubUrl":"https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki","format":"mediawiki","readingMinutes":3,"inbound":1,"revisions":12,"impact":41,"core":false,"references":[],"lastModified":"2025-10-08","html":"<h2 id=\"abstract\">Abstract</h2>\n<p>This BIP describes a new message type for the Bitcoin peer-to-peer network.</p>\n<h2 id=\"motivation\">Motivation</h2>\n<p>Giving peers feedback about why their blocks or transactions are rejected, or why they are being banned for not following the protocol helps interoperability between different implementations.</p>\n<p>It also gives SPV (simplified payment verification) clients a hint that something may be wrong when their transactions are rejected due to insufficient priority or fees.</p>\n<h2 id=\"specification\">Specification</h2>\n<p>Data types in this specification are as described at <a href=\"https://en.bitcoin.it/wiki/Protocol_specification\">https://en.bitcoin.it/wiki/Protocol_specification</a></p>\n<h3 id=\"reject\">reject</h3>\n<p>One new message type \"reject\" is introduced. It is sent directly to a peer in response to a \"version\", \"tx\" or \"block\" message.</p>\n<p>For example, the message flow between two peers for a relayed transaction that is rejected for some reason would be:</p>\n<pre><code>--&gt; inv\n&lt;-- getdata\n--&gt; tx\n&lt;-- reject</code></pre>\n<p>All implementations of the P2P protocol version 70,002 and later should support the reject message.</p>\n<h4 id=\"common-payload\">common payload</h4>\n<p>Every reject message begins with the following fields. Some messages append extra, message-specific data.</p>\n<div class=\"table-wrap\"><table><tbody><tr><td>Field Size</td><td>Name</td><td>Data type</td><td>Comments</td></tr><tr><td>variable</td><td>response-to-msg</td><td>var_str</td><td>Message that triggered the reject</td></tr><tr><td>1</td><td>reject-code</td><td>uint8_t</td><td>0x01 through 0x4f (see below)</td></tr><tr><td>variable</td><td>reason</td><td>var_string</td><td>Human-readable message for debugging</td></tr></tbody></table></div>\n<p>The human-readable string is intended only for debugging purposes; in particular, different implementations may use different strings. The string should not be shown to users or used for anything besides diagnosing interoperability problems.</p>\n<p>The following reject code categories are used; in the descriptions below, \"server\" is the peer generating the reject message, \"client\" is the peer that will receive the message.</p>\n<div class=\"table-wrap\"><table><tbody><tr><td>Range</td><td>Category</td></tr><tr><td>0x01-0x0f</td><td>Protocol syntax errors</td></tr><tr><td>0x10-0x1f</td><td>Protocol semantic errors</td></tr><tr><td>0x40-0x4f</td><td>Server policy rule</td></tr></tbody></table></div>\n<h4 id=\"rejection-codes-common-to-all-message-types\">rejection codes common to all message types</h4>\n<div class=\"table-wrap\"><table><tbody><tr><td>Code</td><td>Description</td></tr><tr><td>0x01</td><td>Message could not be decoded</td></tr></tbody></table></div>\n<h4 id=\"reject-version-codes\">reject version codes</h4>\n<p>Codes generated during the initial connection process in response to a \"version\" message:</p>\n<div class=\"table-wrap\"><table><tbody><tr><td>Code</td><td>Description</td></tr><tr><td>0x11</td><td>Client is an obsolete, unsupported version</td></tr><tr><td>0x12</td><td>Duplicate version message received</td></tr></tbody></table></div>\n<h4 id=\"reject-tx-payload-codes\">reject tx payload, codes</h4>\n<p>Transaction rejection messages extend the basic message with the transaction id hash:</p>\n<div class=\"table-wrap\"><table><tbody><tr><td>Field Size</td><td>Name</td><td>Data type</td><td>Comments</td></tr><tr><td>32</td><td>hash</td><td>char[32]</td><td>transaction that is rejected</td></tr></tbody></table></div>\n<p>The following codes are used:</p>\n<div class=\"table-wrap\"><table><tbody><tr><td>Code</td><td>Description</td></tr><tr><td>0x10</td><td>Transaction is invalid for some reason (invalid signature, output value greater than input, etc.)</td></tr><tr><td>0x12</td><td>An input is already spent</td></tr><tr><td>0x40</td><td>Not mined/relayed because it is \"non-standard\" (type or version unknown by the server)</td></tr><tr><td>0x41</td><td>One or more output amounts are below the 'dust' threshold</td></tr><tr><td>0x42</td><td>Transaction does not have enough fee/priority to be relayed or mined</td></tr></tbody></table></div>\n<h4 id=\"payload-reject-block\">payload, reject block</h4>\n<p>Block rejection messages extend the basic message with the block header hash:</p>\n<div class=\"table-wrap\"><table><tbody><tr><td>Field Size</td><td>Name</td><td>Data type</td><td>Comments</td></tr><tr><td>32</td><td>hash</td><td>char[32]</td><td>block (hash of block header) that is rejected</td></tr></tbody></table></div>\n<p>Rejection codes:</p>\n<div class=\"table-wrap\"><table><tbody><tr><td>code</td><td>description</td></tr><tr><td>0x10</td><td>Block is invalid for some reason (invalid proof-of-work, invalid signature, etc)</td></tr><tr><td>0x11</td><td>Block's version is no longer supported</td></tr><tr><td>0x43</td><td>Inconsistent with a compiled-in checkpoint</td></tr></tbody></table></div>\n<p>Note: blocks that are not part of the server's idea of the current best chain, but are otherwise valid, should not trigger reject messages.</p>\n<h2 id=\"compatibility\">Compatibility</h2>\n<p>The reject message is backwards-compatible; older peers that do not recognize the reject message will ignore it.</p>\n<h2 id=\"implementation-notes\">Implementation notes</h2>\n<p>Implementers must consider what happens if an attacker either sends them reject messages for valid transactions/blocks or sends them random reject messages, and should beware of possible denial-of-service attacks. For example, notifying the user of every reject message received would make it trivial for an attacker to mount an annoy-the-user attack. Even merely writing every reject message to a debugging log could make an implementation vulnerable to a fill-up-the-users-disk attack.</p>","toc":[{"id":"abstract","title":"Abstract","level":2},{"id":"motivation","title":"Motivation","level":2},{"id":"specification","title":"Specification","level":2},{"id":"reject","title":"reject","level":3},{"id":"common-payload","title":"common payload","level":4},{"id":"rejection-codes-common-to-all-message-types","title":"rejection codes common to all message types","level":4},{"id":"reject-version-codes","title":"reject version codes","level":4},{"id":"reject-tx-payload-codes","title":"reject tx payload, codes","level":4},{"id":"payload-reject-block","title":"payload, reject block","level":4},{"id":"compatibility","title":"Compatibility","level":2},{"id":"implementation-notes","title":"Implementation notes","level":2}],"history":{"totalCommits":12,"firstCommit":"2014-06-18T11:13:44-04:00","lastUpdated":"2025-10-08T14:59:36-07:00","events":[{"sha":"24e96e870fffaa257b465ce1f0370c14aac588e8","date":"2025-10-08T14:59:36-07:00","author":"Murch","message":"process: Created ↦ Assigned","url":"https://github.com/bitcoin/bips/commit/24e96e870fffaa257b465ce1f0370c14aac588e8","kind":"edit"},{"sha":"5207ef92a52d0b8902895b0dbb40823a4d698ec9","date":"2025-04-11T20:08:17-07:00","author":"Murch","message":"process: Author ↦ Authors","url":"https://github.com/bitcoin/bips/commit/5207ef92a52d0b8902895b0dbb40823a4d698ec9","kind":"edit"},{"sha":"a233bde4af52c6a11269e2e6dd9707abce441ffe","date":"2025-04-11T18:19:21-07:00","author":"Murch","message":"process: Standards Track ↦ Specification","url":"https://github.com/bitcoin/bips/commit/a233bde4af52c6a11269e2e6dd9707abce441ffe","kind":"edit"},{"sha":"5d3ceb37734f80b2ec206fc94245e3bfd6d5b0f0","date":"2025-04-11T18:08:44-07:00","author":"Murch","message":"process: Final/Active ↦ Deployed","url":"https://github.com/bitcoin/bips/commit/5d3ceb37734f80b2ec206fc94245e3bfd6d5b0f0","kind":"status"},{"sha":"468e9759ba3ab9b58d1cadd300b92f5bd43727dc","date":"2025-02-13T11:56:14-06:00","author":"Jon Atack","message":"spelling: globally change \"implementor\" to \"implementer\"","url":"https://github.com/bitcoin/bips/commit/468e9759ba3ab9b58d1cadd300b92f5bd43727dc","kind":"edit"},{"sha":"f61885edcf5e63ac205b1ca5f08173f1336bff74","date":"2024-05-01T06:54:05+10:00","author":"John Bampton","message":"docs: fix spelling (#1117)","url":"https://github.com/bitcoin/bips/commit/f61885edcf5e63ac205b1ca5f08173f1336bff74","kind":"edit"},{"sha":"c3e8379b611a53114544b0ed7af5307b022b8ac8","date":"2018-04-14T11:16:32+05:30","author":"Varunram","message":"[trivial] Correct typos across bips","url":"https://github.com/bitcoin/bips/commit/c3e8379b611a53114544b0ed7af5307b022b8ac8","kind":"edit"},{"sha":"d9396155350b16b098a0d0b5ec10da80ebd96d5f","date":"2017-03-14T23:27:57+00:00","author":"Luke Dashjr","message":"Propagate summary tone of BIP Comments to their applicable BIP preambles","url":"https://github.com/bitcoin/bips/commit/d9396155350b16b098a0d0b5ec10da80ebd96d5f","kind":"edit"},{"sha":"959fecc15bdad070afa63455468b1dba54655fa6","date":"2016-11-30T09:47:31+00:00","author":"Luke Dashjr","message":"Promote BIP 2 Draft->Active, and implement it","url":"https://github.com/bitcoin/bips/commit/959fecc15bdad070afa63455468b1dba54655fa6","kind":"status"},{"sha":"72f18918a8ae655212ea2700b30f0dc4d758b843","date":"2016-11-30T09:45:33+00:00","author":"Luke Dashjr","message":"Promote BIP 123 Draft->Active, and implement it","url":"https://github.com/bitcoin/bips/commit/72f18918a8ae655212ea2700b30f0dc4d758b843","kind":"status"},{"sha":"cb6f731f625f6d19a9a3b3593c796c395c0bb3d4","date":"2015-03-26T17:56:48+01:00","author":"Nicolas Dorier","message":"Reject code DUPLICATE also used for rejecting tx","url":"https://github.com/bitcoin/bips/commit/cb6f731f625f6d19a9a3b3593c796c395c0bb3d4","kind":"edit"},{"sha":"4d9e7bc20cef9b296f1c1e9112e729186b54fc61","date":"2014-06-18T11:13:44-04:00","author":"Gavin Andresen","message":"reject P2P message (BIP61)","url":"https://github.com/bitcoin/bips/commit/4d9e7bc20cef9b296f1c1e9112e729186b54fc61","kind":"edit"}]}}