<?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=Atheros</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=Atheros"/>
	<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php/Special:Contributions/Atheros"/>
	<updated>2026-06-10T08:11:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47596</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47596"/>
		<updated>2018-02-17T03:50:58Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Updated red text and added link to binary releases&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/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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47595</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47595"/>
		<updated>2018-02-13T23:55:11Z</updated>

		<summary type="html">&lt;p&gt;Atheros: move text to top and update version number&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. 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. We will release binary files for Windows and macOS tomorrow (2018-02-14). In the mean time, users who use binaries should downgrade to 0.6.1 using the links below.&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;
&amp;lt;span style=&amp;quot;color:#CC0000&amp;quot;&amp;gt;We greatly apologize for the issue and we hope to release more information as it becomes available.&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/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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47594</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47594"/>
		<updated>2018-02-13T22:53:08Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Probably shouldn't imply that OSX is invulnerable without proof.&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;
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;
&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 temporary fix has been added and released as 0.6.3. If you run PyBitmessage via code, we highly recommend that you upgrade to 0.6.3. Alternatively you may downgrade to 0.6.1 which is unaffected. We will release binary files for Windows and macOS tomorrow (2018-02-14). In the mean time, users who use binaries should downgrade to 0.6.1 using the links below.&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;
&amp;lt;span style=&amp;quot;color:#CC0000&amp;quot;&amp;gt;We greatly apologize for the issue and we hope to release more information as it becomes available.&amp;lt;/span&amp;gt;&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47593</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47593"/>
		<updated>2018-02-13T22:44:58Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Also change top Infobox&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;
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;
&amp;lt;span style=&amp;quot;color:#DD0000&amp;quot;&amp;gt;A remote code execution vulnerability has been spotted in use against Windows and Linux machines running PyBitmessage v0.6.2. The cause was identified and a temporary fix has been added and released as 0.6.3. If you run PyBitmessage via code, we highly recommend that you upgrade to 0.6.3. Alternatively you may downgrade to 0.6.1 which is unaffected. We will release binary files for Windows and OSX tomorrow (2018-02-14).&amp;lt;/span&amp;gt;&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47592</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=47592"/>
		<updated>2018-02-13T22:38:22Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Added message about vuln and downgrade to 0.6.1&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;
&amp;lt;span style=&amp;quot;color:#DD0000&amp;quot;&amp;gt;A remote code execution vulnerability has been spotted in use against Windows and Linux machines running PyBitmessage v0.6.2. The cause was identified and a temporary fix has been added and released as 0.6.3. If you run PyBitmessage via code, we highly recommend that you upgrade to 0.6.3. Alternatively you may downgrade to 0.6.1 which is unaffected. We will release binary files for Windows and OSX tomorrow (2018-02-14).&amp;lt;/span&amp;gt;&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Template:Infobox&amp;diff=45497</id>
		<title>Template:Infobox</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Template:Infobox&amp;diff=45497"/>
		<updated>2016-05-02T23:56:54Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin-left:5px; margin-bottom:5px; padding:0px; border:1px solid #676702; width:15em; margin-bottom: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:105%; line-height:120%; padding: 0.4em; background-color:#D5D590; border-bottom:1px solid #676702; font-weight: bold;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:32px-Package.png|right|32px|link=|{{#if: {{{downloadsite}}}|{{{downloadsite}}} | Bitmessage_Download }}]] {{#if: {{{release caption|}}} | {{{release caption}}} | Latest stable version}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:200%; padding:0px;&amp;quot;&amp;gt;&lt;br /&gt;
