<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Philipkd</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Philipkd"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Philipkd"/>
	<updated>2026-04-11T16:19:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=OP_CHECKSIG&amp;diff=46210</id>
		<title>OP CHECKSIG</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=OP_CHECKSIG&amp;diff=46210"/>
		<updated>2014-04-07T20:24:26Z</updated>

		<summary type="html">&lt;p&gt;Philipkd: sp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OP_CHECKSIG is [[Script|script]] opcode used to verify that the signature for a tx input is valid. OP_CHECKSIG expects two values to be on the stack, these are, in order of stack depth, the public key and the signature of the script. These two values are normally obtained by running the scriptSig script of the transaction input we are attempting to validate. After the scriptSig script is run the script is deleted but the stack is left as is, and then the scriptPubKey script from the previous transaction output that is now being spent is run, generally concluding in an OP_CHECKSIG. &lt;br /&gt;
&lt;br /&gt;
The standard scriptPubKey checks that the public key (actually a hash of) is a particular value, and that OP_CHECKSIG passes.&lt;br /&gt;
&lt;br /&gt;
For normal transaction inputs if the creator of the current transaction can successfully create a ScriptSig signature that uses the right public key for the ScriptPubKey of the transaction output they are attempting to spend, that transaction input is considered valid. &lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
In addition to the script code itself and the stack parameters, to operate OP_CHECKSIG needs to know the current transaction and the index of current transaction input.&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
Firstly always this (the default) procedure is applied:&lt;br /&gt;
[[File:Bitcoin_OpCheckSig_InDetail.png|thumb|right|Signature verification process of the default procedure]]&lt;br /&gt;
# the public key and the signature are popped from the stack, in that order. If the hash-type value is 0, then it is replaced by the last_byte of the signature. Then the last byte of the signature is always deleted.&lt;br /&gt;
# A new subscript is created from the instruction from the most recently parsed OP_CODESEPARATOR (last one in script) to the end of the script. If there is no OP_CODESEPARATOR the entire script becomes the subscript (hereby referred to as subScript)&lt;br /&gt;
# The sig is deleted from subScript.&lt;br /&gt;
# All OP_CODESEPARATORS are removed from subScript&lt;br /&gt;
# The hashtype is removed from the last byte of the sig and stored&lt;br /&gt;
# A copy is made of the current transaction (hereby referred to txCopy)&lt;br /&gt;
# The scripts for all transaction inputs in txCopy are set to empty scripts (exactly 1 byte 0x00)&lt;br /&gt;
# The script for the current transaction input in txCopy is set to subScript (lead in by its length as a var-integer encoded!)&lt;br /&gt;
&lt;br /&gt;
Now depending on the hashtype various things can happen to txCopy, these will be discussed individually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hashtype Values (from script.h):&#039;&#039;&#039;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| SIGHASH_ALL || 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
| SIGHASH_NONE || 0x00000002&lt;br /&gt;
|-&lt;br /&gt;
| SIGHASH_SINGLE || 0x00000003&lt;br /&gt;
|-&lt;br /&gt;
| SIGHASH_ANYONECANPAY || 0x00000080&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; If (hashtype&amp;amp;31) = SIGHASH_NONE then apply the SIGHASH_NONE-procedure&lt;br /&gt;
&amp;lt;li&amp;gt; If (hashtype&amp;amp;31) = SIGHASH_SINGLE then apply the SIGHASH_SINGLE-procedure&lt;br /&gt;
&amp;lt;li&amp;gt; If hashtype &amp;amp; SIGHASH_ANYONECANPAY then apply the SIGHASH_ANYONECANPAY-procedure&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Hence, hashtype SIGHASH_ANYONECANPAY may be applied also after any other hashtype-procedure&amp;lt;ref&amp;gt;[http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.7.1/bitcoin-0.7.1-linux.tar.gz file src/src/script.cpp in bitcoin-0.7.1]&amp;lt;/ref&amp;gt;. Besides the four listed hashtypes only a hashtype of value 0 appears a few types in the (main) block chain (and is handled like SIGHASH_ALL).&lt;br /&gt;
&lt;br /&gt;
=== Hashtype SIGHASH_ALL (default) ===&lt;br /&gt;
&lt;br /&gt;
No special further handling occurs in the default case.  Think of this as &amp;quot;sign &#039;&#039;&#039;all&#039;&#039;&#039; of the outputs.&amp;quot; Which is already done by the default procedure.&lt;br /&gt;
&lt;br /&gt;
=== Procedure for Hashtype SIGHASH_NONE ===&lt;br /&gt;
&lt;br /&gt;
# The output of txCopy is set to a vector of zero size.&lt;br /&gt;
# All other inputs aside from the current input in txCopy have their nSequence index set to zero&lt;br /&gt;
&lt;br /&gt;
Think of this as &amp;quot;sign &#039;&#039;&#039;none&#039;&#039;&#039; of the outputs-- I don&#039;t care where the bitcoins go.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Procedure for Hashtype SIGHASH_SINGLE ===&lt;br /&gt;
&lt;br /&gt;
# The output of txCopy is resized to the size of the current input index+1.&lt;br /&gt;
# All other txCopy outputs aside from the output that is the same as the current input index are set to a blank script and a value of (long) -1.&lt;br /&gt;
# All other txCopy inputs aside from the current input are set to have an nSequence index of zero.&lt;br /&gt;
&lt;br /&gt;
Think of this as &amp;quot;sign &#039;&#039;&#039;one&#039;&#039;&#039; of the outputs-- I don&#039;t care where the other outputs go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note: The transaction that uses SIGHASH_SINGLE type of signature should not have more inputs than outputs.&lt;br /&gt;
However if it does (because of the pre-existing implementation), it shall not be rejected, but instead for every &amp;quot;illegal&amp;quot; input (meaning: an input that has an index bigger than the maximum output index) the node should still verify it, though assuming the hash of 0000000000000000000000000000000000000000000000000000000000000001 [https://bitcointalk.org/index.php?topic=260595.0]&lt;br /&gt;
&lt;br /&gt;
=== Procedure for Hashtype SIGHASH_ANYONECANPAY ===&lt;br /&gt;
&lt;br /&gt;
# The txCopy input vector is resized to a length of one.&lt;br /&gt;
# The subScript (lead in by its length as a var-integer encoded!) is set as the first and only member of this vector.&lt;br /&gt;
&lt;br /&gt;
Think of this as &amp;quot;Let other people add inputs to this transaction, I don&#039;t care where the rest of the bitcoins come from.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Final signature check===&lt;br /&gt;
&lt;br /&gt;
An array of bytes is constructed from the serialized txCopy appended by four bytes for the hash type. This array is sha256 hashed twice, then the public key is used to check the supplied signature against the hash.&lt;br /&gt;
The secp256k1 elliptic curve is used for the verification with the given public key.&lt;br /&gt;
&lt;br /&gt;
== Return values ==&lt;br /&gt;
&lt;br /&gt;
OP_CHECKSIG will push true to the stack if the check passed, false otherwise.&lt;br /&gt;
OP_CHECKSIG_VERIFY leaves nothing on the stack but will cause the script eval to fail immediately if the check does not pass.&lt;br /&gt;
&lt;br /&gt;
== Code samples and raw dumps ==&lt;br /&gt;
&lt;br /&gt;
Taking the first transaction in Bitcoin which is in block number 170, we would get after serialising the transaction but before we hash+sign (or verify) it:&lt;br /&gt;
&lt;br /&gt;
* http://blockexplorer.com/block/00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee&lt;br /&gt;
* http://blockexplorer.com/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16&lt;br /&gt;
&lt;br /&gt;
See also [https://gitorious.org/libbitcoin/libbitcoin libbitcoin] for code samples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
01 00 00 00              version&lt;br /&gt;
01                       number of inputs (var_uint)&lt;br /&gt;
&lt;br /&gt;
input 0:&lt;br /&gt;
c9 97 a5 e5 6e 10 41 02  input address hash&lt;br /&gt;
fa 20 9c 6a 85 2d d9 06 &lt;br /&gt;
60 a2 0b 2d 9c 35 24 23 &lt;br /&gt;
ed ce 25 85 7f cd 37 04&lt;br /&gt;
00 00 00 00              input index&lt;br /&gt;
&lt;br /&gt;
48                       size of script (var_uint)&lt;br /&gt;
47                       push 71 bytes to stack&lt;br /&gt;
30 44 02 20 4e 45 e1 69&lt;br /&gt;
32 b8 af 51 49 61 a1 d3&lt;br /&gt;
a1 a2 5f df 3f 4f 77 32&lt;br /&gt;
e9 d6 24 c6 c6 15 48 ab&lt;br /&gt;
5f b8 cd 41 02 20 18 15&lt;br /&gt;
22 ec 8e ca 07 de 48 60&lt;br /&gt;
a4 ac dd 12 90 9d 83 1c&lt;br /&gt;
c5 6c bb ac 46 22 08 22&lt;br /&gt;
21 a8 76 8d 1d 09 01&lt;br /&gt;
ff ff ff ff              sequence&lt;br /&gt;
&lt;br /&gt;
02                       number of outputs (var_uint)&lt;br /&gt;
&lt;br /&gt;
output 0:&lt;br /&gt;
00 ca 9a 3b 00 00 00 00  amount = 10.00000000&lt;br /&gt;
43                       size of script (var_uint)&lt;br /&gt;
script for output 0:&lt;br /&gt;
41                       push 65 bytes to stack&lt;br /&gt;
04 ae 1a 62 fe 09 c5 f5 &lt;br /&gt;
1b 13 90 5f 07 f0 6b 99 &lt;br /&gt;
a2 f7 15 9b 22 25 f3 74 &lt;br /&gt;
cd 37 8d 71 30 2f a2 84 &lt;br /&gt;
14 e7 aa b3 73 97 f5 54 &lt;br /&gt;
a7 df 5f 14 2c 21 c1 b7 &lt;br /&gt;
30 3b 8a 06 26 f1 ba de &lt;br /&gt;
d5 c7 2a 70 4f 7e 6c d8 &lt;br /&gt;
4c &lt;br /&gt;
ac                       OP_CHECKSIG&lt;br /&gt;
&lt;br /&gt;
output 1:&lt;br /&gt;
00 28 6b ee 00 00 00 00  amount = 40.00000000&lt;br /&gt;
43                       size of script (var_uint)&lt;br /&gt;
script for output 1:&lt;br /&gt;
41                       push 65 bytes to stack&lt;br /&gt;
04 11 db 93 e1 dc db 8a  &lt;br /&gt;
01 6b 49 84 0f 8c 53 bc &lt;br /&gt;
1e b6 8a 38 2e 97 b1 48 &lt;br /&gt;
2e ca d7 b1 48 a6 90 9a&lt;br /&gt;
5c b2 e0 ea dd fb 84 cc &lt;br /&gt;
f9 74 44 64 f8 2e 16 0b &lt;br /&gt;
fa 9b 8b 64 f9 d4 c0 3f &lt;br /&gt;
99 9b 86 43 f6 56 b4 12 &lt;br /&gt;
a3                       &lt;br /&gt;
ac                       OP_CHECKSIG&lt;br /&gt;
&lt;br /&gt;
00 00 00 00              locktime&lt;br /&gt;
01 00 00 00              hash_code_type (added on)&lt;br /&gt;
&lt;br /&gt;
result =&lt;br /&gt;
01 00 00 00 01 c9 97 a5 e5 6e 10 41 02 fa 20 9c 6a 85 2d d9 06 60 a2 0b 2d 9c 35 &lt;br /&gt;
24 23 ed ce 25 85 7f cd 37 04 00 00 00 00 43 41 04 11 db 93 e1 dc db 8a 01 6b 49 &lt;br /&gt;
84 0f 8c 53 bc 1e b6 8a 38 2e 97 b1 48 2e ca d7 b1 48 a6 90 9a 5c b2 e0 ea dd fb &lt;br /&gt;
84 cc f9 74 44 64 f8 2e 16 0b fa 9b 8b 64 f9 d4 c0 3f 99 9b 86 43 f6 56 b4 12 a3 &lt;br /&gt;
ac ff ff ff ff 02 00 ca 9a 3b 00 00 00 00 43 41 04 ae 1a 62 fe 09 c5 f5 1b 13 90 &lt;br /&gt;
5f 07 f0 6b 99 a2 f7 15 9b 22 25 f3 74 cd 37 8d 71 30 2f a2 84 14 e7 aa b3 73 97 &lt;br /&gt;
f5 54 a7 df 5f 14 2c 21 c1 b7 30 3b 8a 06 26 f1 ba de d5 c7 2a 70 4f 7e 6c d8 4c &lt;br /&gt;
ac 00 28 6b ee 00 00 00 00 43 41 04 11 db 93 e1 dc db 8a 01 6b 49 84 0f 8c 53 bc &lt;br /&gt;
1e b6 8a 38 2e 97 b1 48 2e ca d7 b1 48 a6 90 9a 5c b2 e0 ea dd fb 84 cc f9 74 44 &lt;br /&gt;
64 f8 2e 16 0b fa 9b 8b 64 f9 d4 c0 3f 99 9b 86 43 f6 56 b4 12 a3 ac 00 00 00 00 &lt;br /&gt;
01 00 00 00 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To understand where that raw dump has come from, it may be useful to examine tests/ec-key.cpp in [https://gitorious.org/libbitcoin/libbitcoin libbitcoin],&lt;br /&gt;
&lt;br /&gt;
[https://gitorious.org/libbitcoin/libbitcoin libbitcoin] has a unit test under tests/ec-key.cpp (make ec-key &amp;amp;&amp;amp; ./bin/tests/ec-key). There is also a working OP_CHECKSIG implementation in src/script.cpp under script::op_checksig(). See also the unit test: tests/script-test.cpp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;iomanip&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/serializer.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/elliptic_curve_key.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/sha256.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/assert.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/logger.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/types.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/ecdsa.h&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/obj_mac.h&amp;gt;&lt;br /&gt;
using libbitcoin::elliptic_curve_key;&lt;br /&gt;
using libbitcoin::serializer;&lt;br /&gt;
using libbitcoin::hash_digest;&lt;br /&gt;
using libbitcoin::data_chunk;&lt;br /&gt;
using libbitcoin::log_info;&lt;br /&gt;
using libbitcoin::log_fatal;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    serializer ss;&lt;br /&gt;
    // blk number 170, tx 1, input 0&lt;br /&gt;
    // version = 1&lt;br /&gt;
    ss.write_4_bytes(1);&lt;br /&gt;
    // 1 inputs&lt;br /&gt;
    ss.write_var_uint(1);&lt;br /&gt;
&lt;br /&gt;
    // input 0&lt;br /&gt;
    // prevout hash&lt;br /&gt;
    ss.write_hash(hash_digest{0x04, 0x37, 0xcd, 0x7f, 0x85, 0x25, 0xce, 0xed, 0x23, 0x24, 0x35, 0x9c, 0x2d, 0x0b, 0xa2, 0x60, 0x06, 0xd9, 0x2d, 0x85, 0x6a, 0x9c, 0x20, 0xfa, 0x02, 0x41, 0x10, 0x6e, 0xe5, 0xa5, 0x97, 0xc9});&lt;br /&gt;
    // prevout index &lt;br /&gt;
    ss.write_4_bytes(0);&lt;br /&gt;
&lt;br /&gt;
    // input script after running OP_CHECKSIG for this tx is a single&lt;br /&gt;
    // OP_CHECKSIG opcode&lt;br /&gt;
    data_chunk raw_data;&lt;br /&gt;
    raw_data = {0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3};&lt;br /&gt;
    data_chunk raw_script;&lt;br /&gt;
    raw_script = data_chunk();&lt;br /&gt;
    raw_script.push_back(raw_data.size());&lt;br /&gt;
    libbitcoin::extend_data(raw_script, raw_data);&lt;br /&gt;
    raw_script.push_back(172);&lt;br /&gt;
    ss.write_var_uint(raw_script.size());&lt;br /&gt;
    ss.write_data(raw_script);&lt;br /&gt;
    // sequence&lt;br /&gt;
    ss.write_4_bytes(0xffffffff);&lt;br /&gt;
&lt;br /&gt;
    // 2 outputs for this tx&lt;br /&gt;
    ss.write_var_uint(2);&lt;br /&gt;
&lt;br /&gt;
    // output 0&lt;br /&gt;
    ss.write_8_bytes(1000000000);&lt;br /&gt;
    // script for output 0&lt;br /&gt;
    raw_data = {0x04, 0xae, 0x1a, 0x62, 0xfe, 0x09, 0xc5, 0xf5, 0x1b, 0x13, 0x90, 0x5f, 0x07, 0xf0, 0x6b, 0x99, 0xa2, 0xf7, 0x15, 0x9b, 0x22, 0x25, 0xf3, 0x74, 0xcd, 0x37, 0x8d, 0x71, 0x30, 0x2f, 0xa2, 0x84, 0x14, 0xe7, 0xaa, 0xb3, 0x73, 0x97, 0xf5, 0x54, 0xa7, 0xdf, 0x5f, 0x14, 0x2c, 0x21, 0xc1, 0xb7, 0x30, 0x3b, 0x8a, 0x06, 0x26, 0xf1, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c, 0xd8, 0x4c};&lt;br /&gt;
    // when data &amp;lt; 75, we can just write it&#039;s length as a single byte (&#039;special&#039;&lt;br /&gt;
    // opcodes)&lt;br /&gt;
    raw_script = data_chunk();&lt;br /&gt;
    raw_script.push_back(raw_data.size());&lt;br /&gt;
    libbitcoin::extend_data(raw_script, raw_data);&lt;br /&gt;
    // OP_CHECKSIG&lt;br /&gt;
    raw_script.push_back(172);&lt;br /&gt;
    // now actually write the script&lt;br /&gt;
    ss.write_var_uint(raw_script.size());&lt;br /&gt;
    ss.write_data(raw_script);&lt;br /&gt;
&lt;br /&gt;
    // output 1&lt;br /&gt;
    ss.write_8_bytes(4000000000);&lt;br /&gt;
    // script for output 0&lt;br /&gt;
    raw_data = {0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3};&lt;br /&gt;
    // when data &amp;lt; 75, we can just write it&#039;s length as a single byte (&#039;special&#039;&lt;br /&gt;
    raw_script.push_back(raw_data.size());&lt;br /&gt;
    libbitcoin::extend_data(raw_script, raw_data);&lt;br /&gt;
    // OP_CHECKSIG&lt;br /&gt;
    raw_script.push_back(172);&lt;br /&gt;
    // now actually write the script&lt;br /&gt;
    ss.write_var_uint(raw_script.size());&lt;br /&gt;
    ss.write_data(raw_script);&lt;br /&gt;
&lt;br /&gt;
    // End of 2 outputs&lt;br /&gt;
&lt;br /&gt;
    // locktime&lt;br /&gt;
    ss.write_4_bytes(0);&lt;br /&gt;
&lt;br /&gt;
    // write hash_type_code&lt;br /&gt;
    ss.write_4_bytes(1);&lt;br /&gt;
&lt;br /&gt;
    // Dump hex to screen&lt;br /&gt;
    log_info() &amp;lt;&amp;lt; &amp;quot;hashing:&amp;quot;;&lt;br /&gt;
    {&lt;br /&gt;
        auto log_obj = log_info();&lt;br /&gt;
        log_obj &amp;lt;&amp;lt; std::hex;&lt;br /&gt;
        for (int val: ss.get_data())&lt;br /&gt;
            log_obj &amp;lt;&amp;lt; std::setfill(&#039;0&#039;) &amp;lt;&amp;lt; std::setw(2) &amp;lt;&amp;lt; val &amp;lt;&amp;lt; &#039; &#039;;&lt;br /&gt;
    }&lt;br /&gt;
    log_info();&lt;br /&gt;
&lt;br /&gt;
    data_chunk raw_tx = {0x01, 0x00, 0x00, 0x00, 0x01, 0xc9, 0x97, 0xa5, 0xe5, 0x6e, 0x10, 0x41, 0x02, 0xfa, 0x20, 0x9c, 0x6a, 0x85, 0x2d, 0xd9, 0x06, 0x60, 0xa2, 0x0b, 0x2d, 0x9c, 0x35, 0x24, 0x23, 0xed, 0xce, 0x25, 0x85, 0x7f, 0xcd, 0x37, 0x04, 0x00, 0x00, 0x00, 0x00, 0x43, 0x41, 0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3, 0xac, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0xca, 0x9a, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x43, 0x41, 0x04, 0xae, 0x1a, 0x62, 0xfe, 0x09, 0xc5, 0xf5, 0x1b, 0x13, 0x90, 0x5f, 0x07, 0xf0, 0x6b, 0x99, 0xa2, 0xf7, 0x15, 0x9b, 0x22, 0x25, 0xf3, 0x74, 0xcd, 0x37, 0x8d, 0x71, 0x30, 0x2f, 0xa2, 0x84, 0x14, 0xe7, 0xaa, 0xb3, 0x73, 0x97, 0xf5, 0x54, 0xa7, 0xdf, 0x5f, 0x14, 0x2c, 0x21, 0xc1, 0xb7, 0x30, 0x3b, 0x8a, 0x06, 0x26, 0xf1, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c, 0xd8, 0x4c, 0xac, 0x00, 0x28, 0x6b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x43, 0x41, 0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3, 0xac, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00};&lt;br /&gt;
    BITCOIN_ASSERT(raw_tx == ss.get_data());&lt;br /&gt;
&lt;br /&gt;
    hash_digest tx_hash = libbitcoin::generate_sha256_hash(ss.get_data());&lt;br /&gt;
&lt;br /&gt;
    data_chunk pubkey{0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3};&lt;br /&gt;
    // Leave out last byte since that&#039;s the hash_type_code (SIGHASH_ALL in this&lt;br /&gt;
    // case)&lt;br /&gt;
    data_chunk signature{0x30, 0x44, 0x02, 0x20, 0x4e, 0x45, 0xe1, 0x69, 0x32, 0xb8, 0xaf, 0x51, 0x49, 0x61, 0xa1, 0xd3, 0xa1, 0xa2, 0x5f, 0xdf, 0x3f, 0x4f, 0x77, 0x32, 0xe9, 0xd6, 0x24, 0xc6, 0xc6, 0x15, 0x48, 0xab, 0x5f, 0xb8, 0xcd, 0x41, 0x02, 0x20, 0x18, 0x15, 0x22, 0xec, 0x8e, 0xca, 0x07, 0xde, 0x48, 0x60, 0xa4, 0xac, 0xdd, 0x12, 0x90, 0x9d, 0x83, 0x1c, 0xc5, 0x6c, 0xbb, 0xac, 0x46, 0x22, 0x08, 0x22, 0x21, 0xa8, 0x76, 0x8d, 0x1d, 0x09};&lt;br /&gt;
    BITCOIN_ASSERT(signature.size() == 70);&lt;br /&gt;
&lt;br /&gt;
    elliptic_curve_key key;&lt;br /&gt;
    if (!key.set_public_key(pubkey))&lt;br /&gt;
    {&lt;br /&gt;
        log_fatal() &amp;lt;&amp;lt; &amp;quot;unable to set EC public key&amp;quot;;&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    log_info() &amp;lt;&amp;lt; &amp;quot;checksig returns: &amp;quot; &amp;lt;&amp;lt; (key.verify(tx_hash, signature) ? &amp;quot;true&amp;quot; : &amp;quot;false&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Philipkd</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Original_Bitcoin_client&amp;diff=45746</id>
		<title>Original Bitcoin client</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Original_Bitcoin_client&amp;diff=45746"/>
		<updated>2014-04-04T17:08:19Z</updated>

		<summary type="html">&lt;p&gt;Philipkd: made linguistically smoother&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Satoshi client&#039;&#039;&#039; or the &#039;&#039;&#039;Satoshi code&#039;&#039;&#039; refers to [[bitcoind]], bitcoin-client, and bitcoin-qt. This is in honor of [[Satoshi Nakamoto]] for creating [[Bitcoin]].&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;In the most widest sense:&lt;br /&gt;
&amp;lt;dd&amp;gt;All releases of bitcoin-x.y.z (starting 2009) and future official releases of the [http://bitcoin.org  bitcoin-developer community].&amp;lt;br&amp;gt; (Last/newest when writing this remark is of release 0.7.2 in December 2012).&lt;br /&gt;
&amp;lt;dt&amp;gt;In the narrow sense:&lt;br /&gt;
&amp;lt;dd&amp;gt;Only the bitcoin releases up to version 0.3.19 which Satoshi Nakamoto himself was chief and main developer. He retired afterwards (end of 2010) completely from this project. With the next release also [[Testnet]] was reseted with a new Genesis block.&lt;br /&gt;
&amp;lt;dt&amp;gt;Original Satoshi clients:&lt;br /&gt;
&amp;lt;dd&amp;gt;Only the bitcoin releases 0.1.0 up to 0.1.5 which supported only Windows 2000 / Windows NT and Windows XP (perhaps Windows Vista). The next bitcoin release 0.2.0 from Dec 2009, nearly a year later, starts to support Linux and the [https://bitcointalk.org/index.php?topic=5.0 community] got more and more actively involved in the development.&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
For history, one of the earliest available proof of a running bitcoin-0.1.0 with a [http://sourceforge.net/mailarchive/attachment.php?list_name=bitcoin-list&amp;amp;message_id=da7b3ce30901101113v2ec6bf61xf018265479eb7faf%40mail.gmail.com&amp;amp;counter=1 human readable debug log]. &lt;br /&gt;
There might have been also (private) earlier client code before 0.1.0 available only to Satoshi Nakamoto.&lt;br /&gt;
==See also==&lt;br /&gt;
[[Bitcoind#History of official bitcoind (and predecessor) releases|History of Bitcoind]]&lt;/div&gt;</summary>
		<author><name>Philipkd</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Regression_test_mode&amp;diff=45441</id>
		<title>Regression test mode</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Regression_test_mode&amp;diff=45441"/>
		<updated>2014-03-26T16:02:14Z</updated>

		<summary type="html">&lt;p&gt;Philipkd: not sure if that&amp;#039;s the right port.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can run bitcoin in &#039;&#039;&#039;regression test mode&#039;&#039;&#039; with the &#039;&#039;&#039;-regtest&#039;&#039;&#039; command-line argument. This runs a local-only server and lets you generate blocks instantly. Use regtest for app development and testing purposes.&lt;/div&gt;</summary>
		<author><name>Philipkd</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Regression_test_mode&amp;diff=45440</id>
		<title>Regression test mode</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Regression_test_mode&amp;diff=45440"/>
		<updated>2014-03-26T15:50:31Z</updated>

		<summary type="html">&lt;p&gt;Philipkd: better wikiformatting.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can run bitcoin in &#039;&#039;&#039;regression test mode&#039;&#039;&#039; with the &#039;&#039;&#039;-regtest&#039;&#039;&#039; command-line argument. This runs a local-only server on port 18444 and lets you generate blocks instantly. Use regtest for app development and testing purposes.&lt;/div&gt;</summary>
		<author><name>Philipkd</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Regression_test_mode&amp;diff=45439</id>
		<title>Regression test mode</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Regression_test_mode&amp;diff=45439"/>
		<updated>2014-03-26T15:48:22Z</updated>

		<summary type="html">&lt;p&gt;Philipkd: Basic description of regtest&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can run Bitcoin in **regression test mode** with the **-regtest** command-line argument. This runs a local-only server on port 18444 and lets you generate blocks instantly.&lt;/div&gt;</summary>
		<author><name>Philipkd</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Running_Bitcoin&amp;diff=45438</id>
		<title>Running Bitcoin</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Running_Bitcoin&amp;diff=45438"/>
		<updated>2014-03-26T15:41:07Z</updated>

		<summary type="html">&lt;p&gt;Philipkd: updated for 0.9 command line options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two variations of the original bitcoin program available; one with a graphical user interface (usually referred to as just “Bitcoin”), and a &#039;headless&#039; version (called [[bitcoind]]). They are completely compatible with each other, and take the same command-line arguments, read the same configuration file, and read and write the same data files. You can run one copy of either Bitcoin or bitcoind on your system at a time (if you accidently try to launch another, the copy will let you know that Bitcoin or bitcoind is already running and will exit).&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Linux Quickstart==&lt;br /&gt;
&lt;br /&gt;
The simplest way to start from scratch with the command line client, automatically syncing blockchain and creating a wallet, is to just run this command (without arguments) from the directory containing your bitcoind binary:&lt;br /&gt;
&lt;br /&gt;
  ./bitcoind&lt;br /&gt;
&lt;br /&gt;
To run with the standard GUI interface:&lt;br /&gt;
&lt;br /&gt;
  ./bitcoin-qt&lt;br /&gt;
&lt;br /&gt;
==Command-line arguments==&lt;br /&gt;
&lt;br /&gt;
Give Bitcoin (or bitcoind) the -? or –-help argument and it will print out a list of the most commonly used command-line arguments and then exit:&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
  bitcoin-qt [command-line options]                     &lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -?                     This help message&lt;br /&gt;
  -conf=&amp;lt;file&amp;gt;           Specify configuration file (default: bitcoin.conf)&lt;br /&gt;
  -datadir=&amp;lt;dir&amp;gt;         Specify data directory&lt;br /&gt;
  -testnet               Use the test network&lt;br /&gt;
  -pid=&amp;lt;file&amp;gt;            Specify pid file (default: bitcoind.pid)&lt;br /&gt;
  -gen                   Generate coins (default: 0)&lt;br /&gt;
  -dbcache=&amp;lt;n&amp;gt;           Set database cache size in megabytes (4 to 4096, default: 100)&lt;br /&gt;
  -timeout=&amp;lt;n&amp;gt;           Specify connection timeout in milliseconds (default: 5000)&lt;br /&gt;
  -proxy=&amp;lt;ip:port&amp;gt;       Connect through SOCKS proxy&lt;br /&gt;
  -socks=&amp;lt;n&amp;gt;             Select SOCKS version for -proxy (4 or 5, default: 5)&lt;br /&gt;
  -onion=&amp;lt;ip:port&amp;gt;       Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)&lt;br /&gt;
  -dns                   Allow DNS lookups for -addnode, -seednode and -connect&lt;br /&gt;
  -port=&amp;lt;port&amp;gt;           Listen for connections on &amp;lt;port&amp;gt; (default: 8333 or testnet: 18333)&lt;br /&gt;
  -maxconnections=&amp;lt;n&amp;gt;    Maintain at most &amp;lt;n&amp;gt; connections to peers (default: 125)&lt;br /&gt;
  -addnode=&amp;lt;ip&amp;gt;          Add a node to connect to and attempt to keep the connection open&lt;br /&gt;
  -connect=&amp;lt;ip&amp;gt;          Connect only to the specified node(s)&lt;br /&gt;
  -seednode=&amp;lt;ip&amp;gt;         Connect to a node to retrieve peer addresses, and disconnect&lt;br /&gt;
  -externalip=&amp;lt;ip&amp;gt;       Specify your own public address&lt;br /&gt;
  -onlynet=&amp;lt;net&amp;gt;         Only connect to nodes in network &amp;lt;net&amp;gt; (IPv4, IPv6 or Tor)&lt;br /&gt;
  -discover              Discover own IP address (default: 1 when listening and no -externalip)&lt;br /&gt;
  -checkpoints           Only accept block chain matching built-in checkpoints (default: 1)&lt;br /&gt;
  -listen                Accept connections from outside (default: 1 if no -proxy or -connect)&lt;br /&gt;
  -bind=&amp;lt;addr&amp;gt;           Bind to given address and always listen on it. Use [host]:port notation for IPv6&lt;br /&gt;
  -dnsseed               Find peers using DNS lookup (default: 1 unless -connect)&lt;br /&gt;
  -banscore=&amp;lt;n&amp;gt;          Threshold for disconnecting misbehaving peers (default: 100)&lt;br /&gt;
  -bantime=&amp;lt;n&amp;gt;           Number of seconds to keep misbehaving peers from reconnecting (default: 86400)&lt;br /&gt;
  -maxreceivebuffer=&amp;lt;n&amp;gt;  Maximum per-connection receive buffer, &amp;lt;n&amp;gt;*1000 bytes (default: 5000)&lt;br /&gt;
  -maxsendbuffer=&amp;lt;n&amp;gt;     Maximum per-connection send buffer, &amp;lt;n&amp;gt;*1000 bytes (default: 1000)&lt;br /&gt;
  -upnp                  Use UPnP to map the listening port (default: 1 when listening)&lt;br /&gt;
  -debug=&amp;lt;category&amp;gt;      Output debugging information (default: 0, supplying &amp;lt;category&amp;gt; is optional)&lt;br /&gt;
                         If &amp;lt;category&amp;gt; is not supplied, output all debugging information.&lt;br /&gt;
                         &amp;lt;category&amp;gt; can be: addrman, alert, coindb, db, lock, rand, rpc, selectcoins, mempool, net, qt.&lt;br /&gt;
  -logtimestamps         Prepend debug output with timestamp (default: 1)&lt;br /&gt;
  -shrinkdebugfile       Shrink debug.log file on client startup (default: 1 when no -debug)&lt;br /&gt;
  -printtoconsole        Send trace/debug info to console instead of debug.log file&lt;br /&gt;
  -regtest               Enter regression test mode, which uses a special chain in which blocks can be solved instantly.&lt;br /&gt;
                         This is intended for regression testing tools and app development.&lt;br /&gt;
  -server                Accept command line and JSON-RPC commands&lt;br /&gt;
  -rpcuser=&amp;lt;user&amp;gt;        Username for JSON-RPC connections&lt;br /&gt;
  -rpcpassword=&amp;lt;pw&amp;gt;      Password for JSON-RPC connections&lt;br /&gt;
  -rpcport=&amp;lt;port&amp;gt;        Listen for JSON-RPC connections on &amp;lt;port&amp;gt; (default: 8332 or testnet: 18332)&lt;br /&gt;
  -rpcallowip=&amp;lt;ip&amp;gt;       Allow JSON-RPC connections from specified IP address&lt;br /&gt;
  -rpcthreads=&amp;lt;n&amp;gt;        Set the number of threads to service RPC calls (default: 4)&lt;br /&gt;
  -blocknotify=&amp;lt;cmd&amp;gt;     Execute command when the best block changes (%s in cmd is replaced by block hash)&lt;br /&gt;
  -alertnotify=&amp;lt;cmd&amp;gt;     Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)&lt;br /&gt;
  -keypool=&amp;lt;n&amp;gt;           Set key pool size to &amp;lt;n&amp;gt; (default: 100)&lt;br /&gt;
  -checkblocks=&amp;lt;n&amp;gt;       How many blocks to check at startup (default: 288, 0 = all)&lt;br /&gt;
  -checklevel=&amp;lt;n&amp;gt;        How thorough the block verification is (0-4, default: 3)&lt;br /&gt;
  -txindex               Maintain a full transaction index (default: 0)&lt;br /&gt;
  -loadblock=&amp;lt;file&amp;gt;      Imports blocks from external blk000??.dat file&lt;br /&gt;
  -reindex               Rebuild block chain index from current blk000??.dat files&lt;br /&gt;
  -par=&amp;lt;n&amp;gt;               Set the number of script verification threads (up to 16, 0 = auto, &amp;lt;0 = leave that many cores free, default: 0)&lt;br /&gt;
&lt;br /&gt;
Wallet options:&lt;br /&gt;
  -disablewallet         Do not load the wallet and disable wallet RPC calls&lt;br /&gt;
  -paytxfee=&amp;lt;amt&amp;gt;        Fee per kB to add to transactions you send&lt;br /&gt;
  -rescan                Rescan the block chain for missing wallet transactions&lt;br /&gt;
  -zapwallettxes         Clear list of wallet transactions (diagnostic tool; implies -rescan)&lt;br /&gt;
  -salvagewallet         Attempt to recover private keys from a corrupt wallet.dat&lt;br /&gt;
  -upgradewallet         Upgrade wallet to latest format&lt;br /&gt;
  -wallet=&amp;lt;file&amp;gt;         Specify wallet file (within data directory)&lt;br /&gt;
  -walletnotify=&amp;lt;cmd&amp;gt;    Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)&lt;br /&gt;
  -spendzeroconfchange   Spend unconfirmed change when sending transactions (default: 1)&lt;br /&gt;
&lt;br /&gt;
Block creation options:&lt;br /&gt;
  -blockminsize=&amp;lt;n&amp;gt;      Set minimum block size in bytes (default: 0)&lt;br /&gt;
  -blockmaxsize=&amp;lt;n&amp;gt;      Set maximum block size in bytes (default: 750000)&lt;br /&gt;
  -blockprioritysize=&amp;lt;n&amp;gt; Set maximum size of high-priority/low-fee transactions in bytes (default: 50000)&lt;br /&gt;
&lt;br /&gt;
SSL options: (see the Bitcoin Wiki for SSL setup instructions)&lt;br /&gt;
  -rpcssl                                  Use OpenSSL (https) for JSON-RPC connections&lt;br /&gt;
  -rpcsslcertificatechainfile=&amp;lt;file.cert&amp;gt;  Server certificate file (default: server.cert)&lt;br /&gt;
  -rpcsslprivatekeyfile=&amp;lt;file.pem&amp;gt;         Server private key (default: server.pem)&lt;br /&gt;
  -rpcsslciphers=&amp;lt;ciphers&amp;gt;                 Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)&lt;br /&gt;
&lt;br /&gt;
UI options:&lt;br /&gt;
  -lang=&amp;lt;lang&amp;gt;           Set language, for example &amp;quot;de_DE&amp;quot; (default: system locale)&lt;br /&gt;
  -min                   Start minimized&lt;br /&gt;
  -splash                Show splash screen on startup (default: 1)&lt;br /&gt;
  -choosedatadir         Choose data directory on startup (default: 0)&lt;br /&gt;
&lt;br /&gt;
Many of the boolean options can also be set to off by specifying them with a &amp;quot;no&amp;quot; prefix: e.g. -nodnseed.&lt;br /&gt;
&lt;br /&gt;
==Bitcoin.conf Configuration File==&lt;br /&gt;
All command-line options (except for -datadir and -conf) may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file.&lt;br /&gt;
&lt;br /&gt;
The configuration file is a list of setting=value pairs, one per line, with optional comments starting with the &#039;#&#039; character.&lt;br /&gt;
&lt;br /&gt;
The configuration file is not automatically created; you can create it using your favorite plain-text editor. By default, Bitcoin (or bitcoind) will look for a file named &#039;bitcoin.conf&#039; in the bitcoin [[data directory]], but both the data directory and the configuration file path may be changed using the -datadir and -conf command-line arguments.&lt;br /&gt;
{|&lt;br /&gt;
! Operating System&lt;br /&gt;
! Default bitcoin datadir&lt;br /&gt;
! Typical path to configuration file&lt;br /&gt;
|-&lt;br /&gt;
| Windows&lt;br /&gt;
| %APPDATA%\Bitcoin\&lt;br /&gt;
| (XP) C:\Documents and Settings\username\Application Data\Bitcoin\bitcoin.conf&lt;br /&gt;
(Vista, 7) C:\Users\username\AppData\Roaming\Bitcoin\bitcoin.conf&lt;br /&gt;
|-&lt;br /&gt;
| Linux&lt;br /&gt;
| $HOME/.bitcoin/&lt;br /&gt;
| /home/username/.bitcoin/bitcoin.conf&lt;br /&gt;
|-&lt;br /&gt;
| Mac OSX&lt;br /&gt;
| $HOME/Library/Application Support/Bitcoin/&lt;br /&gt;
| /Users/username/Library/Application Support/Bitcoin/bitcoin.conf&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: if running Bitcoin in testnet mode, the sub-folder &amp;quot;testnet&amp;quot; will be appended to the data directory automatically.&lt;br /&gt;
&lt;br /&gt;
==Sample Bitcoin.conf==&lt;br /&gt;
Here is a sample bitcoin.conf file.&lt;br /&gt;
&lt;br /&gt;
  # bitcoin.conf configuration file. Lines beginning with # are comments.&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  # Network-related settings:&lt;br /&gt;
  &lt;br /&gt;
  # Run on the test network instead of the real bitcoin network.&lt;br /&gt;
  #testnet=0&lt;br /&gt;
  &lt;br /&gt;
  # Connect via a socks4 proxy&lt;br /&gt;
  #proxy=127.0.0.1:9050&lt;br /&gt;
  &lt;br /&gt;
  ##############################################################&lt;br /&gt;
  ##            Quick Primer on addnode vs connect            ##&lt;br /&gt;
  ##  Let&#039;s say for instance you use addnode=4.2.2.4          ##&lt;br /&gt;
  ##  addnode will connect you to and tell you about the      ##&lt;br /&gt;
  ##    nodes connected to 4.2.2.4.  In addition it will tell ##&lt;br /&gt;
  ##    the other nodes connected to it that you exist so     ##&lt;br /&gt;
  ##    they can connect to you.                              ##&lt;br /&gt;
  ##  connect will not do the above when you &#039;connect&#039; to it. ##&lt;br /&gt;
  ##    It will *only* connect you to 4.2.2.4 and no one else.##&lt;br /&gt;
  ##                                                          ##&lt;br /&gt;
  ##  So if you&#039;re behind a firewall, or have other problems  ##&lt;br /&gt;
  ##  finding nodes, add some using &#039;addnode&#039;.                ##&lt;br /&gt;
  ##                                                          ##&lt;br /&gt;
  ##  If you want to stay private, use &#039;connect&#039; to only      ##&lt;br /&gt;
  ##  connect to &amp;quot;trusted&amp;quot; nodes.                             ##&lt;br /&gt;
  ##                                                          ##&lt;br /&gt;
  ##  If you run multiple nodes on a LAN, there&#039;s no need for ##&lt;br /&gt;
  ##  all of them to open lots of connections.  Instead       ##&lt;br /&gt;
  ##  &#039;connect&#039; them all to one node that is port forwarded   ##&lt;br /&gt;
  ##  and has lots of connections.                            ##&lt;br /&gt;
  ##       Thanks goes to [Noodle] on Freenode.               ##&lt;br /&gt;
  ##############################################################&lt;br /&gt;
  &lt;br /&gt;
  # Use as many addnode= settings as you like to connect to specific peers&lt;br /&gt;
  #addnode=69.164.218.197&lt;br /&gt;
  #addnode=10.0.0.2:8333&lt;br /&gt;
  &lt;br /&gt;
  # ... or use as many connect= settings as you like to connect ONLY&lt;br /&gt;
  # to specific peers:&lt;br /&gt;
  #connect=69.164.218.197&lt;br /&gt;
  #connect=10.0.0.1:8333&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  # Maximum number of inbound+outbound connections.&lt;br /&gt;
  #maxconnections=&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  # JSON-RPC options (for controlling a running Bitcoin/bitcoind process)&lt;br /&gt;
  &lt;br /&gt;
  # server=1 tells Bitcoin-QT to accept JSON-RPC commands.&lt;br /&gt;
  #server=0&lt;br /&gt;
  &lt;br /&gt;
  # You must set rpcuser and rpcpassword to secure the JSON-RPC api&lt;br /&gt;
  #rpcuser=Ulysseys&lt;br /&gt;
  #rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593&lt;br /&gt;
  &lt;br /&gt;
  # How many seconds bitcoin will wait for a complete RPC HTTP request.&lt;br /&gt;
  # after the HTTP connection is established. &lt;br /&gt;
  #rpctimeout=30&lt;br /&gt;
  &lt;br /&gt;
  # By default, only RPC connections from localhost are allowed.  Specify&lt;br /&gt;
  # as many rpcallowip= settings as you like to allow connections from&lt;br /&gt;
  # other hosts (and you may use * as a wildcard character).&lt;br /&gt;
  # NOTE: opening up the RPC port to hosts outside your local&lt;br /&gt;
  # trusted network is NOT RECOMMENDED, because the rpcpassword&lt;br /&gt;
  # is transmitted over the network unencrypted.&lt;br /&gt;
  #rpcallowip=10.1.1.34&lt;br /&gt;
  #rpcallowip=192.168.1.*&lt;br /&gt;
  &lt;br /&gt;
  # Listen for RPC connections on this TCP port:&lt;br /&gt;
  #rpcport=8332&lt;br /&gt;
  &lt;br /&gt;
  # You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind&lt;br /&gt;
  # running on another host using this option:&lt;br /&gt;
  #rpcconnect=127.0.0.1&lt;br /&gt;
  &lt;br /&gt;
  # Use Secure Sockets Layer (also known as TLS or HTTPS) to communicate&lt;br /&gt;
  # with Bitcoin -server or bitcoind&lt;br /&gt;
  #rpcssl=1&lt;br /&gt;
  &lt;br /&gt;
  # OpenSSL settings used when rpcssl=1&lt;br /&gt;
  #rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH&lt;br /&gt;
  #rpcsslcertificatechainfile=server.cert&lt;br /&gt;
  #rpcsslprivatekeyfile=server.pem&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  # Miscellaneous options&lt;br /&gt;
  &lt;br /&gt;
  # Set gen=1 to attempt to generate bitcoins&lt;br /&gt;
  #gen=0&lt;br /&gt;
   &lt;br /&gt;
  # Pre-generate this many public/private key pairs, so wallet backups will be valid for&lt;br /&gt;
  # both prior transactions and several dozen future transactions.&lt;br /&gt;
  #keypool=100&lt;br /&gt;
  &lt;br /&gt;
  # Pay an optional transaction fee every time you send bitcoins.  Transactions with fees&lt;br /&gt;
  # are more likely than free transactions to be included in generated blocks, so may&lt;br /&gt;
  # be validated sooner.&lt;br /&gt;
  #paytxfee=0.00&lt;br /&gt;
  &lt;br /&gt;
  # Allow direct connections for the &#039;pay via IP address&#039; feature.&lt;br /&gt;
  #allowreceivebyip=1&lt;br /&gt;
    &lt;br /&gt;
  # User interface options&lt;br /&gt;
  &lt;br /&gt;
  # Start Bitcoin minimized&lt;br /&gt;
  #min=1&lt;br /&gt;
  &lt;br /&gt;
  # Minimize to the system tray&lt;br /&gt;
  #minimizetotray=1&lt;br /&gt;
&lt;br /&gt;
==Platforms==&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
====Start automatically====&lt;br /&gt;
To configure the Bitcoin client to start automatically:&lt;br /&gt;
&lt;br /&gt;
You might use the configuration-file, or the GUI-Settings:&lt;br /&gt;
&lt;br /&gt;
Settings -&amp;gt; Options&lt;br /&gt;
&lt;br /&gt;
then mark the checkbox titled:&lt;br /&gt;
 [X] Start Bitcoin on system startup&lt;br /&gt;
&lt;br /&gt;
[[{{ns:file}}:Client_Settings_Options_windows.png]]&lt;br /&gt;
&lt;br /&gt;
====Batch automation====&lt;br /&gt;
To work with batch, you have to start the daemon (bitcoind.exe). The bitcoin.exe run with option &amp;quot;-server&amp;quot; will respond with GUI-messages you are not able to process its answers.&lt;br /&gt;
&lt;br /&gt;
===Mac===&lt;br /&gt;
[[{{ns:file}}:MacBitcoinStartOnLogin.png]]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
[[{{ns:file}}:Client_Settings_Options.png]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Data directory]]&lt;br /&gt;
&lt;br /&gt;
[[es:Ejecución de Bitcoin]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Philipkd</name></author>
	</entry>
</feed>