<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bitmessage.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=PeterSurda</id>
	<title>Bitmessage Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bitmessage.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=PeterSurda"/>
	<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php/Special:Contributions/PeterSurda"/>
	<updated>2026-06-10T04:51:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=48830</id>
		<title>Contribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=48830"/>
		<updated>2020-12-25T12:06:50Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: more buildbot info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= How to contribute to the project =&lt;br /&gt;
&lt;br /&gt;
Please follow the instructions below to find out how to best contribute to the project.&lt;br /&gt;
&lt;br /&gt;
== Register with buildbot ==&lt;br /&gt;
&lt;br /&gt;
In order to contribute code, first please register your GitHub fork with the project's buildbot instance. This will then then execute all the code tests and builds that are currently available by just committing to your repository.&lt;br /&gt;
&lt;br /&gt;
# Login to [https://github.com/ GitHub]&lt;br /&gt;
# If you haven't done so yet, fork the [https://github.com/Bitmessage/PyBitmessage PyBitmessage repository]&lt;br /&gt;
# Visit the [https://github.com/apps/pybitmessage-buildbot PyBitmessage Buildbot installation page]&lt;br /&gt;
# Install it into your account and give it access to your &amp;quot;PyBitmessage&amp;quot; repository&lt;br /&gt;
&lt;br /&gt;
Now, whenever you push code, you can check [https://buildbot.bitmessage.org PyBitmessage Buildbot] for the results of the tests. To find your repo's builds, navigate to &amp;quot;Builds&amp;quot; / &amp;quot;Last Changes&amp;quot; and at the top of your commit description, click on &amp;quot;See builds&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The tests are also run once you create a PR.&lt;br /&gt;
&lt;br /&gt;
== Pull request requirements ==&lt;br /&gt;
&lt;br /&gt;
The best code contributions are pull requests on [https://github.com/Bitmessage/PyBitmessage GitHub]. Here are some rules to follow:&lt;br /&gt;
&lt;br /&gt;
* try to explain what the code is about&lt;br /&gt;
* try to follow [https://www.python.org/dev/peps/pep-0008/ PEP0008]&lt;br /&gt;
* make the pull request against the [https://github.com/Bitmessage/PyBitmessage/tree/v0.6 &amp;quot;v0.6&amp;quot; branch]&lt;br /&gt;
* it should be possible to do a fast-forward merge of the pull requests. I.e. if possible, do a rebase of a pull request after another is merged ahead of yours. However, if it can be merged without having to manually resolve a conflict, that's acceptable as well.&lt;br /&gt;
* PGP-sign the commits included in the pull request, and make sure to upload your PGP key into your GitHub account&lt;br /&gt;
* You can get paid for merged commits if you register at [https://tip4commit.com/github/Bitmessage/PyBitmessage Tip4Commit]&lt;br /&gt;
&lt;br /&gt;
If for some reason you don't want to use github, you can register with [https://git.bitmessage.org PyBitmessage Gitea], fork the latest archive of the project, and let us know which branch with the new code.&lt;br /&gt;
&lt;br /&gt;
==Translations==&lt;br /&gt;
&lt;br /&gt;
For helping with translations, please use [https://www.transifex.com/bitmessage-project/pybitmessage/ Transifex]. There is no need to submit pull requests for translations.&lt;br /&gt;
&lt;br /&gt;
For translating technical terms it is recommended to consult the [https://www.microsoft.com/Language/en-US/Default.aspx Microsoft Language Portal].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=48829</id>
		<title>Contribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=48829"/>
		<updated>2020-12-24T16:10:34Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Add info about buildbot and gitea&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= How to contribute to the project =&lt;br /&gt;
&lt;br /&gt;
Please follow the instructions below to find out how to best contribute to the project.&lt;br /&gt;
&lt;br /&gt;
== Register with buildbot ==&lt;br /&gt;
&lt;br /&gt;
In order to contribute code, first please register your GitHub fork with the project's buildbot instance. This will then then execute all the code tests and builds that are currently available by just committing to your repository.&lt;br /&gt;
&lt;br /&gt;
# Login to [https://github.com/ GitHub]&lt;br /&gt;
# If you haven't done so yet, fork the [https://github.com/Bitmessage/PyBitmessage PyBitmessage repository]&lt;br /&gt;
# Visit the [https://github.com/apps/pybitmessage-buildbot PyBitmessage Buildbot installation page]&lt;br /&gt;
# Install it into your account and give it access to your &amp;quot;PyBitmessage&amp;quot; repository&lt;br /&gt;
&lt;br /&gt;
Now, whenever you push code, you can check [https://buildbot.bitmessage.org PyBitmessage Buildbot] for the results of the tests.&lt;br /&gt;
&lt;br /&gt;
The tests are also run once you create a PR.&lt;br /&gt;
&lt;br /&gt;
== Pull request requirements ==&lt;br /&gt;
&lt;br /&gt;
The best code contributions are pull requests on [https://github.com/Bitmessage/PyBitmessage GitHub]. Here are some rules to follow:&lt;br /&gt;
&lt;br /&gt;
* try to explain what the code is about&lt;br /&gt;
* try to follow [https://www.python.org/dev/peps/pep-0008/ PEP0008]&lt;br /&gt;
* make the pull request against the [https://github.com/Bitmessage/PyBitmessage/tree/v0.6 &amp;quot;v0.6&amp;quot; branch]&lt;br /&gt;
* it should be possible to do a fast-forward merge of the pull requests. I.e. if possible, do a rebase of a pull request after another is merged ahead of yours. However, if it can be merged without having to manually resolve a conflict, that's acceptable as well.&lt;br /&gt;
* PGP-sign the commits included in the pull request, and make sure to upload your PGP key into your GitHub account&lt;br /&gt;
* You can get paid for merged commits if you register at [https://tip4commit.com/github/Bitmessage/PyBitmessage Tip4Commit]&lt;br /&gt;
&lt;br /&gt;
If for some reason you don't want to use github, you can register with [https://git.bitmessage.org PyBitmessage Gitea], fork the latest archive of the project, and let us know which branch with the new code.&lt;br /&gt;
&lt;br /&gt;
==Translations==&lt;br /&gt;
&lt;br /&gt;
For helping with translations, please use [https://www.transifex.com/bitmessage-project/pybitmessage/ Transifex]. There is no need to submit pull requests for translations.&lt;br /&gt;
&lt;br /&gt;
For translating technical terms it is recommended to consult the [https://www.microsoft.com/Language/en-US/Default.aspx Microsoft Language Portal].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=48663</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=48663"/>
		<updated>2020-04-29T02:40:12Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* Pubkey bitfield features */ Reassign bit 29 from extended_encoding to chat&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || See [[Extended encoding]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 27 || onion_router || ('''Proposal''') Node can be used to onion-route messages. In theory any node can onion route, but since it requires more resources, they may have the functionality disabled. This field will be used to indicate that the node is willing to do this.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || forward_secrecy || ('''Proposal''') Receiving node supports a forward secrecy encryption extension. The exact design is pending.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || chat || ('''Proposal''') Address if for chatting rather than messaging. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || ('''Proposal''') Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them.&lt;br /&gt;
'''NOTE:''' since hardly anyone implements this, this will be redesigned as simple recipient verification: https://github.com/Bitmessage/PyBitmessage/pull/808#issuecomment-170189856&lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|-&lt;br /&gt;
| 3 || NODE_POW     || '''(Proposal)''' This node may do PoW on behalf of some its peers (PoW offloading/delegating), but it doesn't have to. Clients may have to meet additional requirements (e.g. TLS authentication)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NODE_DANDELION || Node supports dandelion (https://github.com/gfanti/bips/blob/master/bip-dandelion.mediawiki)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47598</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47598"/>
		<updated>2020-02-15T04:45:30Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: URL fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name=Bitmessage&lt;br /&gt;
|downloadsite=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe&lt;br /&gt;
|release caption=Previous Version (Beta)&lt;br /&gt;
|latest release date=Aug 21, 2016&lt;br /&gt;
|version=0.6.1&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#CC0000&amp;quot;&amp;gt;A remote code execution vulnerability has been spotted in use against some users running PyBitmessage v0.6.2. The cause was identified and a fix has been added and released as 0.6.3.2 [https://github.com/Bitmessage/PyBitmessage/releases/ here]. If you run PyBitmessage via code, we highly recommend that you upgrade to 0.6.3.2. Alternatively you may downgrade to 0.6.1 which is unaffected. .&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#CC0000&amp;quot;&amp;gt;Bitmessage developer Peter Šurda's Bitmessage addresses are to be considered compromised.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitmessage is a P2P communications [[Protocol specification|protocol]] used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide &amp;quot;non-content&amp;quot; data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs. If Bitmessage is completely new to you, you may wish to start by reading the [https://bitmessage.org/bitmessage.pdf whitepaper].&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
An open source client is available for free under the very liberal [http://opensource.org/licenses/mit-license.php MIT license]. For screenshots and a description of the client, see this CryptoJunky article: [http://cryptojunky.com/2013/03/09/setting-up-and-using-bitmessage-an-encrypted-communications-platform-based-on-bitcoin/ &amp;quot;Setting Up And Using Bitmessage&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
[[File:windows_icon.png|link=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe]] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe Download for Windows (32bit)] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1_64.exe (64bit)]&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/bitmessage-v0.6.1.dmg]] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/bitmessage-v0.6.1.dmg Download for OS X]&lt;br /&gt;
&lt;br /&gt;
[[File:tux.png|link=Compiling_instructions]] [[Compiling instructions|Run the source code]]&lt;br /&gt;
&lt;br /&gt;
=== Source code ===&lt;br /&gt;
You may view the Python [https://github.com/Bitmessage/PyBitmessage source code on Github]. Bitmessage requires PyQt and OpenSSL. Step-by-step instructions on how to run the source code on Linux, Windows, or OSX is [[Compiling instructions|available here]].&lt;br /&gt;
&lt;br /&gt;
=== Contribute ===&lt;br /&gt;
Please follow the [[Contribute|contribution guidelines]] when contributing code or translations.&lt;br /&gt;
&lt;br /&gt;
=== Security audit needed ===&lt;br /&gt;
Bitmessage is in need of an independent audit to verify its security. If you are a researcher capable of reviewing the source code, please [https://bitmessage.org/misc/emailaddress.png email] the lead developer. You will be helping to create a great privacy option for people everywhere!&lt;br /&gt;
&lt;br /&gt;
=== Forum ===&lt;br /&gt;
* Visit or subscribe to the [https://pay.reddit.com/r/bitmessage Bitmessage subreddit].&lt;br /&gt;
* A community-based forum for questions, feedback, and discussion is also available at [https://bitmessage.org/forum Bitmessage.org/forum].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47597</id>
		<title>Contribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47597"/>
		<updated>2018-02-28T00:51:42Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* Code contributions to the Bitmessage project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Code contributions to the Bitmessage project==&lt;br /&gt;
&lt;br /&gt;
The best code contributions are pull requests on [https://github.com/Bitmessage/PyBitmessage GitHub]. Here are some rules to follow:&lt;br /&gt;
&lt;br /&gt;
* try to explain what the code is about&lt;br /&gt;
* try to follow [https://www.python.org/dev/peps/pep-0008/ PEP0008]&lt;br /&gt;
* make the pull request against the [https://github.com/Bitmessage/PyBitmessage/tree/v0.6 &amp;quot;v0.6&amp;quot; branch]&lt;br /&gt;
* it should be possible to do a fast-forward merge of the pull requests. I.e. if possible, do a rebase of a pull request after another is merged ahead of yours. However, if it can be merged without having to manually resolve a conflict, that's acceptable as well.&lt;br /&gt;
* PGP-sign the commits included in the pull request&lt;br /&gt;
* You can get paid for merged commits if you register at [https://tip4commit.com/github/Bitmessage/PyBitmessage Tip4Commit]&lt;br /&gt;
&lt;br /&gt;
If for some reason you don't want to use github, you can submit the patch using Bitmessage to the &amp;quot;bitmessage&amp;quot; chan, or to one of the developers.&lt;br /&gt;
&lt;br /&gt;
==Translations==&lt;br /&gt;
&lt;br /&gt;
For helping with translations, please use [https://www.transifex.com/bitmessage-project/pybitmessage/ Transifex]. There is no need to submit pull requests for translations.&lt;br /&gt;
&lt;br /&gt;
For translating technical terms it is recommended to consult the [https://www.microsoft.com/Language/en-US/Default.aspx Microsoft Language Portal].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47591</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47591"/>
		<updated>2018-02-03T11:34:36Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* Pubkey bitfield features */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || See [[Extended encoding]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 27 || onion_router || ('''Proposal''') Node can be used to onion-route messages. In theory any node can onion route, but since it requires more resources, they may have the functionality disabled. This field will be used to indicate that the node is willing to do this.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || forward_secrecy || ('''Proposal''') Receiving node supports a forward secrecy encryption extension. The exact design is pending.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || extended_encoding || ('''Proposal''') Receiving node supports extended encoding. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || ('''Proposal''') Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them.&lt;br /&gt;
'''NOTE:''' since hardly anyone implements this, this will be redesigned as simple recipient verification: https://github.com/Bitmessage/PyBitmessage/pull/808#issuecomment-170189856&lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|-&lt;br /&gt;
| 3 || NODE_POW     || '''(Proposal)''' This node may do PoW on behalf of some its peers (PoW offloading/delegating), but it doesn't have to. Clients may have to meet additional requirements (e.g. TLS authentication)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NODE_DANDELION || Node supports dandelion (https://github.com/gfanti/bips/blob/master/bip-dandelion.mediawiki)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47590</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47590"/>
		<updated>2018-02-03T11:33:58Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Dandelion is now ready&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || See [[Extended encoding]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 27 || onion_router || ('''Proposal''') Node can be used to onion-route messages. In theory any node can onion route, but since it requires more resources, they may have the functionality disabled. This field will be used to indicate that the node is willing to do this.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || forward_secrecy || ('''Proposal''') Receiving node supports a forward secrecy encryption extension. The exact design is pending.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || extended_encoding || ('''Proposal'') Receiving node supports extended encoding. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || ('''Proposal''') Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them.&lt;br /&gt;
'''NOTE:''' since hardly anyone implements this, this will be redesigned as simple recipient verification: https://github.com/Bitmessage/PyBitmessage/pull/808#issuecomment-170189856&lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|-&lt;br /&gt;
| 3 || NODE_POW     || '''(Proposal)''' This node may do PoW on behalf of some its peers (PoW offloading/delegating), but it doesn't have to. Clients may have to meet additional requirements (e.g. TLS authentication)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NODE_DANDELION || Node supports dandelion (https://github.com/gfanti/bips/blob/master/bip-dandelion.mediawiki)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47589</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47589"/>
		<updated>2017-12-27T05:47:37Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should help novice users run Bitmessage from the source code files.&lt;br /&gt;
&lt;br /&gt;
= setuptools =&lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' and in most cases the easiest procedure for installing PyBitmessage. There is also a helper script to resolve dependencies easily.&lt;br /&gt;
&lt;br /&gt;
Go to the directory with PyBitmessage source code and run:&lt;br /&gt;
&lt;br /&gt;
  python checkdeps.py&lt;br /&gt;
&lt;br /&gt;
If there are missing dependencies, it will explain you what is missing and for many Unix-like systems also what you have to do to resolve it. How you then run setuptools depends on whether you want to install it to user's directory or system.&lt;br /&gt;
&lt;br /&gt;
As normal user:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install --user&lt;br /&gt;
  ~/.local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
or as root:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install&lt;br /&gt;
  /usr/local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
If it doesn't work out, you can follow the more detailed description below.&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
== Resolve dependencies ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;80%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Distribuion&lt;br /&gt;
! Instructions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Debian-based&lt;br /&gt;
(Ubuntu, Raspbian, PiBang, others)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Note for Debian Squeeze (6.0) users: Debian Squeeze does not offer packages (like Python, OpenSSL) in versions that are needed for Bitmessage. You can still try to [https://github.com/Bitmessage/PyBitmessage/issues/47#issuecomment-17774377 work around these problems]. Debian 7 &amp;quot;wheezy&amp;quot; works without problems.''&amp;lt;/small&amp;gt;&lt;br /&gt;
  sudo apt-get install python openssl libssl-dev git python-msgpack python-qt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Arch Linux&lt;br /&gt;
| &lt;br /&gt;
  sudo pacman -S python2 openssl git python2-pyqt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Fedora&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/f18/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
Note for Fedora 20 users: Due to inconsistent behavior encountered by declaring the above variable globally, the following &amp;quot;wrapper script&amp;quot; will declare the LD_LIBRARY_PATH variable correctly and only when running bitmessage.  Name the script something like &amp;quot;bitmessage&amp;quot;, mark it as executable (probably something like 755) and put it in /usr/bin so it's accessible without the full path.&lt;br /&gt;
  export LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}&amp;quot;&lt;br /&gt;
  /home/&amp;lt;yourusername&amp;gt;/PyBitmessage/src/bitmessagemain.py &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Red Hat Enterprise Linux (RHEL)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/el6/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GNU Guix&lt;br /&gt;
| &lt;br /&gt;
  guix package -i python2-msgpack python2-pyqt@4.11.4 python2-sip openssl&lt;br /&gt;
&lt;br /&gt;
For the C PoW in addition&lt;br /&gt;
&lt;br /&gt;
  guix package -i gcc binutils make linux-libre-headers gcc-toolchain&lt;br /&gt;
&lt;br /&gt;
For the OpenCL PoW in addition to both of the above, and drivers for your GPU:&lt;br /&gt;
&lt;br /&gt;
  guix package -i libffi;pip2 install pyopencl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Download and run PyBitmessage ==&lt;br /&gt;
# Download the source code from github:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/Bitmessage/PyBitmessage $HOME/PyBitmessage&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run PyBitmessage:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&lt;br /&gt;
Check the wiki for more information on how to run Bitmessage [https://bitmessage.org/wiki/Daemon as a daemon].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;If you receive a warning that you need to use python 2.7.3 or greater, and have followed the above instructions to upgrade it, your system may be attemping to run PyBitmessage with python 3. In this case, run &amp;lt;code&amp;gt;python2 ~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
To upgrade Bitmessage run the following commands:&lt;br /&gt;
:&amp;lt;code&amp;gt;cd $HOME/PyBitmessage&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OS X =&lt;br /&gt;
== With Homebrew package manager ==&lt;br /&gt;
; Setup&lt;br /&gt;
First, make sure you have not already installed Macports. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Install Homebrew: &lt;br /&gt;
 ruby -e &amp;quot;$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; Update Python:&lt;br /&gt;
 brew install python&lt;br /&gt;
&lt;br /&gt;
; Install dependencies:&lt;br /&gt;
 brew install pyqt openssl&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
== With macports package manager ==&lt;br /&gt;
First, make sure you have not already installed Homebrew. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Installing with macports or homebrew essentially has the same effect. Homebrew does some things better than ports, and ports does some things better than brew. If old-school floats your boat, these instructions are for you. &lt;br /&gt;
&lt;br /&gt;
; Select the macports installation that is right for your version of osx&lt;br /&gt;
Read the instructions or take this as a reminder: Apple's XCode and their Command Line Tools are a prerequiste for Macports, go: https://www.macports.org/install.php&lt;br /&gt;
&lt;br /&gt;
; Install dependencies and needed tools&lt;br /&gt;
 sudo port install python27 py27-pyqt4 openssl&lt;br /&gt;
 sudo port install git-core +svn +doc +bash_completion +gitweb&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python2.7 src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
= Windows =&lt;br /&gt;
# Download and install the latest revision of Python 2.7 (currently Python 2.7.10 from [https://www.python.org/downloads/ here]). The ''Windows x86 MSI Installer'' is the right choice for most people. (64-bit users may want the 64-bit version).&lt;br /&gt;
## Test that it installed:&lt;br /&gt;
### Open a command prompt by going to Start &amp;gt; Run. Type 'cmd' then press enter.&lt;br /&gt;
### type 'python'. If python is installed, you should see the python version and the prompt: '&amp;gt;&amp;gt;&amp;gt;'&lt;br /&gt;
### If you see a message such as: &amp;quot;'Python is not recognized as an internal or external command...&amp;quot; then you must add the python path to your path environmental variable:&lt;br /&gt;
#### Find the location where Python was installed (in particular, the location where python.exe exists). It might simply be in c:\Python2.7 &lt;br /&gt;
#### Follow [http://www.computerhope.com/issues/ch000549.htm these directions] to add the Python path to your path variable.&lt;br /&gt;
#### Close the command prompt window and reopen it. &lt;br /&gt;
### Try running 'python' again.&lt;br /&gt;
###Press Ctrl-Z to exit Python.&lt;br /&gt;
# Download PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here].   ''PyQt is one of Bitmessage's two dependencies.'' Look for the links to downloads under the heading labeled &amp;quot;Binary Package;&amp;quot; the binary package versions are already compiled for you. Select the version for Python 2.7 (look for &amp;quot;Py2.7&amp;quot; in the file name). Install PyQt.&lt;br /&gt;
# Download OpenSSL from [http://slproweb.com/products/Win32OpenSSL.html here]. ''OpenSSL is the second of Bitmessage's two dependencies.''  Install OpenSSL.  If an error message appears during installation of OpenSSL, download and install Visual C++ 2008.  A link is provided on the OpenSSL download page.&lt;br /&gt;
# Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'.&lt;br /&gt;
# To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'. &lt;br /&gt;
&lt;br /&gt;
== If you change user interface files ==&lt;br /&gt;
You can use Qt's Designer application to modify the user interface. After you do this, you will need to 'compile' .ui files into .py files. &lt;br /&gt;
# In a command prompt, change directories to the directory of your .ui file.&lt;br /&gt;
# Run 'pyuic4 example.ui &amp;gt; example.py'  If you get a message similar to 'pyuic4 is not recognized as an internal or external command' then you must add the PyQt directory to your system's path variable. This directory should hold pyuic4.bat. It might be in C:\Python27\Lib\site-packages\PyQt4. Remember to close the command window and reopen it after you change your path variable.&lt;br /&gt;
&lt;br /&gt;
If you add icons to bitmessage_icons.qrc, then you must run this command:&lt;br /&gt;
pyrcc4 bitmessage_icons.qrc -o bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
== Optional: Compile into a stand-alone EXE ==&lt;br /&gt;
# Download and install PyWin32&lt;br /&gt;
# Download [http://www.pyinstaller.org/ PyInstaller].&lt;br /&gt;
# Copy Bitmessage's 'src' directory to the PyInstaller directory (which contains pyinstaller.py). &lt;br /&gt;
# Run 'pyinstaller.py --onefile --noconsole --icon=&amp;quot;src\images\can-icon.ico&amp;quot; src\bitmessagemain.py'&lt;br /&gt;
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps:&lt;br /&gt;
# After following the steps above, you will see that pyinstaller created a folder called bitmessagemain. In that folder is a file: bitmessagemain.spec. Open it with a text editor.&lt;br /&gt;
# Below the line &amp;quot;a.datas,&amp;quot; add this line: &amp;lt;code&amp;gt;a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],&amp;lt;/code&amp;gt;&lt;br /&gt;
# Optionally also include the translations by modifying this file further by adding the lines shown in [[Example_pyinstaller_spec_file|this]] example file. &lt;br /&gt;
# Save and close&lt;br /&gt;
# Run this command: pyinstaller.py bitmessagemain/bitmessagemain.spec&lt;br /&gt;
&lt;br /&gt;
If you do not have the libeay32.dll you can download it here. http://www.dll-files.com/dllindex/dll-files.shtml?libeay32&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47588</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47588"/>
		<updated>2017-09-21T11:48:12Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Explain checkdeps.py vs setup.py&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should help novice users run Bitmessage from the source code files.&lt;br /&gt;
&lt;br /&gt;
= setuptools =&lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' and in most cases the easiest procedure for installing PyBitmessage. There is also a helper script to resolve dependencies easily.&lt;br /&gt;
&lt;br /&gt;
Go to the directory with PyBitmessage source code and run:&lt;br /&gt;
&lt;br /&gt;
  python checkeps.py&lt;br /&gt;
&lt;br /&gt;
If there are missing dependencies, it will explain you what is missing and for many Unix-like systems also what you have to do to resolve it. How you then run setuptools depends on whether you want to install it to user's directory or system.&lt;br /&gt;
&lt;br /&gt;
As normal user:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install --user&lt;br /&gt;
  ~/.local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
or as root:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install&lt;br /&gt;
  /usr/local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
If it doesn't work out, you can follow the more detailed description below.&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
== Resolve dependencies ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;80%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Distribuion&lt;br /&gt;
! Instructions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Debian-based&lt;br /&gt;
(Ubuntu, Raspbian, PiBang, others)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Note for Debian Squeeze (6.0) users: Debian Squeeze does not offer packages (like Python, OpenSSL) in versions that are needed for Bitmessage. You can still try to [https://github.com/Bitmessage/PyBitmessage/issues/47#issuecomment-17774377 work around these problems]. Debian 7 &amp;quot;wheezy&amp;quot; works without problems.''&amp;lt;/small&amp;gt;&lt;br /&gt;
  sudo apt-get install python openssl libssl-dev git python-msgpack python-qt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Arch Linux&lt;br /&gt;
| &lt;br /&gt;
  sudo pacman -S python2 openssl git python2-pyqt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Fedora&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/f18/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
Note for Fedora 20 users: Due to inconsistent behavior encountered by declaring the above variable globally, the following &amp;quot;wrapper script&amp;quot; will declare the LD_LIBRARY_PATH variable correctly and only when running bitmessage.  Name the script something like &amp;quot;bitmessage&amp;quot;, mark it as executable (probably something like 755) and put it in /usr/bin so it's accessible without the full path.&lt;br /&gt;
  export LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}&amp;quot;&lt;br /&gt;
  /home/&amp;lt;yourusername&amp;gt;/PyBitmessage/src/bitmessagemain.py &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Red Hat Enterprise Linux (RHEL)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/el6/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GNU Guix&lt;br /&gt;
| &lt;br /&gt;
  guix package -i python2-msgpack python2-pyqt@4.11.4 python2-sip openssl&lt;br /&gt;
&lt;br /&gt;
For the C PoW in addition&lt;br /&gt;
&lt;br /&gt;
  guix package -i gcc binutils make linux-libre-headers gcc-toolchain&lt;br /&gt;
&lt;br /&gt;
For the OpenCL PoW in addition to both of the above, and drivers for your GPU:&lt;br /&gt;
&lt;br /&gt;
  guix package -i libffi;pip2 install pyopencl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Download and run PyBitmessage ==&lt;br /&gt;
# Download the source code from github:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/Bitmessage/PyBitmessage $HOME/PyBitmessage&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run PyBitmessage:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&lt;br /&gt;
Check the wiki for more information on how to run Bitmessage [https://bitmessage.org/wiki/Daemon as a daemon].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;If you receive a warning that you need to use python 2.7.3 or greater, and have followed the above instructions to upgrade it, your system may be attemping to run PyBitmessage with python 3. In this case, run &amp;lt;code&amp;gt;python2 ~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
To upgrade Bitmessage run the following commands:&lt;br /&gt;
:&amp;lt;code&amp;gt;cd $HOME/PyBitmessage&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OS X =&lt;br /&gt;
== With Homebrew package manager ==&lt;br /&gt;
; Setup&lt;br /&gt;
First, make sure you have not already installed Macports. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Install Homebrew: &lt;br /&gt;
 ruby -e &amp;quot;$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; Update Python:&lt;br /&gt;
 brew install python&lt;br /&gt;
&lt;br /&gt;
; Install dependencies:&lt;br /&gt;
 brew install pyqt openssl&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
== With macports package manager ==&lt;br /&gt;
First, make sure you have not already installed Homebrew. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Installing with macports or homebrew essentially has the same effect. Homebrew does some things better than ports, and ports does some things better than brew. If old-school floats your boat, these instructions are for you. &lt;br /&gt;
&lt;br /&gt;
; Select the macports installation that is right for your version of osx&lt;br /&gt;
Read the instructions or take this as a reminder: Apple's XCode and their Command Line Tools are a prerequiste for Macports, go: https://www.macports.org/install.php&lt;br /&gt;
&lt;br /&gt;
; Install dependencies and needed tools&lt;br /&gt;
 sudo port install python27 py27-pyqt4 openssl&lt;br /&gt;
 sudo port install git-core +svn +doc +bash_completion +gitweb&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python2.7 src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
= Windows =&lt;br /&gt;
# Download and install the latest revision of Python 2.7 (currently Python 2.7.10 from [https://www.python.org/downloads/ here]). The ''Windows x86 MSI Installer'' is the right choice for most people. (64-bit users may want the 64-bit version).&lt;br /&gt;
## Test that it installed:&lt;br /&gt;
### Open a command prompt by going to Start &amp;gt; Run. Type 'cmd' then press enter.&lt;br /&gt;
### type 'python'. If python is installed, you should see the python version and the prompt: '&amp;gt;&amp;gt;&amp;gt;'&lt;br /&gt;
### If you see a message such as: &amp;quot;'Python is not recognized as an internal or external command...&amp;quot; then you must add the python path to your path environmental variable:&lt;br /&gt;
#### Find the location where Python was installed (in particular, the location where python.exe exists). It might simply be in c:\Python2.7 &lt;br /&gt;
#### Follow [http://www.computerhope.com/issues/ch000549.htm these directions] to add the Python path to your path variable.&lt;br /&gt;
#### Close the command prompt window and reopen it. &lt;br /&gt;
### Try running 'python' again.&lt;br /&gt;
###Press Ctrl-Z to exit Python.&lt;br /&gt;
# Download PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here].   ''PyQt is one of Bitmessage's two dependencies.'' Look for the links to downloads under the heading labeled &amp;quot;Binary Package;&amp;quot; the binary package versions are already compiled for you. Select the version for Python 2.7 (look for &amp;quot;Py2.7&amp;quot; in the file name). Install PyQt.&lt;br /&gt;
# Download OpenSSL from [http://slproweb.com/products/Win32OpenSSL.html here]. ''OpenSSL is the second of Bitmessage's two dependencies.''  Install OpenSSL.  If an error message appears during installation of OpenSSL, download and install Visual C++ 2008.  A link is provided on the OpenSSL download page.&lt;br /&gt;
# Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'.&lt;br /&gt;
# To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'. &lt;br /&gt;
&lt;br /&gt;
== If you change user interface files ==&lt;br /&gt;
You can use Qt's Designer application to modify the user interface. After you do this, you will need to 'compile' .ui files into .py files. &lt;br /&gt;
# In a command prompt, change directories to the directory of your .ui file.&lt;br /&gt;
# Run 'pyuic4 example.ui &amp;gt; example.py'  If you get a message similar to 'pyuic4 is not recognized as an internal or external command' then you must add the PyQt directory to your system's path variable. This directory should hold pyuic4.bat. It might be in C:\Python27\Lib\site-packages\PyQt4. Remember to close the command window and reopen it after you change your path variable.&lt;br /&gt;
&lt;br /&gt;
If you add icons to bitmessage_icons.qrc, then you must run this command:&lt;br /&gt;
pyrcc4 bitmessage_icons.qrc -o bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
== Optional: Compile into a stand-alone EXE ==&lt;br /&gt;
# Download and install PyWin32&lt;br /&gt;
# Download [http://www.pyinstaller.org/ PyInstaller].&lt;br /&gt;
# Copy Bitmessage's 'src' directory to the PyInstaller directory (which contains pyinstaller.py). &lt;br /&gt;
# Run 'pyinstaller.py --onefile --noconsole --icon=&amp;quot;src\images\can-icon.ico&amp;quot; src\bitmessagemain.py'&lt;br /&gt;
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps:&lt;br /&gt;
# After following the steps above, you will see that pyinstaller created a folder called bitmessagemain. In that folder is a file: bitmessagemain.spec. Open it with a text editor.&lt;br /&gt;
# Below the line &amp;quot;a.datas,&amp;quot; add this line: &amp;lt;code&amp;gt;a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],&amp;lt;/code&amp;gt;&lt;br /&gt;
# Optionally also include the translations by modifying this file further by adding the lines shown in [[Example_pyinstaller_spec_file|this]] example file. &lt;br /&gt;
# Save and close&lt;br /&gt;
# Run this command: pyinstaller.py bitmessagemain/bitmessagemain.spec&lt;br /&gt;
&lt;br /&gt;
If you do not have the libeay32.dll you can download it here. http://www.dll-files.com/dllindex/dll-files.shtml?libeay32&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47585</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47585"/>
		<updated>2017-07-31T05:47:57Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* version */ Reserve bitfield for dandelion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || See [[Extended encoding]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 27 || onion_router || ('''Proposal''') Node can be used to onion-route messages. In theory any node can onion route, but since it requires more resources, they may have the functionality disabled. This field will be used to indicate that the node is willing to do this.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || forward_secrecy || ('''Proposal''') Receiving node supports a forward secrecy encryption extension. The exact design is pending.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || extended_encoding || ('''Proposal'') Receiving node supports extended encoding. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || ('''Proposal''') Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them.&lt;br /&gt;
'''NOTE:''' since hardly anyone implements this, this will be redesigned as simple recipient verification: https://github.com/Bitmessage/PyBitmessage/pull/808#issuecomment-170189856&lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|-&lt;br /&gt;
| 3 || NODE_POW     || '''(Proposal)''' This node may do PoW on behalf of some its peers (PoW offloading/delegating), but it doesn't have to. Clients may have to meet additional requirements (e.g. TLS authentication)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NODE_DANDELION || '''(Proposal)''' Node supports dandelion (https://github.com/gfanti/bips/blob/master/bip-dandelion.mediawiki)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47584</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47584"/>
		<updated>2017-07-31T05:46:11Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* Pubkey bitfield features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || See [[Extended encoding]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 27 || onion_router || ('''Proposal''') Node can be used to onion-route messages. In theory any node can onion route, but since it requires more resources, they may have the functionality disabled. This field will be used to indicate that the node is willing to do this.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || forward_secrecy || ('''Proposal''') Receiving node supports a forward secrecy encryption extension. The exact design is pending.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || extended_encoding || ('''Proposal'') Receiving node supports extended encoding. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || ('''Proposal''') Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them.&lt;br /&gt;
'''NOTE:''' since hardly anyone implements this, this will be redesigned as simple recipient verification: https://github.com/Bitmessage/PyBitmessage/pull/808#issuecomment-170189856&lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|-&lt;br /&gt;
| 3 || NODE_POW     || This node may do PoW on behalf of some its peers (PoW offloading/delegating), but it doesn't have to. Clients may have to meet additional requirements (e.g. TLS authentication) '''(proposal)'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=47581</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=47581"/>
		<updated>2017-05-27T05:51:01Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Fix: sendMessage/sendBroadcast if using TTL, you also need encodingtype&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
The PyBitmessage API uses [http://en.wikipedia.org/wiki/XML-RPC XML-RPC].&lt;br /&gt;
&lt;br /&gt;
=== Enable the API ===&lt;br /&gt;
To enable the API, copy and paste these lines into the bitmessagesettings section of the [[keys.dat]] file.&lt;br /&gt;
Note that the values &amp;quot;username&amp;quot; and &amp;quot;password&amp;quot; below are merely examples, and should be replaced by values that cannot feasibly be guessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apienabled = true&lt;br /&gt;
apiport = 8442&lt;br /&gt;
apiinterface = 127.0.0.1&lt;br /&gt;
apiusername = username &lt;br /&gt;
apipassword = password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, you may optionally include an additional entry which will specify a program which Bitmessage will run when certain events occur.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apinotifypath = c:\\example\\example.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
One of these arguments will be passed to your program: startingUp, newMessage, newBroadcast. Be sure your program doesn't crash when given newer arguments introduced in the future as this list will likely expand.&lt;br /&gt;
&lt;br /&gt;
=== Remote Access ===&lt;br /&gt;
To access the Bitmessage API from a remote location, change the apiinterface value from '''127.0.0.1''' to '''0.0.0.0'''. &lt;br /&gt;
&lt;br /&gt;
The following Python code offers a demonstration of how to create a client that can connect to the PyBitmessage API. &lt;br /&gt;
&lt;br /&gt;
In this example, the username is &amp;quot;username&amp;quot;, the password is &amp;quot;password&amp;quot;, the IP address of the server running PyBitmessage is 105.168.1.0 (a random example), and the port number which PyBitmessage has been configured to listen on is 8442. In order to connect with the remote copy of PyBitmessage, these settings must match those in PyBitmessage's &amp;quot;keys.dat&amp;quot; file. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import xmlrpclib&lt;br /&gt;
import json&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
api = xmlrpclib.ServerProxy(&amp;quot;http://username:password@105.168.1.0:8442/&amp;quot;)&lt;br /&gt;
print api.add(2,3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more complete example can be found in the [https://github.com/Bitmessage/PyBitmessage/blob/master/src/api_client.py api_client.py] file in the PyBitmessage source code. &lt;br /&gt;
&lt;br /&gt;
=== List of Operations ===&lt;br /&gt;
Required arguments are denoted inside &amp;lt; and &amp;gt;  Optional arguments are inside [ and ]. &lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Command !! Parameters !! Minimum Version !! Description&lt;br /&gt;
|-&lt;br /&gt;
| helloWorld || &amp;lt;firstWord&amp;gt; &amp;lt;secondWord&amp;gt; || 0.2.7 || returns 'firstWord-secondWord'. Used as a simple test of the API.&lt;br /&gt;
|-&lt;br /&gt;
| add || &amp;lt;integer&amp;gt; &amp;lt;integer&amp;gt; || 0.2.7 || returns the sum of the integers. Used as a simple test of the API.&lt;br /&gt;
|-&lt;br /&gt;
| statusBar || &amp;lt;message&amp;gt; || 0.2.7 || Displays the message in the status bar on the GUI&lt;br /&gt;
|-&lt;br /&gt;
| listAddresses2|| || 0.4.0 || Lists all addresses shown on the Your Identities tab. Returns a list of objects with these properties:&lt;br /&gt;
* label (base64, decodes into utf-8) &lt;br /&gt;
* address (ascii/utf-8)&lt;br /&gt;
* stream (integer)&lt;br /&gt;
* enabled (bool)&lt;br /&gt;
* chan (bool)&lt;br /&gt;
&lt;br /&gt;
This is called listAddresses'''2''' because 'listAddresses' is obsolete.&lt;br /&gt;
|-&lt;br /&gt;
| createRandomAddress || &amp;lt;label&amp;gt; [eighteenByteRipe] [totalDifficulty] [smallMessageDifficulty] || 0.2.7 || Creates one address using the random number generator. label should be base64 encoded. eighteenByteRipe is a boolean telling Bitmessage whether to generate an address with an 18 byte RIPE hash(as opposed to a 19 byte hash). This is the same setting as the &amp;quot;Do extra work to make the address 1 or 2 characters shorter&amp;quot; in the user interface. Using False is recommended if you are running some sort of website and will be generating a lot of addresses. Note that even if you don't ask for it, there is still a 1 in 256 chance that you will get an address with an 18 byte RIPE hash so if you actually ''need'' an address with a 19 byte RIPE hash for some reason, you will need to check for it. eighteenByteRipe defaults to False. totalDifficulty and smallMessageDifficulty default to 1.&lt;br /&gt;
&lt;br /&gt;
Returns the address.&lt;br /&gt;
&lt;br /&gt;
Warning: At present, Bitmessage gets confused if you use both the API and the UI to make an address at the same time.&lt;br /&gt;
|-&lt;br /&gt;
|createDeterministicAddresses ||&amp;lt;passphrase&amp;gt; [numberOfAddresses] [addressVersionNumber] [streamNumber] [eighteenByteRipe] [totalDifficulty] [smallMessageDifficulty] || 0.3.4 || Similar to createRandomAddress except that you may generate many addresses in one go. passphrase should be base64 encoded. numberOfAddresses defaults to 1. addressVersionNumber and streamNumber may be set to 0 which will tell Bitmessage to use the most up-to-date addressVersionNumber and the most available streamNumber. Using zero for each of these fields is recommended. eighteenByteRipe defaults to False. totalDifficulty and smallMessageDifficulty default to 1.&lt;br /&gt;
&lt;br /&gt;
Returns a list of new addresses.  This list will be empty if the addresses already existed.&lt;br /&gt;
&lt;br /&gt;
Warning: At present, Bitmessage gets confused if you use both the API and the UI to make addresses at the same time.&lt;br /&gt;
|-&lt;br /&gt;
|getDeterministicAddress ||&amp;lt;passphrase&amp;gt; &amp;lt;addressVersionNumber&amp;gt; &amp;lt;streamNumber&amp;gt;  || 0.3.1 || Similar to createDeterministicAddresses except that the one address that is returned will not be added to the Bitmessage user interface or the keys.dat file. passphrase should be base64 encoded. addressVersionNumber should be set to 3 or 4 as these are the only ones currently supported. streamNumber must be set to 1 as this is the only one currently supported. &lt;br /&gt;
&lt;br /&gt;
Returns a single address. &lt;br /&gt;
&lt;br /&gt;
Warning: At present, Bitmessage gets confused if you use both this API command and the UI to make addresses at the same time.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;getAllInboxMessages&amp;lt;/code&amp;gt;|| || 0.2.7 || Does not include trashed messages. Returns a list of objects with these properties:&lt;br /&gt;
* msgid (hex)&lt;br /&gt;
* toAddress (ascii/utf-8)&lt;br /&gt;
* fromAddress (ascii/utf-8)&lt;br /&gt;
* subject (base64, decodes into utf-8)&lt;br /&gt;
* message (base64, decodes into utf-8)&lt;br /&gt;
* [[Protocol_specification#Message_Encodings|encodingType]] (integer)&lt;br /&gt;
* receivedTime (integer, Unix time)&lt;br /&gt;
* read (integer representing binary state (0 or 1))&lt;br /&gt;
&lt;br /&gt;
The msgid is the same as the hash of the message (analogous to the TXID in Bitcoin) thus it is shown in hex as that is the de facto standard. The base64 encoding Bitmessage uses includes line breaks including one on the end of the string.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;getAllInboxMessageIDs&amp;lt;/code&amp;gt;|| || 0.2.7 || Returns a list of msgids of all Inbox messages with there properties:&lt;br /&gt;
* msgid (hex)&lt;br /&gt;
|-&lt;br /&gt;
| getInboxMessageByID || &amp;lt;msgid&amp;gt; [read] || 0.4.0 || Returns an object with these properties:&lt;br /&gt;
* msgid (hex)&lt;br /&gt;
* toAddress (ascii/utf-8)&lt;br /&gt;
* fromAddress (ascii/utf-8)&lt;br /&gt;
* subject (base64, decodes into utf-8)&lt;br /&gt;
* message (base64, decodes into utf-8)&lt;br /&gt;
* [[Protocol_specification#Message_Encodings|encodingType]] (integer)&lt;br /&gt;
* receivedTime (integer, Unix time)&lt;br /&gt;
* read (integer representing binary state (0 or 1))&lt;br /&gt;
&lt;br /&gt;
Optionally sets the specific message to have a read status of 'read' (bool).&lt;br /&gt;
&lt;br /&gt;
The msgid is the same as the hash of the message (analogous to the TXID in Bitcoin) thus it should be given in hex as that is the de facto standard. The base64 encoding Bitmessage uses includes line breaks including one on the end of the string.&lt;br /&gt;
|-&lt;br /&gt;
| getSentMessageByAckData || &amp;lt;ackData&amp;gt; || 0.3.4 || Returns an object with these properties:&lt;br /&gt;
* msgid (hex)&lt;br /&gt;
* toAddress (ascii/utf-8)&lt;br /&gt;
* fromAddress (ascii/utf-8)&lt;br /&gt;
* subject (base64, decodes into utf-8)&lt;br /&gt;
* message (base64, decodes into utf-8)&lt;br /&gt;
* [[Protocol_specification#Message_Encodings|encodingType]] (integer)&lt;br /&gt;
* lastActionTime (integer, Unix time)&lt;br /&gt;
* status (ascii/utf-8)&lt;br /&gt;
* ackData (hex)&lt;br /&gt;
|-&lt;br /&gt;
| getAllSentMessages || || 0.3.4 || Returns an object with these properties:&lt;br /&gt;
* msgid (hex)&lt;br /&gt;
* toAddress (ascii/utf-8)&lt;br /&gt;
* fromAddress (ascii/utf-8)&lt;br /&gt;
* subject (base64, decodes into utf-8)&lt;br /&gt;
* message (base64, decodes into utf-8)&lt;br /&gt;
* [[Protocol_specification#Message_Encodings|encodingType]] (integer)&lt;br /&gt;
* lastActionTime (integer, Unix time)&lt;br /&gt;
* status (ascii/utf-8)&lt;br /&gt;
* ackData (hex)&lt;br /&gt;
|-&lt;br /&gt;
| getSentMessageByID || &amp;lt;msgid&amp;gt; || 0.3.4 || Returns an object with these properties:&lt;br /&gt;
* msgid (hex)&lt;br /&gt;
* toAddress (ascii/utf-8)&lt;br /&gt;
* fromAddress (ascii/utf-8)&lt;br /&gt;
* subject (base64, decodes into utf-8)&lt;br /&gt;
* message (base64, decodes into utf-8)&lt;br /&gt;
* [[Protocol_specification#Message_Encodings|encodingType]] (integer)&lt;br /&gt;
* lastActionTime (integer, Unix time)&lt;br /&gt;
* status (ascii/utf-8)&lt;br /&gt;
* ackData (hex)&lt;br /&gt;
|-&lt;br /&gt;
| getSentMessagesBySender|| &amp;lt;fromAddress&amp;gt; || 0.3.4 || Returns a list of objects with these properties:&lt;br /&gt;
* msgid (hex)&lt;br /&gt;
* toAddress (ascii/utf-8)&lt;br /&gt;
* fromAddress (ascii/utf-8)&lt;br /&gt;
* subject (base64, decodes into utf-8)&lt;br /&gt;
* message (base64, decodes into utf-8)&lt;br /&gt;
* [[Protocol_specification#Message_Encodings|encodingType]] (integer)&lt;br /&gt;
* lastActionTime (integer, Unix time)&lt;br /&gt;
* status (ascii/utf-8)&lt;br /&gt;
* ackData (hex)&lt;br /&gt;
|-&lt;br /&gt;
| trashMessage || &amp;lt;msgid&amp;gt; || 0.2.7 || returns a simple message saying that the message was trashed assuming it ever even existed. Prior existence is not checked. msgid is encoded in hex just like in the getAllInboxMessages function.&lt;br /&gt;
|-&lt;br /&gt;
| sendMessage || &amp;lt;toAddress&amp;gt; &amp;lt;fromAddress&amp;gt; &amp;lt;subject&amp;gt; &amp;lt;message&amp;gt; [encodingType [TTL]] || 0.2.7 or 0.4.5 || returns ackdata encoded in hex. subject and message must be encoded in base64 which may optionally include line breaks. If used, the encodingType must be set to 2; this is included for forwards compatibility. TTL is specified in seconds; values outside the bounds of 3600 to 2419200 will be moved to be within those bounds. TTL defaults to 4 days. TTL is only available in PyBitmessage version 0.4.5 and higher.&lt;br /&gt;
|-&lt;br /&gt;
| sendBroadcast || &amp;lt;fromAddress&amp;gt; &amp;lt;subject&amp;gt; &amp;lt;message&amp;gt; [encodingType [TTL]] || 0.2.7 or 0.4.5 || returns ackData encoded in hex. subject and message must be encoded in base64. If used, the encodingType must be set to 2; this is included for forwards compatibility. TTL is specified in seconds; values outside the bounds of 3600 to 2419200 will be moved to be within those bounds. TTL defaults to 4 days. TTL is only available in PyBitmessage version 0.4.5 and higher.&lt;br /&gt;
|-&lt;br /&gt;
| getStatus || &amp;lt;ackData&amp;gt; || 0.3.0 || returns one of these strings: &amp;lt;strike&amp;gt;notFound, findingPubkey, doingPOW, sentMessage, or ackReceived&amp;lt;/strike&amp;gt; notfound, msgqueued, broadcastqueued, broadcastsent, doingpubkeypow, awaitingpubkey, doingmsgpow, forcepow, msgsent, msgsentnoackexpected, or ackreceived. &lt;br /&gt;
|-&lt;br /&gt;
| listSubscriptions||  || 0.4.0 || Returns a list of objects with these properties:&lt;br /&gt;
* label (base64, decodes into utf-8)&lt;br /&gt;
* address (ascii/utf-8)&lt;br /&gt;
* enabled (bool)&lt;br /&gt;
|-&lt;br /&gt;
| addSubscription|| &amp;lt;address&amp;gt; [label] || 0.3.1 || Subscribe to an address. label must be base64-encoded.&lt;br /&gt;
|-&lt;br /&gt;
| deleteSubscription|| &amp;lt;address&amp;gt; || 0.3.1 || Unsubscribe from an address. The program does not check to see whether you were subscribed in the first place.&lt;br /&gt;
|-&lt;br /&gt;
| listAddressBookEntries|| || 0.4.0 ||Returns a list of objects with these properties: &lt;br /&gt;
* address (ascii/utf-8)&lt;br /&gt;
* label (base64, decodes into utf-8)&lt;br /&gt;
|-&lt;br /&gt;
| addAddressBookEntry|| &amp;lt;address&amp;gt; &amp;lt;label&amp;gt; || 0.4.0 || Add an entry to your address book. label must be base64-encoded.&lt;br /&gt;
|-&lt;br /&gt;
| deleteAddressBookEntry|| &amp;lt;address&amp;gt; || 0.4.0 || Delete an entry from your address book. The program does not check to see whether it was there in the first place.&lt;br /&gt;
|-&lt;br /&gt;
| trashSentMessageByAckData|| &amp;lt;ackData&amp;gt; || 0.4.0 || Trashes a sent message based on its ackdata. ackData should be encoded in hex. Returns a simple message saying that the message was trashed assuming it ever even existed. Prior existence is not checked.&lt;br /&gt;
|-&lt;br /&gt;
| createChan|| &amp;lt;passphrase&amp;gt; || 0.4.2 || Creates a new chan. passphrase must be base64 encoded. Outputs the corresponding Bitmessage address. &lt;br /&gt;
|-&lt;br /&gt;
| joinChan|| &amp;lt;passphrase&amp;gt; &amp;lt;address&amp;gt; || 0.4.2 || Join a chan. passphrase must be base64 encoded. Outputs &amp;quot;success&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| leaveChan|| &amp;lt;address&amp;gt; || 0.4.2 || Leave a chan. Outputs &amp;quot;success&amp;quot;. Note that at this time, the address is still shown in the UI until a restart. &lt;br /&gt;
|-&lt;br /&gt;
| deleteAddress|| &amp;lt;address&amp;gt; || 0.4.2 || Permanently delete an address from Your Identities and your keys.dat file. Outputs &amp;quot;success&amp;quot;. Note that at this time, the address is still shown in the UI until a restart.&lt;br /&gt;
|-&lt;br /&gt;
| decodeAddress|| &amp;lt;address&amp;gt; || 0.4.2 || Returns an object with these properties: &lt;br /&gt;
* status (ascii/utf-8)&lt;br /&gt;
* addressVersion (ascii integer)&lt;br /&gt;
* streamNumber (ascii integer)&lt;br /&gt;
* ripe (base64, decodes into binary data)&lt;br /&gt;
|-&lt;br /&gt;
| addAddressToBlackWhiteList || &amp;lt;address&amp;gt; [label] || 0.4.5 || Add an entry to your black or white list- whichever you are currently using. label must be base64-encoded.&lt;br /&gt;
|-&lt;br /&gt;
| removeAddressFromBlackWhiteList || &amp;lt;address&amp;gt; || 0.4.5 || Delete an entry from your black or white list- whichever you are currently using (but not both). &lt;br /&gt;
|-&lt;br /&gt;
| clientStatus ||  || 0.4.0 || Returns the softwareName, softwareVersion, networkStatus, networkConnections, numberOfPubkeysProcessed, numberOfMessagesProcessed, and numberOfBroadcastsProcessed. networkStatus will be one of these strings: &amp;quot;notConnected&amp;quot;, &amp;quot;connectedButHaveNotReceivedIncomingConnections&amp;quot;, or &amp;quot;connectedAndReceivingIncomingConnections&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the minimum required version is higher than {{Bitmessage Current Version Number}} then the code is available in source but not yet available in a compiled binary.&lt;br /&gt;
&lt;br /&gt;
==== Possible error values ====&lt;br /&gt;
&lt;br /&gt;
Here are the various error numbers and descriptions you might see.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Error Number!! Message&lt;br /&gt;
|- &lt;br /&gt;
|0000 || API Error 0000: I need parameters!&lt;br /&gt;
|-&lt;br /&gt;
| 0001 || API Error 0001: The specified passphrase is blank.&lt;br /&gt;
|-&lt;br /&gt;
| 0002 || API Error 0002: The address version number currently must be 3 or 4 (or 0 which means auto-select).&lt;br /&gt;
|- &lt;br /&gt;
| 0003 || API Error 0003: The stream number must be 1 (or 0 which means auto-select). Others aren't supported.&lt;br /&gt;
|-&lt;br /&gt;
| 0004 || API Error 0004: Why would you ask me to generate 0 addresses for you?&lt;br /&gt;
|-&lt;br /&gt;
| 0005 || API Error 0005: You have (accidentally?) specified too many addresses to make. Maximum 999. This check only exists to prevent mischief; if you really want to create more addresses than this, contact the Bitmessage developers and we can modify the check or you can do it yourself by searching the source code for this message.&lt;br /&gt;
|- &lt;br /&gt;
| 0006 || API Error 0006: The encoding type must be 2 because that is the only one this program currently supports.&lt;br /&gt;
|- &lt;br /&gt;
| 0007 || API Error 0007: Could not decode address&lt;br /&gt;
|- &lt;br /&gt;
| 0008 || API Error 0008: Checksum failed for address&lt;br /&gt;
|- &lt;br /&gt;
| 0009 || API Error 0009: Invalid characters in address&lt;br /&gt;
|-&lt;br /&gt;
| 0010 || API Error 0010: Address version number too high (or zero) in address&lt;br /&gt;
|-&lt;br /&gt;
| 0011 || API Error 0011: The address version number currently must be 2, 3, or 4. Others aren't supported.&lt;br /&gt;
|-&lt;br /&gt;
| 0012 || API Error 0012: The stream number must be 1. Others aren't supported.&lt;br /&gt;
|-&lt;br /&gt;
| 0013 || API Error 0013: Could not find your fromAddress in the keys.dat file.&lt;br /&gt;
|- &lt;br /&gt;
| 0014 || API Error 0014: Your fromAddress is disabled. Cannot send.&lt;br /&gt;
|-&lt;br /&gt;
| 0015 || API Error 0015: The length of ackData should be 32 bytes (encoded in hex thus 64 characters).&lt;br /&gt;
|-&lt;br /&gt;
| 0016 || API Error 0016: You are already subscribed to that address.&lt;br /&gt;
|-&lt;br /&gt;
| 0017 || API Error 0017: Label is not valid UTF-8 data.&lt;br /&gt;
|-&lt;br /&gt;
| 0018 || API Error 0018: Chan name does not match address.&lt;br /&gt;
|-&lt;br /&gt;
| 0019 || API Error 0019: The length of hash should be 20 bytes (encoded in hex thus 40 characters).&lt;br /&gt;
|-&lt;br /&gt;
| 0020 || API Error 0020: Invalid method: &amp;lt;method_name_you_tried_to_execute&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0021 || API Error 0021: Unexpected API Failure&lt;br /&gt;
|-&lt;br /&gt;
| 0022 || API Error 0022: Decode Error&lt;br /&gt;
|-&lt;br /&gt;
| 0023 || API Error 0023: Bool expected&lt;br /&gt;
|-&lt;br /&gt;
| 0024 || API Error 0024: Chan address is already present.&lt;br /&gt;
|-&lt;br /&gt;
| 0025 || API Error 0025: Specified address is not a chan address. Use deleteAddress API call instead.&lt;br /&gt;
|-&lt;br /&gt;
| 0026 || API Error 0026: Varint encoded in address is malformed.&lt;br /&gt;
|-&lt;br /&gt;
| 0027 || API Error 0027: Message is too long.&lt;br /&gt;
|-&lt;br /&gt;
| 0028 || API Error 0028: You have already black-/white-listed that address.&lt;br /&gt;
|-&lt;br /&gt;
| 0029 || API Error 0029: That entry does not exist in the black-/white-list.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47579</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47579"/>
		<updated>2017-04-21T12:54:16Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Added NODE_POW services (proposal)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || See [[Extended encoding]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 27 || onion_router || ('''Proposal''') Node can be used to onion-route messages. In theory any node can onion route, but since it requires more resources, they may have the functionality disabled. This field will be used to indicate that the node is willing to do this.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || forward_secrecy || ('''Proposal''') Receiving node supports a forward secrecy encryption extension. The exact design is pending.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || extended_encoding || Receiving node supports extended encoding. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || ('''Proposal''') Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. '''NOTE:''' since hardly anyone implements this, this will be redesigned as simple recipient verification: https://github.com/Bitmessage/PyBitmessage/pull/808#issuecomment-170189856&lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|-&lt;br /&gt;
| 3 || NODE_POW     || This node may do PoW on behalf of some its peers (PoW offloading/delegating), but it doesn't have to. Clients may have to meet additional requirements (e.g. TLS authentication) '''(proposal)'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47578</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47578"/>
		<updated>2017-03-19T21:40:44Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: setuptools is now recommended&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should help novice users run Bitmessage from the source code files.&lt;br /&gt;
&lt;br /&gt;
= setuptools =&lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' and in most cases the easiest procedure for installing PyBitmessage. If there are missing dependencies, it will explain you what is missing and for many Unix-like systems also what you have to do to resolve it. Go to the directory with the PyBitmessage source code and:&lt;br /&gt;
&lt;br /&gt;
as normal user:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install --user&lt;br /&gt;
  ~/.local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
or as root:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install&lt;br /&gt;
  /usr/local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
If it doesn't work out, you can follow the more detailed description below.&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
== Resolve dependencies ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;80%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Distribuion&lt;br /&gt;
! Instructions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Debian-based&lt;br /&gt;
(Ubuntu, Raspbian, PiBang, others)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Note for Debian Squeeze (6.0) users: Debian Squeeze does not offer packages (like Python, OpenSSL) in versions that are needed for Bitmessage. You can still try to [https://github.com/Bitmessage/PyBitmessage/issues/47#issuecomment-17774377 work around these problems]. Debian 7 &amp;quot;wheezy&amp;quot; works without problems.''&amp;lt;/small&amp;gt;&lt;br /&gt;
  sudo apt-get install python openssl libssl-dev git python-msgpack python-qt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Arch Linux&lt;br /&gt;
| &lt;br /&gt;
  sudo pacman -S python2 openssl git python2-pyqt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Fedora&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/f18/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
Note for Fedora 20 users: Due to inconsistent behavior encountered by declaring the above variable globally, the following &amp;quot;wrapper script&amp;quot; will declare the LD_LIBRARY_PATH variable correctly and only when running bitmessage.  Name the script something like &amp;quot;bitmessage&amp;quot;, mark it as executable (probably something like 755) and put it in /usr/bin so it's accessible without the full path.&lt;br /&gt;
  export LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}&amp;quot;&lt;br /&gt;
  /home/&amp;lt;yourusername&amp;gt;/PyBitmessage/src/bitmessagemain.py &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Red Hat Enterprise Linux (RHEL)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/el6/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GNU Guix&lt;br /&gt;
| &lt;br /&gt;
  guix package -i python2-msgpack python2-pyqt@4.11.4 python2-sip openssl&lt;br /&gt;
&lt;br /&gt;
For the C PoW in addition&lt;br /&gt;
&lt;br /&gt;
  guix package -i gcc binutils make linux-libre-headers gcc-toolchain&lt;br /&gt;
&lt;br /&gt;
For the OpenCL PoW in addition to both of the above, and drivers for your GPU:&lt;br /&gt;
&lt;br /&gt;
  guix package -i libffi;pip2 install pyopencl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Download and run PyBitmessage ==&lt;br /&gt;
# Download the source code from github:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/Bitmessage/PyBitmessage $HOME/PyBitmessage&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run PyBitmessage:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&lt;br /&gt;
Check the wiki for more information on how to run Bitmessage [https://bitmessage.org/wiki/Daemon as a daemon].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;If you receive a warning that you need to use python 2.7.3 or greater, and have followed the above instructions to upgrade it, your system may be attemping to run PyBitmessage with python 3. In this case, run &amp;lt;code&amp;gt;python2 ~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
To upgrade Bitmessage run the following commands:&lt;br /&gt;
:&amp;lt;code&amp;gt;cd $HOME/PyBitmessage&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OS X =&lt;br /&gt;
== With Homebrew package manager ==&lt;br /&gt;
; Setup&lt;br /&gt;
First, make sure you have not already installed Macports. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Install Homebrew: &lt;br /&gt;
 ruby -e &amp;quot;$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; Update Python:&lt;br /&gt;
 brew install python&lt;br /&gt;
&lt;br /&gt;
; Install dependencies:&lt;br /&gt;
 brew install pyqt openssl&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
== With macports package manager ==&lt;br /&gt;
First, make sure you have not already installed Homebrew. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Installing with macports or homebrew essentially has the same effect. Homebrew does some things better than ports, and ports does some things better than brew. If old-school floats your boat, these instructions are for you. &lt;br /&gt;
&lt;br /&gt;
; Select the macports installation that is right for your version of osx&lt;br /&gt;
Read the instructions or take this as a reminder: Apple's XCode and their Command Line Tools are a prerequiste for Macports, go: https://www.macports.org/install.php&lt;br /&gt;
&lt;br /&gt;
; Install dependencies and needed tools&lt;br /&gt;
 sudo port install python27 py27-pyqt4 openssl&lt;br /&gt;
 sudo port install git-core +svn +doc +bash_completion +gitweb&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python2.7 src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
= Windows =&lt;br /&gt;
# Download and install the latest revision of Python 2.7 (currently Python 2.7.10 from [https://www.python.org/downloads/ here]). The ''Windows x86 MSI Installer'' is the right choice for most people. (64-bit users may want the 64-bit version).&lt;br /&gt;
## Test that it installed:&lt;br /&gt;
### Open a command prompt by going to Start &amp;gt; Run. Type 'cmd' then press enter.&lt;br /&gt;
### type 'python'. If python is installed, you should see the python version and the prompt: '&amp;gt;&amp;gt;&amp;gt;'&lt;br /&gt;
### If you see a message such as: &amp;quot;'Python is not recognized as an internal or external command...&amp;quot; then you must add the python path to your path environmental variable:&lt;br /&gt;
#### Find the location where Python was installed (in particular, the location where python.exe exists). It might simply be in c:\Python2.7 &lt;br /&gt;
#### Follow [http://www.computerhope.com/issues/ch000549.htm these directions] to add the Python path to your path variable.&lt;br /&gt;
#### Close the command prompt window and reopen it. &lt;br /&gt;
### Try running 'python' again.&lt;br /&gt;
###Press Ctrl-Z to exit Python.&lt;br /&gt;
# Download PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here].   ''PyQt is one of Bitmessage's two dependencies.'' Look for the links to downloads under the heading labeled &amp;quot;Binary Package;&amp;quot; the binary package versions are already compiled for you. Select the version for Python 2.7 (look for &amp;quot;Py2.7&amp;quot; in the file name). Install PyQt.&lt;br /&gt;
# Download OpenSSL from [http://slproweb.com/products/Win32OpenSSL.html here]. ''OpenSSL is the second of Bitmessage's two dependencies.''  Install OpenSSL.  If an error message appears during installation of OpenSSL, download and install Visual C++ 2008.  A link is provided on the OpenSSL download page.&lt;br /&gt;
# Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'.&lt;br /&gt;
# To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'. &lt;br /&gt;
&lt;br /&gt;
== If you change user interface files ==&lt;br /&gt;
You can use Qt's Designer application to modify the user interface. After you do this, you will need to 'compile' .ui files into .py files. &lt;br /&gt;
# In a command prompt, change directories to the directory of your .ui file.&lt;br /&gt;
# Run 'pyuic4 example.ui &amp;gt; example.py'  If you get a message similar to 'pyuic4 is not recognized as an internal or external command' then you must add the PyQt directory to your system's path variable. This directory should hold pyuic4.bat. It might be in C:\Python27\Lib\site-packages\PyQt4. Remember to close the command window and reopen it after you change your path variable.&lt;br /&gt;
&lt;br /&gt;
If you add icons to bitmessage_icons.qrc, then you must run this command:&lt;br /&gt;
pyrcc4 bitmessage_icons.qrc -o bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
== Optional: Compile into a stand-alone EXE ==&lt;br /&gt;
# Download and install PyWin32&lt;br /&gt;
# Download [http://www.pyinstaller.org/ PyInstaller].&lt;br /&gt;
# Copy Bitmessage's 'src' directory to the PyInstaller directory (which contains pyinstaller.py). &lt;br /&gt;
# Run 'pyinstaller.py --onefile --noconsole --icon=&amp;quot;src\images\can-icon.ico&amp;quot; src\bitmessagemain.py'&lt;br /&gt;
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps:&lt;br /&gt;
# After following the steps above, you will see that pyinstaller created a folder called bitmessagemain. In that folder is a file: bitmessagemain.spec. Open it with a text editor.&lt;br /&gt;
# Below the line &amp;quot;a.datas,&amp;quot; add this line: &amp;lt;code&amp;gt;a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],&amp;lt;/code&amp;gt;&lt;br /&gt;
# Optionally also include the translations by modifying this file further by adding the lines shown in [[Example_pyinstaller_spec_file|this]] example file. &lt;br /&gt;
# Save and close&lt;br /&gt;
# Run this command: pyinstaller.py bitmessagemain/bitmessagemain.spec&lt;br /&gt;
&lt;br /&gt;
If you do not have the libeay32.dll you can download it here. http://www.dll-files.com/dllindex/dll-files.shtml?libeay32&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47577</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47577"/>
		<updated>2017-03-19T21:38:47Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Ubuntu dependencies (libssl-dev was missing)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should help novice users run Bitmessage from the source code files.&lt;br /&gt;
&lt;br /&gt;
= setuptools =&lt;br /&gt;
&lt;br /&gt;
On most unix-like systems, you can use setuptools (setup.py) to install PyBitmessage. If there are missing dependencies, it will explain you what is missing and what you have to do to resolve it. Go to the directory with the PyBitmessage source code and:&lt;br /&gt;
&lt;br /&gt;
as normal user:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install --user&lt;br /&gt;
  ~/.local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
or as root:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install&lt;br /&gt;
  /usr/local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
If it doesn't work out, you can follow the more detailed description below.&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
== Resolve dependencies ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;80%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Distribuion&lt;br /&gt;
! Instructions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Debian-based&lt;br /&gt;
(Ubuntu, Raspbian, PiBang, others)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Note for Debian Squeeze (6.0) users: Debian Squeeze does not offer packages (like Python, OpenSSL) in versions that are needed for Bitmessage. You can still try to [https://github.com/Bitmessage/PyBitmessage/issues/47#issuecomment-17774377 work around these problems]. Debian 7 &amp;quot;wheezy&amp;quot; works without problems.''&amp;lt;/small&amp;gt;&lt;br /&gt;
  sudo apt-get install python openssl libssl-dev git python-msgpack python-qt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Arch Linux&lt;br /&gt;
| &lt;br /&gt;
  sudo pacman -S python2 openssl git python2-pyqt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Fedora&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/f18/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
Note for Fedora 20 users: Due to inconsistent behavior encountered by declaring the above variable globally, the following &amp;quot;wrapper script&amp;quot; will declare the LD_LIBRARY_PATH variable correctly and only when running bitmessage.  Name the script something like &amp;quot;bitmessage&amp;quot;, mark it as executable (probably something like 755) and put it in /usr/bin so it's accessible without the full path.&lt;br /&gt;
  export LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}&amp;quot;&lt;br /&gt;
  /home/&amp;lt;yourusername&amp;gt;/PyBitmessage/src/bitmessagemain.py &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Red Hat Enterprise Linux (RHEL)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/el6/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GNU Guix&lt;br /&gt;
| &lt;br /&gt;
  guix package -i python2-msgpack python2-pyqt@4.11.4 python2-sip openssl&lt;br /&gt;
&lt;br /&gt;
For the C PoW in addition&lt;br /&gt;
&lt;br /&gt;
  guix package -i gcc binutils make linux-libre-headers gcc-toolchain&lt;br /&gt;
&lt;br /&gt;
For the OpenCL PoW in addition to both of the above, and drivers for your GPU:&lt;br /&gt;
&lt;br /&gt;
  guix package -i libffi;pip2 install pyopencl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Download and run PyBitmessage ==&lt;br /&gt;
# Download the source code from github:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/Bitmessage/PyBitmessage $HOME/PyBitmessage&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run PyBitmessage:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&lt;br /&gt;
Check the wiki for more information on how to run Bitmessage [https://bitmessage.org/wiki/Daemon as a daemon].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;If you receive a warning that you need to use python 2.7.3 or greater, and have followed the above instructions to upgrade it, your system may be attemping to run PyBitmessage with python 3. In this case, run &amp;lt;code&amp;gt;python2 ~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
To upgrade Bitmessage run the following commands:&lt;br /&gt;
:&amp;lt;code&amp;gt;cd $HOME/PyBitmessage&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OS X =&lt;br /&gt;
== With Homebrew package manager ==&lt;br /&gt;
; Setup&lt;br /&gt;
First, make sure you have not already installed Macports. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Install Homebrew: &lt;br /&gt;
 ruby -e &amp;quot;$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; Update Python:&lt;br /&gt;
 brew install python&lt;br /&gt;
&lt;br /&gt;
; Install dependencies:&lt;br /&gt;
 brew install pyqt openssl&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
== With macports package manager ==&lt;br /&gt;
First, make sure you have not already installed Homebrew. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Installing with macports or homebrew essentially has the same effect. Homebrew does some things better than ports, and ports does some things better than brew. If old-school floats your boat, these instructions are for you. &lt;br /&gt;
&lt;br /&gt;
; Select the macports installation that is right for your version of osx&lt;br /&gt;
Read the instructions or take this as a reminder: Apple's XCode and their Command Line Tools are a prerequiste for Macports, go: https://www.macports.org/install.php&lt;br /&gt;
&lt;br /&gt;
; Install dependencies and needed tools&lt;br /&gt;
 sudo port install python27 py27-pyqt4 openssl&lt;br /&gt;
 sudo port install git-core +svn +doc +bash_completion +gitweb&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python2.7 src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
= Windows =&lt;br /&gt;
# Download and install the latest revision of Python 2.7 (currently Python 2.7.10 from [https://www.python.org/downloads/ here]). The ''Windows x86 MSI Installer'' is the right choice for most people. (64-bit users may want the 64-bit version).&lt;br /&gt;
## Test that it installed:&lt;br /&gt;
### Open a command prompt by going to Start &amp;gt; Run. Type 'cmd' then press enter.&lt;br /&gt;
### type 'python'. If python is installed, you should see the python version and the prompt: '&amp;gt;&amp;gt;&amp;gt;'&lt;br /&gt;
### If you see a message such as: &amp;quot;'Python is not recognized as an internal or external command...&amp;quot; then you must add the python path to your path environmental variable:&lt;br /&gt;
#### Find the location where Python was installed (in particular, the location where python.exe exists). It might simply be in c:\Python2.7 &lt;br /&gt;
#### Follow [http://www.computerhope.com/issues/ch000549.htm these directions] to add the Python path to your path variable.&lt;br /&gt;
#### Close the command prompt window and reopen it. &lt;br /&gt;
### Try running 'python' again.&lt;br /&gt;
###Press Ctrl-Z to exit Python.&lt;br /&gt;
# Download PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here].   ''PyQt is one of Bitmessage's two dependencies.'' Look for the links to downloads under the heading labeled &amp;quot;Binary Package;&amp;quot; the binary package versions are already compiled for you. Select the version for Python 2.7 (look for &amp;quot;Py2.7&amp;quot; in the file name). Install PyQt.&lt;br /&gt;
# Download OpenSSL from [http://slproweb.com/products/Win32OpenSSL.html here]. ''OpenSSL is the second of Bitmessage's two dependencies.''  Install OpenSSL.  If an error message appears during installation of OpenSSL, download and install Visual C++ 2008.  A link is provided on the OpenSSL download page.&lt;br /&gt;
# Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'.&lt;br /&gt;
# To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'. &lt;br /&gt;
&lt;br /&gt;
== If you change user interface files ==&lt;br /&gt;
You can use Qt's Designer application to modify the user interface. After you do this, you will need to 'compile' .ui files into .py files. &lt;br /&gt;
# In a command prompt, change directories to the directory of your .ui file.&lt;br /&gt;
# Run 'pyuic4 example.ui &amp;gt; example.py'  If you get a message similar to 'pyuic4 is not recognized as an internal or external command' then you must add the PyQt directory to your system's path variable. This directory should hold pyuic4.bat. It might be in C:\Python27\Lib\site-packages\PyQt4. Remember to close the command window and reopen it after you change your path variable.&lt;br /&gt;
&lt;br /&gt;
If you add icons to bitmessage_icons.qrc, then you must run this command:&lt;br /&gt;
pyrcc4 bitmessage_icons.qrc -o bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
== Optional: Compile into a stand-alone EXE ==&lt;br /&gt;
# Download and install PyWin32&lt;br /&gt;
# Download [http://www.pyinstaller.org/ PyInstaller].&lt;br /&gt;
# Copy Bitmessage's 'src' directory to the PyInstaller directory (which contains pyinstaller.py). &lt;br /&gt;
# Run 'pyinstaller.py --onefile --noconsole --icon=&amp;quot;src\images\can-icon.ico&amp;quot; src\bitmessagemain.py'&lt;br /&gt;
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps:&lt;br /&gt;
# After following the steps above, you will see that pyinstaller created a folder called bitmessagemain. In that folder is a file: bitmessagemain.spec. Open it with a text editor.&lt;br /&gt;
# Below the line &amp;quot;a.datas,&amp;quot; add this line: &amp;lt;code&amp;gt;a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],&amp;lt;/code&amp;gt;&lt;br /&gt;
# Optionally also include the translations by modifying this file further by adding the lines shown in [[Example_pyinstaller_spec_file|this]] example file. &lt;br /&gt;
# Save and close&lt;br /&gt;
# Run this command: pyinstaller.py bitmessagemain/bitmessagemain.spec&lt;br /&gt;
&lt;br /&gt;
If you do not have the libeay32.dll you can download it here. http://www.dll-files.com/dllindex/dll-files.shtml?libeay32&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47576</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47576"/>
		<updated>2017-03-01T12:54:52Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Add setuptools instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should help novice users run Bitmessage from the source code files.&lt;br /&gt;
&lt;br /&gt;
= setuptools =&lt;br /&gt;
&lt;br /&gt;
On most unix-like systems, you can use setuptools (setup.py) to install PyBitmessage. If there are missing dependencies, it will explain you what is missing and what you have to do to resolve it. Go to the directory with the PyBitmessage source code and:&lt;br /&gt;
&lt;br /&gt;
as normal user:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install --user&lt;br /&gt;
  ~/.local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
or as root:&lt;br /&gt;
&lt;br /&gt;
  python setup.py install&lt;br /&gt;
  /usr/local/bin/pybitmessage&lt;br /&gt;
&lt;br /&gt;
If it doesn't work out, you can follow the more detailed description below.&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
== Resolve dependencies ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;80%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Distribuion&lt;br /&gt;
! Instructions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Debian-based&lt;br /&gt;
(Ubuntu, Raspbian, PiBang, others)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Note for Debian Squeeze (6.0) users: Debian Squeeze does not offer packages (like Python, OpenSSL) in versions that are needed for Bitmessage. You can still try to [https://github.com/Bitmessage/PyBitmessage/issues/47#issuecomment-17774377 work around these problems]. Debian 7 &amp;quot;wheezy&amp;quot; works without problems.''&amp;lt;/small&amp;gt;&lt;br /&gt;
  sudo apt-get install python openssl git python-msgpack python-qt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Arch Linux&lt;br /&gt;
| &lt;br /&gt;
  sudo pacman -S python2 openssl git python2-pyqt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Fedora&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/f18/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
Note for Fedora 20 users: Due to inconsistent behavior encountered by declaring the above variable globally, the following &amp;quot;wrapper script&amp;quot; will declare the LD_LIBRARY_PATH variable correctly and only when running bitmessage.  Name the script something like &amp;quot;bitmessage&amp;quot;, mark it as executable (probably something like 755) and put it in /usr/bin so it's accessible without the full path.&lt;br /&gt;
  export LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}&amp;quot;&lt;br /&gt;
  /home/&amp;lt;yourusername&amp;gt;/PyBitmessage/src/bitmessagemain.py &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Red Hat Enterprise Linux (RHEL)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/el6/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GNU Guix&lt;br /&gt;
| &lt;br /&gt;
  guix package -i python2-msgpack python2-pyqt@4.11.4 python2-sip openssl&lt;br /&gt;
&lt;br /&gt;
For the C PoW in addition&lt;br /&gt;
&lt;br /&gt;
  guix package -i gcc binutils make linux-libre-headers gcc-toolchain&lt;br /&gt;
&lt;br /&gt;
For the OpenCL PoW in addition to both of the above, and drivers for your GPU:&lt;br /&gt;
&lt;br /&gt;
  guix package -i libffi;pip2 install pyopencl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Download and run PyBitmessage ==&lt;br /&gt;
# Download the source code from github:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/Bitmessage/PyBitmessage $HOME/PyBitmessage&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run PyBitmessage:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&lt;br /&gt;
Check the wiki for more information on how to run Bitmessage [https://bitmessage.org/wiki/Daemon as a daemon].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;If you receive a warning that you need to use python 2.7.3 or greater, and have followed the above instructions to upgrade it, your system may be attemping to run PyBitmessage with python 3. In this case, run &amp;lt;code&amp;gt;python2 ~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
To upgrade Bitmessage run the following commands:&lt;br /&gt;
:&amp;lt;code&amp;gt;cd $HOME/PyBitmessage&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OS X =&lt;br /&gt;
== With Homebrew package manager ==&lt;br /&gt;
; Setup&lt;br /&gt;
First, make sure you have not already installed Macports. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Install Homebrew: &lt;br /&gt;
 ruby -e &amp;quot;$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; Update Python:&lt;br /&gt;
 brew install python&lt;br /&gt;
&lt;br /&gt;
; Install dependencies:&lt;br /&gt;
 brew install pyqt openssl&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
== With macports package manager ==&lt;br /&gt;
First, make sure you have not already installed Homebrew. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Installing with macports or homebrew essentially has the same effect. Homebrew does some things better than ports, and ports does some things better than brew. If old-school floats your boat, these instructions are for you. &lt;br /&gt;
&lt;br /&gt;
; Select the macports installation that is right for your version of osx&lt;br /&gt;
Read the instructions or take this as a reminder: Apple's XCode and their Command Line Tools are a prerequiste for Macports, go: https://www.macports.org/install.php&lt;br /&gt;
&lt;br /&gt;
; Install dependencies and needed tools&lt;br /&gt;
 sudo port install python27 py27-pyqt4 openssl&lt;br /&gt;
 sudo port install git-core +svn +doc +bash_completion +gitweb&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python2.7 src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
= Windows =&lt;br /&gt;
# Download and install the latest revision of Python 2.7 (currently Python 2.7.10 from [https://www.python.org/downloads/ here]). The ''Windows x86 MSI Installer'' is the right choice for most people. (64-bit users may want the 64-bit version).&lt;br /&gt;
## Test that it installed:&lt;br /&gt;
### Open a command prompt by going to Start &amp;gt; Run. Type 'cmd' then press enter.&lt;br /&gt;
### type 'python'. If python is installed, you should see the python version and the prompt: '&amp;gt;&amp;gt;&amp;gt;'&lt;br /&gt;
### If you see a message such as: &amp;quot;'Python is not recognized as an internal or external command...&amp;quot; then you must add the python path to your path environmental variable:&lt;br /&gt;
#### Find the location where Python was installed (in particular, the location where python.exe exists). It might simply be in c:\Python2.7 &lt;br /&gt;
#### Follow [http://www.computerhope.com/issues/ch000549.htm these directions] to add the Python path to your path variable.&lt;br /&gt;
#### Close the command prompt window and reopen it. &lt;br /&gt;
### Try running 'python' again.&lt;br /&gt;
###Press Ctrl-Z to exit Python.&lt;br /&gt;
# Download PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here].   ''PyQt is one of Bitmessage's two dependencies.'' Look for the links to downloads under the heading labeled &amp;quot;Binary Package;&amp;quot; the binary package versions are already compiled for you. Select the version for Python 2.7 (look for &amp;quot;Py2.7&amp;quot; in the file name). Install PyQt.&lt;br /&gt;
# Download OpenSSL from [http://slproweb.com/products/Win32OpenSSL.html here]. ''OpenSSL is the second of Bitmessage's two dependencies.''  Install OpenSSL.  If an error message appears during installation of OpenSSL, download and install Visual C++ 2008.  A link is provided on the OpenSSL download page.&lt;br /&gt;
# Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'.&lt;br /&gt;
# To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'. &lt;br /&gt;
&lt;br /&gt;
== If you change user interface files ==&lt;br /&gt;
You can use Qt's Designer application to modify the user interface. After you do this, you will need to 'compile' .ui files into .py files. &lt;br /&gt;
# In a command prompt, change directories to the directory of your .ui file.&lt;br /&gt;
# Run 'pyuic4 example.ui &amp;gt; example.py'  If you get a message similar to 'pyuic4 is not recognized as an internal or external command' then you must add the PyQt directory to your system's path variable. This directory should hold pyuic4.bat. It might be in C:\Python27\Lib\site-packages\PyQt4. Remember to close the command window and reopen it after you change your path variable.&lt;br /&gt;
&lt;br /&gt;
If you add icons to bitmessage_icons.qrc, then you must run this command:&lt;br /&gt;
pyrcc4 bitmessage_icons.qrc -o bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
== Optional: Compile into a stand-alone EXE ==&lt;br /&gt;
# Download and install PyWin32&lt;br /&gt;
# Download [http://www.pyinstaller.org/ PyInstaller].&lt;br /&gt;
# Copy Bitmessage's 'src' directory to the PyInstaller directory (which contains pyinstaller.py). &lt;br /&gt;
# Run 'pyinstaller.py --onefile --noconsole --icon=&amp;quot;src\images\can-icon.ico&amp;quot; src\bitmessagemain.py'&lt;br /&gt;
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps:&lt;br /&gt;
# After following the steps above, you will see that pyinstaller created a folder called bitmessagemain. In that folder is a file: bitmessagemain.spec. Open it with a text editor.&lt;br /&gt;
# Below the line &amp;quot;a.datas,&amp;quot; add this line: &amp;lt;code&amp;gt;a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],&amp;lt;/code&amp;gt;&lt;br /&gt;
# Optionally also include the translations by modifying this file further by adding the lines shown in [[Example_pyinstaller_spec_file|this]] example file. &lt;br /&gt;
# Save and close&lt;br /&gt;
# Run this command: pyinstaller.py bitmessagemain/bitmessagemain.spec&lt;br /&gt;
&lt;br /&gt;
If you do not have the libeay32.dll you can download it here. http://www.dll-files.com/dllindex/dll-files.shtml?libeay32&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47575</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47575"/>
		<updated>2017-03-01T12:48:40Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: v0.6.2 was released&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name=Bitmessage&lt;br /&gt;
|downloadsite=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.2/Bitmessage_x86_0.6.2.exe&lt;br /&gt;
|release caption=Current version (Beta)&lt;br /&gt;
|latest release date=Mar 1, 2017&lt;br /&gt;
|version=0.6.2&lt;br /&gt;
}}&lt;br /&gt;
Bitmessage is a P2P communications [[Protocol specification|protocol]] used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide &amp;quot;non-content&amp;quot; data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs. If Bitmessage is completely new to you, you may wish to start by reading the [https://bitmessage.org/bitmessage.pdf whitepaper].&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
An open source client is available for free under the very liberal [http://opensource.org/licenses/mit-license.php MIT license]. For screenshots and a description of the client, see this CryptoJunky article: [http://cryptojunky.com/blog/2013/03/09/setting-up-and-using-bitmessage-an-encrypted-communications-platform-based-on-bitcoin/ &amp;quot;Setting Up And Using Bitmessage&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
[[File:windows_icon.png|link=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.2/Bitmessage_x86_0.6.2.exe]] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.2/Bitmessage_x86_0.6.2.exe Download for Windows (32bit)] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.2/Bitmessage_x64_0.6.2.exe (64bit)]&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.2/bitmessage-v0.6.2.dmg]] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.2/bitmessage-v0.6.2.dmg Download for OS X]&lt;br /&gt;
&lt;br /&gt;
[[File:tux.png|link=Compiling_instructions]] [[Compiling instructions|Run the source code]]&lt;br /&gt;
&lt;br /&gt;
=== Source code ===&lt;br /&gt;
You may view the Python [https://github.com/Bitmessage/PyBitmessage source code on Github]. Bitmessage requires PyQt and OpenSSL. Step-by-step instructions on how to run the source code on Linux, Windows, or OSX is [[Compiling instructions|available here]].&lt;br /&gt;
&lt;br /&gt;
=== Contribute ===&lt;br /&gt;
Please follow the [[Contribute|contribution guidelines]] when contributing code or translations.&lt;br /&gt;
&lt;br /&gt;
=== Security audit needed ===&lt;br /&gt;
Bitmessage is in need of an independent audit to verify its security. If you are a researcher capable of reviewing the source code, please [https://bitmessage.org/misc/emailaddress.png email] the lead developer. You will be helping to create a great privacy option for people everywhere!&lt;br /&gt;
&lt;br /&gt;
=== Forum ===&lt;br /&gt;
* Visit or subscribe to the [https://pay.reddit.com/r/bitmessage Bitmessage subreddit].&lt;br /&gt;
* A community-based forum for questions, feedback, and discussion is also available at [https://bitmessage.org/forum Bitmessage.org/forum].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=47574</id>
		<title>Changelog</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=47574"/>
		<updated>2017-03-01T12:38:11Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: v0.6.2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PyBitmessage Changelog ==&lt;br /&gt;
0.6.2&lt;br /&gt;
&lt;br /&gt;
*Usability:&lt;br /&gt;
**many minor usability improvements, in particular helpful for beginners&lt;br /&gt;
**get rid of confusing log messages&lt;br /&gt;
**improved feedback when busy during shutdown&lt;br /&gt;
**UI feedback when problems with proxy&lt;br /&gt;
**UI feedback when local time is wrong&lt;br /&gt;
**UI feedback when C PoW module is not available&lt;br /&gt;
**folder loading performance improved&lt;br /&gt;
**translations updated&lt;br /&gt;
**chan join/create interface redesigned&lt;br /&gt;
**can select OpenCL vendor if multiple are available (previously it would have crashed)&lt;br /&gt;
**locale initialisation fixes&lt;br /&gt;
**contact support form and About dialog show the GIT head&lt;br /&gt;
**added setup.py (setuptools) for easier installation&lt;br /&gt;
**gentle warning if sending to a chan with a too low TTL&lt;br /&gt;
**message retransmit timing now works as the description&lt;br /&gt;
&lt;br /&gt;
*Fixes:&lt;br /&gt;
**networking subsystem stability fixes&lt;br /&gt;
**multiprocessing python PoW fixed&lt;br /&gt;
**message parser fixes&lt;br /&gt;
**many smaller fixes&lt;br /&gt;
**OpenBSD listening socket fix (works IPv4-only mode instead of not at all)&lt;br /&gt;
&lt;br /&gt;
*Backend:&lt;br /&gt;
**try to auto-build PoW module&lt;br /&gt;
**networking subsystem performance improvements&lt;br /&gt;
**refactoring of configuration interface, inventory, downloading and uploading tracking, known nodes and other minor parts&lt;br /&gt;
**refactoring to reduce circular imports and global variables&lt;br /&gt;
**support for OpenSSL 1.1.0 and LibreSSL&lt;br /&gt;
**some network parameters configurable, but mostly only through directly editing keys.dat&lt;br /&gt;
**network settings allow an optimised bootstrap provider mode&lt;br /&gt;
&lt;br /&gt;
*Developers:&lt;br /&gt;
**extended encoding available for testing. Use it by holding Shift while clicking on Send&lt;br /&gt;
**extended encoding can be extended by adding new classes to the &amp;quot;messagetypes&amp;quot; directory&lt;br /&gt;
**directory structure reorganisation to get rid of obsolete code&lt;br /&gt;
&lt;br /&gt;
*Linux:&lt;br /&gt;
**setup.py detects Ubuntu, Debian, Fedora, openSUSE, Gentoo and Guix&lt;br /&gt;
&lt;br /&gt;
*FreeBSD/OpenBSD:&lt;br /&gt;
**separate Makefile for BSD make&lt;br /&gt;
**C PoW core count detection fixes for OpenBSD&lt;br /&gt;
**setup.py detects FreeBSD and OpenBSD&lt;br /&gt;
&lt;br /&gt;
*Windows:&lt;br /&gt;
**improved error handling&lt;br /&gt;
**separate Makefile for Microsoft Visual C++&lt;br /&gt;
**pyinstaller spec file updated&lt;br /&gt;
**64bit binary does not require MSVC Redistributable 2012 anymore and is mostly built with mingw instead of MSVC&lt;br /&gt;
**updated Python to 2.7.13 and OpenSSL to 1.0.2j/1.0.2k&lt;br /&gt;
&lt;br /&gt;
*OSX:&lt;br /&gt;
**binary works with OpenCL&lt;br /&gt;
**updated to Python 2.7.13 and OpenSSL 1.0.2k&lt;br /&gt;
&lt;br /&gt;
*Infrastructure:&lt;br /&gt;
**3 additional bootstrap nodes&lt;br /&gt;
**new server for building/testing&lt;br /&gt;
**transifex webhooks automate translation workflow&lt;br /&gt;
**integration with landscape.io for code quality checking&lt;br /&gt;
&lt;br /&gt;
0.6.1&lt;br /&gt;
&lt;br /&gt;
* Translation update and localisation fixes&lt;br /&gt;
* Minor bug fixes&lt;br /&gt;
* Minor UI improvements&lt;br /&gt;
* Namecoin integration fixed and improved&lt;br /&gt;
* SMTP server and client interface&lt;br /&gt;
* Tor hidden service support&lt;br /&gt;
* C PoW builds and runs on *BSD&lt;br /&gt;
* Windows binary:&lt;br /&gt;
** fixed build&lt;br /&gt;
** upgraded to Python 2.7.12 and OpenSSL 1.0.2h&lt;br /&gt;
** 64bit binary available for download&lt;br /&gt;
** self-built PyInstaller bootloader should trigger fewer antivirus false positives&lt;br /&gt;
* Mac OSX binary:&lt;br /&gt;
** upgraded to Python 2.7.12 and OpenSSL 1.0.2h&lt;br /&gt;
&lt;br /&gt;
0.6.0&lt;br /&gt;
&lt;br /&gt;
* QT interface overhaul&lt;br /&gt;
* Opportunistic TLS support&lt;br /&gt;
* Mitigation of some deanonymisation attacks&lt;br /&gt;
* C (using OpenSSL) and OpenCL PoW modules&lt;br /&gt;
* Performance improvements (backend as well as QT GUI)&lt;br /&gt;
* UPnP support&lt;br /&gt;
* Improved bootstrapping over Tor&lt;br /&gt;
* Translation updates&lt;br /&gt;
* Lots of tiny bugfixes and some minor security improvements&lt;br /&gt;
* Integration of mailchuck.com email gateway&lt;br /&gt;
&lt;br /&gt;
0.4.4&lt;br /&gt;
&lt;br /&gt;
* Added ability to limit network transfer rate&lt;br /&gt;
* Updated to [[Protocol_specification_v3|Protocol Version 3]]&lt;br /&gt;
* Removed use of memoryview so that we can support python 2.7.3 &lt;br /&gt;
* Make use of l10n for localizations&lt;br /&gt;
&lt;br /&gt;
0.4.3&lt;br /&gt;
&lt;br /&gt;
* Support pyelliptic's updated HMAC algorithm. We'll remove support for the old method after an upgrade period.&lt;br /&gt;
* Improved version check&lt;br /&gt;
* Refactored decodeBase58 function&lt;br /&gt;
* Ignore duplicate messages&lt;br /&gt;
* Added bytes received/sent counts and rate on the network information tab&lt;br /&gt;
* Fix unicode handling in 'View HTML code as formatted text'&lt;br /&gt;
* Refactor handling of packet headers &lt;br /&gt;
* Use pointMult function instead of arithmetic.privtopub since it is faster&lt;br /&gt;
* Fixed issue where client wasn't waiting for a verack before continuing on with the conversation&lt;br /&gt;
* Fixed CPU hogging by implementing tab-based refresh improvements &lt;br /&gt;
* Added curses interface&lt;br /&gt;
* Added support for IPv6&lt;br /&gt;
* Added a 'trustedpeer' option to keys.dat&lt;br /&gt;
* Limit maximum object size to 20 MB&lt;br /&gt;
* Support email-like &amp;gt; quote characters and reply-below-quote&lt;br /&gt;
* Added Japanese and Dutch language files; updated Norwegian and Russian languages files&lt;br /&gt;
&lt;br /&gt;
0.4.2&lt;br /&gt;
&lt;br /&gt;
* Added Norwegian, Chinese, and Arabic translations&lt;br /&gt;
* sock.sendall function isn't atomic. Let sendDataThread be the only thread which sends data.&lt;br /&gt;
* Moved API code to api.py&lt;br /&gt;
* Populate comboBoxSendFrom when replying&lt;br /&gt;
* Added option to show recent broadcasts when subscribing&lt;br /&gt;
* Fixed issue: If Windows username contained an international character, Bitmessage wouldn't start&lt;br /&gt;
* Added some code for FreeBSD compatibility&lt;br /&gt;
* Moved responsibility for processing network objects to the new ObjectProcessorThread&lt;br /&gt;
* Refactored main QT module&lt;br /&gt;
** Moved popup menus initialization to separate methods&lt;br /&gt;
** Simplified inbox loading&lt;br /&gt;
** Moved magic strings to the model scope constants so they won't be created every time.&lt;br /&gt;
* Updated list of defaultKnownNodes&lt;br /&gt;
* Fixed issue: [Linux] When too many messages arrive too quickly, exception occurs: &amp;quot;Exceeded maximum number of notifications&amp;quot;&lt;br /&gt;
* Fixed issue: creating then deleting an Address in short time crashes class_singleWorker.py&lt;br /&gt;
* Refactored code which displays messages to improve code readability&lt;br /&gt;
* load &amp;quot;Sent To&amp;quot; label from subscriptions if available&lt;br /&gt;
* Removed code to add chans to our address book as it is no longer necessary&lt;br /&gt;
* Added identicons&lt;br /&gt;
* Modified addresses.decodeAddress so that API command decodeAddress works properly&lt;br /&gt;
* Added API commands createChan, joinChan, leaveChan, deleteAddress&lt;br /&gt;
* In pyelliptic, check the return value of RAND_bytes to make sure enough random data was generated&lt;br /&gt;
* Don't store messages in UI table (and thus in memory), pull from SQL inventory as needed&lt;br /&gt;
* Fix typos in API commands addSubscription and getInboxMessagesByAddress&lt;br /&gt;
* Add feature in settings menu to give up resending a message after a specified period of time&lt;br /&gt;
&lt;br /&gt;
0.4.1&lt;br /&gt;
&lt;br /&gt;
* Fixed whitelist bug&lt;br /&gt;
* Fixed chan bug&lt;br /&gt;
** Added addressversion field to pubkeys table&lt;br /&gt;
** Sending messages to a chan no longer uses anything in the pubkeys table&lt;br /&gt;
** Sending messages to yourself is now fully supported&lt;br /&gt;
* Change _verifyAddress function to support v4 addresses&lt;br /&gt;
&lt;br /&gt;
0.4.0&lt;br /&gt;
&lt;br /&gt;
* Raised default demanded difficulty from 1 to 2 for new addresses&lt;br /&gt;
* Added v4 addresses: pubkeys are now encrypted and tagged in the inventory&lt;br /&gt;
* Use locks when accessing dictionary inventory&lt;br /&gt;
* Refactored the way inv and addr messages are shared&lt;br /&gt;
* Give user feedback when disk is full&lt;br /&gt;
* Added chan true/false to listAddresses results&lt;br /&gt;
* When replying using chan address, send to whole chan not just sender&lt;br /&gt;
* Refactored of the way PyBitmessage looks for interesting new objects in large inv messages from peers&lt;br /&gt;
* Show inventory lookup rate on Network Status tab&lt;br /&gt;
* Added SqlBulkExecute class so we can update inventory with only one commit&lt;br /&gt;
* Updated Russian translations&lt;br /&gt;
* Move duplicated SQL code into helper&lt;br /&gt;
* Allow specification of alternate settings dir via BITMESSAGE_HOME environment variable&lt;br /&gt;
* Removed use of gevent. Removed class_bgWorker.py&lt;br /&gt;
* Added Sip and PyQt to includes in build_osx.py&lt;br /&gt;
* Show number of each message type processed in the API command clientStatus&lt;br /&gt;
* Use fast PoW unless we're explicitly a frozen (binary) version of the code&lt;br /&gt;
* Enable user-set localization in settings&lt;br /&gt;
* Fix Archlinux package creation&lt;br /&gt;
* Fallback to language only localization when region doesn't match&lt;br /&gt;
* Fixed brew install instructions&lt;br /&gt;
* Added German translation&lt;br /&gt;
* Made inbox and sent messages table panels read-only&lt;br /&gt;
* Allow inbox and sent preview panels to resize&lt;br /&gt;
* Count RE: as a reply header, just like Re: so we don't chain Re: RE:&lt;br /&gt;
* Fix for traceback on OSX&lt;br /&gt;
* Added backend ability to understand shorter addresses&lt;br /&gt;
* Convert 'API Error' to raise APIError()&lt;br /&gt;
* Added option in settings to allow sending to a mobile device (app not yet done)&lt;br /&gt;
* Added ability to start daemon mode when using Bitmessage as a module&lt;br /&gt;
* Improved the way client detects locale&lt;br /&gt;
* Added API commands: getInboxMessageIds, getSentMessageIds, listAddressBookEntries, trashSentMessageByAckData, addAddressBookEntry, deleteAddressBookEntry, listAddresses2, listSubscriptions&lt;br /&gt;
* Set a maximum frequency for playing sounds&lt;br /&gt;
* Show Invalid Method error in same format as other API errors&lt;br /&gt;
* Update status of separate broadcasts separately even if the sent data is identical&lt;br /&gt;
* Added Namecoin integration&lt;br /&gt;
* Internally distinguish peers by IP and port&lt;br /&gt;
* Inbox message retrieval API functions now also returns read status&lt;br /&gt;
&lt;br /&gt;
0.3.5 &lt;br /&gt;
&lt;br /&gt;
* Added right-click option to mark a message as unread&lt;br /&gt;
* Prompt user to connect at first startup&lt;br /&gt;
* Install into /usr/local by default&lt;br /&gt;
* Add a missing `rm -f` to the uninstall task.&lt;br /&gt;
* Use system text color for enabled addresses instead of black&lt;br /&gt;
* Added support for Chans&lt;br /&gt;
* Start storing msgid in sent table&lt;br /&gt;
* Optionally play sounds on connection/disconnection or when messages arrive&lt;br /&gt;
* Adding configuration option to listen for connections when using SOCKS&lt;br /&gt;
* Added packaging for multiple distros (Arch, Puppy, Slack, etc.)&lt;br /&gt;
* Added Russian translation&lt;br /&gt;
* Added search support in the UI&lt;br /&gt;
* Added 'make uninstall'&lt;br /&gt;
* To improve OSX support, use PKCS5_PBKDF2_HMAC_SHA1 if PKCS5_PBKDF2_HMAC is unavailable&lt;br /&gt;
* Added better warnings for OSX users who are using old versions of Python&lt;br /&gt;
* Repaired debian packaging&lt;br /&gt;
* Altered Makefile to avoid needing to chase changes&lt;br /&gt;
* Added logger module&lt;br /&gt;
* Added bgWorker class for background tasks&lt;br /&gt;
* Added use of gevent module&lt;br /&gt;
* On not-Windows: Fix insecure keyfile permissions&lt;br /&gt;
* Fix 100% CPU usage issue&lt;br /&gt;
&lt;br /&gt;
0.3.4&lt;br /&gt;
&lt;br /&gt;
* Linux: Store config files in $XDG_CONFIG_HOME&lt;br /&gt;
* Added a new global variable user option: doTimingAttackMitigation&lt;br /&gt;
* Moved a variety of classes and functions out of bitmessagemain.py and to their own modules&lt;br /&gt;
* New API command: getSentMessageByAckData&lt;br /&gt;
* Modified the getAllSentMessages and getSentMessageById commands to return ackData&lt;br /&gt;
* API commands to get messages now return actual encoding type&lt;br /&gt;
* Bugfix: Unicode chars in localtime prevented the gui from starting&lt;br /&gt;
* Added 'Save message as...' option in Inbox&lt;br /&gt;
* Added OS X Build scripts&lt;br /&gt;
* Added option to subscribe to an address in your address book&lt;br /&gt;
* Added getInboxMessageById API command&lt;br /&gt;
* Updated icons to have sRGB profile to prevent warnings&lt;br /&gt;
* Added French translation&lt;br /&gt;
* Switched addr, msg, broadcast, and getpubkey message types to 8 byte time. Last remaining type is pubkey.&lt;br /&gt;
* Added tooltips to show the full subject of messages&lt;br /&gt;
* Added Maximum Acceptable Difficulty fields in the settings&lt;br /&gt;
* Send out pubkey immediately after generating deterministic addresses rather than waiting for a request&lt;br /&gt;
&lt;br /&gt;
0.3.3&lt;br /&gt;
* Remove inbox item from GUI when using API command trashMessage&lt;br /&gt;
* Add missing trailing semicolons to pybitmessage.desktop&lt;br /&gt;
* Ensure $(DESTDIR)/usr/bin exists&lt;br /&gt;
* Update Makefile to correct sandbox violations when built via Portage (Gentoo)&lt;br /&gt;
* Fix message authentication bug&lt;br /&gt;
&lt;br /&gt;
0.3.211&lt;br /&gt;
&lt;br /&gt;
* Removed multi-core proof of work as the multiprocessing module does not work well with pyinstaller's --onefile option.&lt;br /&gt;
&lt;br /&gt;
0.3.2&lt;br /&gt;
&lt;br /&gt;
* Bugfix: Remove remaining references to the old myapp.trayIcon&lt;br /&gt;
* Refactored message status-related code. API function getStatus now returns one of these strings: notfound, msgqueued, broadcastqueued, broadcastsent, doingpubkeypow, awaitingpubkey, doingmsgpow, msgsent, or ackreceived&lt;br /&gt;
* Moved proof of work to low-priority multi-threaded child processes&lt;br /&gt;
* Added menu option to delete all trashed messages&lt;br /&gt;
* Added inv flooding attack mitigation&lt;br /&gt;
* On Linux, when selecting Show Bitmessage, do not maximize automatically&lt;br /&gt;
* Store tray icons in bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
0.3.1&lt;br /&gt;
&lt;br /&gt;
* Added new API commands: getDeterministicAddress, addSubscription, deleteSubscription&lt;br /&gt;
* TCP Connection timeout for non-fully-established connections now 20 seconds&lt;br /&gt;
* Don't update the time we last communicated with a node unless the connection is fully established. This will allow us to forget about active but non-Bitmessage nodes which have made it into our knownNodes file.&lt;br /&gt;
* Prevent incoming connection flooding from crashing singleListener thread. Client will now only accept one connection per remote node IP&lt;br /&gt;
* Bugfix: Worker thread crashed when doing a POW to send out a v2 pubkey (bug introduced in 0.3.0)&lt;br /&gt;
* Wrap all sock.shutdown functions in error handlers&lt;br /&gt;
* Put all 'commit' commands within SQLLocks&lt;br /&gt;
* Bugfix: If address book label is blank, Bitmessage wouldn't show message (bug introduced in 0.3.0)&lt;br /&gt;
* Messaging menu item selects the oldest unread message&lt;br /&gt;
* Standardize on 'Quit' rather than 'Exit'&lt;br /&gt;
* [OSX] Try to seek homebrew installation of OpenSSL&lt;br /&gt;
* Prevent multiple instances of the application from running&lt;br /&gt;
* Show 'Connected' or 'Connection Lost' indicators&lt;br /&gt;
* Use only 9 half-open connections on Windows but 32 for everyone else&lt;br /&gt;
* Added appIndicator (a more functional tray icon) and Ubuntu Messaging Menu integration&lt;br /&gt;
* Changed Debian install directory and run script name based on Github issue #135&lt;br /&gt;
&lt;br /&gt;
0.3.0&lt;br /&gt;
&lt;br /&gt;
* Added new API function: getStatus&lt;br /&gt;
* Added error-handling around all sock.sendall() functions in the receiveData thread so that if there is a problem sending data, the threads will close gracefully&lt;br /&gt;
* Abandoned and removed the connectionsCount data structure; use the connectedHostsList instead because it has proved to be more accurate than trying to maintain the connectionsCount&lt;br /&gt;
* Added daemon mode. All UI code moved into a module and many shared objects moved into shared.py&lt;br /&gt;
* Truncate display of very long messages to avoid freezing the UI&lt;br /&gt;
* Added encrypted broadcasts for v3 addresses or v2 addresses after 2013-05-28 10:00 UTC&lt;br /&gt;
* No longer self.sock.close() from within receiveDataThreads, let the sendDataThreads do it&lt;br /&gt;
* Swapped out the v2 announcements subscription address for a v3 announcements subscription address&lt;br /&gt;
* Vacuum the messages.dat file once a month: will greatly reduce the file size&lt;br /&gt;
* Added a settings table in message.dat&lt;br /&gt;
* Implemented v3 addresses: pubkey messages must now include two var_ints: nonce_trials_per_byte and extra_bytes, and also be signed. When sending a message to a v3 address, the sender must use these values in calculating its POW or else the message will not be accepted by the receiver. &lt;br /&gt;
* Display a privacy warning when selecting 'Send Broadcast from this address'&lt;br /&gt;
* Added gitignore file&lt;br /&gt;
* Added code in preparation for a switch from 32-bit time to 64-bit time. Nodes will now advertise themselves as using protocol version 2.&lt;br /&gt;
* Don't necessarily delete entries from the inventory after 2.5 days; leave pubkeys there for 28 days so that we don't process the same ones many times throughout a month. This was causing the 'pubkeys processed' indicator on the 'Network Status' tab to not accurately reflect the number of truly new addresses on the network. &lt;br /&gt;
* Use 32 threads for outgoing connections in order to connect quickly&lt;br /&gt;
* Fix typo when calling os.environ in the sys.platform=='darwin' case&lt;br /&gt;
* Allow the cancelling of a message which is in the process of being sent by trashing it then restarting Bitmessage&lt;br /&gt;
* Bug fix: can't delete address from address book&lt;br /&gt;
&lt;br /&gt;
0.2.8&lt;br /&gt;
&lt;br /&gt;
* Fixed Ubuntu &amp;amp; OS X issue: Bitmessage wouldn't receive any objects from peers after restart. &lt;br /&gt;
* Inventory flush to disk when exiting program now vastly faster. &lt;br /&gt;
* Fixed address generation bug (kept Bitmessage from restarting). &lt;br /&gt;
* Improve deserialization of messages before processing. &lt;br /&gt;
* Change to help Macs find OpenSSL the way Unix systems find it. &lt;br /&gt;
* Do not share or accept IPs which are in the private IP ranges. &lt;br /&gt;
* Added time-fuzzing to the embedded time in pubkey and getpubkey messages. &lt;br /&gt;
* Added a knownNodes lock to prevent an exception from sometimes occurring when saving the data-structure to disk. &lt;br /&gt;
* Show unread messages in bold and do not display new messages automatically; let user click it.&lt;br /&gt;
* Support selecting multiple items in the inbox, sent box, and address book. &lt;br /&gt;
* Use delete key to trash Inbox or Sent messages. &lt;br /&gt;
* Display richtext(HTML) messages from senders in address book or subscriptions (although not pseudo-mailing-lists; use new right-click option). &lt;br /&gt;
* Support enabling and disabling subscriptions.&lt;br /&gt;
* Trim spaces from the beginning and end of addresses when adding to address book, subscriptions, and blacklist. &lt;br /&gt;
* Improved the display of the time for foreign language users. &lt;br /&gt;
&lt;br /&gt;
0.2.7&lt;br /&gt;
* Added API. See [[API_Reference|API Reference]].&lt;br /&gt;
* Added error handling for the case where the client tries to send a message from an address for which the human has deleted the keys.&lt;br /&gt;
* Improved GUI messages when doing work (or pending work) for broadcast messages.&lt;br /&gt;
* Added error handling for the case where the proof of work takes no measurable time (caused a divide by zero error). &lt;br /&gt;
&lt;br /&gt;
0.2.6&lt;br /&gt;
* New Feature: Pseudo-mailing-lists (available by right-clicking one of your addresses)&lt;br /&gt;
* New Feature: Portable Mode (available in the settings)&lt;br /&gt;
* Added missing context menu on the blacklist tab&lt;br /&gt;
&lt;br /&gt;
0.2.5&lt;br /&gt;
* Bugfix-only release: Program improperly handles other nodes claiming to be in stream 0 (issue appeared when implementing IPv6). UI Freezes.&lt;br /&gt;
&lt;br /&gt;
0.2.4&lt;br /&gt;
* Prevent user from sending messages to themselves since the client cannot process its own getpubkey or msg messages&lt;br /&gt;
* Do the pubkey POW and broadcast it directly after generating a new address&lt;br /&gt;
&lt;br /&gt;
0.2.3&lt;br /&gt;
* Defined rules for nodes to follow for storing and relaying pubkeys. Nodes now store keys for 4 weeks then delete them. They also will not accept pubkeys older than 4 weeks; the owner will have to retransmit them if they are needed.&lt;br /&gt;
* Added 'fuzzing' to the time embedded in msg and broadcast messages. &lt;br /&gt;
* Added timing attack mitigation to the function that processes incoming pubkeys&lt;br /&gt;
* Added a new file: ''messages.dat reader.py'' which can be independently used to print information stored in the messages.dat file to the console.&lt;br /&gt;
* Users who run the software for the first time will now be subscribed by default to a Bitmessage address used to send announcements.&lt;br /&gt;
&lt;br /&gt;
0.2.2&lt;br /&gt;
* Don't use DNS-based bootstrapping method if user is connecting via SOCKS; just skip it. Hopefully the nodes listed in defaultKnownNodes are still up.&lt;br /&gt;
* Implemented timing attack mitigation measure&lt;br /&gt;
&lt;br /&gt;
0.2.1&lt;br /&gt;
* Added ability to send Sent items to the trash&lt;br /&gt;
* Keep track of which objects each peer is already aware and don't advertise objects that they already know about&lt;br /&gt;
&lt;br /&gt;
0.2.0&lt;br /&gt;
* Major upgrade to ECC:&lt;br /&gt;
** Elliptic curve secp256k1 is used for Bitmessage's signing and asymetric encryption. Keys are interchangable between Bitmessage and Bitcoin.&lt;br /&gt;
** Keys stored in Wallet Import Format in the keys.dat file&lt;br /&gt;
** Deterministic addresses&lt;br /&gt;
** Addresses are now shorter: Bitmessage now supports 18 and 19 byte RIPE addresses where the missing 1 or 2 bytes are assumed to be zeros.&lt;br /&gt;
* Moved pubkey POW responsibility from the receiveData thread to the singleWorker thread&lt;br /&gt;
&lt;br /&gt;
0.1.6&lt;br /&gt;
* Added DNS-based bootstrap method so that updating defaultKnownNodes doesn't require a code push.&lt;br /&gt;
&lt;br /&gt;
0.1.5&lt;br /&gt;
* Client now checks whether a getpubkey message has the correct time before storing in inventory and also uses embeddedTime rather than system time (the way it is done for all other messages). This was a bug that didn't cause any ill-effect.&lt;br /&gt;
* Fix so that today's Bitmessage client will properly handle future versions of Bitmessage addresses&lt;br /&gt;
* Updated defaultKnownNodes&lt;br /&gt;
0.1.4&lt;br /&gt;
* Added support for SOCKS4a and SOCKS5 proxies&lt;br /&gt;
* Adjusted UI so that it looks appropriate on OS X&lt;br /&gt;
* Changed UI to accept Bitmessage addresses which lack a &amp;quot;BM-&amp;quot;. This makes copying and pasting easier.&lt;br /&gt;
* Fixed OS X issue: if user minimized client to tray then restored, segmentation fault occured&lt;br /&gt;
* Added locks to prevent ill-effect if the client receives the same object from two different nodes at the exact same time&lt;br /&gt;
* Commented out code that prevents the client from accepting a second connection from the same IP since this prevents users from running two clients within the same local network. When the Bitmessage network grows, this code will be re-enabled. &lt;br /&gt;
&lt;br /&gt;
0.1.3&lt;br /&gt;
* Updated defaultKnownNodes so people who download Bitmessage on a fresh machine can bootstrap&lt;br /&gt;
* Sort received-message-time by actual time rather than by time-interpreted-alphabetically&lt;br /&gt;
&lt;br /&gt;
0.1.2&lt;br /&gt;
* Fixed line break display issue&lt;br /&gt;
* Updated defaultKnownNodes so people who download Bitmessage on a fresh machine can bootstrap&lt;br /&gt;
* Bug fix: If subject in received message contained international characters, reply button wouldn't work completely&lt;br /&gt;
&lt;br /&gt;
0.1.1&lt;br /&gt;
* Fixed bug that prevented user from deleting a recently received message&lt;br /&gt;
* On the &amp;quot;Send&amp;quot; tab, select your address automatically if you have only one&lt;br /&gt;
* Rewrote the SQLite version check more liberally accept SQLite revision numbers&lt;br /&gt;
* Fixed &amp;quot;reply&amp;quot; functionality&lt;br /&gt;
* Removed PyObjc dependency for OSX&lt;br /&gt;
&lt;br /&gt;
0.1.0&lt;br /&gt;
* Initial release&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47573</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47573"/>
		<updated>2017-02-23T12:04:55Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* Resolve dependencies */ Add msgpack to ubuntu/debian&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should help novice users run Bitmessage from the source code files.&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
== Resolve dependencies ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;80%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Distribuion&lt;br /&gt;
! Instructions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Debian-based&lt;br /&gt;
(Ubuntu, Raspbian, PiBang, others)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Note for Debian Squeeze (6.0) users: Debian Squeeze does not offer packages (like Python, OpenSSL) in versions that are needed for Bitmessage. You can still try to [https://github.com/Bitmessage/PyBitmessage/issues/47#issuecomment-17774377 work around these problems]. Debian 7 &amp;quot;wheezy&amp;quot; works without problems.''&amp;lt;/small&amp;gt;&lt;br /&gt;
  sudo apt-get install python openssl git python-msgpack python-qt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Arch Linux&lt;br /&gt;
| &lt;br /&gt;
  sudo pacman -S python2 openssl git python2-pyqt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Fedora&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/f18/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
Note for Fedora 20 users: Due to inconsistent behavior encountered by declaring the above variable globally, the following &amp;quot;wrapper script&amp;quot; will declare the LD_LIBRARY_PATH variable correctly and only when running bitmessage.  Name the script something like &amp;quot;bitmessage&amp;quot;, mark it as executable (probably something like 755) and put it in /usr/bin so it's accessible without the full path.&lt;br /&gt;
  export LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}&amp;quot;&lt;br /&gt;
  /home/&amp;lt;yourusername&amp;gt;/PyBitmessage/src/bitmessagemain.py &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Red Hat Enterprise Linux (RHEL)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/el6/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GNU Guix&lt;br /&gt;
| &lt;br /&gt;
  guix package -i python2-msgpack python2-pyqt@4.11.4 python2-sip openssl&lt;br /&gt;
&lt;br /&gt;
For the C PoW in addition&lt;br /&gt;
&lt;br /&gt;
  guix package -i gcc binutils make linux-libre-headers gcc-toolchain&lt;br /&gt;
&lt;br /&gt;
For the OpenCL PoW in addition to both of the above, and drivers for your GPU:&lt;br /&gt;
&lt;br /&gt;
  guix package -i libffi;pip2 install pyopencl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Download and run PyBitmessage ==&lt;br /&gt;
# Download the source code from github:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/Bitmessage/PyBitmessage $HOME/PyBitmessage&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run PyBitmessage:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&lt;br /&gt;
Check the wiki for more information on how to run Bitmessage [https://bitmessage.org/wiki/Daemon as a daemon].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;If you receive a warning that you need to use python 2.7.3 or greater, and have followed the above instructions to upgrade it, your system may be attemping to run PyBitmessage with python 3. In this case, run &amp;lt;code&amp;gt;python2 ~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
To upgrade Bitmessage run the following commands:&lt;br /&gt;
:&amp;lt;code&amp;gt;cd $HOME/PyBitmessage&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OS X =&lt;br /&gt;
== With Homebrew package manager ==&lt;br /&gt;
; Setup&lt;br /&gt;
First, make sure you have not already installed Macports. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Install Homebrew: &lt;br /&gt;
 ruby -e &amp;quot;$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; Update Python:&lt;br /&gt;
 brew install python&lt;br /&gt;
&lt;br /&gt;
; Install dependencies:&lt;br /&gt;
 brew install pyqt openssl&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
== With macports package manager ==&lt;br /&gt;
First, make sure you have not already installed Homebrew. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Installing with macports or homebrew essentially has the same effect. Homebrew does some things better than ports, and ports does some things better than brew. If old-school floats your boat, these instructions are for you. &lt;br /&gt;
&lt;br /&gt;
; Select the macports installation that is right for your version of osx&lt;br /&gt;
Read the instructions or take this as a reminder: Apple's XCode and their Command Line Tools are a prerequiste for Macports, go: https://www.macports.org/install.php&lt;br /&gt;
&lt;br /&gt;
; Install dependencies and needed tools&lt;br /&gt;
 sudo port install python27 py27-pyqt4 openssl&lt;br /&gt;
 sudo port install git-core +svn +doc +bash_completion +gitweb&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python2.7 src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
= Windows =&lt;br /&gt;
# Download and install the latest revision of Python 2.7 (currently Python 2.7.10 from [https://www.python.org/downloads/ here]). The ''Windows x86 MSI Installer'' is the right choice for most people. (64-bit users may want the 64-bit version).&lt;br /&gt;
## Test that it installed:&lt;br /&gt;
### Open a command prompt by going to Start &amp;gt; Run. Type 'cmd' then press enter.&lt;br /&gt;
### type 'python'. If python is installed, you should see the python version and the prompt: '&amp;gt;&amp;gt;&amp;gt;'&lt;br /&gt;
### If you see a message such as: &amp;quot;'Python is not recognized as an internal or external command...&amp;quot; then you must add the python path to your path environmental variable:&lt;br /&gt;
#### Find the location where Python was installed (in particular, the location where python.exe exists). It might simply be in c:\Python2.7 &lt;br /&gt;
#### Follow [http://www.computerhope.com/issues/ch000549.htm these directions] to add the Python path to your path variable.&lt;br /&gt;
#### Close the command prompt window and reopen it. &lt;br /&gt;
### Try running 'python' again.&lt;br /&gt;
###Press Ctrl-Z to exit Python.&lt;br /&gt;
# Download PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here].   ''PyQt is one of Bitmessage's two dependencies.'' Look for the links to downloads under the heading labeled &amp;quot;Binary Package;&amp;quot; the binary package versions are already compiled for you. Select the version for Python 2.7 (look for &amp;quot;Py2.7&amp;quot; in the file name). Install PyQt.&lt;br /&gt;
# Download OpenSSL from [http://slproweb.com/products/Win32OpenSSL.html here]. ''OpenSSL is the second of Bitmessage's two dependencies.''  Install OpenSSL.  If an error message appears during installation of OpenSSL, download and install Visual C++ 2008.  A link is provided on the OpenSSL download page.&lt;br /&gt;
# Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'.&lt;br /&gt;
# To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'. &lt;br /&gt;
&lt;br /&gt;
== If you change user interface files ==&lt;br /&gt;
You can use Qt's Designer application to modify the user interface. After you do this, you will need to 'compile' .ui files into .py files. &lt;br /&gt;
# In a command prompt, change directories to the directory of your .ui file.&lt;br /&gt;
# Run 'pyuic4 example.ui &amp;gt; example.py'  If you get a message similar to 'pyuic4 is not recognized as an internal or external command' then you must add the PyQt directory to your system's path variable. This directory should hold pyuic4.bat. It might be in C:\Python27\Lib\site-packages\PyQt4. Remember to close the command window and reopen it after you change your path variable.&lt;br /&gt;
&lt;br /&gt;
If you add icons to bitmessage_icons.qrc, then you must run this command:&lt;br /&gt;
pyrcc4 bitmessage_icons.qrc -o bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
== Optional: Compile into a stand-alone EXE ==&lt;br /&gt;
# Download and install PyWin32&lt;br /&gt;
# Download [http://www.pyinstaller.org/ PyInstaller].&lt;br /&gt;
# Copy Bitmessage's 'src' directory to the PyInstaller directory (which contains pyinstaller.py). &lt;br /&gt;
# Run 'pyinstaller.py --onefile --noconsole --icon=&amp;quot;src\images\can-icon.ico&amp;quot; src\bitmessagemain.py'&lt;br /&gt;
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps:&lt;br /&gt;
# After following the steps above, you will see that pyinstaller created a folder called bitmessagemain. In that folder is a file: bitmessagemain.spec. Open it with a text editor.&lt;br /&gt;
# Below the line &amp;quot;a.datas,&amp;quot; add this line: &amp;lt;code&amp;gt;a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],&amp;lt;/code&amp;gt;&lt;br /&gt;
# Optionally also include the translations by modifying this file further by adding the lines shown in [[Example_pyinstaller_spec_file|this]] example file. &lt;br /&gt;
# Save and close&lt;br /&gt;
# Run this command: pyinstaller.py bitmessagemain/bitmessagemain.spec&lt;br /&gt;
&lt;br /&gt;
If you do not have the libeay32.dll you can download it here. http://www.dll-files.com/dllindex/dll-files.shtml?libeay32&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47572</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=47572"/>
		<updated>2017-02-17T16:02:42Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* Resolve dependencies */ Add GNU Guix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should help novice users run Bitmessage from the source code files.&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
== Resolve dependencies ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;80%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Distribuion&lt;br /&gt;
! Instructions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Debian-based&lt;br /&gt;
(Ubuntu, Raspbian, PiBang, others)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Note for Debian Squeeze (6.0) users: Debian Squeeze does not offer packages (like Python, OpenSSL) in versions that are needed for Bitmessage. You can still try to [https://github.com/Bitmessage/PyBitmessage/issues/47#issuecomment-17774377 work around these problems]. Debian 7 &amp;quot;wheezy&amp;quot; works without problems.''&amp;lt;/small&amp;gt;&lt;br /&gt;
  sudo apt-get install python openssl git python-qt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Arch Linux&lt;br /&gt;
| &lt;br /&gt;
  sudo pacman -S python2 openssl git python2-pyqt4&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Fedora&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/f18/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
Note for Fedora 20 users: Due to inconsistent behavior encountered by declaring the above variable globally, the following &amp;quot;wrapper script&amp;quot; will declare the LD_LIBRARY_PATH variable correctly and only when running bitmessage.  Name the script something like &amp;quot;bitmessage&amp;quot;, mark it as executable (probably something like 755) and put it in /usr/bin so it's accessible without the full path.&lt;br /&gt;
  export LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}&amp;quot;&lt;br /&gt;
  /home/&amp;lt;yourusername&amp;gt;/PyBitmessage/src/bitmessagemain.py &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Red Hat Enterprise Linux (RHEL)&lt;br /&gt;
| &amp;lt;small&amp;gt;''Fedora and RHEL6 do not support EC in OpenSSL. Therefore we need [http://linux.ringingliberty.com/bitcoin/ Ringing Liberty's bitcoin repository] to get a compatible library.''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
  su -c 'yum install -y http://linux.ringingliberty.com/bitcoin/el6/x86_64/bitcoin-release-1-4.noarch.rpm'&lt;br /&gt;
  su -c 'yum install -y python python-qt4 git openssl-compat-bitcoin-libs'&lt;br /&gt;
Tell your system where to look for the library:&lt;br /&gt;
  echo 'LD_LIBRARY_PATH=&amp;quot;/opt/openssl-compat-bitcoin/lib/&amp;quot;' &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GNU Guix&lt;br /&gt;
| &lt;br /&gt;
  guix package -i python2-msgpack python2-pyqt@4.11.4 python2-sip openssl&lt;br /&gt;
&lt;br /&gt;
For the C PoW in addition&lt;br /&gt;
&lt;br /&gt;
  guix package -i gcc binutils make linux-libre-headers gcc-toolchain&lt;br /&gt;
&lt;br /&gt;
For the OpenCL PoW in addition to both of the above, and drivers for your GPU:&lt;br /&gt;
&lt;br /&gt;
  guix package -i libffi;pip2 install pyopencl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Download and run PyBitmessage ==&lt;br /&gt;
# Download the source code from github:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/Bitmessage/PyBitmessage $HOME/PyBitmessage&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run PyBitmessage:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&lt;br /&gt;
Check the wiki for more information on how to run Bitmessage [https://bitmessage.org/wiki/Daemon as a daemon].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;If you receive a warning that you need to use python 2.7.3 or greater, and have followed the above instructions to upgrade it, your system may be attemping to run PyBitmessage with python 3. In this case, run &amp;lt;code&amp;gt;python2 ~/PyBitmessage/src/bitmessagemain.py&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
To upgrade Bitmessage run the following commands:&lt;br /&gt;
:&amp;lt;code&amp;gt;cd $HOME/PyBitmessage&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OS X =&lt;br /&gt;
== With Homebrew package manager ==&lt;br /&gt;
; Setup&lt;br /&gt;
First, make sure you have not already installed Macports. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Install Homebrew: &lt;br /&gt;
 ruby -e &amp;quot;$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; Update Python:&lt;br /&gt;
 brew install python&lt;br /&gt;
&lt;br /&gt;
; Install dependencies:&lt;br /&gt;
 brew install pyqt openssl&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
== With macports package manager ==&lt;br /&gt;
First, make sure you have not already installed Homebrew. Having both macports and homebrew on the same system is a recipe for disaster. &lt;br /&gt;
Installing with macports or homebrew essentially has the same effect. Homebrew does some things better than ports, and ports does some things better than brew. If old-school floats your boat, these instructions are for you. &lt;br /&gt;
&lt;br /&gt;
; Select the macports installation that is right for your version of osx&lt;br /&gt;
Read the instructions or take this as a reminder: Apple's XCode and their Command Line Tools are a prerequiste for Macports, go: https://www.macports.org/install.php&lt;br /&gt;
&lt;br /&gt;
; Install dependencies and needed tools&lt;br /&gt;
 sudo port install python27 py27-pyqt4 openssl&lt;br /&gt;
 sudo port install git-core +svn +doc +bash_completion +gitweb&lt;br /&gt;
&lt;br /&gt;
; Download and run&lt;br /&gt;
 cd ~/Desktop&lt;br /&gt;
 git clone git://github.com/Bitmessage/PyBitmessage.git&lt;br /&gt;
 cd PyBitmessage&lt;br /&gt;
 python2.7 src/bitmessagemain.py&lt;br /&gt;
&lt;br /&gt;
= Windows =&lt;br /&gt;
# Download and install the latest revision of Python 2.7 (currently Python 2.7.10 from [https://www.python.org/downloads/ here]). The ''Windows x86 MSI Installer'' is the right choice for most people. (64-bit users may want the 64-bit version).&lt;br /&gt;
## Test that it installed:&lt;br /&gt;
### Open a command prompt by going to Start &amp;gt; Run. Type 'cmd' then press enter.&lt;br /&gt;
### type 'python'. If python is installed, you should see the python version and the prompt: '&amp;gt;&amp;gt;&amp;gt;'&lt;br /&gt;
### If you see a message such as: &amp;quot;'Python is not recognized as an internal or external command...&amp;quot; then you must add the python path to your path environmental variable:&lt;br /&gt;
#### Find the location where Python was installed (in particular, the location where python.exe exists). It might simply be in c:\Python2.7 &lt;br /&gt;
#### Follow [http://www.computerhope.com/issues/ch000549.htm these directions] to add the Python path to your path variable.&lt;br /&gt;
#### Close the command prompt window and reopen it. &lt;br /&gt;
### Try running 'python' again.&lt;br /&gt;
###Press Ctrl-Z to exit Python.&lt;br /&gt;
# Download PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here].   ''PyQt is one of Bitmessage's two dependencies.'' Look for the links to downloads under the heading labeled &amp;quot;Binary Package;&amp;quot; the binary package versions are already compiled for you. Select the version for Python 2.7 (look for &amp;quot;Py2.7&amp;quot; in the file name). Install PyQt.&lt;br /&gt;
# Download OpenSSL from [http://slproweb.com/products/Win32OpenSSL.html here]. ''OpenSSL is the second of Bitmessage's two dependencies.''  Install OpenSSL.  If an error message appears during installation of OpenSSL, download and install Visual C++ 2008.  A link is provided on the OpenSSL download page.&lt;br /&gt;
# Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'.&lt;br /&gt;
# To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'. &lt;br /&gt;
&lt;br /&gt;
== If you change user interface files ==&lt;br /&gt;
You can use Qt's Designer application to modify the user interface. After you do this, you will need to 'compile' .ui files into .py files. &lt;br /&gt;
# In a command prompt, change directories to the directory of your .ui file.&lt;br /&gt;
# Run 'pyuic4 example.ui &amp;gt; example.py'  If you get a message similar to 'pyuic4 is not recognized as an internal or external command' then you must add the PyQt directory to your system's path variable. This directory should hold pyuic4.bat. It might be in C:\Python27\Lib\site-packages\PyQt4. Remember to close the command window and reopen it after you change your path variable.&lt;br /&gt;
&lt;br /&gt;
If you add icons to bitmessage_icons.qrc, then you must run this command:&lt;br /&gt;
pyrcc4 bitmessage_icons.qrc -o bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
== Optional: Compile into a stand-alone EXE ==&lt;br /&gt;
# Download and install PyWin32&lt;br /&gt;
# Download [http://www.pyinstaller.org/ PyInstaller].&lt;br /&gt;
# Copy Bitmessage's 'src' directory to the PyInstaller directory (which contains pyinstaller.py). &lt;br /&gt;
# Run 'pyinstaller.py --onefile --noconsole --icon=&amp;quot;src\images\can-icon.ico&amp;quot; src\bitmessagemain.py'&lt;br /&gt;
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps:&lt;br /&gt;
# After following the steps above, you will see that pyinstaller created a folder called bitmessagemain. In that folder is a file: bitmessagemain.spec. Open it with a text editor.&lt;br /&gt;
# Below the line &amp;quot;a.datas,&amp;quot; add this line: &amp;lt;code&amp;gt;a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],&amp;lt;/code&amp;gt;&lt;br /&gt;
# Optionally also include the translations by modifying this file further by adding the lines shown in [[Example_pyinstaller_spec_file|this]] example file. &lt;br /&gt;
# Save and close&lt;br /&gt;
# Run this command: pyinstaller.py bitmessagemain/bitmessagemain.spec&lt;br /&gt;
&lt;br /&gt;
If you do not have the libeay32.dll you can download it here. http://www.dll-files.com/dllindex/dll-files.shtml?libeay32&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47571</id>
		<title>Contribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47571"/>
		<updated>2017-02-16T16:35:11Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Add info about Tip4Commit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Code contributions to the Bitmessage project==&lt;br /&gt;
&lt;br /&gt;
The best code contributions are pull requests on [https://github.com/Bitmessage/PyBitmessage GitHub]. Here are some rules to follow:&lt;br /&gt;
&lt;br /&gt;
* try to explain what the code is about&lt;br /&gt;
* try to follow [https://www.python.org/dev/peps/pep-0008/ PEP0008]&lt;br /&gt;
* make the pull request against the [https://github.com/Bitmessage/PyBitmessage/tree/v0.6 &amp;quot;v0.6&amp;quot; branch]&lt;br /&gt;
* it should be possible to do a fast-forward merge of the pull requests&lt;br /&gt;
* PGP-sign the commits included in the pull request&lt;br /&gt;
* You can get paid for merged commits if you register at [https://tip4commit.com/github/Bitmessage/PyBitmessage Tip4Commit]&lt;br /&gt;
&lt;br /&gt;
If for some reason you don't want to use github, you can submit the patch using Bitmessage to the &amp;quot;bitmessage&amp;quot; chan, or to one of the developers.&lt;br /&gt;
&lt;br /&gt;
==Translations==&lt;br /&gt;
&lt;br /&gt;
For helping with translations, please use [https://www.transifex.com/bitmessage-project/pybitmessage/ Transifex]. There is no need to submit pull requests for translations.&lt;br /&gt;
&lt;br /&gt;
For translating technical terms it is recommended to consult the [https://www.microsoft.com/Language/en-US/Default.aspx Microsoft Language Portal].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47570</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47570"/>
		<updated>2017-02-08T10:31:17Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* Pubkey bitfield features */ Add proposals.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || See [[Extended encoding]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 27 || onion_router || ('''Proposal''') Node can be used to onion-route messages. In theory any node can onion route, but since it requires more resources, they may have the functionality disabled. This field will be used to indicate that the node is willing to do this.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || forward_secrecy || ('''Proposal''') Receiving node supports a forward secrecy encryption extension. The exact design is pending.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || extended_encoding || Receiving node supports extended encoding. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || ('''Proposal''') Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. '''NOTE:''' since hardly anyone implements this, this will be redesigned as simple recipient verification: https://github.com/Bitmessage/PyBitmessage/pull/808#issuecomment-170189856&lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Extended_encoding&amp;diff=47476</id>
		<title>Extended encoding</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Extended_encoding&amp;diff=47476"/>
		<updated>2016-11-15T16:05:14Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Created Extended encoding page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Extended encoding is an attempt to create a standard for transmitting structured data. The goals are flexibility, wide platform support and extensibility. It is currently available in the v0.6 branch and can be enabled by holding &amp;quot;Shift&amp;quot; while clicking on Send. It is planned that v5 addresses will have to support this. It's a work in progress, the basic plain text message works but don't expect anthing else at this time.&lt;br /&gt;
&lt;br /&gt;
The data structure is in msgpack, then compressed with zlib. The top level is a key/value store, and the &amp;quot;&amp;quot; key (empty string) contains the value of the type of object, which can then have its individual format and standards.&lt;br /&gt;
&lt;br /&gt;
Text fields are encoded using UTF-8.&lt;br /&gt;
&lt;br /&gt;
==Types==&lt;br /&gt;
&lt;br /&gt;
You can find the implementations in the &amp;lt;code&amp;gt;src/messagetypes&amp;lt;/code&amp;gt; directory of PyBitmessage. Each type has its own file which includes one class, and they are dynamically loaded on startup. It's planned that this will also contain initialisation, rendering and so on, so that developers can simply add a new object type by adding a single file in the messagetypes directory and not have to change any other part of the code.&lt;br /&gt;
&lt;br /&gt;
===message===&lt;br /&gt;
&lt;br /&gt;
The replacement for the old messages. Mandatory keys are &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;subject&amp;lt;/code&amp;gt;, others are currently not implemented and not mandatory. Proposed other keys:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;parents&amp;lt;/code&amp;gt;: array of msgids referring to messages that logically precede it in a conversation. Allows to create a threaded conversation view&lt;br /&gt;
* &amp;lt;code&amp;gt;files&amp;lt;/code&amp;gt;: array of files (which is a key/value pair):&lt;br /&gt;
** &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;: file name, mandatory&lt;br /&gt;
** &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;: the binary data of the file&lt;br /&gt;
** &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt;: MIME content type&lt;br /&gt;
** &amp;lt;code&amp;gt;disposition&amp;lt;/code&amp;gt;: MIME content disposition, possible values are &amp;quot;inline&amp;quot; and &amp;quot;attachment&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===vote===&lt;br /&gt;
&lt;br /&gt;
Dummy code available in the repository. Supposed to serve voting in a chan (thumbs up/down) for decentralised moderation. Does not actually do anything at the moment and specification can change.&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47475</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=47475"/>
		<updated>2016-11-15T15:55:57Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Update extended encoding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || See [[Extended encoding]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 29 || extended_encoding || Receiving node supports extended encoding. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47161</id>
		<title>Contribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47161"/>
		<updated>2016-10-11T10:01:58Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Added link to MS language portal&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Code contributions to the Bitmessage project==&lt;br /&gt;
&lt;br /&gt;
The best code contributions are pull requests on [https://github.com/Bitmessage/PyBitmessage GitHub]. Here are some rules to follow:&lt;br /&gt;
&lt;br /&gt;
* try to explain what the code is about&lt;br /&gt;
* try to follow [https://www.python.org/dev/peps/pep-0008/ PEP0008]&lt;br /&gt;
* make the pull request against the [https://github.com/Bitmessage/PyBitmessage/tree/v0.6 &amp;quot;v0.6&amp;quot; branch]&lt;br /&gt;
* it should be possible to do a fast-forward merge of the pull requests&lt;br /&gt;
* PGP-sign the commits included in the pull request&lt;br /&gt;
&lt;br /&gt;
If for some reason you don't want to use github, you can submit the patch using Bitmessage to the &amp;quot;bitmessage&amp;quot; chan, or to one of the developers.&lt;br /&gt;
&lt;br /&gt;
==Translations==&lt;br /&gt;
&lt;br /&gt;
For helping with translations, please use [https://www.transifex.com/bitmessage-project/pybitmessage/ Transifex]. There is no need to submit pull requests for translations.&lt;br /&gt;
&lt;br /&gt;
For translating technical terms it is recommended to consult the [https://www.microsoft.com/Language/en-US/Default.aspx Microsoft Language Portal].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47158</id>
		<title>Contribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47158"/>
		<updated>2016-10-11T09:30:46Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Link formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Code contributions to the Bitmessage project==&lt;br /&gt;
&lt;br /&gt;
The best code contributions are pull requests on [https://github.com/Bitmessage/PyBitmessage GitHub]. Here are some rules to follow:&lt;br /&gt;
&lt;br /&gt;
* try to explain what the code is about&lt;br /&gt;
* try to follow [https://www.python.org/dev/peps/pep-0008/ PEP0008]&lt;br /&gt;
* make the pull request against the [https://github.com/Bitmessage/PyBitmessage/tree/v0.6 &amp;quot;v0.6&amp;quot; branch]&lt;br /&gt;
* it should be possible to do a fast-forward merge of the pull requests&lt;br /&gt;
* PGP-sign the commits included in the pull request&lt;br /&gt;
&lt;br /&gt;
If for some reason you don't want to use github, you can submit the patch using Bitmessage to the &amp;quot;bitmessage&amp;quot; chan, or to one of the developers.&lt;br /&gt;
&lt;br /&gt;
==Translations==&lt;br /&gt;
&lt;br /&gt;
For helping with translations, please use [https://www.transifex.com/bitmessage-project/pybitmessage/ Transifex]. There is no need to submit pull requests for translations.&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47157</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47157"/>
		<updated>2016-10-11T09:28:24Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Add link to contribution guidelines&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name=Bitmessage&lt;br /&gt;
|downloadsite=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe&lt;br /&gt;
|release caption=Current version (Beta)&lt;br /&gt;
|latest release date=Aug 21, 2016&lt;br /&gt;
|version=0.6.1&lt;br /&gt;
}}&lt;br /&gt;
Bitmessage is a P2P communications [[Protocol specification|protocol]] used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide &amp;quot;non-content&amp;quot; data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs. If Bitmessage is completely new to you, you may wish to start by reading the [https://bitmessage.org/bitmessage.pdf whitepaper].&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
An open source client is available for free under the very liberal [http://opensource.org/licenses/mit-license.php MIT license]. For screenshots and a description of the client, see this CryptoJunky article: [http://cryptojunky.com/blog/2013/03/09/setting-up-and-using-bitmessage-an-encrypted-communications-platform-based-on-bitcoin/ &amp;quot;Setting Up And Using Bitmessage&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
[[File:windows_icon.png|link=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe]] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe Download for Windows (32bit)] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1_64.exe (64bit)]&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/bitmessage-v0.6.1.dmg]] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/bitmessage-v0.6.1.dmg Download for OS X]&lt;br /&gt;
&lt;br /&gt;
[[File:tux.png|link=Compiling_instructions]] [[Compiling instructions|Run the source code]]&lt;br /&gt;
&lt;br /&gt;
=== Source code ===&lt;br /&gt;
You may view the Python [https://github.com/Bitmessage/PyBitmessage source code on Github]. Bitmessage requires PyQt and OpenSSL. Step-by-step instructions on how to run the source code on Linux, Windows, or OSX is [[Compiling instructions|available here]].&lt;br /&gt;
&lt;br /&gt;
=== Contribute ===&lt;br /&gt;
Please follow the [[Contribute|contribution guidelines]] when contributing code or translations.&lt;br /&gt;
&lt;br /&gt;
=== Security audit needed ===&lt;br /&gt;
Bitmessage is in need of an independent audit to verify its security. If you are a researcher capable of reviewing the source code, please [https://bitmessage.org/misc/emailaddress.png email] the lead developer. You will be helping to create a great privacy option for people everywhere!&lt;br /&gt;
&lt;br /&gt;
=== Forum ===&lt;br /&gt;
* Visit or subscribe to the [https://pay.reddit.com/r/bitmessage Bitmessage subreddit].&lt;br /&gt;
* A community-based forum for questions, feedback, and discussion is also available at [https://bitmessage.org/forum Bitmessage.org/forum].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47156</id>
		<title>Contribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Contribute&amp;diff=47156"/>
		<updated>2016-10-11T09:26:04Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Created page with &amp;quot;==Code contributions to the Bitmessage project==  The best code contributions are pull requests on https://github.com/Bitmessage/PyBitmessage. Here are some rules to follow:...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Code contributions to the Bitmessage project==&lt;br /&gt;
&lt;br /&gt;
The best code contributions are pull requests on https://github.com/Bitmessage/PyBitmessage. Here are some rules to follow:&lt;br /&gt;
&lt;br /&gt;
* try to explain what the code is about&lt;br /&gt;
* try to follow https://www.python.org/dev/peps/pep-0008/&lt;br /&gt;
* make the pull request against the &amp;quot;v0.6&amp;quot; branch, https://github.com/Bitmessage/PyBitmessage/tree/v0.6&lt;br /&gt;
* it should be possible to do a fast-forward merge of the pull requests&lt;br /&gt;
* PGP-sign the commits included in the pull request&lt;br /&gt;
&lt;br /&gt;
If for some reason you don't want to use github, you can submit the patch using Bitmessage to the &amp;quot;bitmessage&amp;quot; chan, or to one of the developers.&lt;br /&gt;
&lt;br /&gt;
==Translations==&lt;br /&gt;
&lt;br /&gt;
For helping with translations, please use https://www.transifex.com/bitmessage-project/pybitmessage/. There is no need to submit pull requests for translations.&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=46815</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=46815"/>
		<updated>2016-08-21T10:18:21Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: v0.6.1 release&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name=Bitmessage&lt;br /&gt;
|downloadsite=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe&lt;br /&gt;
|release caption=Current version (Beta)&lt;br /&gt;
|latest release date=Aug 21, 2016&lt;br /&gt;
|version=0.6.1&lt;br /&gt;
}}&lt;br /&gt;
Bitmessage is a P2P communications [[Protocol specification|protocol]] used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide &amp;quot;non-content&amp;quot; data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs. If Bitmessage is completely new to you, you may wish to start by reading the [https://bitmessage.org/bitmessage.pdf whitepaper].&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
An open source client is available for free under the very liberal [http://opensource.org/licenses/mit-license.php MIT license]. For screenshots and a description of the client, see this CryptoJunky article: [http://cryptojunky.com/blog/2013/03/09/setting-up-and-using-bitmessage-an-encrypted-communications-platform-based-on-bitcoin/ &amp;quot;Setting Up And Using Bitmessage&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
[[File:windows_icon.png|link=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe]] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1.exe Download for Windows (32bit)] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/Bitmessage-0.6.1_64.exe (64bit)]&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/bitmessage-v0.6.1.dmg]] [https://github.com/Bitmessage/PyBitmessage/releases/download/v0.6.1/bitmessage-v0.6.1.dmg Download for OS X]&lt;br /&gt;
&lt;br /&gt;
[[File:tux.png|link=Compiling_instructions]] [[Compiling instructions|Run the source code]]&lt;br /&gt;
&lt;br /&gt;
=== Source code ===&lt;br /&gt;
You may view the Python [https://github.com/Bitmessage/PyBitmessage source code on Github]. Bitmessage requires PyQt and OpenSSL. Step-by-step instructions on how to run the source code on Linux, Windows, or OSX is [[Compiling instructions|available here]].&lt;br /&gt;
&lt;br /&gt;
=== Security audit needed ===&lt;br /&gt;
Bitmessage is in need of an independent audit to verify its security. If you are a researcher capable of reviewing the source code, please [https://bitmessage.org/misc/emailaddress.png email] the lead developer. You will be helping to create a great privacy option for people everywhere!&lt;br /&gt;
&lt;br /&gt;
=== Forum ===&lt;br /&gt;
* Visit or subscribe to the [https://pay.reddit.com/r/bitmessage Bitmessage subreddit].&lt;br /&gt;
* A community-based forum for questions, feedback, and discussion is also available at [https://bitmessage.org/forum Bitmessage.org/forum].&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=46814</id>
		<title>Changelog</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=46814"/>
		<updated>2016-08-21T09:52:53Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: 0.6.1 release&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PyBitmessage Changelog ==&lt;br /&gt;
0.6.1&lt;br /&gt;
&lt;br /&gt;
* Translation update and localisation fixes&lt;br /&gt;
* Minor bug fixes&lt;br /&gt;
* Minor UI improvements&lt;br /&gt;
* Namecoin integration fixed and improved&lt;br /&gt;
* SMTP server and client interface&lt;br /&gt;
* Tor hidden service support&lt;br /&gt;
* C PoW builds and runs on *BSD&lt;br /&gt;
* Windows binary:&lt;br /&gt;
** fixed build&lt;br /&gt;
** upgraded to Python 2.7.12 and OpenSSL 1.0.2h&lt;br /&gt;
** 64bit binary available for download&lt;br /&gt;
** self-built PyInstaller bootloader should trigger fewer antivirus false positives&lt;br /&gt;
* Mac OSX binary:&lt;br /&gt;
** upgraded to Python 2.7.12 and OpenSSL 1.0.2h&lt;br /&gt;
&lt;br /&gt;
0.6.0&lt;br /&gt;
&lt;br /&gt;
* QT interface overhaul&lt;br /&gt;
* Opportunistic TLS support&lt;br /&gt;
* Mitigation of some deanonymisation attacks&lt;br /&gt;
* C (using OpenSSL) and OpenCL PoW modules&lt;br /&gt;
* Performance improvements (backend as well as QT GUI)&lt;br /&gt;
* UPnP support&lt;br /&gt;
* Improved bootstrapping over Tor&lt;br /&gt;
* Translation updates&lt;br /&gt;
* Lots of tiny bugfixes and some minor security improvements&lt;br /&gt;
* Integration of mailchuck.com email gateway&lt;br /&gt;
&lt;br /&gt;
0.4.4&lt;br /&gt;
&lt;br /&gt;
* Added ability to limit network transfer rate&lt;br /&gt;
* Updated to [[Protocol_specification_v3|Protocol Version 3]]&lt;br /&gt;
* Removed use of memoryview so that we can support python 2.7.3 &lt;br /&gt;
* Make use of l10n for localizations&lt;br /&gt;
&lt;br /&gt;
0.4.3&lt;br /&gt;
&lt;br /&gt;
* Support pyelliptic's updated HMAC algorithm. We'll remove support for the old method after an upgrade period.&lt;br /&gt;
* Improved version check&lt;br /&gt;
* Refactored decodeBase58 function&lt;br /&gt;
* Ignore duplicate messages&lt;br /&gt;
* Added bytes received/sent counts and rate on the network information tab&lt;br /&gt;
* Fix unicode handling in 'View HTML code as formatted text'&lt;br /&gt;
* Refactor handling of packet headers &lt;br /&gt;
* Use pointMult function instead of arithmetic.privtopub since it is faster&lt;br /&gt;
* Fixed issue where client wasn't waiting for a verack before continuing on with the conversation&lt;br /&gt;
* Fixed CPU hogging by implementing tab-based refresh improvements &lt;br /&gt;
* Added curses interface&lt;br /&gt;
* Added support for IPv6&lt;br /&gt;
* Added a 'trustedpeer' option to keys.dat&lt;br /&gt;
* Limit maximum object size to 20 MB&lt;br /&gt;
* Support email-like &amp;gt; quote characters and reply-below-quote&lt;br /&gt;
* Added Japanese and Dutch language files; updated Norwegian and Russian languages files&lt;br /&gt;
&lt;br /&gt;
0.4.2&lt;br /&gt;
&lt;br /&gt;
* Added Norwegian, Chinese, and Arabic translations&lt;br /&gt;
* sock.sendall function isn't atomic. Let sendDataThread be the only thread which sends data.&lt;br /&gt;
* Moved API code to api.py&lt;br /&gt;
* Populate comboBoxSendFrom when replying&lt;br /&gt;
* Added option to show recent broadcasts when subscribing&lt;br /&gt;
* Fixed issue: If Windows username contained an international character, Bitmessage wouldn't start&lt;br /&gt;
* Added some code for FreeBSD compatibility&lt;br /&gt;
* Moved responsibility for processing network objects to the new ObjectProcessorThread&lt;br /&gt;
* Refactored main QT module&lt;br /&gt;
** Moved popup menus initialization to separate methods&lt;br /&gt;
** Simplified inbox loading&lt;br /&gt;
** Moved magic strings to the model scope constants so they won't be created every time.&lt;br /&gt;
* Updated list of defaultKnownNodes&lt;br /&gt;
* Fixed issue: [Linux] When too many messages arrive too quickly, exception occurs: &amp;quot;Exceeded maximum number of notifications&amp;quot;&lt;br /&gt;
* Fixed issue: creating then deleting an Address in short time crashes class_singleWorker.py&lt;br /&gt;
* Refactored code which displays messages to improve code readability&lt;br /&gt;
* load &amp;quot;Sent To&amp;quot; label from subscriptions if available&lt;br /&gt;
* Removed code to add chans to our address book as it is no longer necessary&lt;br /&gt;
* Added identicons&lt;br /&gt;
* Modified addresses.decodeAddress so that API command decodeAddress works properly&lt;br /&gt;
* Added API commands createChan, joinChan, leaveChan, deleteAddress&lt;br /&gt;
* In pyelliptic, check the return value of RAND_bytes to make sure enough random data was generated&lt;br /&gt;
* Don't store messages in UI table (and thus in memory), pull from SQL inventory as needed&lt;br /&gt;
* Fix typos in API commands addSubscription and getInboxMessagesByAddress&lt;br /&gt;
* Add feature in settings menu to give up resending a message after a specified period of time&lt;br /&gt;
&lt;br /&gt;
0.4.1&lt;br /&gt;
&lt;br /&gt;
* Fixed whitelist bug&lt;br /&gt;
* Fixed chan bug&lt;br /&gt;
** Added addressversion field to pubkeys table&lt;br /&gt;
** Sending messages to a chan no longer uses anything in the pubkeys table&lt;br /&gt;
** Sending messages to yourself is now fully supported&lt;br /&gt;
* Change _verifyAddress function to support v4 addresses&lt;br /&gt;
&lt;br /&gt;
0.4.0&lt;br /&gt;
&lt;br /&gt;
* Raised default demanded difficulty from 1 to 2 for new addresses&lt;br /&gt;
* Added v4 addresses: pubkeys are now encrypted and tagged in the inventory&lt;br /&gt;
* Use locks when accessing dictionary inventory&lt;br /&gt;
* Refactored the way inv and addr messages are shared&lt;br /&gt;
* Give user feedback when disk is full&lt;br /&gt;
* Added chan true/false to listAddresses results&lt;br /&gt;
* When replying using chan address, send to whole chan not just sender&lt;br /&gt;
* Refactored of the way PyBitmessage looks for interesting new objects in large inv messages from peers&lt;br /&gt;
* Show inventory lookup rate on Network Status tab&lt;br /&gt;
* Added SqlBulkExecute class so we can update inventory with only one commit&lt;br /&gt;
* Updated Russian translations&lt;br /&gt;
* Move duplicated SQL code into helper&lt;br /&gt;
* Allow specification of alternate settings dir via BITMESSAGE_HOME environment variable&lt;br /&gt;
* Removed use of gevent. Removed class_bgWorker.py&lt;br /&gt;
* Added Sip and PyQt to includes in build_osx.py&lt;br /&gt;
* Show number of each message type processed in the API command clientStatus&lt;br /&gt;
* Use fast PoW unless we're explicitly a frozen (binary) version of the code&lt;br /&gt;
* Enable user-set localization in settings&lt;br /&gt;
* Fix Archlinux package creation&lt;br /&gt;
* Fallback to language only localization when region doesn't match&lt;br /&gt;
* Fixed brew install instructions&lt;br /&gt;
* Added German translation&lt;br /&gt;
* Made inbox and sent messages table panels read-only&lt;br /&gt;
* Allow inbox and sent preview panels to resize&lt;br /&gt;
* Count RE: as a reply header, just like Re: so we don't chain Re: RE:&lt;br /&gt;
* Fix for traceback on OSX&lt;br /&gt;
* Added backend ability to understand shorter addresses&lt;br /&gt;
* Convert 'API Error' to raise APIError()&lt;br /&gt;
* Added option in settings to allow sending to a mobile device (app not yet done)&lt;br /&gt;
* Added ability to start daemon mode when using Bitmessage as a module&lt;br /&gt;
* Improved the way client detects locale&lt;br /&gt;
* Added API commands: getInboxMessageIds, getSentMessageIds, listAddressBookEntries, trashSentMessageByAckData, addAddressBookEntry, deleteAddressBookEntry, listAddresses2, listSubscriptions&lt;br /&gt;
* Set a maximum frequency for playing sounds&lt;br /&gt;
* Show Invalid Method error in same format as other API errors&lt;br /&gt;
* Update status of separate broadcasts separately even if the sent data is identical&lt;br /&gt;
* Added Namecoin integration&lt;br /&gt;
* Internally distinguish peers by IP and port&lt;br /&gt;
* Inbox message retrieval API functions now also returns read status&lt;br /&gt;
&lt;br /&gt;
0.3.5 &lt;br /&gt;
&lt;br /&gt;
* Added right-click option to mark a message as unread&lt;br /&gt;
* Prompt user to connect at first startup&lt;br /&gt;
* Install into /usr/local by default&lt;br /&gt;
* Add a missing `rm -f` to the uninstall task.&lt;br /&gt;
* Use system text color for enabled addresses instead of black&lt;br /&gt;
* Added support for Chans&lt;br /&gt;
* Start storing msgid in sent table&lt;br /&gt;
* Optionally play sounds on connection/disconnection or when messages arrive&lt;br /&gt;
* Adding configuration option to listen for connections when using SOCKS&lt;br /&gt;
* Added packaging for multiple distros (Arch, Puppy, Slack, etc.)&lt;br /&gt;
* Added Russian translation&lt;br /&gt;
* Added search support in the UI&lt;br /&gt;
* Added 'make uninstall'&lt;br /&gt;
* To improve OSX support, use PKCS5_PBKDF2_HMAC_SHA1 if PKCS5_PBKDF2_HMAC is unavailable&lt;br /&gt;
* Added better warnings for OSX users who are using old versions of Python&lt;br /&gt;
* Repaired debian packaging&lt;br /&gt;
* Altered Makefile to avoid needing to chase changes&lt;br /&gt;
* Added logger module&lt;br /&gt;
* Added bgWorker class for background tasks&lt;br /&gt;
* Added use of gevent module&lt;br /&gt;
* On not-Windows: Fix insecure keyfile permissions&lt;br /&gt;
* Fix 100% CPU usage issue&lt;br /&gt;
&lt;br /&gt;
0.3.4&lt;br /&gt;
&lt;br /&gt;
* Linux: Store config files in $XDG_CONFIG_HOME&lt;br /&gt;
* Added a new global variable user option: doTimingAttackMitigation&lt;br /&gt;
* Moved a variety of classes and functions out of bitmessagemain.py and to their own modules&lt;br /&gt;
* New API command: getSentMessageByAckData&lt;br /&gt;
* Modified the getAllSentMessages and getSentMessageById commands to return ackData&lt;br /&gt;
* API commands to get messages now return actual encoding type&lt;br /&gt;
* Bugfix: Unicode chars in localtime prevented the gui from starting&lt;br /&gt;
* Added 'Save message as...' option in Inbox&lt;br /&gt;
* Added OS X Build scripts&lt;br /&gt;
* Added option to subscribe to an address in your address book&lt;br /&gt;
* Added getInboxMessageById API command&lt;br /&gt;
* Updated icons to have sRGB profile to prevent warnings&lt;br /&gt;
* Added French translation&lt;br /&gt;
* Switched addr, msg, broadcast, and getpubkey message types to 8 byte time. Last remaining type is pubkey.&lt;br /&gt;
* Added tooltips to show the full subject of messages&lt;br /&gt;
* Added Maximum Acceptable Difficulty fields in the settings&lt;br /&gt;
* Send out pubkey immediately after generating deterministic addresses rather than waiting for a request&lt;br /&gt;
&lt;br /&gt;
0.3.3&lt;br /&gt;
* Remove inbox item from GUI when using API command trashMessage&lt;br /&gt;
* Add missing trailing semicolons to pybitmessage.desktop&lt;br /&gt;
* Ensure $(DESTDIR)/usr/bin exists&lt;br /&gt;
* Update Makefile to correct sandbox violations when built via Portage (Gentoo)&lt;br /&gt;
* Fix message authentication bug&lt;br /&gt;
&lt;br /&gt;
0.3.211&lt;br /&gt;
&lt;br /&gt;
* Removed multi-core proof of work as the multiprocessing module does not work well with pyinstaller's --onefile option.&lt;br /&gt;
&lt;br /&gt;
0.3.2&lt;br /&gt;
&lt;br /&gt;
* Bugfix: Remove remaining references to the old myapp.trayIcon&lt;br /&gt;
* Refactored message status-related code. API function getStatus now returns one of these strings: notfound, msgqueued, broadcastqueued, broadcastsent, doingpubkeypow, awaitingpubkey, doingmsgpow, msgsent, or ackreceived&lt;br /&gt;
* Moved proof of work to low-priority multi-threaded child processes&lt;br /&gt;
* Added menu option to delete all trashed messages&lt;br /&gt;
* Added inv flooding attack mitigation&lt;br /&gt;
* On Linux, when selecting Show Bitmessage, do not maximize automatically&lt;br /&gt;
* Store tray icons in bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
0.3.1&lt;br /&gt;
&lt;br /&gt;
* Added new API commands: getDeterministicAddress, addSubscription, deleteSubscription&lt;br /&gt;
* TCP Connection timeout for non-fully-established connections now 20 seconds&lt;br /&gt;
* Don't update the time we last communicated with a node unless the connection is fully established. This will allow us to forget about active but non-Bitmessage nodes which have made it into our knownNodes file.&lt;br /&gt;
* Prevent incoming connection flooding from crashing singleListener thread. Client will now only accept one connection per remote node IP&lt;br /&gt;
* Bugfix: Worker thread crashed when doing a POW to send out a v2 pubkey (bug introduced in 0.3.0)&lt;br /&gt;
* Wrap all sock.shutdown functions in error handlers&lt;br /&gt;
* Put all 'commit' commands within SQLLocks&lt;br /&gt;
* Bugfix: If address book label is blank, Bitmessage wouldn't show message (bug introduced in 0.3.0)&lt;br /&gt;
* Messaging menu item selects the oldest unread message&lt;br /&gt;
* Standardize on 'Quit' rather than 'Exit'&lt;br /&gt;
* [OSX] Try to seek homebrew installation of OpenSSL&lt;br /&gt;
* Prevent multiple instances of the application from running&lt;br /&gt;
* Show 'Connected' or 'Connection Lost' indicators&lt;br /&gt;
* Use only 9 half-open connections on Windows but 32 for everyone else&lt;br /&gt;
* Added appIndicator (a more functional tray icon) and Ubuntu Messaging Menu integration&lt;br /&gt;
* Changed Debian install directory and run script name based on Github issue #135&lt;br /&gt;
&lt;br /&gt;
0.3.0&lt;br /&gt;
&lt;br /&gt;
* Added new API function: getStatus&lt;br /&gt;
* Added error-handling around all sock.sendall() functions in the receiveData thread so that if there is a problem sending data, the threads will close gracefully&lt;br /&gt;
* Abandoned and removed the connectionsCount data structure; use the connectedHostsList instead because it has proved to be more accurate than trying to maintain the connectionsCount&lt;br /&gt;
* Added daemon mode. All UI code moved into a module and many shared objects moved into shared.py&lt;br /&gt;
* Truncate display of very long messages to avoid freezing the UI&lt;br /&gt;
* Added encrypted broadcasts for v3 addresses or v2 addresses after 2013-05-28 10:00 UTC&lt;br /&gt;
* No longer self.sock.close() from within receiveDataThreads, let the sendDataThreads do it&lt;br /&gt;
* Swapped out the v2 announcements subscription address for a v3 announcements subscription address&lt;br /&gt;
* Vacuum the messages.dat file once a month: will greatly reduce the file size&lt;br /&gt;
* Added a settings table in message.dat&lt;br /&gt;
* Implemented v3 addresses: pubkey messages must now include two var_ints: nonce_trials_per_byte and extra_bytes, and also be signed. When sending a message to a v3 address, the sender must use these values in calculating its POW or else the message will not be accepted by the receiver. &lt;br /&gt;
* Display a privacy warning when selecting 'Send Broadcast from this address'&lt;br /&gt;
* Added gitignore file&lt;br /&gt;
* Added code in preparation for a switch from 32-bit time to 64-bit time. Nodes will now advertise themselves as using protocol version 2.&lt;br /&gt;
* Don't necessarily delete entries from the inventory after 2.5 days; leave pubkeys there for 28 days so that we don't process the same ones many times throughout a month. This was causing the 'pubkeys processed' indicator on the 'Network Status' tab to not accurately reflect the number of truly new addresses on the network. &lt;br /&gt;
* Use 32 threads for outgoing connections in order to connect quickly&lt;br /&gt;
* Fix typo when calling os.environ in the sys.platform=='darwin' case&lt;br /&gt;
* Allow the cancelling of a message which is in the process of being sent by trashing it then restarting Bitmessage&lt;br /&gt;
* Bug fix: can't delete address from address book&lt;br /&gt;
&lt;br /&gt;
0.2.8&lt;br /&gt;
&lt;br /&gt;
* Fixed Ubuntu &amp;amp; OS X issue: Bitmessage wouldn't receive any objects from peers after restart. &lt;br /&gt;
* Inventory flush to disk when exiting program now vastly faster. &lt;br /&gt;
* Fixed address generation bug (kept Bitmessage from restarting). &lt;br /&gt;
* Improve deserialization of messages before processing. &lt;br /&gt;
* Change to help Macs find OpenSSL the way Unix systems find it. &lt;br /&gt;
* Do not share or accept IPs which are in the private IP ranges. &lt;br /&gt;
* Added time-fuzzing to the embedded time in pubkey and getpubkey messages. &lt;br /&gt;
* Added a knownNodes lock to prevent an exception from sometimes occurring when saving the data-structure to disk. &lt;br /&gt;
* Show unread messages in bold and do not display new messages automatically; let user click it.&lt;br /&gt;
* Support selecting multiple items in the inbox, sent box, and address book. &lt;br /&gt;
* Use delete key to trash Inbox or Sent messages. &lt;br /&gt;
* Display richtext(HTML) messages from senders in address book or subscriptions (although not pseudo-mailing-lists; use new right-click option). &lt;br /&gt;
* Support enabling and disabling subscriptions.&lt;br /&gt;
* Trim spaces from the beginning and end of addresses when adding to address book, subscriptions, and blacklist. &lt;br /&gt;
* Improved the display of the time for foreign language users. &lt;br /&gt;
&lt;br /&gt;
0.2.7&lt;br /&gt;
* Added API. See [[API_Reference|API Reference]].&lt;br /&gt;
* Added error handling for the case where the client tries to send a message from an address for which the human has deleted the keys.&lt;br /&gt;
* Improved GUI messages when doing work (or pending work) for broadcast messages.&lt;br /&gt;
* Added error handling for the case where the proof of work takes no measurable time (caused a divide by zero error). &lt;br /&gt;
&lt;br /&gt;
0.2.6&lt;br /&gt;
* New Feature: Pseudo-mailing-lists (available by right-clicking one of your addresses)&lt;br /&gt;
* New Feature: Portable Mode (available in the settings)&lt;br /&gt;
* Added missing context menu on the blacklist tab&lt;br /&gt;
&lt;br /&gt;
0.2.5&lt;br /&gt;
* Bugfix-only release: Program improperly handles other nodes claiming to be in stream 0 (issue appeared when implementing IPv6). UI Freezes.&lt;br /&gt;
&lt;br /&gt;
0.2.4&lt;br /&gt;
* Prevent user from sending messages to themselves since the client cannot process its own getpubkey or msg messages&lt;br /&gt;
* Do the pubkey POW and broadcast it directly after generating a new address&lt;br /&gt;
&lt;br /&gt;
0.2.3&lt;br /&gt;
* Defined rules for nodes to follow for storing and relaying pubkeys. Nodes now store keys for 4 weeks then delete them. They also will not accept pubkeys older than 4 weeks; the owner will have to retransmit them if they are needed.&lt;br /&gt;
* Added 'fuzzing' to the time embedded in msg and broadcast messages. &lt;br /&gt;
* Added timing attack mitigation to the function that processes incoming pubkeys&lt;br /&gt;
* Added a new file: ''messages.dat reader.py'' which can be independently used to print information stored in the messages.dat file to the console.&lt;br /&gt;
* Users who run the software for the first time will now be subscribed by default to a Bitmessage address used to send announcements.&lt;br /&gt;
&lt;br /&gt;
0.2.2&lt;br /&gt;
* Don't use DNS-based bootstrapping method if user is connecting via SOCKS; just skip it. Hopefully the nodes listed in defaultKnownNodes are still up.&lt;br /&gt;
* Implemented timing attack mitigation measure&lt;br /&gt;
&lt;br /&gt;
0.2.1&lt;br /&gt;
* Added ability to send Sent items to the trash&lt;br /&gt;
* Keep track of which objects each peer is already aware and don't advertise objects that they already know about&lt;br /&gt;
&lt;br /&gt;
0.2.0&lt;br /&gt;
* Major upgrade to ECC:&lt;br /&gt;
** Elliptic curve secp256k1 is used for Bitmessage's signing and asymetric encryption. Keys are interchangable between Bitmessage and Bitcoin.&lt;br /&gt;
** Keys stored in Wallet Import Format in the keys.dat file&lt;br /&gt;
** Deterministic addresses&lt;br /&gt;
** Addresses are now shorter: Bitmessage now supports 18 and 19 byte RIPE addresses where the missing 1 or 2 bytes are assumed to be zeros.&lt;br /&gt;
* Moved pubkey POW responsibility from the receiveData thread to the singleWorker thread&lt;br /&gt;
&lt;br /&gt;
0.1.6&lt;br /&gt;
* Added DNS-based bootstrap method so that updating defaultKnownNodes doesn't require a code push.&lt;br /&gt;
&lt;br /&gt;
0.1.5&lt;br /&gt;
* Client now checks whether a getpubkey message has the correct time before storing in inventory and also uses embeddedTime rather than system time (the way it is done for all other messages). This was a bug that didn't cause any ill-effect.&lt;br /&gt;
* Fix so that today's Bitmessage client will properly handle future versions of Bitmessage addresses&lt;br /&gt;
* Updated defaultKnownNodes&lt;br /&gt;
0.1.4&lt;br /&gt;
* Added support for SOCKS4a and SOCKS5 proxies&lt;br /&gt;
* Adjusted UI so that it looks appropriate on OS X&lt;br /&gt;
* Changed UI to accept Bitmessage addresses which lack a &amp;quot;BM-&amp;quot;. This makes copying and pasting easier.&lt;br /&gt;
* Fixed OS X issue: if user minimized client to tray then restored, segmentation fault occured&lt;br /&gt;
* Added locks to prevent ill-effect if the client receives the same object from two different nodes at the exact same time&lt;br /&gt;
* Commented out code that prevents the client from accepting a second connection from the same IP since this prevents users from running two clients within the same local network. When the Bitmessage network grows, this code will be re-enabled. &lt;br /&gt;
&lt;br /&gt;
0.1.3&lt;br /&gt;
* Updated defaultKnownNodes so people who download Bitmessage on a fresh machine can bootstrap&lt;br /&gt;
* Sort received-message-time by actual time rather than by time-interpreted-alphabetically&lt;br /&gt;
&lt;br /&gt;
0.1.2&lt;br /&gt;
* Fixed line break display issue&lt;br /&gt;
* Updated defaultKnownNodes so people who download Bitmessage on a fresh machine can bootstrap&lt;br /&gt;
* Bug fix: If subject in received message contained international characters, reply button wouldn't work completely&lt;br /&gt;
&lt;br /&gt;
0.1.1&lt;br /&gt;
* Fixed bug that prevented user from deleting a recently received message&lt;br /&gt;
* On the &amp;quot;Send&amp;quot; tab, select your address automatically if you have only one&lt;br /&gt;
* Rewrote the SQLite version check more liberally accept SQLite revision numbers&lt;br /&gt;
* Fixed &amp;quot;reply&amp;quot; functionality&lt;br /&gt;
* Removed PyObjc dependency for OSX&lt;br /&gt;
&lt;br /&gt;
0.1.0&lt;br /&gt;
* Initial release&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=46314</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=46314"/>
		<updated>2016-06-24T20:29:53Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Added EXTENDED encoding.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || A data structure in msgpack, then compressed with zlib. Null data type is encoded as an empty string, and booleans as an integer 0 (false) or 1 (true). Text fields are encoded using UTF-8. v5 and newer address versions MUST support this. Proposal, exact structure pending standardisation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 29 || extended_encoding || Receiving node supports extended encoding. &lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=46313</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=46313"/>
		<updated>2016-06-24T19:49:27Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Decided to go for msgpack instead of bencode after all&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || A data structure in msgpack, then compressed with zlib. Null data type is encoded as an empty string, and booleans as an integer 0 (false) or 1 (true). Text fields are encoded using UTF-8. v5 and newer address versions MUST support this. Proposal, exact structure pending standardisation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=FAQ&amp;diff=46174</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=FAQ&amp;diff=46174"/>
		<updated>2016-06-16T12:39:20Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: sockshostname now resolves when checking for incoming connections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Installation and configuration==&lt;br /&gt;
===How do I install Bitmessage===&lt;br /&gt;
Bitmessage does not needs to be &amp;quot;installed&amp;quot;. it is simply downloaded and executed. You can find instructions to download and run bitmessage from the [[Main Page]].&lt;br /&gt;
A great write up for setting up and using Bitmessage on Windows can be found [http://cryptojunky.com/blog/2013/03/09/setting-up-and-using-bitmessage-an-encrypted-communications-platform-based-on-bitcoin/ Here.]&lt;br /&gt;
&lt;br /&gt;
Bitmessage should run on any OS though it is only lightly tested on OSX. The start-on-boot and minimize-to-tray features are only implemented for Windows thus far. Several examples of how to install Bitmessage on *nix and OSX platforms can be found [https://bitmessage.org/forum/index.php in the forums.]&lt;br /&gt;
&lt;br /&gt;
===How do I become a node to help the network===&lt;br /&gt;
If your connection indicator is green then you are already accepting incoming connections and helping the Bitmessage network.&lt;br /&gt;
&lt;br /&gt;
If your connection indicator is yellow, check your firewall settings and port forwarding to make sure incoming connections are allowed to your machine on the correct TCP port (Default: 8444), the port can be found in the Bitmessage settings.&lt;br /&gt;
&lt;br /&gt;
You can click on the indicator for more information about each color.&lt;br /&gt;
&lt;br /&gt;
===Why is my Connection Indicator Yellow===&lt;br /&gt;
Bitmessage will work normally with a yellow indicator. If your indicator is yellow, you can have up to 8 connections. To make your indicator green, please forward the required TCP port (usually 8444). You can find the Port in the Bitmessage settings.&lt;br /&gt;
&lt;br /&gt;
===How do I setup Bitmessage to work with Tor===&lt;br /&gt;
If you need a TOR client, more complete instructions can be found on the [[TOR]] page.&lt;br /&gt;
If you already have a client, follow the instructions below.&lt;br /&gt;
&lt;br /&gt;
'''Tor'''&lt;br /&gt;
&lt;br /&gt;
If you are using the Tor Browser Bundle skip to the next section. In order for Bitmessage to use Tor as a proxy follow these steps.&lt;br /&gt;
*Navigate to Settings &amp;gt; Network Settings and select SOCKS5 from the Type: drop down under the Proxy server / Tor section.&lt;br /&gt;
*Next to 'Server hostname:' enter 'localhost' and next to 'Port:' enter '9050'.&lt;br /&gt;
*Select ok.&lt;br /&gt;
*Restart Bitmessage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tor Browser Bundle'''&lt;br /&gt;
*Navigate to Settings &amp;gt; Network Settings and select SOCKS5 from the Type: drop down under the Proxy server / Tor section.&lt;br /&gt;
*Next to 'Server hostname:' enter 'localhost' and next to 'Port:' enter '9150'.&lt;br /&gt;
*Select ok.&lt;br /&gt;
*Restart Bitmessage.&lt;br /&gt;
&lt;br /&gt;
===How do I setup Bitmessage as a hidden service on Tor===&lt;br /&gt;
&lt;br /&gt;
Bitmessage can accept incoming connections as a Tor hidden service. This feature is supported since https://github.com/Bitmessage/PyBitmessage/commit/1a40c29d221f036e82a87444ace331afbb8e80c6. In order to use it you have to manually add a new hidden service in your tor configuration. The following table explains the settings combination for Bitmessage's keys.dat. IP addresses and port number are just examples, adjust them if you have a different setup:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Outgoing connections !! Incoming connections only through clearnet !! Incoming connections only through Tor !! Incoming connections from both clearnet and Tor&lt;br /&gt;
|-&lt;br /&gt;
| Over clearnet || &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = none&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionbindip = 127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = false&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Over Tor || &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionbindip = 127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = false&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
===How can I run Bitmessage in daemon mode===&lt;br /&gt;
Refer to the [[Daemon|Daemon Mode Page]].&lt;br /&gt;
&lt;br /&gt;
===How many connections should I have===&lt;br /&gt;
As long as you have at least one connection, you can communicate with the network. If your connection indicator is yellow, you can have a maximum of 8 connections.&lt;br /&gt;
&lt;br /&gt;
===Can I send a message to someone that is offline===&lt;br /&gt;
Yes. However, if you go offline then they must come back online within 2 days of the message being sent. Nodes delete data, and do not accept data, older than 2 days. &lt;br /&gt;
&lt;br /&gt;
===How do I format my messages===&lt;br /&gt;
Here is [https://qt-project.org/doc/qt-4.8/richtext-html-subset.html the list of supported HTML tags].&lt;br /&gt;
&lt;br /&gt;
===What are subscriptions?===&lt;br /&gt;
&lt;br /&gt;
A [[Subscriptions|subscription]] allows you to receive messages, that were broadcasted by the address you subscribe too.&lt;br /&gt;
Since [[broadcast]] messages are encrypted with a key, that can be created by everyone who knows the address, you must be subscribed to an address to actually read the messages.&lt;br /&gt;
&lt;br /&gt;
Subscriptions are also required to use a [[Mailing List]].&lt;br /&gt;
&lt;br /&gt;
===What are &amp;quot;chans&amp;quot;?===&lt;br /&gt;
Chan is another word for DML. Please refer to [[DML|this article]] for a complete documentation of this rather complex feature.&lt;br /&gt;
&lt;br /&gt;
==How does Bitmessage work==&lt;br /&gt;
'''Startup'''&lt;br /&gt;
&lt;br /&gt;
When you first start Bitmessage, your client connects itself to the network and starts downloading a list of known nodes. Each new node that you connect to shares its list of known nodes. In addition to the known nodes, you will also start receiving person-to-person messages, broadcasts, and public keys. If any of these messages are bound for you, they will be shown in your inbox. All of this data is exchanged between all of your connections to make sure that everyone has a copy. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sending a Message'''&lt;br /&gt;
&lt;br /&gt;
When you send a message, your client must first compute a Proof of Work (POW). This POW helps mitigate spam on the network. Nodes and other clients will not process your message if it does not show sufficient POW. After the POW is complete, your message is shared to all of your connections which in turn share it with all of their connections. &lt;br /&gt;
&lt;br /&gt;
===Where can I find more documentation about Bitmessage===&lt;br /&gt;
* [https://bitmessage.org/bitmessage.pdf Overview White Paper (PDF)]&lt;br /&gt;
* [[Protocol specification]]&lt;br /&gt;
* Detail about the [[Proof of work]]&lt;br /&gt;
&lt;br /&gt;
==How does Bitmessage compare to other messaging methods==&lt;br /&gt;
Here is a table comparing Bitmessage to other common messaging services.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fully Distributed&amp;quot; means that after bootstrapping, the service will no longer depend on any central authority and will have no single point of failure.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Voice calls&amp;quot; and &amp;quot;Video Calls&amp;quot; are irrelevant to clients which do not support &amp;quot;Instant Messaging&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of Messaging Services&lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
! Trustless&lt;br /&gt;
! P2P&lt;br /&gt;
! Open Source&lt;br /&gt;
! Requires Proof of Work&lt;br /&gt;
! Hide Sender?&lt;br /&gt;
! Hide Receiver?&lt;br /&gt;
! Mobile Version&lt;br /&gt;
! Application or Web Based&lt;br /&gt;
! Attachments or File Transfers&lt;br /&gt;
! Acknowledge delivery&lt;br /&gt;
! Fully Distributed&lt;br /&gt;
! Instant messaging&lt;br /&gt;
! Voice calls&lt;br /&gt;
! Video calls&lt;br /&gt;
! Offline messages&lt;br /&gt;
|-&lt;br /&gt;
! Bitmessage&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| [http://opensource.org/licenses/mit-license.php MIT]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|Beta, requires server}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes|220KB}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Up to 28 days}}&lt;br /&gt;
|-&lt;br /&gt;
! Standard Email&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! Email + GPG&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://xmpp.org/ XMPP] + [https://en.wikipedia.org/wiki/Off-the-Record_Messaging OTR]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|GPL V2.1}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Partial|No OTR, not trustless}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/TorChat TorChat]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Queued}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://www.skype.com/en/ Skype]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://www.tox.im/ Tox]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial|Queued}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://www.scayl.com/ Scayl]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Alpha}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/I2P#E-mail I2P Bote]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL V3}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Up to 100 days}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://crypto.cat/ CryptoCat]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/Internet_Relay_Chat IRC]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
| {{Yes}} &lt;br /&gt;
| {{No}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
|-&lt;br /&gt;
! SMS&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://retroshare.sourceforge.net/ RetroShare]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/Freenet#Tools_and_applications Freenet + Frost]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|&lt;br /&gt;
| {{Yes}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! [https://mirror4.freenetproject.org/tools.html Freenet + FMS]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://mirror4.freenetproject.org/tools.html Freenet + Freemail] 0.2&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://wiki.freenetproject.org/FLIP Freenet + FLIP]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  [http://emp.jar.st/ EMP]&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes|BSD}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  Application&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes|Up to 30 days}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===My Connection Indicator is Red===&lt;br /&gt;
Check your connection settings.&lt;br /&gt;
Check if you can access the internet. In case you have a firewall with outgoing restrictions (not Windoes firewall) allow unrestricted access for Bitmessage through your firewall.&lt;br /&gt;
Sometimes Bitmessage takes time to connect to the network, especially if [[knownnodes.dat]] is large. Please allow at least 30 minutes for it to connect before posting to the forum.&lt;br /&gt;
You can also try deleting [[knownnodes.dat]].&lt;br /&gt;
&lt;br /&gt;
If none of that works, [https://bitmessage.org/forum/index.php please visit the forum here.]&lt;br /&gt;
&lt;br /&gt;
===I have not received a reply from the Echo Server===&lt;br /&gt;
*Your connection indicator should be yellow or green.&lt;br /&gt;
*Make sure that your POW is complete and the message has been sent. You should see an acknowledgement under &amp;quot;Status&amp;quot; on the &amp;quot;Sent&amp;quot; tab. &lt;br /&gt;
*On average it should take 8 minutes from the time you click the send button to the time you receive a response. &lt;br /&gt;
*Be sure to allow extra time in the event that the server is under heavy traffic (Example: An article about Bitmessage was posted on a popular website).&lt;br /&gt;
*You can always send a message to another echo server. Here are two echo addresses:&lt;br /&gt;
** BM-orkCbppXWSqPpAxnz6jnfTZ2djb5pJKDb&lt;br /&gt;
** BM-omXeTjutKWmYgQJjmoZjAG3u3NmaLEdZK&lt;br /&gt;
*You may subscribe to the [[Timeservice Broadcast]] to receive network heartbeats.&lt;br /&gt;
*You can send messages to a [[Mailing List]] in case it still does not works&lt;br /&gt;
If you still do not receive a response, [https://bitmessage.org/forum/index.php visit the forum] to see if there is a current technical issue or to submit a new request for assistance.&lt;br /&gt;
&lt;br /&gt;
===Other===&lt;br /&gt;
Here is a list of average times for different parts of Bitmessage. [[PyBitmessage Help]]&lt;br /&gt;
&lt;br /&gt;
Please [https://bitmessage.org/forum/index.php visit the forum] for all other issues.&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=FAQ&amp;diff=46017</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=FAQ&amp;diff=46017"/>
		<updated>2016-06-08T12:52:19Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: /* How do I setup Bitmessage as a hidden service on Tor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Installation and configuration==&lt;br /&gt;
===How do I install Bitmessage===&lt;br /&gt;
Bitmessage does not needs to be &amp;quot;installed&amp;quot;. it is simply downloaded and executed. You can find instructions to download and run bitmessage from the [[Main Page]].&lt;br /&gt;
A great write up for setting up and using Bitmessage on Windows can be found [http://cryptojunky.com/blog/2013/03/09/setting-up-and-using-bitmessage-an-encrypted-communications-platform-based-on-bitcoin/ Here.]&lt;br /&gt;
&lt;br /&gt;
Bitmessage should run on any OS though it is only lightly tested on OSX. The start-on-boot and minimize-to-tray features are only implemented for Windows thus far. Several examples of how to install Bitmessage on *nix and OSX platforms can be found [https://bitmessage.org/forum/index.php in the forums.]&lt;br /&gt;
&lt;br /&gt;
===How do I become a node to help the network===&lt;br /&gt;
If your connection indicator is green then you are already accepting incoming connections and helping the Bitmessage network.&lt;br /&gt;
&lt;br /&gt;
If your connection indicator is yellow, check your firewall settings and port forwarding to make sure incoming connections are allowed to your machine on the correct TCP port (Default: 8444), the port can be found in the Bitmessage settings.&lt;br /&gt;
&lt;br /&gt;
You can click on the indicator for more information about each color.&lt;br /&gt;
&lt;br /&gt;
===Why is my Connection Indicator Yellow===&lt;br /&gt;
Bitmessage will work normally with a yellow indicator. If your indicator is yellow, you can have up to 8 connections. To make your indicator green, please forward the required TCP port (usually 8444). You can find the Port in the Bitmessage settings.&lt;br /&gt;
&lt;br /&gt;
===How do I setup Bitmessage to work with Tor===&lt;br /&gt;
If you need a TOR client, more complete instructions can be found on the [[TOR]] page.&lt;br /&gt;
If you already have a client, follow the instructions below.&lt;br /&gt;
&lt;br /&gt;
'''Tor'''&lt;br /&gt;
&lt;br /&gt;
If you are using the Tor Browser Bundle skip to the next section. In order for Bitmessage to use Tor as a proxy follow these steps.&lt;br /&gt;
*Navigate to Settings &amp;gt; Network Settings and select SOCKS5 from the Type: drop down under the Proxy server / Tor section.&lt;br /&gt;
*Next to 'Server hostname:' enter 'localhost' and next to 'Port:' enter '9050'.&lt;br /&gt;
*Select ok.&lt;br /&gt;
*Restart Bitmessage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tor Browser Bundle'''&lt;br /&gt;
*Navigate to Settings &amp;gt; Network Settings and select SOCKS5 from the Type: drop down under the Proxy server / Tor section.&lt;br /&gt;
*Next to 'Server hostname:' enter 'localhost' and next to 'Port:' enter '9150'.&lt;br /&gt;
*Select ok.&lt;br /&gt;
*Restart Bitmessage.&lt;br /&gt;
&lt;br /&gt;
===How do I setup Bitmessage as a hidden service on Tor===&lt;br /&gt;
&lt;br /&gt;
Bitmessage can accept incoming connections as a Tor hidden service. This feature is supported since https://github.com/Bitmessage/PyBitmessage/commit/1a40c29d221f036e82a87444ace331afbb8e80c6. In order to use it you have to manually add a new hidden service in your tor configuration. The following table explains the settings combination for Bitmessage's keys.dat. IP addresses and port number are just examples, adjust them if you have a different setup:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Outgoing connections !! Incoming connections only through clearnet !! Incoming connections only through Tor !! Incoming connections from both clearnet and Tor&lt;br /&gt;
|-&lt;br /&gt;
| Over clearnet || &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = none&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionbindip = 127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = false&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Over Tor || &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionbindip = 127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = false&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Also, at the moment it's recommended to change sockshostname from &amp;quot;localhost&amp;quot; to &amp;quot;127.0.0.1&amp;quot;, otherwise you will only be able to accept one simultaneous connection. This will be fixed in the future.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
===How can I run Bitmessage in daemon mode===&lt;br /&gt;
Refer to the [[Daemon|Daemon Mode Page]].&lt;br /&gt;
&lt;br /&gt;
===How many connections should I have===&lt;br /&gt;
As long as you have at least one connection, you can communicate with the network. If your connection indicator is yellow, you can have a maximum of 8 connections.&lt;br /&gt;
&lt;br /&gt;
===Can I send a message to someone that is offline===&lt;br /&gt;
Yes. However, if you go offline then they must come back online within 2 days of the message being sent. Nodes delete data, and do not accept data, older than 2 days. &lt;br /&gt;
&lt;br /&gt;
===How do I format my messages===&lt;br /&gt;
Here is [https://qt-project.org/doc/qt-4.8/richtext-html-subset.html the list of supported HTML tags].&lt;br /&gt;
&lt;br /&gt;
===What are subscriptions?===&lt;br /&gt;
&lt;br /&gt;
A [[Subscriptions|subscription]] allows you to receive messages, that were broadcasted by the address you subscribe too.&lt;br /&gt;
Since [[broadcast]] messages are encrypted with a key, that can be created by everyone who knows the address, you must be subscribed to an address to actually read the messages.&lt;br /&gt;
&lt;br /&gt;
Subscriptions are also required to use a [[Mailing List]].&lt;br /&gt;
&lt;br /&gt;
===What are &amp;quot;chans&amp;quot;?===&lt;br /&gt;
Chan is another word for DML. Please refer to [[DML|this article]] for a complete documentation of this rather complex feature.&lt;br /&gt;
&lt;br /&gt;
==How does Bitmessage work==&lt;br /&gt;
'''Startup'''&lt;br /&gt;
&lt;br /&gt;
When you first start Bitmessage, your client connects itself to the network and starts downloading a list of known nodes. Each new node that you connect to shares its list of known nodes. In addition to the known nodes, you will also start receiving person-to-person messages, broadcasts, and public keys. If any of these messages are bound for you, they will be shown in your inbox. All of this data is exchanged between all of your connections to make sure that everyone has a copy. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sending a Message'''&lt;br /&gt;
&lt;br /&gt;
When you send a message, your client must first compute a Proof of Work (POW). This POW helps mitigate spam on the network. Nodes and other clients will not process your message if it does not show sufficient POW. After the POW is complete, your message is shared to all of your connections which in turn share it with all of their connections. &lt;br /&gt;
&lt;br /&gt;
===Where can I find more documentation about Bitmessage===&lt;br /&gt;
* [https://bitmessage.org/bitmessage.pdf Overview White Paper (PDF)]&lt;br /&gt;
* [[Protocol specification]]&lt;br /&gt;
* Detail about the [[Proof of work]]&lt;br /&gt;
&lt;br /&gt;
==How does Bitmessage compare to other messaging methods==&lt;br /&gt;
Here is a table comparing Bitmessage to other common messaging services.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fully Distributed&amp;quot; means that after bootstrapping, the service will no longer depend on any central authority and will have no single point of failure.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Voice calls&amp;quot; and &amp;quot;Video Calls&amp;quot; are irrelevant to clients which do not support &amp;quot;Instant Messaging&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of Messaging Services&lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
! Trustless&lt;br /&gt;
! P2P&lt;br /&gt;
! Open Source&lt;br /&gt;
! Requires Proof of Work&lt;br /&gt;
! Hide Sender?&lt;br /&gt;
! Hide Receiver?&lt;br /&gt;
! Mobile Version&lt;br /&gt;
! Application or Web Based&lt;br /&gt;
! Attachments or File Transfers&lt;br /&gt;
! Acknowledge delivery&lt;br /&gt;
! Fully Distributed&lt;br /&gt;
! Instant messaging&lt;br /&gt;
! Voice calls&lt;br /&gt;
! Video calls&lt;br /&gt;
! Offline messages&lt;br /&gt;
|-&lt;br /&gt;
! Bitmessage&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| [http://opensource.org/licenses/mit-license.php MIT]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|Beta, requires server}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes|220KB}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Up to 28 days}}&lt;br /&gt;
|-&lt;br /&gt;
! Standard Email&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! Email + GPG&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://xmpp.org/ XMPP] + [https://en.wikipedia.org/wiki/Off-the-Record_Messaging OTR]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|GPL V2.1}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Partial|No OTR, not trustless}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/TorChat TorChat]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Queued}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://www.skype.com/en/ Skype]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://www.tox.im/ Tox]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial|Queued}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://www.scayl.com/ Scayl]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Alpha}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/I2P#E-mail I2P Bote]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL V3}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Up to 100 days}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://crypto.cat/ CryptoCat]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/Internet_Relay_Chat IRC]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
| {{Yes}} &lt;br /&gt;
| {{No}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
|-&lt;br /&gt;
! SMS&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://retroshare.sourceforge.net/ RetroShare]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/Freenet#Tools_and_applications Freenet + Frost]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|&lt;br /&gt;
| {{Yes}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! [https://mirror4.freenetproject.org/tools.html Freenet + FMS]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://mirror4.freenetproject.org/tools.html Freenet + Freemail] 0.2&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://wiki.freenetproject.org/FLIP Freenet + FLIP]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  [http://emp.jar.st/ EMP]&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes|BSD}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  Application&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes|Up to 30 days}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===My Connection Indicator is Red===&lt;br /&gt;
Check your connection settings.&lt;br /&gt;
Check if you can access the internet. In case you have a firewall with outgoing restrictions (not Windoes firewall) allow unrestricted access for Bitmessage through your firewall.&lt;br /&gt;
Sometimes Bitmessage takes time to connect to the network, especially if [[knownnodes.dat]] is large. Please allow at least 30 minutes for it to connect before posting to the forum.&lt;br /&gt;
You can also try deleting [[knownnodes.dat]].&lt;br /&gt;
&lt;br /&gt;
If none of that works, [https://bitmessage.org/forum/index.php please visit the forum here.]&lt;br /&gt;
&lt;br /&gt;
===I have not received a reply from the Echo Server===&lt;br /&gt;
*Your connection indicator should be yellow or green.&lt;br /&gt;
*Make sure that your POW is complete and the message has been sent. You should see an acknowledgement under &amp;quot;Status&amp;quot; on the &amp;quot;Sent&amp;quot; tab. &lt;br /&gt;
*On average it should take 8 minutes from the time you click the send button to the time you receive a response. &lt;br /&gt;
*Be sure to allow extra time in the event that the server is under heavy traffic (Example: An article about Bitmessage was posted on a popular website).&lt;br /&gt;
*You can always send a message to another echo server. Here are two echo addresses:&lt;br /&gt;
** BM-orkCbppXWSqPpAxnz6jnfTZ2djb5pJKDb&lt;br /&gt;
** BM-omXeTjutKWmYgQJjmoZjAG3u3NmaLEdZK&lt;br /&gt;
*You may subscribe to the [[Timeservice Broadcast]] to receive network heartbeats.&lt;br /&gt;
*You can send messages to a [[Mailing List]] in case it still does not works&lt;br /&gt;
If you still do not receive a response, [https://bitmessage.org/forum/index.php visit the forum] to see if there is a current technical issue or to submit a new request for assistance.&lt;br /&gt;
&lt;br /&gt;
===Other===&lt;br /&gt;
Here is a list of average times for different parts of Bitmessage. [[PyBitmessage Help]]&lt;br /&gt;
&lt;br /&gt;
Please [https://bitmessage.org/forum/index.php visit the forum] for all other issues.&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=FAQ&amp;diff=46012</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=FAQ&amp;diff=46012"/>
		<updated>2016-06-08T10:19:47Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Minor clarification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Installation and configuration==&lt;br /&gt;
===How do I install Bitmessage===&lt;br /&gt;
Bitmessage does not needs to be &amp;quot;installed&amp;quot;. it is simply downloaded and executed. You can find instructions to download and run bitmessage from the [[Main Page]].&lt;br /&gt;
A great write up for setting up and using Bitmessage on Windows can be found [http://cryptojunky.com/blog/2013/03/09/setting-up-and-using-bitmessage-an-encrypted-communications-platform-based-on-bitcoin/ Here.]&lt;br /&gt;
&lt;br /&gt;
Bitmessage should run on any OS though it is only lightly tested on OSX. The start-on-boot and minimize-to-tray features are only implemented for Windows thus far. Several examples of how to install Bitmessage on *nix and OSX platforms can be found [https://bitmessage.org/forum/index.php in the forums.]&lt;br /&gt;
&lt;br /&gt;
===How do I become a node to help the network===&lt;br /&gt;
If your connection indicator is green then you are already accepting incoming connections and helping the Bitmessage network.&lt;br /&gt;
&lt;br /&gt;
If your connection indicator is yellow, check your firewall settings and port forwarding to make sure incoming connections are allowed to your machine on the correct TCP port (Default: 8444), the port can be found in the Bitmessage settings.&lt;br /&gt;
&lt;br /&gt;
You can click on the indicator for more information about each color.&lt;br /&gt;
&lt;br /&gt;
===Why is my Connection Indicator Yellow===&lt;br /&gt;
Bitmessage will work normally with a yellow indicator. If your indicator is yellow, you can have up to 8 connections. To make your indicator green, please forward the required TCP port (usually 8444). You can find the Port in the Bitmessage settings.&lt;br /&gt;
&lt;br /&gt;
===How do I setup Bitmessage to work with Tor===&lt;br /&gt;
If you need a TOR client, more complete instructions can be found on the [[TOR]] page.&lt;br /&gt;
If you already have a client, follow the instructions below.&lt;br /&gt;
&lt;br /&gt;
'''Tor'''&lt;br /&gt;
&lt;br /&gt;
If you are using the Tor Browser Bundle skip to the next section. In order for Bitmessage to use Tor as a proxy follow these steps.&lt;br /&gt;
*Navigate to Settings &amp;gt; Network Settings and select SOCKS5 from the Type: drop down under the Proxy server / Tor section.&lt;br /&gt;
*Next to 'Server hostname:' enter 'localhost' and next to 'Port:' enter '9050'.&lt;br /&gt;
*Select ok.&lt;br /&gt;
*Restart Bitmessage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tor Browser Bundle'''&lt;br /&gt;
*Navigate to Settings &amp;gt; Network Settings and select SOCKS5 from the Type: drop down under the Proxy server / Tor section.&lt;br /&gt;
*Next to 'Server hostname:' enter 'localhost' and next to 'Port:' enter '9150'.&lt;br /&gt;
*Select ok.&lt;br /&gt;
*Restart Bitmessage.&lt;br /&gt;
&lt;br /&gt;
===How do I setup Bitmessage as a hidden service on Tor===&lt;br /&gt;
&lt;br /&gt;
Bitmessage can accept incoming connections as a Tor hidden service. This feature is supported since https://github.com/Bitmessage/PyBitmessage/commit/1a40c29d221f036e82a87444ace331afbb8e80c6. In order to use it you have to manually add a new hidden service in your tor configuration. The following table explains the settings combination for Bitmessage's keys.dat. IP addresses and port number are just examples, adjust them if you have a different setup:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Outgoing connections !! Incoming connections only through clearnet !! Incoming connections only through Tor !! Incoming connections from both clearnet and Tor&lt;br /&gt;
|-&lt;br /&gt;
| Over clearnet || &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = none&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionbindip = 127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Over Tor || &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionbindip = 127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Also, at the moment it's recommended to change sockshostname from &amp;quot;localhost&amp;quot; to &amp;quot;127.0.0.1&amp;quot;, otherwise you will only be able to accept one simultaneous connection. This will be fixed in the future.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
===How can I run Bitmessage in daemon mode===&lt;br /&gt;
Refer to the [[Daemon|Daemon Mode Page]].&lt;br /&gt;
&lt;br /&gt;
===How many connections should I have===&lt;br /&gt;
As long as you have at least one connection, you can communicate with the network. If your connection indicator is yellow, you can have a maximum of 8 connections.&lt;br /&gt;
&lt;br /&gt;
===Can I send a message to someone that is offline===&lt;br /&gt;
Yes. However, if you go offline then they must come back online within 2 days of the message being sent. Nodes delete data, and do not accept data, older than 2 days. &lt;br /&gt;
&lt;br /&gt;
===How do I format my messages===&lt;br /&gt;
Here is [https://qt-project.org/doc/qt-4.8/richtext-html-subset.html the list of supported HTML tags].&lt;br /&gt;
&lt;br /&gt;
===What are subscriptions?===&lt;br /&gt;
&lt;br /&gt;
A [[Subscriptions|subscription]] allows you to receive messages, that were broadcasted by the address you subscribe too.&lt;br /&gt;
Since [[broadcast]] messages are encrypted with a key, that can be created by everyone who knows the address, you must be subscribed to an address to actually read the messages.&lt;br /&gt;
&lt;br /&gt;
Subscriptions are also required to use a [[Mailing List]].&lt;br /&gt;
&lt;br /&gt;
===What are &amp;quot;chans&amp;quot;?===&lt;br /&gt;
Chan is another word for DML. Please refer to [[DML|this article]] for a complete documentation of this rather complex feature.&lt;br /&gt;
&lt;br /&gt;
==How does Bitmessage work==&lt;br /&gt;
'''Startup'''&lt;br /&gt;
&lt;br /&gt;
When you first start Bitmessage, your client connects itself to the network and starts downloading a list of known nodes. Each new node that you connect to shares its list of known nodes. In addition to the known nodes, you will also start receiving person-to-person messages, broadcasts, and public keys. If any of these messages are bound for you, they will be shown in your inbox. All of this data is exchanged between all of your connections to make sure that everyone has a copy. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sending a Message'''&lt;br /&gt;
&lt;br /&gt;
When you send a message, your client must first compute a Proof of Work (POW). This POW helps mitigate spam on the network. Nodes and other clients will not process your message if it does not show sufficient POW. After the POW is complete, your message is shared to all of your connections which in turn share it with all of their connections. &lt;br /&gt;
&lt;br /&gt;
===Where can I find more documentation about Bitmessage===&lt;br /&gt;
* [https://bitmessage.org/bitmessage.pdf Overview White Paper (PDF)]&lt;br /&gt;
* [[Protocol specification]]&lt;br /&gt;
* Detail about the [[Proof of work]]&lt;br /&gt;
&lt;br /&gt;
==How does Bitmessage compare to other messaging methods==&lt;br /&gt;
Here is a table comparing Bitmessage to other common messaging services.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fully Distributed&amp;quot; means that after bootstrapping, the service will no longer depend on any central authority and will have no single point of failure.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Voice calls&amp;quot; and &amp;quot;Video Calls&amp;quot; are irrelevant to clients which do not support &amp;quot;Instant Messaging&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of Messaging Services&lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
! Trustless&lt;br /&gt;
! P2P&lt;br /&gt;
! Open Source&lt;br /&gt;
! Requires Proof of Work&lt;br /&gt;
! Hide Sender?&lt;br /&gt;
! Hide Receiver?&lt;br /&gt;
! Mobile Version&lt;br /&gt;
! Application or Web Based&lt;br /&gt;
! Attachments or File Transfers&lt;br /&gt;
! Acknowledge delivery&lt;br /&gt;
! Fully Distributed&lt;br /&gt;
! Instant messaging&lt;br /&gt;
! Voice calls&lt;br /&gt;
! Video calls&lt;br /&gt;
! Offline messages&lt;br /&gt;
|-&lt;br /&gt;
! Bitmessage&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| [http://opensource.org/licenses/mit-license.php MIT]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|Beta, requires server}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes|220KB}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Up to 28 days}}&lt;br /&gt;
|-&lt;br /&gt;
! Standard Email&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! Email + GPG&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://xmpp.org/ XMPP] + [https://en.wikipedia.org/wiki/Off-the-Record_Messaging OTR]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|GPL V2.1}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Partial|No OTR, not trustless}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/TorChat TorChat]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Queued}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://www.skype.com/en/ Skype]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://www.tox.im/ Tox]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial|Queued}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://www.scayl.com/ Scayl]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Alpha}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/I2P#E-mail I2P Bote]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL V3}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Up to 100 days}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://crypto.cat/ CryptoCat]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/Internet_Relay_Chat IRC]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
| {{Yes}} &lt;br /&gt;
| {{No}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
|-&lt;br /&gt;
! SMS&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://retroshare.sourceforge.net/ RetroShare]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/Freenet#Tools_and_applications Freenet + Frost]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|&lt;br /&gt;
| {{Yes}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! [https://mirror4.freenetproject.org/tools.html Freenet + FMS]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://mirror4.freenetproject.org/tools.html Freenet + Freemail] 0.2&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://wiki.freenetproject.org/FLIP Freenet + FLIP]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  [http://emp.jar.st/ EMP]&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes|BSD}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  Application&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes|Up to 30 days}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===My Connection Indicator is Red===&lt;br /&gt;
Check your connection settings.&lt;br /&gt;
Check if you can access the internet. In case you have a firewall with outgoing restrictions (not Windoes firewall) allow unrestricted access for Bitmessage through your firewall.&lt;br /&gt;
Sometimes Bitmessage takes time to connect to the network, especially if [[knownnodes.dat]] is large. Please allow at least 30 minutes for it to connect before posting to the forum.&lt;br /&gt;
You can also try deleting [[knownnodes.dat]].&lt;br /&gt;
&lt;br /&gt;
If none of that works, [https://bitmessage.org/forum/index.php please visit the forum here.]&lt;br /&gt;
&lt;br /&gt;
===I have not received a reply from the Echo Server===&lt;br /&gt;
*Your connection indicator should be yellow or green.&lt;br /&gt;
*Make sure that your POW is complete and the message has been sent. You should see an acknowledgement under &amp;quot;Status&amp;quot; on the &amp;quot;Sent&amp;quot; tab. &lt;br /&gt;
*On average it should take 8 minutes from the time you click the send button to the time you receive a response. &lt;br /&gt;
*Be sure to allow extra time in the event that the server is under heavy traffic (Example: An article about Bitmessage was posted on a popular website).&lt;br /&gt;
*You can always send a message to another echo server. Here are two echo addresses:&lt;br /&gt;
** BM-orkCbppXWSqPpAxnz6jnfTZ2djb5pJKDb&lt;br /&gt;
** BM-omXeTjutKWmYgQJjmoZjAG3u3NmaLEdZK&lt;br /&gt;
*You may subscribe to the [[Timeservice Broadcast]] to receive network heartbeats.&lt;br /&gt;
*You can send messages to a [[Mailing List]] in case it still does not works&lt;br /&gt;
If you still do not receive a response, [https://bitmessage.org/forum/index.php visit the forum] to see if there is a current technical issue or to submit a new request for assistance.&lt;br /&gt;
&lt;br /&gt;
===Other===&lt;br /&gt;
Here is a list of average times for different parts of Bitmessage. [[PyBitmessage Help]]&lt;br /&gt;
&lt;br /&gt;
Please [https://bitmessage.org/forum/index.php visit the forum] for all other issues.&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=FAQ&amp;diff=46011</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=FAQ&amp;diff=46011"/>
		<updated>2016-06-08T10:13:23Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Tor hidden service&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Installation and configuration==&lt;br /&gt;
===How do I install Bitmessage===&lt;br /&gt;
Bitmessage does not needs to be &amp;quot;installed&amp;quot;. it is simply downloaded and executed. You can find instructions to download and run bitmessage from the [[Main Page]].&lt;br /&gt;
A great write up for setting up and using Bitmessage on Windows can be found [http://cryptojunky.com/blog/2013/03/09/setting-up-and-using-bitmessage-an-encrypted-communications-platform-based-on-bitcoin/ Here.]&lt;br /&gt;
&lt;br /&gt;
Bitmessage should run on any OS though it is only lightly tested on OSX. The start-on-boot and minimize-to-tray features are only implemented for Windows thus far. Several examples of how to install Bitmessage on *nix and OSX platforms can be found [https://bitmessage.org/forum/index.php in the forums.]&lt;br /&gt;
&lt;br /&gt;
===How do I become a node to help the network===&lt;br /&gt;
If your connection indicator is green then you are already accepting incoming connections and helping the Bitmessage network.&lt;br /&gt;
&lt;br /&gt;
If your connection indicator is yellow, check your firewall settings and port forwarding to make sure incoming connections are allowed to your machine on the correct TCP port (Default: 8444), the port can be found in the Bitmessage settings.&lt;br /&gt;
&lt;br /&gt;
You can click on the indicator for more information about each color.&lt;br /&gt;
&lt;br /&gt;
===Why is my Connection Indicator Yellow===&lt;br /&gt;
Bitmessage will work normally with a yellow indicator. If your indicator is yellow, you can have up to 8 connections. To make your indicator green, please forward the required TCP port (usually 8444). You can find the Port in the Bitmessage settings.&lt;br /&gt;
&lt;br /&gt;
===How do I setup Bitmessage to work with Tor===&lt;br /&gt;
If you need a TOR client, more complete instructions can be found on the [[TOR]] page.&lt;br /&gt;
If you already have a client, follow the instructions below.&lt;br /&gt;
&lt;br /&gt;
'''Tor'''&lt;br /&gt;
&lt;br /&gt;
If you are using the Tor Browser Bundle skip to the next section. In order for Bitmessage to use Tor as a proxy follow these steps.&lt;br /&gt;
*Navigate to Settings &amp;gt; Network Settings and select SOCKS5 from the Type: drop down under the Proxy server / Tor section.&lt;br /&gt;
*Next to 'Server hostname:' enter 'localhost' and next to 'Port:' enter '9050'.&lt;br /&gt;
*Select ok.&lt;br /&gt;
*Restart Bitmessage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tor Browser Bundle'''&lt;br /&gt;
*Navigate to Settings &amp;gt; Network Settings and select SOCKS5 from the Type: drop down under the Proxy server / Tor section.&lt;br /&gt;
*Next to 'Server hostname:' enter 'localhost' and next to 'Port:' enter '9150'.&lt;br /&gt;
*Select ok.&lt;br /&gt;
*Restart Bitmessage.&lt;br /&gt;
&lt;br /&gt;
===How do I setup Bitmessage as a hidden service on Tor===&lt;br /&gt;
&lt;br /&gt;
Bitmessage can accept incoming connections as a Tor hidden service. This feature is supported since https://github.com/Bitmessage/PyBitmessage/commit/1a40c29d221f036e82a87444ace331afbb8e80c6. In order to use it you have to manually add a new hidden service in your tor configuration. The following table explains the settings combination (IP addresses and port number are just examples, adjust them if you have a different setup):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Outgoing connections !! Incoming connections only through clearnet !! Incoming connections only through Tor !! Incoming connections from both clearnet and Tor&lt;br /&gt;
|-&lt;br /&gt;
| Over clearnet || &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = none&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionbindip = 127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Over Tor || &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionbindip = 127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;socksproxytype = SOCKS5&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;onionhostname = abcdefgh.onion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onionport = 8444&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sockslisten = true&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
===How can I run Bitmessage in daemon mode===&lt;br /&gt;
Refer to the [[Daemon|Daemon Mode Page]].&lt;br /&gt;
&lt;br /&gt;
===How many connections should I have===&lt;br /&gt;
As long as you have at least one connection, you can communicate with the network. If your connection indicator is yellow, you can have a maximum of 8 connections.&lt;br /&gt;
&lt;br /&gt;
===Can I send a message to someone that is offline===&lt;br /&gt;
Yes. However, if you go offline then they must come back online within 2 days of the message being sent. Nodes delete data, and do not accept data, older than 2 days. &lt;br /&gt;
&lt;br /&gt;
===How do I format my messages===&lt;br /&gt;
Here is [https://qt-project.org/doc/qt-4.8/richtext-html-subset.html the list of supported HTML tags].&lt;br /&gt;
&lt;br /&gt;
===What are subscriptions?===&lt;br /&gt;
&lt;br /&gt;
A [[Subscriptions|subscription]] allows you to receive messages, that were broadcasted by the address you subscribe too.&lt;br /&gt;
Since [[broadcast]] messages are encrypted with a key, that can be created by everyone who knows the address, you must be subscribed to an address to actually read the messages.&lt;br /&gt;
&lt;br /&gt;
Subscriptions are also required to use a [[Mailing List]].&lt;br /&gt;
&lt;br /&gt;
===What are &amp;quot;chans&amp;quot;?===&lt;br /&gt;
Chan is another word for DML. Please refer to [[DML|this article]] for a complete documentation of this rather complex feature.&lt;br /&gt;
&lt;br /&gt;
==How does Bitmessage work==&lt;br /&gt;
'''Startup'''&lt;br /&gt;
&lt;br /&gt;
When you first start Bitmessage, your client connects itself to the network and starts downloading a list of known nodes. Each new node that you connect to shares its list of known nodes. In addition to the known nodes, you will also start receiving person-to-person messages, broadcasts, and public keys. If any of these messages are bound for you, they will be shown in your inbox. All of this data is exchanged between all of your connections to make sure that everyone has a copy. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sending a Message'''&lt;br /&gt;
&lt;br /&gt;
When you send a message, your client must first compute a Proof of Work (POW). This POW helps mitigate spam on the network. Nodes and other clients will not process your message if it does not show sufficient POW. After the POW is complete, your message is shared to all of your connections which in turn share it with all of their connections. &lt;br /&gt;
&lt;br /&gt;
===Where can I find more documentation about Bitmessage===&lt;br /&gt;
* [https://bitmessage.org/bitmessage.pdf Overview White Paper (PDF)]&lt;br /&gt;
* [[Protocol specification]]&lt;br /&gt;
* Detail about the [[Proof of work]]&lt;br /&gt;
&lt;br /&gt;
==How does Bitmessage compare to other messaging methods==&lt;br /&gt;
Here is a table comparing Bitmessage to other common messaging services.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fully Distributed&amp;quot; means that after bootstrapping, the service will no longer depend on any central authority and will have no single point of failure.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Voice calls&amp;quot; and &amp;quot;Video Calls&amp;quot; are irrelevant to clients which do not support &amp;quot;Instant Messaging&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Comparison of Messaging Services&lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
! Trustless&lt;br /&gt;
! P2P&lt;br /&gt;
! Open Source&lt;br /&gt;
! Requires Proof of Work&lt;br /&gt;
! Hide Sender?&lt;br /&gt;
! Hide Receiver?&lt;br /&gt;
! Mobile Version&lt;br /&gt;
! Application or Web Based&lt;br /&gt;
! Attachments or File Transfers&lt;br /&gt;
! Acknowledge delivery&lt;br /&gt;
! Fully Distributed&lt;br /&gt;
! Instant messaging&lt;br /&gt;
! Voice calls&lt;br /&gt;
! Video calls&lt;br /&gt;
! Offline messages&lt;br /&gt;
|-&lt;br /&gt;
! Bitmessage&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| [http://opensource.org/licenses/mit-license.php MIT]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|Beta, requires server}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes|220KB}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Up to 28 days}}&lt;br /&gt;
|-&lt;br /&gt;
! Standard Email&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! Email + GPG&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://xmpp.org/ XMPP] + [https://en.wikipedia.org/wiki/Off-the-Record_Messaging OTR]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|GPL V2.1}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Partial|No OTR, not trustless}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/TorChat TorChat]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Queued}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://www.skype.com/en/ Skype]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://www.tox.im/ Tox]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Partial|Queued}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://www.scayl.com/ Scayl]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Alpha}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/I2P#E-mail I2P Bote]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL V3}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|Up to 100 days}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://crypto.cat/ CryptoCat]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/Internet_Relay_Chat IRC]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Both&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
| {{Yes}} &lt;br /&gt;
| {{No}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Partial|Depends}}&lt;br /&gt;
|-&lt;br /&gt;
! SMS&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
! [http://retroshare.sourceforge.net/ RetroShare]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! [https://en.wikipedia.org/wiki/Freenet#Tools_and_applications Freenet + Frost]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|&lt;br /&gt;
| {{Yes}} &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! [https://mirror4.freenetproject.org/tools.html Freenet + FMS]&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://mirror4.freenetproject.org/tools.html Freenet + Freemail] 0.2&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes|GPL}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! [https://wiki.freenetproject.org/FLIP Freenet + FLIP]&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| &lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| Application&lt;br /&gt;
| {{No}}&lt;br /&gt;
| &lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!  [http://emp.jar.st/ EMP]&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes|BSD}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  Application&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{Yes}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{No}}&lt;br /&gt;
|  {{Yes|Up to 30 days}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===My Connection Indicator is Red===&lt;br /&gt;
Check your connection settings.&lt;br /&gt;
Check if you can access the internet. In case you have a firewall with outgoing restrictions (not Windoes firewall) allow unrestricted access for Bitmessage through your firewall.&lt;br /&gt;
Sometimes Bitmessage takes time to connect to the network, especially if [[knownnodes.dat]] is large. Please allow at least 30 minutes for it to connect before posting to the forum.&lt;br /&gt;
You can also try deleting [[knownnodes.dat]].&lt;br /&gt;
&lt;br /&gt;
If none of that works, [https://bitmessage.org/forum/index.php please visit the forum here.]&lt;br /&gt;
&lt;br /&gt;
===I have not received a reply from the Echo Server===&lt;br /&gt;
*Your connection indicator should be yellow or green.&lt;br /&gt;
*Make sure that your POW is complete and the message has been sent. You should see an acknowledgement under &amp;quot;Status&amp;quot; on the &amp;quot;Sent&amp;quot; tab. &lt;br /&gt;
*On average it should take 8 minutes from the time you click the send button to the time you receive a response. &lt;br /&gt;
*Be sure to allow extra time in the event that the server is under heavy traffic (Example: An article about Bitmessage was posted on a popular website).&lt;br /&gt;
*You can always send a message to another echo server. Here are two echo addresses:&lt;br /&gt;
** BM-orkCbppXWSqPpAxnz6jnfTZ2djb5pJKDb&lt;br /&gt;
** BM-omXeTjutKWmYgQJjmoZjAG3u3NmaLEdZK&lt;br /&gt;
*You may subscribe to the [[Timeservice Broadcast]] to receive network heartbeats.&lt;br /&gt;
*You can send messages to a [[Mailing List]] in case it still does not works&lt;br /&gt;
If you still do not receive a response, [https://bitmessage.org/forum/index.php visit the forum] to see if there is a current technical issue or to submit a new request for assistance.&lt;br /&gt;
&lt;br /&gt;
===Other===&lt;br /&gt;
Here is a list of average times for different parts of Bitmessage. [[PyBitmessage Help]]&lt;br /&gt;
&lt;br /&gt;
Please [https://bitmessage.org/forum/index.php visit the forum] for all other issues.&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=46009</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=46009"/>
		<updated>2016-06-08T08:01:59Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Added EXTENDED encoding.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EXTENDED || A data structure in bencode, then compressed with zlib. Null data type is encoded as an empty string, and booleans as an integer 0 (false) or 1 (true). Text fields are encoded using UTF-8. v5 and newer address versions MUST support this. Proposal, exact structure pending standardisation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=46007</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=46007"/>
		<updated>2016-06-08T07:34:00Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: removed incoming (I decided not to implement it), and added some clarification for ssl&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS in the current connect (python &amp;lt; 2.7.9 only supports a SSL client, so in that case it would only have this on when the connection is a client).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=45842</id>
		<title>Changelog</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=45842"/>
		<updated>2016-05-30T09:40:11Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Updated 0.6.0 changelog&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PyBitmessage Changelog ==&lt;br /&gt;
0.6.0&lt;br /&gt;
&lt;br /&gt;
* QT interface overhaul&lt;br /&gt;
* Opportunistic TLS support&lt;br /&gt;
* Mitigation of some deanonymisation attacks&lt;br /&gt;
* C (using OpenSSL) and OpenCL PoW modules&lt;br /&gt;
* Performance improvements (backend as well as QT GUI)&lt;br /&gt;
* UPnP support&lt;br /&gt;
* Improved bootstrapping over Tor&lt;br /&gt;
* Translation updates&lt;br /&gt;
* Lots of tiny bugfixes and some minor security improvements&lt;br /&gt;
* Integration of mailchuck.com email gateway&lt;br /&gt;
&lt;br /&gt;
0.4.4&lt;br /&gt;
&lt;br /&gt;
* Added ability to limit network transfer rate&lt;br /&gt;
* Updated to [[Protocol_specification_v3|Protocol Version 3]]&lt;br /&gt;
* Removed use of memoryview so that we can support python 2.7.3 &lt;br /&gt;
* Make use of l10n for localizations&lt;br /&gt;
&lt;br /&gt;
0.4.3&lt;br /&gt;
&lt;br /&gt;
* Support pyelliptic's updated HMAC algorithm. We'll remove support for the old method after an upgrade period.&lt;br /&gt;
* Improved version check&lt;br /&gt;
* Refactored decodeBase58 function&lt;br /&gt;
* Ignore duplicate messages&lt;br /&gt;
* Added bytes received/sent counts and rate on the network information tab&lt;br /&gt;
* Fix unicode handling in 'View HTML code as formatted text'&lt;br /&gt;
* Refactor handling of packet headers &lt;br /&gt;
* Use pointMult function instead of arithmetic.privtopub since it is faster&lt;br /&gt;
* Fixed issue where client wasn't waiting for a verack before continuing on with the conversation&lt;br /&gt;
* Fixed CPU hogging by implementing tab-based refresh improvements &lt;br /&gt;
* Added curses interface&lt;br /&gt;
* Added support for IPv6&lt;br /&gt;
* Added a 'trustedpeer' option to keys.dat&lt;br /&gt;
* Limit maximum object size to 20 MB&lt;br /&gt;
* Support email-like &amp;gt; quote characters and reply-below-quote&lt;br /&gt;
* Added Japanese and Dutch language files; updated Norwegian and Russian languages files&lt;br /&gt;
&lt;br /&gt;
0.4.2&lt;br /&gt;
&lt;br /&gt;
* Added Norwegian, Chinese, and Arabic translations&lt;br /&gt;
* sock.sendall function isn't atomic. Let sendDataThread be the only thread which sends data.&lt;br /&gt;
* Moved API code to api.py&lt;br /&gt;
* Populate comboBoxSendFrom when replying&lt;br /&gt;
* Added option to show recent broadcasts when subscribing&lt;br /&gt;
* Fixed issue: If Windows username contained an international character, Bitmessage wouldn't start&lt;br /&gt;
* Added some code for FreeBSD compatibility&lt;br /&gt;
* Moved responsibility for processing network objects to the new ObjectProcessorThread&lt;br /&gt;
* Refactored main QT module&lt;br /&gt;
** Moved popup menus initialization to separate methods&lt;br /&gt;
** Simplified inbox loading&lt;br /&gt;
** Moved magic strings to the model scope constants so they won't be created every time.&lt;br /&gt;
* Updated list of defaultKnownNodes&lt;br /&gt;
* Fixed issue: [Linux] When too many messages arrive too quickly, exception occurs: &amp;quot;Exceeded maximum number of notifications&amp;quot;&lt;br /&gt;
* Fixed issue: creating then deleting an Address in short time crashes class_singleWorker.py&lt;br /&gt;
* Refactored code which displays messages to improve code readability&lt;br /&gt;
* load &amp;quot;Sent To&amp;quot; label from subscriptions if available&lt;br /&gt;
* Removed code to add chans to our address book as it is no longer necessary&lt;br /&gt;
* Added identicons&lt;br /&gt;
* Modified addresses.decodeAddress so that API command decodeAddress works properly&lt;br /&gt;
* Added API commands createChan, joinChan, leaveChan, deleteAddress&lt;br /&gt;
* In pyelliptic, check the return value of RAND_bytes to make sure enough random data was generated&lt;br /&gt;
* Don't store messages in UI table (and thus in memory), pull from SQL inventory as needed&lt;br /&gt;
* Fix typos in API commands addSubscription and getInboxMessagesByAddress&lt;br /&gt;
* Add feature in settings menu to give up resending a message after a specified period of time&lt;br /&gt;
&lt;br /&gt;
0.4.1&lt;br /&gt;
&lt;br /&gt;
* Fixed whitelist bug&lt;br /&gt;
* Fixed chan bug&lt;br /&gt;
** Added addressversion field to pubkeys table&lt;br /&gt;
** Sending messages to a chan no longer uses anything in the pubkeys table&lt;br /&gt;
** Sending messages to yourself is now fully supported&lt;br /&gt;
* Change _verifyAddress function to support v4 addresses&lt;br /&gt;
&lt;br /&gt;
0.4.0&lt;br /&gt;
&lt;br /&gt;
* Raised default demanded difficulty from 1 to 2 for new addresses&lt;br /&gt;
* Added v4 addresses: pubkeys are now encrypted and tagged in the inventory&lt;br /&gt;
* Use locks when accessing dictionary inventory&lt;br /&gt;
* Refactored the way inv and addr messages are shared&lt;br /&gt;
* Give user feedback when disk is full&lt;br /&gt;
* Added chan true/false to listAddresses results&lt;br /&gt;
* When replying using chan address, send to whole chan not just sender&lt;br /&gt;
* Refactored of the way PyBitmessage looks for interesting new objects in large inv messages from peers&lt;br /&gt;
* Show inventory lookup rate on Network Status tab&lt;br /&gt;
* Added SqlBulkExecute class so we can update inventory with only one commit&lt;br /&gt;
* Updated Russian translations&lt;br /&gt;
* Move duplicated SQL code into helper&lt;br /&gt;
* Allow specification of alternate settings dir via BITMESSAGE_HOME environment variable&lt;br /&gt;
* Removed use of gevent. Removed class_bgWorker.py&lt;br /&gt;
* Added Sip and PyQt to includes in build_osx.py&lt;br /&gt;
* Show number of each message type processed in the API command clientStatus&lt;br /&gt;
* Use fast PoW unless we're explicitly a frozen (binary) version of the code&lt;br /&gt;
* Enable user-set localization in settings&lt;br /&gt;
* Fix Archlinux package creation&lt;br /&gt;
* Fallback to language only localization when region doesn't match&lt;br /&gt;
* Fixed brew install instructions&lt;br /&gt;
* Added German translation&lt;br /&gt;
* Made inbox and sent messages table panels read-only&lt;br /&gt;
* Allow inbox and sent preview panels to resize&lt;br /&gt;
* Count RE: as a reply header, just like Re: so we don't chain Re: RE:&lt;br /&gt;
* Fix for traceback on OSX&lt;br /&gt;
* Added backend ability to understand shorter addresses&lt;br /&gt;
* Convert 'API Error' to raise APIError()&lt;br /&gt;
* Added option in settings to allow sending to a mobile device (app not yet done)&lt;br /&gt;
* Added ability to start daemon mode when using Bitmessage as a module&lt;br /&gt;
* Improved the way client detects locale&lt;br /&gt;
* Added API commands: getInboxMessageIds, getSentMessageIds, listAddressBookEntries, trashSentMessageByAckData, addAddressBookEntry, deleteAddressBookEntry, listAddresses2, listSubscriptions&lt;br /&gt;
* Set a maximum frequency for playing sounds&lt;br /&gt;
* Show Invalid Method error in same format as other API errors&lt;br /&gt;
* Update status of separate broadcasts separately even if the sent data is identical&lt;br /&gt;
* Added Namecoin integration&lt;br /&gt;
* Internally distinguish peers by IP and port&lt;br /&gt;
* Inbox message retrieval API functions now also returns read status&lt;br /&gt;
&lt;br /&gt;
0.3.5 &lt;br /&gt;
&lt;br /&gt;
* Added right-click option to mark a message as unread&lt;br /&gt;
* Prompt user to connect at first startup&lt;br /&gt;
* Install into /usr/local by default&lt;br /&gt;
* Add a missing `rm -f` to the uninstall task.&lt;br /&gt;
* Use system text color for enabled addresses instead of black&lt;br /&gt;
* Added support for Chans&lt;br /&gt;
* Start storing msgid in sent table&lt;br /&gt;
* Optionally play sounds on connection/disconnection or when messages arrive&lt;br /&gt;
* Adding configuration option to listen for connections when using SOCKS&lt;br /&gt;
* Added packaging for multiple distros (Arch, Puppy, Slack, etc.)&lt;br /&gt;
* Added Russian translation&lt;br /&gt;
* Added search support in the UI&lt;br /&gt;
* Added 'make uninstall'&lt;br /&gt;
* To improve OSX support, use PKCS5_PBKDF2_HMAC_SHA1 if PKCS5_PBKDF2_HMAC is unavailable&lt;br /&gt;
* Added better warnings for OSX users who are using old versions of Python&lt;br /&gt;
* Repaired debian packaging&lt;br /&gt;
* Altered Makefile to avoid needing to chase changes&lt;br /&gt;
* Added logger module&lt;br /&gt;
* Added bgWorker class for background tasks&lt;br /&gt;
* Added use of gevent module&lt;br /&gt;
* On not-Windows: Fix insecure keyfile permissions&lt;br /&gt;
* Fix 100% CPU usage issue&lt;br /&gt;
&lt;br /&gt;
0.3.4&lt;br /&gt;
&lt;br /&gt;
* Linux: Store config files in $XDG_CONFIG_HOME&lt;br /&gt;
* Added a new global variable user option: doTimingAttackMitigation&lt;br /&gt;
* Moved a variety of classes and functions out of bitmessagemain.py and to their own modules&lt;br /&gt;
* New API command: getSentMessageByAckData&lt;br /&gt;
* Modified the getAllSentMessages and getSentMessageById commands to return ackData&lt;br /&gt;
* API commands to get messages now return actual encoding type&lt;br /&gt;
* Bugfix: Unicode chars in localtime prevented the gui from starting&lt;br /&gt;
* Added 'Save message as...' option in Inbox&lt;br /&gt;
* Added OS X Build scripts&lt;br /&gt;
* Added option to subscribe to an address in your address book&lt;br /&gt;
* Added getInboxMessageById API command&lt;br /&gt;
* Updated icons to have sRGB profile to prevent warnings&lt;br /&gt;
* Added French translation&lt;br /&gt;
* Switched addr, msg, broadcast, and getpubkey message types to 8 byte time. Last remaining type is pubkey.&lt;br /&gt;
* Added tooltips to show the full subject of messages&lt;br /&gt;
* Added Maximum Acceptable Difficulty fields in the settings&lt;br /&gt;
* Send out pubkey immediately after generating deterministic addresses rather than waiting for a request&lt;br /&gt;
&lt;br /&gt;
0.3.3&lt;br /&gt;
* Remove inbox item from GUI when using API command trashMessage&lt;br /&gt;
* Add missing trailing semicolons to pybitmessage.desktop&lt;br /&gt;
* Ensure $(DESTDIR)/usr/bin exists&lt;br /&gt;
* Update Makefile to correct sandbox violations when built via Portage (Gentoo)&lt;br /&gt;
* Fix message authentication bug&lt;br /&gt;
&lt;br /&gt;
0.3.211&lt;br /&gt;
&lt;br /&gt;
* Removed multi-core proof of work as the multiprocessing module does not work well with pyinstaller's --onefile option.&lt;br /&gt;
&lt;br /&gt;
0.3.2&lt;br /&gt;
&lt;br /&gt;
* Bugfix: Remove remaining references to the old myapp.trayIcon&lt;br /&gt;
* Refactored message status-related code. API function getStatus now returns one of these strings: notfound, msgqueued, broadcastqueued, broadcastsent, doingpubkeypow, awaitingpubkey, doingmsgpow, msgsent, or ackreceived&lt;br /&gt;
* Moved proof of work to low-priority multi-threaded child processes&lt;br /&gt;
* Added menu option to delete all trashed messages&lt;br /&gt;
* Added inv flooding attack mitigation&lt;br /&gt;
* On Linux, when selecting Show Bitmessage, do not maximize automatically&lt;br /&gt;
* Store tray icons in bitmessage_icons_rc.py&lt;br /&gt;
&lt;br /&gt;
0.3.1&lt;br /&gt;
&lt;br /&gt;
* Added new API commands: getDeterministicAddress, addSubscription, deleteSubscription&lt;br /&gt;
* TCP Connection timeout for non-fully-established connections now 20 seconds&lt;br /&gt;
* Don't update the time we last communicated with a node unless the connection is fully established. This will allow us to forget about active but non-Bitmessage nodes which have made it into our knownNodes file.&lt;br /&gt;
* Prevent incoming connection flooding from crashing singleListener thread. Client will now only accept one connection per remote node IP&lt;br /&gt;
* Bugfix: Worker thread crashed when doing a POW to send out a v2 pubkey (bug introduced in 0.3.0)&lt;br /&gt;
* Wrap all sock.shutdown functions in error handlers&lt;br /&gt;
* Put all 'commit' commands within SQLLocks&lt;br /&gt;
* Bugfix: If address book label is blank, Bitmessage wouldn't show message (bug introduced in 0.3.0)&lt;br /&gt;
* Messaging menu item selects the oldest unread message&lt;br /&gt;
* Standardize on 'Quit' rather than 'Exit'&lt;br /&gt;
* [OSX] Try to seek homebrew installation of OpenSSL&lt;br /&gt;
* Prevent multiple instances of the application from running&lt;br /&gt;
* Show 'Connected' or 'Connection Lost' indicators&lt;br /&gt;
* Use only 9 half-open connections on Windows but 32 for everyone else&lt;br /&gt;
* Added appIndicator (a more functional tray icon) and Ubuntu Messaging Menu integration&lt;br /&gt;
* Changed Debian install directory and run script name based on Github issue #135&lt;br /&gt;
&lt;br /&gt;
0.3.0&lt;br /&gt;
&lt;br /&gt;
* Added new API function: getStatus&lt;br /&gt;
* Added error-handling around all sock.sendall() functions in the receiveData thread so that if there is a problem sending data, the threads will close gracefully&lt;br /&gt;
* Abandoned and removed the connectionsCount data structure; use the connectedHostsList instead because it has proved to be more accurate than trying to maintain the connectionsCount&lt;br /&gt;
* Added daemon mode. All UI code moved into a module and many shared objects moved into shared.py&lt;br /&gt;
* Truncate display of very long messages to avoid freezing the UI&lt;br /&gt;
* Added encrypted broadcasts for v3 addresses or v2 addresses after 2013-05-28 10:00 UTC&lt;br /&gt;
* No longer self.sock.close() from within receiveDataThreads, let the sendDataThreads do it&lt;br /&gt;
* Swapped out the v2 announcements subscription address for a v3 announcements subscription address&lt;br /&gt;
* Vacuum the messages.dat file once a month: will greatly reduce the file size&lt;br /&gt;
* Added a settings table in message.dat&lt;br /&gt;
* Implemented v3 addresses: pubkey messages must now include two var_ints: nonce_trials_per_byte and extra_bytes, and also be signed. When sending a message to a v3 address, the sender must use these values in calculating its POW or else the message will not be accepted by the receiver. &lt;br /&gt;
* Display a privacy warning when selecting 'Send Broadcast from this address'&lt;br /&gt;
* Added gitignore file&lt;br /&gt;
* Added code in preparation for a switch from 32-bit time to 64-bit time. Nodes will now advertise themselves as using protocol version 2.&lt;br /&gt;
* Don't necessarily delete entries from the inventory after 2.5 days; leave pubkeys there for 28 days so that we don't process the same ones many times throughout a month. This was causing the 'pubkeys processed' indicator on the 'Network Status' tab to not accurately reflect the number of truly new addresses on the network. &lt;br /&gt;
* Use 32 threads for outgoing connections in order to connect quickly&lt;br /&gt;
* Fix typo when calling os.environ in the sys.platform=='darwin' case&lt;br /&gt;
* Allow the cancelling of a message which is in the process of being sent by trashing it then restarting Bitmessage&lt;br /&gt;
* Bug fix: can't delete address from address book&lt;br /&gt;
&lt;br /&gt;
0.2.8&lt;br /&gt;
&lt;br /&gt;
* Fixed Ubuntu &amp;amp; OS X issue: Bitmessage wouldn't receive any objects from peers after restart. &lt;br /&gt;
* Inventory flush to disk when exiting program now vastly faster. &lt;br /&gt;
* Fixed address generation bug (kept Bitmessage from restarting). &lt;br /&gt;
* Improve deserialization of messages before processing. &lt;br /&gt;
* Change to help Macs find OpenSSL the way Unix systems find it. &lt;br /&gt;
* Do not share or accept IPs which are in the private IP ranges. &lt;br /&gt;
* Added time-fuzzing to the embedded time in pubkey and getpubkey messages. &lt;br /&gt;
* Added a knownNodes lock to prevent an exception from sometimes occurring when saving the data-structure to disk. &lt;br /&gt;
* Show unread messages in bold and do not display new messages automatically; let user click it.&lt;br /&gt;
* Support selecting multiple items in the inbox, sent box, and address book. &lt;br /&gt;
* Use delete key to trash Inbox or Sent messages. &lt;br /&gt;
* Display richtext(HTML) messages from senders in address book or subscriptions (although not pseudo-mailing-lists; use new right-click option). &lt;br /&gt;
* Support enabling and disabling subscriptions.&lt;br /&gt;
* Trim spaces from the beginning and end of addresses when adding to address book, subscriptions, and blacklist. &lt;br /&gt;
* Improved the display of the time for foreign language users. &lt;br /&gt;
&lt;br /&gt;
0.2.7&lt;br /&gt;
* Added API. See [[API_Reference|API Reference]].&lt;br /&gt;
* Added error handling for the case where the client tries to send a message from an address for which the human has deleted the keys.&lt;br /&gt;
* Improved GUI messages when doing work (or pending work) for broadcast messages.&lt;br /&gt;
* Added error handling for the case where the proof of work takes no measurable time (caused a divide by zero error). &lt;br /&gt;
&lt;br /&gt;
0.2.6&lt;br /&gt;
* New Feature: Pseudo-mailing-lists (available by right-clicking one of your addresses)&lt;br /&gt;
* New Feature: Portable Mode (available in the settings)&lt;br /&gt;
* Added missing context menu on the blacklist tab&lt;br /&gt;
&lt;br /&gt;
0.2.5&lt;br /&gt;
* Bugfix-only release: Program improperly handles other nodes claiming to be in stream 0 (issue appeared when implementing IPv6). UI Freezes.&lt;br /&gt;
&lt;br /&gt;
0.2.4&lt;br /&gt;
* Prevent user from sending messages to themselves since the client cannot process its own getpubkey or msg messages&lt;br /&gt;
* Do the pubkey POW and broadcast it directly after generating a new address&lt;br /&gt;
&lt;br /&gt;
0.2.3&lt;br /&gt;
* Defined rules for nodes to follow for storing and relaying pubkeys. Nodes now store keys for 4 weeks then delete them. They also will not accept pubkeys older than 4 weeks; the owner will have to retransmit them if they are needed.&lt;br /&gt;
* Added 'fuzzing' to the time embedded in msg and broadcast messages. &lt;br /&gt;
* Added timing attack mitigation to the function that processes incoming pubkeys&lt;br /&gt;
* Added a new file: ''messages.dat reader.py'' which can be independently used to print information stored in the messages.dat file to the console.&lt;br /&gt;
* Users who run the software for the first time will now be subscribed by default to a Bitmessage address used to send announcements.&lt;br /&gt;
&lt;br /&gt;
0.2.2&lt;br /&gt;
* Don't use DNS-based bootstrapping method if user is connecting via SOCKS; just skip it. Hopefully the nodes listed in defaultKnownNodes are still up.&lt;br /&gt;
* Implemented timing attack mitigation measure&lt;br /&gt;
&lt;br /&gt;
0.2.1&lt;br /&gt;
* Added ability to send Sent items to the trash&lt;br /&gt;
* Keep track of which objects each peer is already aware and don't advertise objects that they already know about&lt;br /&gt;
&lt;br /&gt;
0.2.0&lt;br /&gt;
* Major upgrade to ECC:&lt;br /&gt;
** Elliptic curve secp256k1 is used for Bitmessage's signing and asymetric encryption. Keys are interchangable between Bitmessage and Bitcoin.&lt;br /&gt;
** Keys stored in Wallet Import Format in the keys.dat file&lt;br /&gt;
** Deterministic addresses&lt;br /&gt;
** Addresses are now shorter: Bitmessage now supports 18 and 19 byte RIPE addresses where the missing 1 or 2 bytes are assumed to be zeros.&lt;br /&gt;
* Moved pubkey POW responsibility from the receiveData thread to the singleWorker thread&lt;br /&gt;
&lt;br /&gt;
0.1.6&lt;br /&gt;
* Added DNS-based bootstrap method so that updating defaultKnownNodes doesn't require a code push.&lt;br /&gt;
&lt;br /&gt;
0.1.5&lt;br /&gt;
* Client now checks whether a getpubkey message has the correct time before storing in inventory and also uses embeddedTime rather than system time (the way it is done for all other messages). This was a bug that didn't cause any ill-effect.&lt;br /&gt;
* Fix so that today's Bitmessage client will properly handle future versions of Bitmessage addresses&lt;br /&gt;
* Updated defaultKnownNodes&lt;br /&gt;
0.1.4&lt;br /&gt;
* Added support for SOCKS4a and SOCKS5 proxies&lt;br /&gt;
* Adjusted UI so that it looks appropriate on OS X&lt;br /&gt;
* Changed UI to accept Bitmessage addresses which lack a &amp;quot;BM-&amp;quot;. This makes copying and pasting easier.&lt;br /&gt;
* Fixed OS X issue: if user minimized client to tray then restored, segmentation fault occured&lt;br /&gt;
* Added locks to prevent ill-effect if the client receives the same object from two different nodes at the exact same time&lt;br /&gt;
* Commented out code that prevents the client from accepting a second connection from the same IP since this prevents users from running two clients within the same local network. When the Bitmessage network grows, this code will be re-enabled. &lt;br /&gt;
&lt;br /&gt;
0.1.3&lt;br /&gt;
* Updated defaultKnownNodes so people who download Bitmessage on a fresh machine can bootstrap&lt;br /&gt;
* Sort received-message-time by actual time rather than by time-interpreted-alphabetically&lt;br /&gt;
&lt;br /&gt;
0.1.2&lt;br /&gt;
* Fixed line break display issue&lt;br /&gt;
* Updated defaultKnownNodes so people who download Bitmessage on a fresh machine can bootstrap&lt;br /&gt;
* Bug fix: If subject in received message contained international characters, reply button wouldn't work completely&lt;br /&gt;
&lt;br /&gt;
0.1.1&lt;br /&gt;
* Fixed bug that prevented user from deleting a recently received message&lt;br /&gt;
* On the &amp;quot;Send&amp;quot; tab, select your address automatically if you have only one&lt;br /&gt;
* Rewrote the SQLite version check more liberally accept SQLite revision numbers&lt;br /&gt;
* Fixed &amp;quot;reply&amp;quot; functionality&lt;br /&gt;
* Removed PyObjc dependency for OSX&lt;br /&gt;
&lt;br /&gt;
0.1.0&lt;br /&gt;
* Initial release&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Keys.dat_options&amp;diff=45556</id>
		<title>Keys.dat options</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Keys.dat_options&amp;diff=45556"/>
		<updated>2016-05-10T15:21:42Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Added some options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists the extra 'hidden' options of which you can make use by adding them to your [[keys.dat]] file in the bitmessagesettings section. These options are either not set by default or are not documented at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Copy these two lines for easy expansion of the table&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| VERSION || NAME || VALUE || WIKIPAGE || DESCRIPTION&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Possible options ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Version !! Name !! Values !! Documentation !! Description&lt;br /&gt;
|-&lt;br /&gt;
| (?)0.4.4 || maxcores || integer || undocumented || Use no more than this many threads/cores to calculate proofs of work. Only applicable when using the Python PoW and running from source (when running from an executable made with the likes of pyinstaller/py2app, only one core is used for PoW). The C PoW detects the number of cores and compares them to the processor affinity settings, so you can specify the cores the PoW should use by using sysadmin tools.&lt;br /&gt;
|-&lt;br /&gt;
| (?)0.4.4 || trustedpeer || IP:Port || undocumented || Connect to the specified node and only the specified node. Useful if you trust a node on your local network and want to sync to it quickly. Disallows incoming connections. Disables the built-in timing attack mitigation mechanism.&lt;br /&gt;
|-&lt;br /&gt;
| (?)0.4.4 || willinglysendtomobile || true/false || undocumented || This is not fully implemented and may result in errors so leave it at false&lt;br /&gt;
|-&lt;br /&gt;
| (?)0.4.4 || maxdownloadrate || integer || undocumented || Maximum download speed, in kilobytes (bytes * 1000) per second, together across all connections. Set to 0 for unrestricted.&lt;br /&gt;
|-&lt;br /&gt;
| (?)0.4.4 || maxuploadrate || integer || undocumented || Maximum upload speed, in kilobytes (bytes * 1000) per second, together across all connections. Set to 0 for unrestricted&lt;br /&gt;
|-&lt;br /&gt;
| 0.6.0 || ttl || integer || undocumented || The expiration of newly send messages, in seconds. Previously, messages sent from Bitmessage had a fixed TTL of 2 days, now you can configure them. In the GUI, you can use the slider in the &amp;quot;Send&amp;quot; tab to adjust this. Minimum is 1 hours, maximum is 28 days&lt;br /&gt;
|-&lt;br /&gt;
| 0.6.0 || upnp || true/false || undocumented || If yes, will use UPnP to try to establish port mapping so that it can accept incoming connections over firewall/NAT.&lt;br /&gt;
|-&lt;br /&gt;
| 0.6.0 || extport || integer || undocumented || Port that is used by the external firewall/router. Only has an effect if using UPnP. This is mainly so that when restarting, it remembers the last port and does not unnecessarily request a different one.&lt;br /&gt;
|-&lt;br /&gt;
| 0.6.0 || trayonclose || true/false || undocumented || If yes, when closing (Alt-F4, clicking the X in the window title, and so on), instead of exiting, it closes the main window and stays in the system tray&lt;br /&gt;
|-&lt;br /&gt;
| 0.2.7 || apienabled || true/false || [[API|API Reference]] || Turns the [[API]] on or off&lt;br /&gt;
|-&lt;br /&gt;
| 0.2.7 || apiport || integer || [[API|API Reference]] || Port number to listen on (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
| 0.2.7 || apiinterface || IP || [[API|API Reference]] || IP address of a local interface. 127.0.0.1 for localhost only access and 0.0.0.0 for all interfaces.&lt;br /&gt;
|-&lt;br /&gt;
| 0.2.7 || apiusername || string || [[API|API Reference]] || Username to access the API&lt;br /&gt;
|-&lt;br /&gt;
| 0.2.7 || apipassword || string || [[API|API Reference]] || password to access the API&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enabling options ==&lt;br /&gt;
To enable an option, the [[keys.dat]] must be edited.&lt;br /&gt;
Lines of the format&lt;br /&gt;
&amp;lt;pre&amp;gt;name = Value&amp;lt;/pre&amp;gt;&lt;br /&gt;
can be added. '''Please be aware of the spacing around the equal sign'''&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=45306</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=45306"/>
		<updated>2016-04-18T11:44:04Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Added NODE_INCOMING service in bitfield&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || NODE_INCOMING || This node is accepting incoming connections.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=31656</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=31656"/>
		<updated>2015-11-26T15:00:42Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Describe how SSL negotiation works.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&lt;br /&gt;
&lt;br /&gt;
If both sides announce that they support SSL, they MUST perform a SSL handshake immediately after they both send and receive verack. During this SSL handshake, the TCP client acts as a SSL client, and the TCP server acts as a SSL server. The current implementation (v0.5.4 or later) requires the AECDH-AES256-SHA cipher over TLSv1 protocol, and prefers the secp256k1 curve (but other curves may be accepted, depending on the version of python and OpenSSL used).&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=31655</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=31655"/>
		<updated>2015-11-26T14:51:11Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=31654</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=31654"/>
		<updated>2015-11-26T14:49:55Z</updated>

		<summary type="html">&lt;p&gt;PeterSurda: Added NODE_SSL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;All objects sent on the network should support protocol v3 starting on Sun, 16 Nov 2014 22:00:00 GMT. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-512] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when creating an address.&lt;br /&gt;
&lt;br /&gt;
A double-round of SHA-512 is used for the Proof Of Work. Example of double-SHA-512 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round of sha-512)&lt;br /&gt;
 0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200(second round of sha-512)&lt;br /&gt;
&lt;br /&gt;
For Bitmessage addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043(first round is sha-512)&lt;br /&gt;
 79a324faeebcbf9849f310545ed531556882487e (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
All integers are encoded in big endian. (This is different from Bitcoin). &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. Because of other restrictions, there is no reason why this length would ever be larger than 1600003 bytes. Some clients include a sanity-check to avoid processing messages which are larger than this.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || message_payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#object|object]]. Not to be confused with objectPayload.&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;
! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| 0xE9BEB4D9 || E9 BE B4 D9&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.  Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value. For example; the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.&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 integer as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xffffffff || 5 || 0xfe followed by the integer as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xff followed by the integer as uint64_t&lt;br /&gt;
|}&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 || [[Protocol_specification#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;
=== Variable length list of integers===&lt;br /&gt;
&lt;br /&gt;
n integers can be stored using n+1 [[Protocol_specification#Variable_length_integer|variable length integers]] where the first var_int equals n.&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|| [[Protocol_specification#Variable_length_integer|var_int]] || Number of var_ints below&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The first value stored&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || The second value stored...&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || || var_int || etc...&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 or stream 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;
| 8 || time || uint64 || the Time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || stream|| uint32 || Stream number for this node&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. IPv4 addresses are 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&lt;br /&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. Two rounds of SHA-512 are used, resulting in a 64 byte hash. Only the first 32 bytes are used; the later 32 bytes are ignored.&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;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Encrypted payload ===&lt;br /&gt;
&lt;br /&gt;
Bitmessage uses [https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme ECIES] to encrypt its messages. For more information see [[Encryption]]&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;
| 16||IV||uchar[]||Initialization Vector used for AES-256-CBC&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Curve type||Elliptic Curve type 0x02CA (714)&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||X length||Length of X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| X length||uchar[]||X||X component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| 2||uint16_t||Y length||Length of Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| Y length||uchar[]||Y||Y component of public key R&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Cipher text&lt;br /&gt;
|-&lt;br /&gt;
| 32||MAC|| uchar[]||HMACSHA256 Message Authentication Code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unencrypted Message Data ===&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+||msg_version||var_int||Message format version. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This field is not included after the protocol v3 upgrade period.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+||address_version||var_int||Sender's address version number. This is needed in order to calculate the sender's address to show in the UI, and also to allow for forwards compatible changes to the public-key data included below.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream||var_int||Sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||behavior bitfield||uint32_t||A bitfield of optional behaviors and features that can be expected from the node with this pubkey included in this msg message (the sender's pubkey). &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. '''This field is new and is only included when the address_version &amp;gt;= 3.'''&lt;br /&gt;
|-&lt;br /&gt;
| 20||destination ripe||uchar[]||The ripe hash of the public key of the receiver of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||encoding||var_int||[[Protocol_specification#Message_Encodings|Message Encoding]] type&lt;br /&gt;
|-&lt;br /&gt;
| 1+||message_length||var_int||Message Length&lt;br /&gt;
|-&lt;br /&gt;
| message_length||message||uchar[]||The message.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ack_length||var_int||Length of the acknowledgement data&lt;br /&gt;
|-&lt;br /&gt;
| ack_length||ack_data||uchar[]||The acknowledgement data to be transmitted. This takes the form of a Bitmessage protocol message, like another msg message. The POW therein must already be completed.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers the object header starting with the time, appended with the data described in this table down to the ack_data. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Message Encodings====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IGNORE || Any data with this number may be ignored. The sending node might simply be sharing its public key with you.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || TRIVIAL|| UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings of data, like URIs or magnet links.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SIMPLE || UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. &lt;br /&gt;
&amp;lt;code&amp;gt;messageToTransmit = 'Subject:' + subject + '\n' + 'Body:' + message&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further values for the message encodings can be decided upon by the community. Any MIME or MIME-like encoding format, should they be used, should make use of Bitmessage's 8-bit bytes.&lt;br /&gt;
&lt;br /&gt;
====Pubkey bitfield features====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit!! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || undefined || The most significant bit at the beginning of the structure. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| 1 || undefined || The next most significant bit. Undefined&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 30 || include_destination || Receiving node expects that the RIPE hash encoded in their address preceedes the encrypted message data of msg messages bound for them. &lt;br /&gt;
|-&lt;br /&gt;
| 31 || does_ack|| If true, the receiving node does send acknowledgements (rather than dropping them).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
Undefined messages received on the wire must be ignored.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher 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. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher.&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 || net_addr || The network address of the node receiving this message (not including the time or stream number)&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || net_addr || The network address of the node emitting this message (not including the time or stream number and the ip itself is ignored by the receiver)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Random nonce used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || user_agent || [[#Variable length string|var_str]] || [[User Agent]] (0x00 if string is 0 bytes long). Sending nodes must not include a user_agent longer than 5000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream_numbers || [[#Variable length list of integers|var_int_list]] || The stream numbers that the emitting node is interested in. Sending nodes must not include more than 160000 stream numbers.&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. Once you have sent and received a verack messages with the remote node, send an addr message advertising up to 1000 peers of which you are aware, and one or more inv messages advertising all of the valid objects of which you are aware.&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 is a normal network node.&lt;br /&gt;
| 2 || NODE_SSL     || This node supports SSL/TLS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The ''verack'' message is sent in reply to ''version''.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;. The TCP timeout starts out at 20 seconds; after verack messages are exchanged, the timeout is raised to 10 minutes.&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 || [[Protocol_specification#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || addr_list || [[Protocol_specification#Network_address|net_addr]] || Address of other nodes on the network. &lt;br /&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. &lt;br /&gt;
Payload (maximum payload length: 50000 items):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#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 an ''inv'' message to retrieve the content of a specific object after filtering known elements.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum payload length: 50000 entries):&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;
| ? || count || [[Protocol_specification#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== object ===&lt;br /&gt;
&lt;br /&gt;
An object is a message which is shared throughout a stream. It is the only message which propagates; all others are only between two nodes. Objects have a type, like 'msg', or 'broadcast'. To be a valid object, the [[Proof of work|Proof Of Work]] must be done. The maximum allowable length of an object (not to be confused with the objectPayload) is 2&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt; bytes.&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||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||expiresTime||uint64_t||&lt;br /&gt;
The &amp;quot;end of life&amp;quot; time of this object (be aware, in version 2 of the protocol this was the generation time). Objects shall be shared with peers until its end-of-life time has been reached. The node should store the inventory vector of that object for some extra period of time to avoid reloading it from another node with a small time delay. The time may be no further than 28 days + 3 hours in the future.&lt;br /&gt;
|-&lt;br /&gt;
| 4||objectType||uint32_t||&lt;br /&gt;
Four values are currently defined: 0-&amp;quot;getpubkey&amp;quot;, 1-&amp;quot;pubkey&amp;quot;, 2-&amp;quot;msg&amp;quot;, 3-&amp;quot;broadcast&amp;quot;. All other values are reserved. Nodes should relay objects even if they use an undefined object type.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||version||var_int||The object's version. Note that msg objects won't contain a version until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||stream number||var_int||The stream number in which this object may propagate&lt;br /&gt;
|-&lt;br /&gt;
| ?||objectPayload||uchar[]||&lt;br /&gt;
This field varies depending on the object type; see below.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object types ==&lt;br /&gt;
Here are the payloads for various object types.&lt;br /&gt;
&lt;br /&gt;
=== getpubkey === &lt;br /&gt;
&lt;br /&gt;
When a node has the hash of a public key (from an address) but not the public key itself, it must send out a request for the public key.&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;
| &amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;20||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;ripe||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;uchar[]||&amp;lt;font color=&amp;quot;#666666&amp;quot;&amp;gt;The ripemd hash of the public key. This field is only included when the address version is &amp;lt;= 3.&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32||tag||uchar[]||The tag derived from the address version, stream number, and ripe. This field is only included when the address version is &amp;gt;= 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pubkey === &lt;br /&gt;
&lt;br /&gt;
A version 2 pubkey. This is still in use and supported by current clients but ''new'' v2 addresses are not generated by clients.&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 3 pubkey&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||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;as of protocol v3, covers the object header starting with the time, appended with the data described in this table down to the extra_bytes.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A version 4 pubkey&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||tag||uchar[]||The tag, made up of bytes 32-64 of the double hash of the address data (see example python code below)&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted pubkey data.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When version 4 pubkeys are created, most of the data in the pubkey is encrypted. This is done in such a way that only someone who has the Bitmessage address which corresponds to a pubkey can decrypt and use that pubkey. This prevents people from gathering pubkeys sent around the network and using the data from them to create messages to be used in spam or in flooding attacks. &lt;br /&gt;
&lt;br /&gt;
In order to encrypt the pubkey data, a double SHA-512 hash is calculated from the address version number, stream number, and ripe hash of the Bitmessage address that the pubkey corresponds to. The first 32 bytes of this hash are used to create a public and private key pair with which to encrypt and decrypt the pubkey data, using the same algorithm as message encryption (see [[Encryption]]). The remaining 32 bytes of this hash are added to the unencrypted part of the pubkey and used as a tag, as above. This allows nodes to determine which pubkey to decrypt when they wish to send a message. &lt;br /&gt;
&lt;br /&gt;
In PyBitmessage, the double hash of the address data is calculated using the python code below:&lt;br /&gt;
&lt;br /&gt;
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber) + encodeVarint(streamNumber) + hash).digest()).digest()&lt;br /&gt;
&lt;br /&gt;
Encrypted data in version 4 pubkeys:&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;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the node receiving the message. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. &lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length||signature||uchar[]||The ECDSA signature which covers everything from the object header starting with the time, then appended with the decrypted data down to the extra_bytes. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This was changed in protocol v3. &amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== msg ===&lt;br /&gt;
Used for person-to-person messages. Note that msg objects won't contain a version in the object header until Sun, 16 Nov 2014 22:00:00 GMT.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted data. See [[Protocol_specification#Encrypted_payload|Encrypted payload]]. See also [[Protocol_specification#Unencrypted_Message_Data|Unencrypted Message Data Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== broadcast ===&lt;br /&gt;
Users who are subscribed to the sending address will see the message appear in their inbox. Broadcasts are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;version 4 or 5.&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Pubkey objects and v5 broadcast objects are encrypted the same way: The data encoded in the sender's Bitmessage address is hashed twice. The first 32 bytes of the resulting hash constitutes the &amp;quot;private&amp;quot; encryption key and the last 32 bytes constitute a '''tag''' so that anyone listening can easily decide if this particular message is interesting. The sender calculates the public key from the private key and then encrypts the object with this public key. Thus anyone who knows the Bitmessage address of the sender of a broadcast or pubkey object can decrypt it. &lt;br /&gt;
&lt;br /&gt;
The version of broadcast objects was previously 2 or 3 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;but was changed to 4 or 5 for protocol v3. &amp;lt;/span&amp;gt; Having a broadcast version of 5 indicates that a tag is used which, in turn, is used when the sender's address version is &amp;gt;=4.&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 || tag|| uchar[]||The tag. This field is new and only included when the broadcast version is &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;gt;= 5. Changed in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ?||encrypted||uchar[]||Encrypted broadcast data. The keys are derived as described in the paragraph above. See [[Protocol_specification#Encrypted_payload|Encrypted payload]] for details about the encryption algorithm itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unencrypted data format:&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+|| broadcast version|| var_int||&amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;The version number of this broadcast protocol message which is equal to 2 or 3. This is included here so that it can be signed.&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This is no longer included in protocol v3&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || address version|| var_int||The sender's address version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&lt;br /&gt;
|-&lt;br /&gt;
| 4||[[Protocol_specification#Pubkey_bitfield_features|behavior bitfield]]||uint32_t||A bitfield of optional behaviors and features that can be expected from the owner of this pubkey. &lt;br /&gt;
|-&lt;br /&gt;
| 64||public signing key||uchar[]||The ECC public key used for signing (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 64||public encryption key||uchar[]||The ECC public key used for encryption (uncompressed format; normally prepended with \x04 )&lt;br /&gt;
|-&lt;br /&gt;
| 1+||nonce_trials_per_byte||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is the average number of nonce trials a node will have to perform to meet the Proof of Work requirement. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+||extra_bytes||var_int||Used to calculate the difficulty target of messages accepted by this node. The higher this value, the more difficult the Proof of Work must be before this individual will accept the message. This number is added to the data length to make sending small messages more difficult. 1000 is the network minimum so any lower values will be automatically raised to 1000. This field is new and is only included when the address_version &amp;gt;= 3.&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || [[Protocol_specification#Message_Encodings|encoding]]|| var_int||The [[Protocol_specification#Message_Encodings|encoding type]] of the message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ ||messageLength || var_int||The message length in bytes&lt;br /&gt;
|-&lt;br /&gt;
| messageLength || message||uchar[] ||The message&lt;br /&gt;
|-&lt;br /&gt;
| 1+||sig_length||var_int||Length of the signature&lt;br /&gt;
|-&lt;br /&gt;
| sig_length|| signature||uchar[] ||The signature which &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;did&amp;lt;/span&amp;gt; cover the unencrypted data from the broadcast version down through the message. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;In protocol v3, it covers the unencrypted object header starting with the time, all appended with the decrypted data.&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PeterSurda</name></author>
		
	</entry>
</feed>