'''{{{version}}}'''&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
{{#if: {{{latest release date}}} | {{{latest release date}}} | {{Bitmessage Current Release Date}}}}&amp;lt;br&amp;gt;[[Changelog]]&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{| &lt;br /&gt;
|[[Image:bitmessagelogo-reduced.png|link=]]&lt;br /&gt;
| &amp;lt;div style=&amp;quot;font-size:150%;&amp;quot;&amp;gt;{{#if: {{{name|}}} | {{{name}}} | Bitmessage}}&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name=&lt;br /&gt;
|downloadsite=&lt;br /&gt;
|release caption=&lt;br /&gt;
|latest release date=&lt;br /&gt;
|version=&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Template:Bitmessage_Current_Version_Number&amp;diff=45496</id>
		<title>Template:Bitmessage Current Version Number</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Template:Bitmessage_Current_Version_Number&amp;diff=45496"/>
		<updated>2016-05-02T23:56:26Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;page is obsolete&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Template:Infobox&amp;diff=45495</id>
		<title>Template:Infobox</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Template:Infobox&amp;diff=45495"/>
		<updated>2016-05-02T23:55:59Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin-left:5px; margin-bottom:5px; padding:0px; border:1px solid #676702; width:15em; margin-bottom: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:105%; line-height:120%; padding: 0.4em; background-color:#D5D590; border-bottom:1px solid #676702; font-weight: bold;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:32px-Package.png|right|32px|link=|{{#if: {{{downloadsite}}}|{{{downloadsite}}} | Bitmessage_Download }}]] {{#if: {{{release caption|}}} | {{{release caption}}} | Latest stable version}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:200%; padding:0px;&amp;quot;&amp;gt;&lt;br /&gt;
'''{{{version}}}'''&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
{{#if: {{{latest release date}}} | {{{latest release date}}} | {{Bitmessage Current Release Date}}}}&amp;lt;br&amp;gt;[[Changelog]]&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{| &lt;br /&gt;
|[[Image:bitmessagelogo-reduced.png|link=]]&lt;br /&gt;
| &amp;lt;div style=&amp;quot;font-size:150%;&amp;quot;&amp;gt;{{#if: {{{name|}}} | {{{name}}} | Bitmessage}}&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name=&lt;br /&gt;
|downloadsite=&lt;br /&gt;
|release caption=&lt;br /&gt;
|latest release date=&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=45494</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=45494"/>
		<updated>2016-05-02T23:55:32Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &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://bitmessage.org/download/windows/Bitmessage.exe&lt;br /&gt;
|release caption=Current version (Beta)&lt;br /&gt;
|latest release date=May 2, 2016&lt;br /&gt;
|version=0.6.0&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://bitmessage.org/download/windows/Bitmessage.exe]] [https://bitmessage.org/download/windows/Bitmessage.exe Download for Windows]&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://bitmessage.org/download/osx/Bitmessage.dmg]] [https://bitmessage.org/download/osx/Bitmessage.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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Template:Infobox&amp;diff=45493</id>
		<title>Template:Infobox</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Template:Infobox&amp;diff=45493"/>
		<updated>2016-05-02T23:51:15Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Undo revision 45492 by Atheros (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin-left:5px; margin-bottom:5px; padding:0px; border:1px solid #676702; width:15em; margin-bottom: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:105%; line-height:120%; padding: 0.4em; background-color:#D5D590; border-bottom:1px solid #676702; font-weight: bold;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:32px-Package.png|right|32px|link=|{{#if: {{{downloadsite}}}|{{{downloadsite}}} | Bitmessage_Download }}]] {{#if: {{{release caption|}}} | {{{release caption}}} | Latest stable version}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:200%; padding:0px;&amp;quot;&amp;gt;&lt;br /&gt;
'''{{Bitmessage Current Version Number}}'''&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
{{#if: {{{latest release date}}} | {{{latest release date}}} | {{Bitmessage Current Release Date}}}}&amp;lt;br&amp;gt;[[Changelog]]&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{| &lt;br /&gt;
|[[Image:bitmessagelogo-reduced.png|link=]]&lt;br /&gt;
| &amp;lt;div style=&amp;quot;font-size:150%;&amp;quot;&amp;gt;{{#if: {{{name|}}} | {{{name}}} | Bitmessage}}&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name=&lt;br /&gt;
|downloadsite=&lt;br /&gt;
|release caption=&lt;br /&gt;
|latest release date=&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Template:Infobox&amp;diff=45492</id>
		<title>Template:Infobox</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Template:Infobox&amp;diff=45492"/>
		<updated>2016-05-02T23:49:46Z</updated>

		<summary type="html">&lt;p&gt;Atheros: test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin-left:5px; margin-bottom:5px; padding:0px; border:1px solid #676702; width:15em; margin-bottom: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:105%; line-height:120%; padding: 0.4em; background-color:#D5D590; border-bottom:1px solid #676702; font-weight: bold;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:32px-Package.png|right|32px|link=|{{#if: {{{downloadsite}}}|{{{downloadsite}}} | Bitmessage_Download }}]] {{#if: {{{release caption|}}} | {{{release caption}}} | Latest stable version}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:200%; padding:0px;&amp;quot;&amp;gt;&lt;br /&gt;
0.6.0&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
{{#if: {{{latest release date}}} | {{{latest release date}}} | {{Bitmessage Current Release Date}}}}&amp;lt;br&amp;gt;[[Changelog]]&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{| &lt;br /&gt;
|[[Image:bitmessagelogo-reduced.png|link=]]&lt;br /&gt;
| &amp;lt;div style=&amp;quot;font-size:150%;&amp;quot;&amp;gt;{{#if: {{{name|}}} | {{{name}}} | Bitmessage}}&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name=&lt;br /&gt;
|downloadsite=&lt;br /&gt;
|release caption=&lt;br /&gt;
|latest release date=&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Template:Bitmessage_Current_Version_Number&amp;diff=45491</id>
		<title>Template:Bitmessage Current Version Number</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Template:Bitmessage_Current_Version_Number&amp;diff=45491"/>
		<updated>2016-05-02T23:41:41Z</updated>

		<summary type="html">&lt;p&gt;Atheros: 0.6.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;0.6.0&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=45490</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=45490"/>
		<updated>2016-05-02T23:38:23Z</updated>

		<summary type="html">&lt;p&gt;Atheros: release 0.6.0&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://bitmessage.org/download/windows/Bitmessage.exe&lt;br /&gt;
|release caption=Current version (Beta)&lt;br /&gt;
|latest release date=May 2, 2016&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://bitmessage.org/download/windows/Bitmessage.exe]] [https://bitmessage.org/download/windows/Bitmessage.exe Download for Windows]&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://bitmessage.org/download/osx/Bitmessage.dmg]] [https://bitmessage.org/download/osx/Bitmessage.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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=User:Atheros&amp;diff=31729</id>
		<title>User:Atheros</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=User:Atheros&amp;diff=31729"/>
		<updated>2015-12-29T07:47:55Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;test13&lt;br /&gt;
&lt;br /&gt;
Тест международных символов .&lt;br /&gt;
国际字符测试。&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=User:Atheros&amp;diff=31587</id>
		<title>User:Atheros</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=User:Atheros&amp;diff=31587"/>
		<updated>2015-11-10T22:44:11Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;test12&lt;br /&gt;
&lt;br /&gt;
Тест международных символов .&lt;br /&gt;
国际字符测试。&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Example_pyinstaller_spec_file&amp;diff=31209</id>
		<title>Example pyinstaller spec file</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Example_pyinstaller_spec_file&amp;diff=31209"/>
		<updated>2015-10-22T22:48:12Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Update spec file to reflect and work with pyinstaller updates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# -*- mode: python -*-&lt;br /&gt;
&lt;br /&gt;
block_cipher = None&lt;br /&gt;
&lt;br /&gt;
a = Analysis(['..\\src\\bitmessagemain.py'],&lt;br /&gt;
             pathex=['C:\\example\\pyinstaller\\bitmessagemain'],&lt;br /&gt;
             binaries=None,&lt;br /&gt;
             datas=None,&lt;br /&gt;
             hiddenimports=[],&lt;br /&gt;
             hookspath=None,&lt;br /&gt;
             runtime_hooks=None,&lt;br /&gt;
             excludes=None,&lt;br /&gt;
             win_no_prefer_redirects=None,&lt;br /&gt;
             win_private_assemblies=None,&lt;br /&gt;
             cipher=block_cipher)&lt;br /&gt;
&lt;br /&gt;
def addTranslations():&lt;br /&gt;
    import os&lt;br /&gt;
    extraDatas = []&lt;br /&gt;
    for file in os.listdir('src\\translations'):&lt;br /&gt;
        extraDatas.append(('translations\\'+file, 'src\\translations\\' + file, 'DATA'))&lt;br /&gt;
    return extraDatas&lt;br /&gt;
&lt;br /&gt;
# append the translations directory&lt;br /&gt;
a.datas += addTranslations()&lt;br /&gt;
&lt;br /&gt;
pyz = PYZ(a.pure, a.zipped_data,&lt;br /&gt;
             cipher=block_cipher)&lt;br /&gt;
exe = EXE(pyz,&lt;br /&gt;
          a.scripts,&lt;br /&gt;
          a.binaries,&lt;br /&gt;
          a.zipfiles,&lt;br /&gt;
          a.datas,&lt;br /&gt;
          a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],&lt;br /&gt;
          name='bitmessagemain',&lt;br /&gt;
          debug=False,&lt;br /&gt;
          strip=None,&lt;br /&gt;
          upx=True,&lt;br /&gt;
          console=False , icon='src\\images\\can-icon.ico')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=31208</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=31208"/>
		<updated>2015-10-22T22:21:34Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* Windows */ Python 2.7.10 exists now.&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;
&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=28273</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=28273"/>
		<updated>2015-03-07T07:37:03Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* List of Operations */ Added TTL to sendBroadcast&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=28270</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=28270"/>
		<updated>2015-03-07T07:24:33Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* List of Operations */ Added TTL to sendMessage&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 - 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] || 0.2.7 || 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. &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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27936</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27936"/>
		<updated>2015-02-08T01:44:00Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* version */ Added length limit to user_agent and stream_numbers within version message&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 || uint32 || 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 everything from the msg_version 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;
&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27369</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27369"/>
		<updated>2015-01-21T19:57:19Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* Message structure */ Mistake fix: There is no explicit message length limit.&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 || uint32 || 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 everything from the msg_version 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)&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.&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;
&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27368</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27368"/>
		<updated>2015-01-21T19:40:50Z</updated>

		<summary type="html">&lt;p&gt;Atheros: net_addr is always 38 bytes now.&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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&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 || uint32 || 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 everything from the msg_version 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)&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.&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;
&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27363</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27363"/>
		<updated>2015-01-21T18:05:31Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* object */&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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&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;
| 4 (or 8)|| time || uint32 || the Time. Protocol version 1 clients use 4 byte time while protocol version 2 clients use 8 byte 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 everything from the msg_version 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)&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.&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;
&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;
| 34x? || 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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27362</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27362"/>
		<updated>2015-01-21T18:01:06Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&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;
| 4 (or 8)|| time || uint32 || the Time. Protocol version 1 clients use 4 byte time while protocol version 2 clients use 8 byte 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 everything from the msg_version 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)&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.&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;
&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;
| 34x? || 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.&lt;br /&gt;
&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27361</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27361"/>
		<updated>2015-01-21T17:59:46Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* Message structure */&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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&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 object_payload.&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;
| 4 (or 8)|| time || uint32 || the Time. Protocol version 1 clients use 4 byte time while protocol version 2 clients use 8 byte 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 everything from the msg_version 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)&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.&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;
&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;
| 34x? || 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.&lt;br /&gt;
&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;
| ?||payload||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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27360</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=27360"/>
		<updated>2015-01-21T17:58:49Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* Message structure */&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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&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_types|object]]. Not to be confused with object_payload.&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;
| 4 (or 8)|| time || uint32 || the Time. Protocol version 1 clients use 4 byte time while protocol version 2 clients use 8 byte 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 everything from the msg_version 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)&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.&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;
&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;
| 34x? || 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.&lt;br /&gt;
&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;
| ?||payload||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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Keys.dat_options&amp;diff=27241</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=27241"/>
		<updated>2015-01-15T22:31:11Z</updated>

		<summary type="html">&lt;p&gt;Atheros: added maxcores&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;
| ? || maxcores || integer || undocumented || Use no more than this many threads/cores to calculate proofs of work.&lt;br /&gt;
|-&lt;br /&gt;
| ? || 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.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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=26327</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=26327"/>
		<updated>2014-12-26T04:01:32Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* List of Operations */&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] || 0.2.7 || 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. &lt;br /&gt;
|-&lt;br /&gt;
| sendBroadcast || &amp;lt;fromAddress&amp;gt; &amp;lt;subject&amp;gt; &amp;lt;message&amp;gt; [encodingType] || 0.2.7 || 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. &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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=26326</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=26326"/>
		<updated>2014-12-26T04:00:37Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* List of Operations */ Added clientStatus. This was implemented in August 2013.&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] || 0.2.7 || 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. &lt;br /&gt;
|-&lt;br /&gt;
| sendBroadcast || &amp;lt;fromAddress&amp;gt; &amp;lt;subject&amp;gt; &amp;lt;message&amp;gt; [encodingType] || 0.2.7 || 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. &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.3.5 || 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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=26323</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=26323"/>
		<updated>2014-12-26T03:11:37Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* List of Operations */  Added addAddressToBlackWhiteList  and removeAddressFromBlackWhiteList&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] || 0.2.7 || 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. &lt;br /&gt;
|-&lt;br /&gt;
| sendBroadcast || &amp;lt;fromAddress&amp;gt; &amp;lt;subject&amp;gt; &amp;lt;message&amp;gt; [encodingType] || 0.2.7 || 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. &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;
&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=26322</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=26322"/>
		<updated>2014-12-26T03:03:41Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* Possible error values */ Added 28 and 29&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] || 0.2.7 || 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. &lt;br /&gt;
|-&lt;br /&gt;
| sendBroadcast || &amp;lt;fromAddress&amp;gt; &amp;lt;subject&amp;gt; &amp;lt;message&amp;gt; [encodingType] || 0.2.7 || 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. &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;
&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Encryption&amp;diff=25756</id>
		<title>Encryption</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Encryption&amp;diff=25756"/>
		<updated>2014-11-21T22:16:36Z</updated>

		<summary type="html">&lt;p&gt;Atheros: MAC calculation change to match pyelliptic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bitmessage uses the Elliptic Curve Integrated Encryption Scheme (ECIES)[http://en.wikipedia.org/wiki/Integrated_Encryption_Scheme] to encrypt the payload of the Message and Broadcast objects. &lt;br /&gt;
&lt;br /&gt;
The scheme uses Elliptic Curve Diffie-Hellman (ECDH)[http://en.wikipedia.org/wiki/ECDH] to generate a shared secret used to generate the encryption parameters for Advanced Encryption Standard with 256bit key and Cipher-Block Chaining (AES-256-CBC)[http://en.wikipedia.org/wiki/Advanced_Encryption_Standard]. The encrypted data will be padded to a 16 byte boundary in accordance to PKCS7[http://en.wikipedia.org/wiki/Cryptographic_Message_Syntax]. This means that the data is padded with N bytes of value N.&lt;br /&gt;
&lt;br /&gt;
The Key Derivation Function (KDF)[http://en.wikipedia.org/wiki/Key_derivation_function] used to generate the key material for AES is SHA512[http://en.wikipedia.org/wiki/Sha512]. The Message Authentication Code (MAC) scheme used is HMACSHA256[http://en.wikipedia.org/wiki/Hmac].&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
(See also: [[Protocol specification]])&lt;br /&gt;
&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;
In order to reconstitute a usable (65 byte) public key (starting with 0x04), the X and Y components need to be expanded by prepending them with 0x00 bytes until the individual component lengths are 32 bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encryption ==&lt;br /&gt;
&lt;br /&gt;
# The destination public key is called K.&lt;br /&gt;
# Generate 16 random bytes using a secure random number generator. Call them IV.&lt;br /&gt;
# Generate a new random EC key pair with private key called r and public key called R.&lt;br /&gt;
# Do an EC point multiply with public key K and private key r. This gives you public key P.&lt;br /&gt;
# Use the X component of public key P and calculate the SHA512 hash H.&lt;br /&gt;
# The first 32 bytes of H are called key_e and the last 32 bytes are called key_m.&lt;br /&gt;
# Pad the input text to a multiple of 16 bytes, in accordance to PKCS7.&lt;br /&gt;
# Encrypt the data with AES-256-CBC, using IV as initialization vector, key_e as encryption key and the padded input text as payload. Call the output cipher text.&lt;br /&gt;
# Calculate a 32 byte MAC with HMACSHA256, using key_m as salt and IV + R + cipher text as data. Call the output MAC.&lt;br /&gt;
&lt;br /&gt;
The resulting data is: IV + R + cipher text + MAC&lt;br /&gt;
&lt;br /&gt;
== Decryption ==&lt;br /&gt;
&lt;br /&gt;
# The private key used to decrypt is called k.&lt;br /&gt;
# Do an EC point multiply with private key k and public key R. This gives you public key P.&lt;br /&gt;
# Use the X component of public key P and calculate the SHA512 hash H.&lt;br /&gt;
# The first 32 bytes of H are called key_e and the last 32 bytes are called key_m.&lt;br /&gt;
# Calculate MAC' with HMACSHA256, using key_m as salt and IV + R + cipher text as data. &lt;br /&gt;
# Compare MAC with MAC'. If not equal, decryption will fail.&lt;br /&gt;
# Decrypt the cipher text with AES-256-CBC, using IV as initialization vector, key_e as decryption key and the cipher text as payload. The output is the padded input text.&lt;br /&gt;
&lt;br /&gt;
== Partial Example ==&lt;br /&gt;
&lt;br /&gt;
Public key K:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data !! Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
04 09 d4 e5  c0 ab 3d 25&lt;br /&gt;
fe 04 8c 64  c9 da 1a 24&lt;br /&gt;
2c 7f 19 41  7e 95 17 cd&lt;br /&gt;
26 69 50 d7  2c 75 57 13&lt;br /&gt;
58 5c 61 78  e9 7f e0 92&lt;br /&gt;
fc 89 7c 9a  1f 17 20 d5&lt;br /&gt;
77 0a e8 ea  ad 2f a8 fc&lt;br /&gt;
bd 08 e9 32  4a 5d de 18&lt;br /&gt;
57&amp;lt;/pre&amp;gt;||Public key, 0x04 prefix, then 32 bytes X and 32 bytes Y.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initialization Vector IV:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data !! Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;bd db 7c 28  29 b0 80 38&lt;br /&gt;
75 30 84 a2  f3 99 16 81&amp;lt;/pre&amp;gt;||16 bytes generated with a secure random number generator.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Randomly generated key pair with private key r and public key R:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data !! Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;5b e6 fa cd  94 1b 76 e9&lt;br /&gt;
d3 ea d0 30  29 fb db 6b&lt;br /&gt;
6e 08 09 29  3f 7f b1 97&lt;br /&gt;
d0 c5 1f 84  e9 6b 8b a4&amp;lt;/pre&amp;gt;||Private key r&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;04 02 93 21  3d cf 13 88&lt;br /&gt;
b6 1c 2a e5  cf 80 fe e6&lt;br /&gt;
ff ff c0 49  a2 f9 fe 73&lt;br /&gt;
65 fe 38 67  81 3c a8 12&lt;br /&gt;
92 df 94 68  6c 6a fb 56&lt;br /&gt;
5a c6 14 9b  15 3d 61 b3&lt;br /&gt;
b2 87 ee 2c  7f 99 7c 14&lt;br /&gt;
23 87 96 c1  2b 43 a3 86&lt;br /&gt;
5a&amp;lt;/pre&amp;gt;||Public key R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Derived public key P (point multiply r with K):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data !! Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;04 0d b8 e3  ad 8c 0c d7&lt;br /&gt;
3f a2 b3 46  71 b7 b2 47&lt;br /&gt;
72 9b 10 11  41 57 9d 19&lt;br /&gt;
9e 0d c0 bd  02 4e ae fd&lt;br /&gt;
89 ca c8 f5  28 dc 90 b6&lt;br /&gt;
68 11 ab ac  51 7d 74 97&lt;br /&gt;
be 52 92 93  12 29 be 0b&lt;br /&gt;
74 3e 05 03  f4 43 c3 d2&lt;br /&gt;
96&amp;lt;/pre&amp;gt;||Public key P&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;0d b8 e3 ad  8c 0c d7 3f&lt;br /&gt;
a2 b3 46 71  b7 b2 47 72&lt;br /&gt;
9b 10 11 41  57 9d 19 9e&lt;br /&gt;
0d c0 bd 02  4e ae fd 89&amp;lt;/pre&amp;gt;||X component of public key P&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
SHA512 of public key P X component (H):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data !! Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;17 05 43 82  82 67 86 71&lt;br /&gt;
05 26 3d 48  28 ef ff 82&lt;br /&gt;
d9 d5 9c bf  08 74 3b 69&lt;br /&gt;
6b cc 5d 69  fa 18 97 b4&amp;lt;/pre&amp;gt;||First 32 bytes of H called key_e&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;pre&amp;gt;f8 3f 1e 9c  c5 d6 b8 44&lt;br /&gt;
8d 39 dc 6a  9d 5f 5b 7f&lt;br /&gt;
46 0e 4a 78  e9 28 6e e8&lt;br /&gt;
d9 1c e1 66  0a 53 ea cd&amp;lt;/pre&amp;gt;||Last 32 bytes of H called key_m&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Padded input:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data !! Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;54 68 65 20  71 75 69 63&lt;br /&gt;
6b 20 62 72  6f 77 6e 20&lt;br /&gt;
66 6f 78 20  6a 75 6d 70&lt;br /&gt;
73 20 6f 76  65 72 20 74&lt;br /&gt;
68 65 20 6c  61 7a 79 20&lt;br /&gt;
64 6f 67 2e  04 04 04 04&amp;lt;/pre&amp;gt;||The quick brown fox jumps over the lazy dog.0x04,0x04,0x04,0x04&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Cipher text:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data !! Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;64 20 3d 5b  24 68 8e 25&lt;br /&gt;
47 bb a3 45  fa 13 9a 5a&lt;br /&gt;
1d 96 22 20  d4 d4 8a 0c&lt;br /&gt;
f3 b1 57 2c  0d 95 b6 16&lt;br /&gt;
43 a6 f9 a0  d7 5a f7 ea&lt;br /&gt;
cc 1b d9 57  14 7b f7 23&amp;lt;/pre&amp;gt;||3 blocks of 16 bytes of encrypted data.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Proof_of_work&amp;diff=25388</id>
		<title>Proof of work</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Proof_of_work&amp;diff=25388"/>
		<updated>2014-10-17T21:46:38Z</updated>

		<summary type="html">&lt;p&gt;Atheros: updated for Protocol V3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes Bitmessage's Proof of work (&amp;quot;POW&amp;quot;) mechanism as it exists in Protocol Version 3. In this document, hash() means SHA512(). SHA512 was chosen as it is widely supported and so that Bitcoin POW hardware cannot trivially be used for Bitmessage POWs. The author acknowledges that they are essentially the same algorithm with a different key size.&lt;br /&gt;
&lt;br /&gt;
Both averageProofOfWorkNonceTrialsPerByte and payloadLengthExtraBytes are set by the owner of a Bitmessage address. The default and minimum for each is 1000. (This is the same as difficulty 1. If the difficulty is 2, then this value is 2000). The purpose of payloadLengthExtraBytes is to add some extra weight to small messages.&lt;br /&gt;
&lt;br /&gt;
=== Do a POW ===&lt;br /&gt;
&lt;br /&gt;
Let us use a msg message as an example.&lt;br /&gt;
&lt;br /&gt;
    payload = embeddedTime + encodedObjectVersion + encodedStreamNumber + encrypted&lt;br /&gt;
&lt;br /&gt;
    payloadLength = the length of payload, in bytes, + 8 (to account for the nonce which we will append later)&lt;br /&gt;
&lt;br /&gt;
    TTL = the number of seconds in between now and the object expiresTime.&lt;br /&gt;
&lt;br /&gt;
    [[File:POW forumla 2.png|none|caption]]&lt;br /&gt;
&lt;br /&gt;
    initialHash = hash(payload)&lt;br /&gt;
&lt;br /&gt;
start with trialValue = 99999999999999999999    &lt;br /&gt;
&lt;br /&gt;
also start with nonce = 0 where nonce is 8 bytes in length and can be hashed as if it is a string.&lt;br /&gt;
&lt;br /&gt;
    while trialValue &amp;gt; target:&lt;br /&gt;
        nonce = nonce + 1&lt;br /&gt;
        resultHash = hash(hash( nonce || initialHash ))&lt;br /&gt;
        trialValue = the first 8 bytes of resultHash, converted to an integer&lt;br /&gt;
&lt;br /&gt;
When this loop finishes, you will have your 8 byte nonce value which you can prepend onto the front of the payload. The message is then ready to send. &lt;br /&gt;
&lt;br /&gt;
=== Check a POW ===&lt;br /&gt;
&lt;br /&gt;
Let us assume that 'payload' contains the payload for a msg message (the nonce down through the encrypted message data). &lt;br /&gt;
&lt;br /&gt;
    nonce = the first 8 bytes of payload&lt;br /&gt;
&lt;br /&gt;
    dataToCheck = the ninth byte of payload on down (thus it is everything except the nonce)&lt;br /&gt;
&lt;br /&gt;
    initialHash = hash(dataToCheck)&lt;br /&gt;
&lt;br /&gt;
    resultHash = hash(hash( nonce || initialHash ))&lt;br /&gt;
&lt;br /&gt;
    POWValue = the first eight bytes of resultHash converted to an integer&lt;br /&gt;
&lt;br /&gt;
    TTL = the number of seconds in between now and the object expiresTime.&lt;br /&gt;
&lt;br /&gt;
    [[File:POW forumla 2.png|none|caption]]&lt;br /&gt;
&lt;br /&gt;
If POWValue is less than or equal to target, then the POW check passes.&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=25384</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=25384"/>
		<updated>2014-10-17T20:41:56Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* broadcast */&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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#Object_types|object]]&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;
| 4 (or 8)|| time || uint32 || the Time. Protocol version 1 clients use 4 byte time while protocol version 2 clients use 8 byte 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 everything from the msg_version 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)&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.&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;
&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;
| 34x? || 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.&lt;br /&gt;
&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;
| ?||payload||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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=25383</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=25383"/>
		<updated>2014-10-17T20:24:25Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Updated minimum necessary nonce_trials_per_byte and extra_bytes from 320 and 14000 to 1000.&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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#Object_types|object]]&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;
| 4 (or 8)|| time || uint32 || the Time. Protocol version 1 clients use 4 byte time while protocol version 2 clients use 8 byte 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 everything from the msg_version 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)&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.&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;
&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;
| 34x? || 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.&lt;br /&gt;
&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;
| ?||payload||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;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || POW nonce|| uint64_t|| The [[Proof of work|Proof Of Work]] nonce&lt;br /&gt;
|-&lt;br /&gt;
| 8 || time|| uint64_t|| The time that the message was broadcast.&lt;br /&gt;
|-&lt;br /&gt;
| 1+|| broadcast version|| var_int||The version number of this broadcast protocol message &amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;which is equal to 2 or 3. &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Changed to 4 or 5 for protocol v3.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=25382</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=25382"/>
		<updated>2014-10-17T20:19:37Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#Object_types|object]]&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;
| 4 (or 8)|| time || uint32 || the Time. Protocol version 1 clients use 4 byte time while protocol version 2 clients use 8 byte 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. 320 is the network minimum so any lower values will be automatically raised to 320. '''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. 14000 is the network minimum so any lower values will be automatically raised to 14000. '''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 everything from the msg_version 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)&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.&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;
&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;
| 34x? || 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.&lt;br /&gt;
&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;
| ?||payload||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. 320 is the network minimum so any lower values will be automatically raised to 320. &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. 14000 is the network minimum so any lower values will be automatically raised to 14000.&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. 320 is the network minimum so any lower values will be automatically raised to 320. &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. 14000 is the network minimum so any lower values will be automatically raised to 14000.&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;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || POW nonce|| uint64_t|| The [[Proof of work|Proof Of Work]] nonce&lt;br /&gt;
|-&lt;br /&gt;
| 8 || time|| uint64_t|| The time that the message was broadcast.&lt;br /&gt;
|-&lt;br /&gt;
| 1+|| broadcast version|| var_int||The version number of this broadcast protocol message &amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;which is equal to 2 or 3. &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Changed to 4 or 5 for protocol v3.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&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. 320 is the network minimum so any lower values will be automatically raised to 320. 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. 14000 is the network minimum so any lower values will be automatically raised to 14000. 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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification_v3&amp;diff=25381</id>
		<title>Protocol specification v3</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification_v3&amp;diff=25381"/>
		<updated>2014-10-17T20:14:21Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Stub}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Proposal}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This is a DRAFT for the protocol version 3. It describes the changes in protocol version 3 versus version 2. Things which are unchanged from version 2 are not described in detail. So you should use the [[Protocol specification|current protocol specification]], which includes the version 3 changes, as a reference for all formats which are not mentioned in this description.&lt;br /&gt;
&lt;br /&gt;
== New features in version 3 ==&lt;br /&gt;
&lt;br /&gt;
Here are the new features of the version 3 of Bitmessage protocol in keywords:&lt;br /&gt;
&lt;br /&gt;
* object type is now coded inside the message&lt;br /&gt;
* objects may have a variable time to live&lt;br /&gt;
* The POW is more difficult but can be easier if you lower the time to live&lt;br /&gt;
* The protocol is tolerant for further message extension&lt;br /&gt;
* The protocol is tolerant for further object extension&lt;br /&gt;
* A lower maximum object size&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
=== Variable length integer ===&lt;br /&gt;
&lt;br /&gt;
The shortest possible encoding MUST be used. In version 2 the decimal value 10 could be encoded as 0x0A, 0xFD000A, 0xFE0000000A, or 0xFF000000000000000A. In version 3 only the shortest representation, 0x0A, is allowed. The 9-byte form is no longer useful and SHOULD NOT be used.&lt;br /&gt;
&lt;br /&gt;
Here is an example address which uses malformed varints: BM-CVA3RC7Mvy7JDNSpQChktwrSe4KNMaEdDdcymfUo. This address is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
&lt;br /&gt;
Most message types are unchanged from version 2 to version 3. Only the four &amp;quot;objecttype&amp;quot; messages are not valid any more. They are summarized into one single message.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
The version message is identical to [[Protocol specification#version|version 2 version message]].&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The verack message is identical to [[Protocol specification#verack|version 2 verack message]].&lt;br /&gt;
&lt;br /&gt;
=== addr ===&lt;br /&gt;
&lt;br /&gt;
The addr message is identical to [[Protocol specification#addr|version 2 addr message]].&lt;br /&gt;
&lt;br /&gt;
=== inv ===&lt;br /&gt;
&lt;br /&gt;
The inv message is identical to [[Protocol specification#inv|version 2 inv message]].&lt;br /&gt;
&lt;br /&gt;
=== getdata ===&lt;br /&gt;
&lt;br /&gt;
The getdata message is identical to [[Protocol specification#getdata|version 2 getdata message]].&lt;br /&gt;
&lt;br /&gt;
=== error ===&lt;br /&gt;
&lt;br /&gt;
Version 3 of the protocol defined a special error (or debug) message. This message may be silently ignored (and therefor handled like any other &amp;quot;unknown&amp;quot; message).&lt;br /&gt;
The message is intended to inform the other node about protocol errors and can be used for debugging and improving code.&lt;br /&gt;
&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+||fatal||var_int||&lt;br /&gt;
This qualifies the error. If set to 0, than its just a &amp;quot;warning&amp;quot;. You can expect, everything still worked fine. If set to 1, than it's an error, so you may expect, something was going wrong (e.g. an object got lost). If set to 2, it's a fatal error. The node will drop the line for that error and maybe ban you for some time.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1+||ban time||var_int||&lt;br /&gt;
If the error is fatal, you can specify the ban time in seconds, here. You inform the other node, that you will not accept further connections for this number of seconds. For non fatal errors this field has no meaning and should be zero.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1+||inventory vector||var_str||&lt;br /&gt;
If the error is related to an object, this Variable length string contains the inventory vector of that object. If the error is not related to an object, this string is empty. &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1+||error text||var_str||&lt;br /&gt;
A human readable string in English, which describes the error. &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unsupported messages ===&lt;br /&gt;
If a node receives an unknown message it &amp;lt;u&amp;gt;must&amp;lt;/u&amp;gt; silently ignore it. This is for further extensions of the protocol with other messages. Nodes that don't understand such a new message type shall be able to work correct with the message types they understand.&lt;br /&gt;
&lt;br /&gt;
Maybe some version 2 nodes did already implement it that way, but in version 3 it is '''part of the protocol specification''', that a node &amp;lt;u&amp;gt;must&amp;lt;/u&amp;gt; silently ignore unsupported messages.&lt;br /&gt;
&lt;br /&gt;
== Object type ==&lt;br /&gt;
&lt;br /&gt;
The four former object types &amp;quot;getpubkey&amp;quot;, &amp;quot;pubkey&amp;quot;, &amp;quot;msg&amp;quot; and &amp;quot;broadcast&amp;quot; are summarized into a single Message type &amp;quot;object&amp;quot;. The four Messages as they did exist in version 2 protocol are not valid any more.&lt;br /&gt;
&lt;br /&gt;
Objects are shared throughout a stream.  A client should advertise objects until their end of life time is reached. To be a valid object, the [[Proof of work|Proof Of Work]] has to be done.&lt;br /&gt;
&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||POW nonce||uint64_t||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||time||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 broadcast until its end of life time has been reached. The node shall store the inventory vector of that object for at least another hour to avoid reloading it from another node with a small time delay.&lt;br /&gt;
The maximum value for the &amp;quot;time to life&amp;quot; of an object is 28 days. so the &amp;quot;end of life time&amp;quot; is 28 days in the future at maximum.&lt;br /&gt;
|-&lt;br /&gt;
| 4||object type||uint32_t||&lt;br /&gt;
This field specifies the content of the object.&lt;br /&gt;
Valid values are (at the moment) 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 shall transport objects with unknown types, too. This will make further protocol changes more easy.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| ?||payload||uchar[]||&lt;br /&gt;
This field varies depending on the object type. For a detailed description of their content refer to [[Protocol specification#Object_types|version 2 object types]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proof of Work ==&lt;br /&gt;
&lt;br /&gt;
Generally the POW is done exactly like in [[Proof of work|version 2]]&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;target&amp;quot; (the difficulty of the POW) is defined a little bit lower (more difficult) in version 3. This is, because practice did show, it is to easy to flood the network with data.&lt;br /&gt;
In addition to that it is possible in version 3 to lower the time to live of a message (for example when doing a live chat) and getting an easier POW for that.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:POW forumla 2.png|none|caption]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
payloadLengthExtraBytes = 1000&lt;br /&gt;
&lt;br /&gt;
nonceTrialsPerByte = 1000&lt;br /&gt;
&lt;br /&gt;
== Maximum object size ==&lt;br /&gt;
&lt;br /&gt;
In version 2 the maximum object size was defined to be 170 MBytes. This object size is totally unrealistic for a normal use (POW), but is perfectly for a network attack. It will be to big to handle for clients with low bandwidth.&lt;br /&gt;
Currently an average bitmessage &amp;quot;msg&amp;quot; object has the size of 2 kBytes.&lt;br /&gt;
So version 3 limits the objects to a maximum size of 256 KiB(the payload of the object, starting from the POW nonce can have 262144 bytes at maximum).&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=25380</id>
		<title>Changelog</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=25380"/>
		<updated>2014-10-17T20:13:09Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PyBitmessage Changelog ==&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=25379</id>
		<title>Changelog</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Changelog&amp;diff=25379"/>
		<updated>2014-10-17T20:10:10Z</updated>

		<summary type="html">&lt;p&gt;Atheros: v0.4.4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PyBitmessage Changelog ==&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 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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Template:Bitmessage_Current_Version_Number&amp;diff=25378</id>
		<title>Template:Bitmessage Current Version Number</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Template:Bitmessage_Current_Version_Number&amp;diff=25378"/>
		<updated>2014-10-17T19:59:45Z</updated>

		<summary type="html">&lt;p&gt;Atheros: v0.4.4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;0.4.4&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=25377</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=25377"/>
		<updated>2014-10-17T19:59:24Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &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://bitmessage.org/download/windows/Bitmessage.exe&lt;br /&gt;
|release caption=Current version (Beta)&lt;br /&gt;
|latest release date=October 17, 2014&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://bitmessage.org/download/windows/Bitmessage.exe]] [https://bitmessage.org/download/windows/Bitmessage.exe Download for Windows]&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://bitmessage.org/download/osx/Bitmessage.dmg]] [https://bitmessage.org/download/osx/Bitmessage.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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=25376</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=25376"/>
		<updated>2014-10-17T19:59:04Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Not necessary to show version numbers in the 'Download' section since they are all v0.4.4&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://bitmessage.org/download/windows/Bitmessage.exe&lt;br /&gt;
|release caption=Current version (Beta)&lt;br /&gt;
|latest release date=August 06, 2014&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://bitmessage.org/download/windows/Bitmessage.exe]] [https://bitmessage.org/download/windows/Bitmessage.exe Download for Windows]&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://bitmessage.org/download/osx/Bitmessage.dmg]] [https://bitmessage.org/download/osx/Bitmessage.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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=User:Atheros&amp;diff=25218</id>
		<title>User:Atheros</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=User:Atheros&amp;diff=25218"/>
		<updated>2014-10-03T22:06:11Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;test11&lt;br /&gt;
&lt;br /&gt;
Тест международных символов .&lt;br /&gt;
国际字符测试。&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=User:Atheros&amp;diff=25217</id>
		<title>User:Atheros</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=User:Atheros&amp;diff=25217"/>
		<updated>2014-10-03T22:04:53Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;test11&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=24899</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Main_Page&amp;diff=24899"/>
		<updated>2014-08-29T18:28:40Z</updated>

		<summary type="html">&lt;p&gt;Atheros: remove echo server since it doesn't seem to be working&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://bitmessage.org/download/windows/Bitmessage.exe&lt;br /&gt;
|release caption=Current version (Beta)&lt;br /&gt;
|latest release date=August 06, 2014&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://bitmessage.org/download/windows/Bitmessage.exe]] [https://bitmessage.org/download/windows/Bitmessage.exe Download for Windows] (v0.4.3)&lt;br /&gt;
&lt;br /&gt;
[[File:apple_icon.png|link=https://bitmessage.org/download/osx/Bitmessage.dmg]] [https://bitmessage.org/download/osx/Bitmessage.dmg Download for OS X] (v0.4.2)&lt;br /&gt;
&lt;br /&gt;
[[File:tux.png|link=Compiling_instructions]] [[Compiling instructions|Run the source code]] (v0.4.3)&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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=24864</id>
		<title>Protocol specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification&amp;diff=24864"/>
		<updated>2014-08-27T23:20:14Z</updated>

		<summary type="html">&lt;p&gt;Atheros: Protocol V3 upgrade&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. The length may not exceed 2^18 bytes. Longer messages must be ignored.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha512(payload)&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || uchar[] || The actual data, a [[#Message_types|message]] or an [[#Object_types|object]]&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;
| 4 (or 8)|| time || uint32 || the Time. Protocol version 1 clients use 4 byte time while protocol version 2 clients use 8 byte 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. 320 is the network minimum so any lower values will be automatically raised to 320. '''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. 14000 is the network minimum so any lower values will be automatically raised to 14000. '''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 everything from the msg_version 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)&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.&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;
&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;
| 34x? || 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.&lt;br /&gt;
&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;
| ?||payload||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. 320 is the network minimum so any lower values will be automatically raised to 320. &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. 14000 is the network minimum so any lower values will be automatically raised to 14000.&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. 320 is the network minimum so any lower values will be automatically raised to 320. &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. 14000 is the network minimum so any lower values will be automatically raised to 14000.&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 v3 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;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || POW nonce|| uint64_t|| The [[Proof of work|Proof Of Work]] nonce&lt;br /&gt;
|-&lt;br /&gt;
| 8 || time|| uint64_t|| The time that the message was broadcast.&lt;br /&gt;
|-&lt;br /&gt;
| 1+|| broadcast version|| var_int||The version number of this broadcast protocol message &amp;lt;span style=&amp;quot;color:grey&amp;quot;&amp;gt;which is equal to 2 or 3. &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Changed to 4 or 5 for protocol v3.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || stream number|| var_int||The sender's stream number&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. 320 is the network minimum so any lower values will be automatically raised to 320. 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. 14000 is the network minimum so any lower values will be automatically raised to 14000. 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>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=24863</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=24863"/>
		<updated>2014-08-27T20:09:35Z</updated>

		<summary type="html">&lt;p&gt;Atheros: API Error 0027: Message is too long.&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] || 0.2.7 || 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. &lt;br /&gt;
|-&lt;br /&gt;
| sendBroadcast || &amp;lt;fromAddress&amp;gt; &amp;lt;subject&amp;gt; &amp;lt;message&amp;gt; [encodingType] || 0.2.7 || 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. &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;
&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;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Protocol_specification_v3&amp;diff=24850</id>
		<title>Protocol specification v3</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Protocol_specification_v3&amp;diff=24850"/>
		<updated>2014-08-27T00:20:04Z</updated>

		<summary type="html">&lt;p&gt;Atheros: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Stub}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Proposal}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This is a DRAFT for the protocol version 3. It describes the changes in protocol version 3 versus version 2. Things which are unchanged from version 2 are not described in detail. So you should use the [[Protocol specification|version 2 protocol specification]] as a reference for all formats which are not mentioned in this description.&lt;br /&gt;
&lt;br /&gt;
== New features in version 3 ==&lt;br /&gt;
&lt;br /&gt;
Here are the new features of the version 3 of Bitmessage protocol in keywords:&lt;br /&gt;
&lt;br /&gt;
* object type is now coded inside the message&lt;br /&gt;
* objects may have a variable time to live&lt;br /&gt;
* The POW is more difficult but can be easier if you lower the time to live&lt;br /&gt;
* The protocol is tolerant for further message extension&lt;br /&gt;
* The protocol is tolerant for further object extension&lt;br /&gt;
* A lower maximum object size&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
=== Variable length integer ===&lt;br /&gt;
&lt;br /&gt;
The shortest possible encoding MUST be used. In version 2 the decimal value 10 could be encoded as 0x0A, 0xFD000A, 0xFE0000000A, or 0xFF000000000000000A. In version 3 only the shortest representation, 0x0A, is allowed. The 9-byte form is no longer useful and SHOULD NOT be used.&lt;br /&gt;
&lt;br /&gt;
Here is an example address which uses malformed varints: BM-CVA3RC7Mvy7JDNSpQChktwrSe4KNMaEdDdcymfUo. This address is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
&lt;br /&gt;
Most message types are unchanged from version 2 to version 3. Only the four &amp;quot;objecttype&amp;quot; messages are not valid any more. They are summarized into one single message.&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
The version message is identical to [[Protocol specification#version|version 2 version message]].&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The verack message is identical to [[Protocol specification#verack|version 2 verack message]].&lt;br /&gt;
&lt;br /&gt;
=== addr ===&lt;br /&gt;
&lt;br /&gt;
The addr message is identical to [[Protocol specification#addr|version 2 addr message]].&lt;br /&gt;
&lt;br /&gt;
=== inv ===&lt;br /&gt;
&lt;br /&gt;
The inv message is identical to [[Protocol specification#inv|version 2 inv message]].&lt;br /&gt;
&lt;br /&gt;
=== getdata ===&lt;br /&gt;
&lt;br /&gt;
The getdata message is identical to [[Protocol specification#getdata|version 2 getdata message]].&lt;br /&gt;
&lt;br /&gt;
=== Unsupported messages ===&lt;br /&gt;
If a node receives an unknown message it &amp;lt;u&amp;gt;must&amp;lt;/u&amp;gt; silently ignore it. This is for further extensions of the protocol with other messages. Nodes that don't understand such a new message type shall be able to work correct with the message types they understand.&lt;br /&gt;
&lt;br /&gt;
Maybe some version 2 nodes did already implement it that way, but in version 3 it is '''part of the protocol specification''', that a node &amp;lt;u&amp;gt;must&amp;lt;/u&amp;gt; silently ignore unsupported messages.&lt;br /&gt;
&lt;br /&gt;
== Object type ==&lt;br /&gt;
&lt;br /&gt;
The four former object types &amp;quot;getpubkey&amp;quot;, &amp;quot;pubkey&amp;quot;, &amp;quot;msg&amp;quot; and &amp;quot;broadcast&amp;quot; are summarized into a single Message type &amp;quot;object&amp;quot;. The four Messages as they did exist in version 2 protocol are not valid any more.&lt;br /&gt;
&lt;br /&gt;
Objects are shared throughout a stream.  A client should advertise objects until their end of life time is reached. To be a valid object, the [[Proof of work|Proof Of Work]] has to be done.&lt;br /&gt;
&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||POW nonce||uint64_t||&lt;br /&gt;
Random nonce used for the [[Proof of work|Proof Of Work]]&lt;br /&gt;
|-&lt;br /&gt;
| 8||time||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 broadcast until its end of life time has been reached. The node shall store the inventory vector of that object for at least another hour to avoid reloading it from another node with a small time delay.&lt;br /&gt;
The maximum value for the &amp;quot;time to life&amp;quot; of an object is 28 days. so the &amp;quot;end of life time&amp;quot; is 28 days in the future at maximum.&lt;br /&gt;
|-&lt;br /&gt;
| 4||object type||uint32_t||&lt;br /&gt;
This field specifies the content of the object.&lt;br /&gt;
Valid values are (at the moment) 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 shall transport objects with unknown types, too. This will make further protocol changes more easy.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| ?||payload||uchar[]||&lt;br /&gt;
This field varies depending on the object type. For a detailed description of their content refer to [[Protocol specification#Object_types|version 2 object types]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proof of Work ==&lt;br /&gt;
&lt;br /&gt;
Generally the POW is done exactly like in [[Proof of work|version 2]]&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;target&amp;quot; (the difficulty of the POW) is defined a little bit lower (more difficult) in version 3. This is, because practice did show, it is to easy to flood the network with data.&lt;br /&gt;
In addition to that it is possible in version 3 to lower the time to live of a message (for example when doing a live chat) and getting an easier POW for that.&lt;br /&gt;
&lt;br /&gt;
Setting the live time e.g. to 360 seconds (6 Minutes), which is totally sufficient for a live chat, the POW will be 10 times easier than in version 2.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;time to live&amp;quot; is the difference between the current time and the &amp;quot;end of life&amp;quot; time. For POW check and generation the &amp;quot;time to live&amp;quot; value is considered to be at least 300 seconds, even if the object has to live less than 300 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    payload = EndOfLifeTime + ObjectType + payload&lt;br /&gt;
&lt;br /&gt;
                PayloadLenInBytes * TimeToLiveInSeconds&lt;br /&gt;
    loadvalue = ---------------------------------------  +  payloadLengthExtraBytes + 8&lt;br /&gt;
                                3600&lt;br /&gt;
&lt;br /&gt;
                                2^64 &lt;br /&gt;
    target = ------------------------------------------------&lt;br /&gt;
             loadvalue * averageProofOfWorkNonceTrialsPerByte&lt;br /&gt;
&lt;br /&gt;
== Maximum object size ==&lt;br /&gt;
&lt;br /&gt;
In version 2 the maximum object size was defined to be 170 MBytes. This object size is totally unrealistic for a normal use (POW), but is perfectly for a network attack. It will be to big to handle for clients with low bandwidth.&lt;br /&gt;
Currently an average bitmessage &amp;quot;msg&amp;quot; object has the size of 2 kBytes.&lt;br /&gt;
So version 3 limits the objects to a maximum size of 256 KiB(the payload of the object, starting from the POW nonce can have 262144 bytes at maximum).&lt;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=24845</id>
		<title>API Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=API_Reference&amp;diff=24845"/>
		<updated>2014-08-25T21:00:41Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* Possible error values */  Added API Error 0026: Varint encoded in address is malformed.&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] || 0.2.7 || 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. &lt;br /&gt;
|-&lt;br /&gt;
| sendBroadcast || &amp;lt;fromAddress&amp;gt; &amp;lt;subject&amp;gt; &amp;lt;message&amp;gt; [encodingType] || 0.2.7 || 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. &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;
&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;/div&gt;</summary>
		<author><name>Atheros</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=24766</id>
		<title>Compiling instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.bitmessage.org/index.php?title=Compiling_instructions&amp;diff=24766"/>
		<updated>2014-08-07T16:38:41Z</updated>

		<summary type="html">&lt;p&gt;Atheros: /* Windows */&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;
&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.8 from [https://www.python.org/download/releases/2.7.8/ 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 [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>Atheros</name></author>
		
	</entry>
</feed>