Browse Source

Archive Revision as of 15:14, 6 July 2012

https://en.bitcoin.it/w/index.php?title=BIP_0031&oldid=28445
2015_12_bip1
Peter Todd 12 years ago
parent
commit
1e40c8fba5
No known key found for this signature in database GPG Key ID: 2481403DA5F091FB
  1. 11
      bip-0031.mediawiki

11
bip-0031.mediawiki

@ -1,8 +1,10 @@
{{bip}}
<pre> <pre>
BIP: 31 BIP: 31
Title: Pong message Title: Pong message
Author: Mike Hearn <hearn@google.com> Author: Mike Hearn <hearn@google.com>
Status: Draft Status: Accepted
Type: Standards Track Type: Standards Track
Created: 11-04-2012 Created: 11-04-2012
</pre> </pre>
@ -25,15 +27,18 @@ All of these can be solved by a backwards compatible protocol modification.
==Specification== ==Specification==
When the protocol version as negotiated in the "ver" message is greater than or equal to 70000, the "ping" message can contain a uint64 field called "nonce". A peer sending "ping" can set the nonce to a random value, and it is then echoed back by the recipient in a new "pong" message that also contains a single uint64 field. When the protocol version as negotiated in the "ver" message is greater than 60000, the "ping" message must contain a uint64 field called "nonce". A peer sending "ping" should set the nonce to a random value, and it is then echoed back by the recipient in a new "pong" message that also contains a single uint64 field.
In this way, the client can send a ping and measure the time taken to receive the corresponding pong. If a client sends two pings before hearing back the first pong, the responses can be distinguished using the nonce. If the client chooses to never overlap pings in this way it should simply set the nonce value to zero. In this way, the client can send a ping and measure the time taken to receive the corresponding pong. If a client sends two pings before hearing back the first pong, the responses can be distinguished using the nonce. If the client chooses to never overlap pings in this way it should simply set the nonce value to zero.
==Backward compatibility== ==Backward compatibility==
Clients must opt-in to the new feature by advertising a protocol version >= 70000. Clients with older protocol versions are not expected to provide a nonce in the ping message and will not be sent a pong. Clients must opt-in to the new feature by advertising a protocol version > 60000. Clients with older protocol versions are not expected to provide a nonce in the ping message and will not be sent a pong.
==Implementation== ==Implementation==
https://github.com/bitcoin/bitcoin/pull/932/files https://github.com/bitcoin/bitcoin/pull/932/files
[[Category:Developer]]
[[Category:Technical]]
[[Category:BIP|D]]

Loading…
Cancel
Save