<?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=Jbaczuk</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=Jbaczuk"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Jbaczuk"/>
	<updated>2026-05-15T12:37:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Transaction&amp;diff=65621</id>
		<title>Transaction</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Transaction&amp;diff=65621"/>
		<updated>2018-08-07T16:55:09Z</updated>

		<summary type="html">&lt;p&gt;Jbaczuk: Fix broken anchor links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:TxBinaryMap.png|thumb|right|Byte-map of Transaction with each type of TxIn and TxOut]]&lt;br /&gt;
A &#039;&#039;&#039;transaction&#039;&#039;&#039; is a transfer of Bitcoin value that is broadcast to the [[network]] and collected into [[block|blocks]]. A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs. Transactions are not encrypted, so it is possible to browse and view every transaction ever collected into a block. Once transactions are buried under enough [[Confirmation|confirmations]] they can be considered [[Irreversible Transactions|irreversible]].&lt;br /&gt;
&lt;br /&gt;
Standard transaction outputs nominate [[address|addresses]], and the redemption of any future inputs requires a relevant signature.&lt;br /&gt;
&lt;br /&gt;
All transactions are visible in the [[block chain]], and can be viewed with a hex editor. A [[block chain browser]] is a site where every transaction included within the block chain can be viewed in human-readable terms.  This is useful for seeing the technical details of transactions in action and for verifying payments.&lt;br /&gt;
&lt;br /&gt;
=== General format of a Bitcoin transaction (inside a block) ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|Version no&lt;br /&gt;
|currently 1&lt;br /&gt;
|4 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Flag&lt;br /&gt;
|If present, always 0001, and indicates the presence of witness data&lt;br /&gt;
|optional 2 byte array&lt;br /&gt;
|-&lt;br /&gt;
|In-counter&lt;br /&gt;
| positive integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
| 1 - 9 bytes &lt;br /&gt;
|-&lt;br /&gt;
|list of inputs&lt;br /&gt;
|[[Transaction#General_format_.28inside_a_block.29_of_each_input_of_a_transaction_-_Txin|the first input of the first transaction is also called &amp;quot;coinbase&amp;quot; (its content was ignored in earlier versions)]]&lt;br /&gt;
|&amp;lt;in-counter&amp;gt;-many inputs&lt;br /&gt;
|-&lt;br /&gt;
|Out-counter&lt;br /&gt;
| positive integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
| 1 - 9 bytes&lt;br /&gt;
|-&lt;br /&gt;
|list of outputs&lt;br /&gt;
|[[Transaction#General_format_.28inside_a_block.29_of_each_output_of_a_transaction_-_Txout|the outputs of the first transaction spend the mined bitcoins for the block]]&lt;br /&gt;
|&amp;lt;out-counter&amp;gt;-many outputs&lt;br /&gt;
|-&lt;br /&gt;
|Witnesses&lt;br /&gt;
|A list of witnesses, 1 for each input, omitted if flag above is missing&lt;br /&gt;
|variable, see [[Segregated_Witness]]&lt;br /&gt;
|-&lt;br /&gt;
|lock_time&lt;br /&gt;
|if non-zero and sequence numbers are &amp;lt; 0xFFFFFFFF: block height or timestamp when transaction is final&lt;br /&gt;
|4 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Principle example of a Bitcoin transaction with 1 input and 1 output only ===&lt;br /&gt;
&lt;br /&gt;
==== Data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Input:&lt;br /&gt;
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6&lt;br /&gt;
Index: 0&lt;br /&gt;
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10&lt;br /&gt;
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Value: 5000000000&lt;br /&gt;
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d&lt;br /&gt;
OP_EQUALVERIFY OP_CHECKSIG&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Explanation ====&lt;br /&gt;
&lt;br /&gt;
The input in this transaction imports 50 BTC from output #0 in transaction f5d8... Then the output sends 50 BTC to a Bitcoin address (expressed here in hexadecimal 4043... instead of the normal base58). When the recipient wants to spend this money, he will reference output #0 of this transaction in an input of his own transaction.&lt;br /&gt;
&lt;br /&gt;
===== Input =====&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;input&#039;&#039;&#039; is a reference to an output from a previous transaction. Multiple inputs are often listed in a transaction. All of the new transaction&#039;s input values (that is, the total coin value of the previous outputs referenced by the new transaction&#039;s inputs) are added up, and the total (less any transaction fee) is completely used by the outputs of the new transaction. &#039;&#039;&#039;Previous tx&#039;&#039;&#039; is a [[hash]] of a previous transaction. &#039;&#039;&#039;Index&#039;&#039;&#039; is the specific output in the referenced transaction. &#039;&#039;&#039;ScriptSig&#039;&#039;&#039; is the first half of a [[script]] (discussed in more detail later).&lt;br /&gt;
&lt;br /&gt;
The script contains two components, a signature and a public key. The public key must match the hash given in the script of the redeemed output. The public key is used to verify the redeemers signature, which is the second component. More precisely, the second component is an [[ECDSA]] signature over a hash of a simplified version of the transaction. It, combined with the public key, proves the transaction was created by the real owner of the address in question. Various flags define how the transaction is simplified and can be used to create different types of payment.&lt;br /&gt;
&lt;br /&gt;
===== Output =====&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;output&#039;&#039;&#039; contains instructions for sending bitcoins. &#039;&#039;&#039;Value&#039;&#039;&#039; is the number of Satoshi (1 BTC = 100,000,000 Satoshi) that this output will be worth when claimed. &#039;&#039;&#039;ScriptPubKey&#039;&#039;&#039; is the second half of a script (discussed later). There can be more than one output, and they share the combined value of the inputs. Because each output from one transaction can only ever be referenced once by an input of a subsequent transaction, the entire combined input value needs to be sent in an output if you don&#039;t want to lose it. If the input is worth 50 BTC but you only want to send 25 BTC, Bitcoin will create two outputs worth 25 BTC: one to the destination, and one back to you (known as &amp;quot;[[change]]&amp;quot;, though you send it to yourself). Any input bitcoins not redeemed in an output is considered a [[transaction fee]]; whoever generates the block can claim it by inserting it into the coinbase transaction of that block.&lt;br /&gt;
[[File:transaction.png|thumb|A sends 100 BTC to C and C generates 50 BTC. C sends 101 BTC to D, and he needs to send himself some change. D sends the 101 BTC to someone else, but they haven&#039;t redeemed it yet. Only D&#039;s output and C&#039;s change are capable of being spent in the current state.]]&lt;br /&gt;
&lt;br /&gt;
===== Verification =====&lt;br /&gt;
&lt;br /&gt;
To verify that inputs are authorized to collect the values of referenced outputs, Bitcoin uses a custom Forth-like [[script|scripting]] system. The input&#039;s scriptSig and the &#039;&#039;referenced&#039;&#039; output&#039;s scriptPubKey are evaluated (in that order), with scriptPubKey using the values left on the stack by scriptSig. The input is authorized if scriptPubKey returns true. Through the scripting system, the sender can create very complex conditions that people have to meet in order to claim the output&#039;s value. For example, it&#039;s possible to create an output that can be claimed by anyone without any authorization. It&#039;s also possible to require that an input be signed by ten different keys, or be redeemable with a password instead of a key.&lt;br /&gt;
&lt;br /&gt;
=== Types of Transaction ===&lt;br /&gt;
Bitcoin currently creates two different scriptSig/scriptPubKey pairs. These are described below.&lt;br /&gt;
&lt;br /&gt;
It is possible to design more complex types of transactions, and link them together into cryptographically enforced agreements. These are known as [[Contracts]].&lt;br /&gt;
&lt;br /&gt;
==== Pay-to-PubkeyHash ====&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
A Bitcoin [[address]] is only a hash, so the sender can&#039;t provide a full public key in scriptPubKey. When redeeming coins that have been sent to a Bitcoin address, the recipient provides both the signature and the public key. The script verifies that the provided public key does hash to the hash in scriptPubKey, and then it also checks the signature against the public key.&lt;br /&gt;
&lt;br /&gt;
Checking process:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is duplicated.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt;&lt;br /&gt;
|&amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Top stack item is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt; &amp;lt;pubKeyHash&amp;gt;&lt;br /&gt;
|OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Constant added.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
|OP_CHECKSIG&lt;br /&gt;
| Equality is checked between the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Pay-to-Script-Hash ====&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_HASH160 &amp;lt;scriptHash&amp;gt; OP_EQUAL &lt;br /&gt;
 scriptSig: ..signatures... &amp;lt;serialized script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 m-of-n multi-signature transaction:&lt;br /&gt;
 scriptSig: 0 &amp;lt;sig1&amp;gt; ... &amp;lt;script&amp;gt;&lt;br /&gt;
 script: OP_m &amp;lt;pubKey1&amp;gt; ... OP_n OP_CHECKMULTISIG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
P2SH addresses were created with the motivation of moving &amp;quot;the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer. They allow the sender to fund an arbitrary transaction, no matter how complicated, using a 20-byte hash&amp;quot;[https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki#motivation 1]. Pay-to-Pubkey-hash addresses are similarly a 20-byte hash of the public key. &lt;br /&gt;
&lt;br /&gt;
Pay-to-script-hash provides a means for complicated transactions, unlike the Pay-to-pubkey-hash, which has a specific definition for scriptPubKey, and scriptSig. The specification places no limitations on the script, and hence absolutely any contract can be funded using these addresses. &lt;br /&gt;
&lt;br /&gt;
The scriptPubKey in the funding transaction is script which ensures that the script supplied in the redeeming transaction hashes to the script used to create the address. &lt;br /&gt;
&lt;br /&gt;
In the scriptSig above, &#039;signatures&#039; refers to any script which is sufficient to satisfy the following serialized script. &lt;br /&gt;
&lt;br /&gt;
Checking process:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| 0 &amp;lt;sig1&amp;gt; &amp;lt;sig2&amp;gt; OP_2 &amp;lt;pubKey1&amp;gt; &amp;lt;pubKey2&amp;gt; &amp;lt;pubKey3&amp;gt; OP_3 OP_CHECKMULTISIG &lt;br /&gt;
| Only the scriptSig is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0 &amp;lt;sig1&amp;gt; &amp;lt;sig2&amp;gt; OP_2 &amp;lt;pubKey1&amp;gt; &amp;lt;pubKey2&amp;gt; &amp;lt;pubKey3&amp;gt; OP_3 &lt;br /&gt;
| OP_CHECKMULTISIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
| true&lt;br /&gt;
| Empty&lt;br /&gt;
| Signatures validated in the order of the keys in the script.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also [[BIP 0016]]&lt;br /&gt;
&lt;br /&gt;
=== Generation ===&lt;br /&gt;
&lt;br /&gt;
Generations have a single input, and this input has a &amp;quot;[[Coinbase |coinbase]]&amp;quot; parameter instead of a scriptSig. The data in &amp;quot;coinbase&amp;quot; can be anything; it isn&#039;t used. Bitcoin puts the current compact-format [[target]] and the arbitrary-precision &amp;quot;extraNonce&amp;quot; number there, which increments every time the Nonce field in the [[block_hashing_algorithm|block header]] overflows. Outputs can be anything, but Bitcoin creates one exactly like an IP address transaction.&lt;br /&gt;
The extranonce contributes to enlarge the domain for the proof of work function. Miners can easily modify nonce (4byte), timestamp and extranonce (2 to 100bytes).&lt;br /&gt;
&lt;br /&gt;
=== General format (inside a block) of each input of a transaction - Txin ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|Previous Transaction hash &lt;br /&gt;
| doubled [[Wikipedia:SHA-256|SHA256]]-[[hash|hashed]] of a (previous) to-be-used transaction&lt;br /&gt;
|32 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Previous Txout-index&lt;br /&gt;
| non negative integer indexing an output of the to-be-used transaction&lt;br /&gt;
|4 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txin-script length&lt;br /&gt;
|non negative integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
|1 - 9 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txin-script / scriptSig&lt;br /&gt;
|[[Script]]&lt;br /&gt;
|&amp;lt;in-script length&amp;gt;-many bytes&lt;br /&gt;
|-&lt;br /&gt;
|sequence_no&lt;br /&gt;
|normally 0xFFFFFFFF; irrelevant unless transaction&#039;s lock_time is &amp;gt; 0&lt;br /&gt;
|4 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The input sufficiently describes where and how to get the bitcoin amout to be redeemed.&lt;br /&gt;
If it is the (only) input of the first transaction of a block, it is called the generation transaction input and its content completely ignored. (Historically the Previous Transaction hash is 0 and the Previous Txout-index is -1.)&lt;br /&gt;
&lt;br /&gt;
=== General format (inside a block) of each output of a transaction - Txout ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|non negative integer giving the number of [[FAQ#What_do_I_call_the_various_denominations_of_bitcoins.3F|Satoshis(BTC/10^8)]] to be transfered&lt;br /&gt;
|8 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txout-script length&lt;br /&gt;
|non negative integer&lt;br /&gt;
|1 - 9 bytes [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
|-&lt;br /&gt;
|Txout-script / scriptPubKey&lt;br /&gt;
|[[Script]]&lt;br /&gt;
|&amp;lt;out-script length&amp;gt;-many bytes&lt;br /&gt;
|}&lt;br /&gt;
The output sets the conditions to release this bitcoin amount later. The sum of the output values of the first transaction is the value of the mined bitcoins for the block plus possible transactions fees of the other transactions in the block.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Script]]&lt;br /&gt;
* [[Protocol rules#&amp;quot;tx&amp;quot; messages|Protocol rules - &amp;quot;tx&amp;quot; messages]]&lt;br /&gt;
* [[Protocol documentation#Transaction Verification|Protocol documentation - Transaction Verification]]&lt;br /&gt;
* [[Raw Transactions]]&lt;br /&gt;
* [[Coin analogy]]&lt;br /&gt;
* [[Transaction Malleability]]&lt;br /&gt;
* [[Transaction broadcasting]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Vocabulary]]&lt;br /&gt;
[[de:Transaktion]]&lt;br /&gt;
[[es:Transacción]]&lt;br /&gt;
[[pl:Transakcje]]&lt;/div&gt;</summary>
		<author><name>Jbaczuk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Transaction&amp;diff=65593</id>
		<title>Transaction</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Transaction&amp;diff=65593"/>
		<updated>2018-07-18T20:41:19Z</updated>

		<summary type="html">&lt;p&gt;Jbaczuk: Added witness data to the structure of a transaction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:TxBinaryMap.png|thumb|right|Byte-map of Transaction with each type of TxIn and TxOut]]&lt;br /&gt;
A &#039;&#039;&#039;transaction&#039;&#039;&#039; is a transfer of Bitcoin value that is broadcast to the [[network]] and collected into [[block|blocks]]. A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs. Transactions are not encrypted, so it is possible to browse and view every transaction ever collected into a block. Once transactions are buried under enough [[Confirmation|confirmations]] they can be considered [[Irreversible Transactions|irreversible]].&lt;br /&gt;
&lt;br /&gt;
Standard transaction outputs nominate [[address|addresses]], and the redemption of any future inputs requires a relevant signature.&lt;br /&gt;
&lt;br /&gt;
All transactions are visible in the [[block chain]], and can be viewed with a hex editor. A [[block chain browser]] is a site where every transaction included within the block chain can be viewed in human-readable terms.  This is useful for seeing the technical details of transactions in action and for verifying payments.&lt;br /&gt;
&lt;br /&gt;
=== General format of a Bitcoin transaction (inside a block) ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|Version no&lt;br /&gt;
|currently 1&lt;br /&gt;
|4 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Flag&lt;br /&gt;
|If present, always 0001, and indicates the presence of witness data&lt;br /&gt;
|optional 2 byte array&lt;br /&gt;
|-&lt;br /&gt;
|In-counter&lt;br /&gt;
| positive integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
| 1 - 9 bytes &lt;br /&gt;
|-&lt;br /&gt;
|list of inputs&lt;br /&gt;
|[[Transaction#general_format_.28inside_a_block.29_of_each_input_of_a_transaction_-_Txin|the first input of the first transaction is also called &amp;quot;coinbase&amp;quot; (its content was ignored in earlier versions)]]&lt;br /&gt;
|&amp;lt;in-counter&amp;gt;-many inputs&lt;br /&gt;
|-&lt;br /&gt;
|Out-counter&lt;br /&gt;
| positive integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
| 1 - 9 bytes&lt;br /&gt;
|-&lt;br /&gt;
|list of outputs&lt;br /&gt;
|[[Transaction#general_format_.28inside_a_block.29_of_each_output_of_a_transaction_-_Txout|the outputs of the first transaction spend the mined bitcoins for the block]]&lt;br /&gt;
|&amp;lt;out-counter&amp;gt;-many outputs&lt;br /&gt;
|-&lt;br /&gt;
|Witnesses&lt;br /&gt;
|A list of witnesses, 1 for each input, omitted if flag above is missing&lt;br /&gt;
|variable, see [[Segregated_Witness]]&lt;br /&gt;
|-&lt;br /&gt;
|lock_time&lt;br /&gt;
|if non-zero and sequence numbers are &amp;lt; 0xFFFFFFFF: block height or timestamp when transaction is final&lt;br /&gt;
|4 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Principle example of a Bitcoin transaction with 1 input and 1 output only ===&lt;br /&gt;
&lt;br /&gt;
==== Data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Input:&lt;br /&gt;
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6&lt;br /&gt;
Index: 0&lt;br /&gt;
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10&lt;br /&gt;
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Value: 5000000000&lt;br /&gt;
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d&lt;br /&gt;
OP_EQUALVERIFY OP_CHECKSIG&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Explanation ====&lt;br /&gt;
&lt;br /&gt;
The input in this transaction imports 50 BTC from output #0 in transaction f5d8... Then the output sends 50 BTC to a Bitcoin address (expressed here in hexadecimal 4043... instead of the normal base58). When the recipient wants to spend this money, he will reference output #0 of this transaction in an input of his own transaction.&lt;br /&gt;
&lt;br /&gt;
===== Input =====&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;input&#039;&#039;&#039; is a reference to an output from a previous transaction. Multiple inputs are often listed in a transaction. All of the new transaction&#039;s input values (that is, the total coin value of the previous outputs referenced by the new transaction&#039;s inputs) are added up, and the total (less any transaction fee) is completely used by the outputs of the new transaction. &#039;&#039;&#039;Previous tx&#039;&#039;&#039; is a [[hash]] of a previous transaction. &#039;&#039;&#039;Index&#039;&#039;&#039; is the specific output in the referenced transaction. &#039;&#039;&#039;ScriptSig&#039;&#039;&#039; is the first half of a [[script]] (discussed in more detail later).&lt;br /&gt;
&lt;br /&gt;
The script contains two components, a signature and a public key. The public key must match the hash given in the script of the redeemed output. The public key is used to verify the redeemers signature, which is the second component. More precisely, the second component is an [[ECDSA]] signature over a hash of a simplified version of the transaction. It, combined with the public key, proves the transaction was created by the real owner of the address in question. Various flags define how the transaction is simplified and can be used to create different types of payment.&lt;br /&gt;
&lt;br /&gt;
===== Output =====&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;output&#039;&#039;&#039; contains instructions for sending bitcoins. &#039;&#039;&#039;Value&#039;&#039;&#039; is the number of Satoshi (1 BTC = 100,000,000 Satoshi) that this output will be worth when claimed. &#039;&#039;&#039;ScriptPubKey&#039;&#039;&#039; is the second half of a script (discussed later). There can be more than one output, and they share the combined value of the inputs. Because each output from one transaction can only ever be referenced once by an input of a subsequent transaction, the entire combined input value needs to be sent in an output if you don&#039;t want to lose it. If the input is worth 50 BTC but you only want to send 25 BTC, Bitcoin will create two outputs worth 25 BTC: one to the destination, and one back to you (known as &amp;quot;[[change]]&amp;quot;, though you send it to yourself). Any input bitcoins not redeemed in an output is considered a [[transaction fee]]; whoever generates the block can claim it by inserting it into the coinbase transaction of that block.&lt;br /&gt;
[[File:transaction.png|thumb|A sends 100 BTC to C and C generates 50 BTC. C sends 101 BTC to D, and he needs to send himself some change. D sends the 101 BTC to someone else, but they haven&#039;t redeemed it yet. Only D&#039;s output and C&#039;s change are capable of being spent in the current state.]]&lt;br /&gt;
&lt;br /&gt;
===== Verification =====&lt;br /&gt;
&lt;br /&gt;
To verify that inputs are authorized to collect the values of referenced outputs, Bitcoin uses a custom Forth-like [[script|scripting]] system. The input&#039;s scriptSig and the &#039;&#039;referenced&#039;&#039; output&#039;s scriptPubKey are evaluated (in that order), with scriptPubKey using the values left on the stack by scriptSig. The input is authorized if scriptPubKey returns true. Through the scripting system, the sender can create very complex conditions that people have to meet in order to claim the output&#039;s value. For example, it&#039;s possible to create an output that can be claimed by anyone without any authorization. It&#039;s also possible to require that an input be signed by ten different keys, or be redeemable with a password instead of a key.&lt;br /&gt;
&lt;br /&gt;
=== Types of Transaction ===&lt;br /&gt;
Bitcoin currently creates two different scriptSig/scriptPubKey pairs. These are described below.&lt;br /&gt;
&lt;br /&gt;
It is possible to design more complex types of transactions, and link them together into cryptographically enforced agreements. These are known as [[Contracts]].&lt;br /&gt;
&lt;br /&gt;
==== Pay-to-PubkeyHash ====&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
A Bitcoin [[address]] is only a hash, so the sender can&#039;t provide a full public key in scriptPubKey. When redeeming coins that have been sent to a Bitcoin address, the recipient provides both the signature and the public key. The script verifies that the provided public key does hash to the hash in scriptPubKey, and then it also checks the signature against the public key.&lt;br /&gt;
&lt;br /&gt;
Checking process:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is duplicated.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt;&lt;br /&gt;
|&amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Top stack item is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt; &amp;lt;pubKeyHash&amp;gt;&lt;br /&gt;
|OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Constant added.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
|OP_CHECKSIG&lt;br /&gt;
| Equality is checked between the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Pay-to-Script-Hash ====&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_HASH160 &amp;lt;scriptHash&amp;gt; OP_EQUAL &lt;br /&gt;
 scriptSig: ..signatures... &amp;lt;serialized script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 m-of-n multi-signature transaction:&lt;br /&gt;
 scriptSig: 0 &amp;lt;sig1&amp;gt; ... &amp;lt;script&amp;gt;&lt;br /&gt;
 script: OP_m &amp;lt;pubKey1&amp;gt; ... OP_n OP_CHECKMULTISIG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
P2SH addresses were created with the motivation of moving &amp;quot;the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer. They allow the sender to fund an arbitrary transaction, no matter how complicated, using a 20-byte hash&amp;quot;[https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki#motivation 1]. Pay-to-Pubkey-hash addresses are similarly a 20-byte hash of the public key. &lt;br /&gt;
&lt;br /&gt;
Pay-to-script-hash provides a means for complicated transactions, unlike the Pay-to-pubkey-hash, which has a specific definition for scriptPubKey, and scriptSig. The specification places no limitations on the script, and hence absolutely any contract can be funded using these addresses. &lt;br /&gt;
&lt;br /&gt;
The scriptPubKey in the funding transaction is script which ensures that the script supplied in the redeeming transaction hashes to the script used to create the address. &lt;br /&gt;
&lt;br /&gt;
In the scriptSig above, &#039;signatures&#039; refers to any script which is sufficient to satisfy the following serialized script. &lt;br /&gt;
&lt;br /&gt;
Checking process:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| 0 &amp;lt;sig1&amp;gt; &amp;lt;sig2&amp;gt; OP_2 &amp;lt;pubKey1&amp;gt; &amp;lt;pubKey2&amp;gt; &amp;lt;pubKey3&amp;gt; OP_3 OP_CHECKMULTISIG &lt;br /&gt;
| Only the scriptSig is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0 &amp;lt;sig1&amp;gt; &amp;lt;sig2&amp;gt; OP_2 &amp;lt;pubKey1&amp;gt; &amp;lt;pubKey2&amp;gt; &amp;lt;pubKey3&amp;gt; OP_3 &lt;br /&gt;
| OP_CHECKMULTISIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
| true&lt;br /&gt;
| Empty&lt;br /&gt;
| Signatures validated in the order of the keys in the script.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also [[BIP 0016]]&lt;br /&gt;
&lt;br /&gt;
=== Generation ===&lt;br /&gt;
&lt;br /&gt;
Generations have a single input, and this input has a &amp;quot;[[Coinbase |coinbase]]&amp;quot; parameter instead of a scriptSig. The data in &amp;quot;coinbase&amp;quot; can be anything; it isn&#039;t used. Bitcoin puts the current compact-format [[target]] and the arbitrary-precision &amp;quot;extraNonce&amp;quot; number there, which increments every time the Nonce field in the [[block_hashing_algorithm|block header]] overflows. Outputs can be anything, but Bitcoin creates one exactly like an IP address transaction.&lt;br /&gt;
The extranonce contributes to enlarge the domain for the proof of work function. Miners can easily modify nonce (4byte), timestamp and extranonce (2 to 100bytes).&lt;br /&gt;
&lt;br /&gt;
=== General format (inside a block) of each input of a transaction - Txin ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|Previous Transaction hash &lt;br /&gt;
| doubled [[Wikipedia:SHA-256|SHA256]]-[[hash|hashed]] of a (previous) to-be-used transaction&lt;br /&gt;
|32 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Previous Txout-index&lt;br /&gt;
| non negative integer indexing an output of the to-be-used transaction&lt;br /&gt;
|4 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txin-script length&lt;br /&gt;
|non negative integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
|1 - 9 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txin-script / scriptSig&lt;br /&gt;
|[[Script]]&lt;br /&gt;
|&amp;lt;in-script length&amp;gt;-many bytes&lt;br /&gt;
|-&lt;br /&gt;
|sequence_no&lt;br /&gt;
|normally 0xFFFFFFFF; irrelevant unless transaction&#039;s lock_time is &amp;gt; 0&lt;br /&gt;
|4 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The input sufficiently describes where and how to get the bitcoin amout to be redeemed.&lt;br /&gt;
If it is the (only) input of the first transaction of a block, it is called the generation transaction input and its content completely ignored. (Historically the Previous Transaction hash is 0 and the Previous Txout-index is -1.)&lt;br /&gt;
&lt;br /&gt;
=== General format (inside a block) of each output of a transaction - Txout ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|non negative integer giving the number of [[FAQ#What_do_I_call_the_various_denominations_of_bitcoins.3F|Satoshis(BTC/10^8)]] to be transfered&lt;br /&gt;
|8 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txout-script length&lt;br /&gt;
|non negative integer&lt;br /&gt;
|1 - 9 bytes [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
|-&lt;br /&gt;
|Txout-script / scriptPubKey&lt;br /&gt;
|[[Script]]&lt;br /&gt;
|&amp;lt;out-script length&amp;gt;-many bytes&lt;br /&gt;
|}&lt;br /&gt;
The output sets the conditions to release this bitcoin amount later. The sum of the output values of the first transaction is the value of the mined bitcoins for the block plus possible transactions fees of the other transactions in the block.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Script]]&lt;br /&gt;
* [[Protocol rules#&amp;quot;tx&amp;quot; messages|Protocol rules - &amp;quot;tx&amp;quot; messages]]&lt;br /&gt;
* [[Protocol documentation#Transaction Verification|Protocol documentation - Transaction Verification]]&lt;br /&gt;
* [[Raw Transactions]]&lt;br /&gt;
* [[Coin analogy]]&lt;br /&gt;
* [[Transaction Malleability]]&lt;br /&gt;
* [[Transaction broadcasting]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Vocabulary]]&lt;br /&gt;
[[de:Transaktion]]&lt;br /&gt;
[[es:Transacción]]&lt;br /&gt;
[[pl:Transakcje]]&lt;/div&gt;</summary>
		<author><name>Jbaczuk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Smart_Property&amp;diff=65579</id>
		<title>Smart Property</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Smart_Property&amp;diff=65579"/>
		<updated>2018-07-16T16:36:38Z</updated>

		<summary type="html">&lt;p&gt;Jbaczuk: corrected the history of the term smart property by referencing an earlier paper, matching what is on wikipedia at https://en.wikipedia.org/wiki/Smart_contract#cite_note-sc1994-2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Smart property&#039;&#039;&#039; is property whose ownership is controlled via the Bitcoin [[block chain]], using [[Contracts|contracts]]. Examples could include physical property such as cars, phones or houses. Smart property also includes non-physical property like shares in a company or access rights to a remote computer. Making property smart allows it to be traded with radically less trust. This reduces fraud, mediation fees and allows trades to take place that otherwise would never have happened. For example, it allows strangers to loan you money over the internet taking your smart property as collateral, which should make lending more competitive and thus credit cheaper.&lt;br /&gt;
&lt;br /&gt;
Smart property was coined by [[Nick Szabo]] in 1994, [http://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart.contracts.html &amp;quot;Smart Contracts&amp;quot;].&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
Primitive forms of smart property are already common - if you own a car, it probably comes with an immobilizer. Immobilizers augment the physical key with a protocol exchange ensuring only the holders of the correct cryptographic token can activate the engine. They have dramatically reduced car theft, for example, immobilisers are fitted to around 45% of all cars in Australia, but account for only 7% of the cars that are stolen.&lt;br /&gt;
&lt;br /&gt;
Many other forms of modern property are protected against theft using cryptography, for example, some smartphones will refuse to release certain keys if the correct PIN unlock isn&#039;t entered, and cryptography not only renders a stolen device fairly useless but makes it impossible to steal someone&#039;s phone number as well.&lt;br /&gt;
&lt;br /&gt;
Although these are victories for cryptography, the potential of cryptographically activated property has not been fully explored. The private key is usually itself held in a physical container (like a key or SIM card) and can&#039;t be easily transferred or manipulated. Smart property changes this, allowing ownership to be intermediated by Bitcoin miners.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
This section assumes you are familiar with the Bitcoin protocol, and have a good understanding of [[contracts]].&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start with the example of a car. The cars computer requires authentication using an &#039;&#039;ownership key&#039;&#039;. The ownership key is a regular Bitcoin ECDSA-256 key. The car starts its life at the factory gate with the public part of a newly created ownership key. A small token amount of Bitcoins are deposited on that key, call the amount T (it could be 0.0001 BTC for example). Additionally the car has a digital certificate from its manufacturer, and an &#039;&#039;identification key&#039;&#039; which has the public part in the certificate. This allows the car to prove things like its existence, age or mileage to third parties.&lt;br /&gt;
&lt;br /&gt;
When the car is sold, the following protocol is used:&lt;br /&gt;
&lt;br /&gt;
# The buyer generates a nonce (random number) and asks the seller to send them the car data.&lt;br /&gt;
# The seller gives the car that nonce, and the car returns a data structure signed with its identification key. The data contains the nonce, the cars public cert, data about the car, the public key of the current owner, and the transaction+merkle branch which transferred ownership last time. This ensures the buyer knows what they are getting and that it came from the real seller (it&#039;s not a replay).&lt;br /&gt;
# The seller selects a key to receive the payment, k1, and names their price P.&lt;br /&gt;
# The buyer generates a new ownership key, k2.&lt;br /&gt;
# The buyer creates a transaction with two inputs and two outputs. The first input signs for P coins. The second input is connected to the output holding T coins for the ownership address. The first output sends P coins to k1 and the second output sends T coins to k2. This transaction is not valid because only the first input can be signed. The buyer passes this partially complete transaction to the seller, who then signs the second input with the car&#039;s current ownership key and broadcasts the transaction.&lt;br /&gt;
# They wait for some confirmations.&lt;br /&gt;
# The buyer presents the car with the Bitcoin transaction, a merkle branch linking it to the block header and then enough block headers to fill in the gap from the cars current ownership transaction. The car sees that the new transaction re-assigns ownership and is further along in the chain than its current one, plus it has enough work piled on top to be sure the tx won&#039;t be reversed. It then updates its ownership information. The car does not need to keep a full record of the chain nor all headers, but rather just enough data to be able to connect future block headers to the one it was previously presented with.&lt;br /&gt;
&lt;br /&gt;
In practice this process would likely be handled using smartphones with NFC hardware -- the act of touching the phone containing the ownership key to the dashboard would start your wallet app in a special mode that knows how to do smart property trades, after inputting the price the buyer and seller would then touch their phones together to finalize the deal. Although the cryptography is complex they would never need to know anything about it. The phone could double as a way to start the car as well.&lt;br /&gt;
&lt;br /&gt;
==Loans and collateral==&lt;br /&gt;
&lt;br /&gt;
Being able to trade physical property without fraud risk is useful, but we can add an extra layer to allow for secured low-trust loans. Consider a loan with which to start a small business. Rather than deal with a bank, you decide to allow people from around the world bid on your debt so you can get the best rates. For this to work, the strangers need some assurance that if the loan is not repaid, they get to keep the collateral - yet you still need to be able to use the car to set up the business.&lt;br /&gt;
&lt;br /&gt;
We can do this by adding &#039;&#039;access keys&#039;&#039; to the ownership key. By signing a message with the ownership key, access keys can be added or removed. Access keys can be temporary in nature. This means that for the duration of the loan, you can re-assign ownership of the vehicle to the creditor whilst keeping an access key for yourself.&lt;br /&gt;
&lt;br /&gt;
It would be best if the debtor had an assurance that, on repaying his debt, the cars ownership would indeed revert to his control. We can implement this as follows:&lt;br /&gt;
&lt;br /&gt;
# The creditor generates k1, which is used to receive the loan repayments. The loan size is L.&lt;br /&gt;
# The creditor signs Tx1 that has an input/output re-assigning ownership of the car back to the debtor which is signed with SIGHASH_ALL | SIGHASH_ANYONECANPAY, and an output for L coins to k1. This transaction is not valid because the loan has not yet been repaid, so the output sums to more value than the inputs. The creditor sends this transaction to the debtor who keeps it.&lt;br /&gt;
# As the debtor re-earns the money they spent, they add inputs to Tx1 to increase its value. This doesn&#039;t break the signature on the ownership key input/output pair because it was signed with SIGHASH_ANYONECANPAY so is independent of other inputs. They can&#039;t adjust the outputs or anything else about the transaction because that would invalidate the ownership input/output (SIGHASH_ALL).&lt;br /&gt;
# Once the transaction has enough inputs to sum to L, the debtor broadcasts the transaction, thus repaying their debt and simultaneously retaking ownership of the vehicle.&lt;br /&gt;
&lt;br /&gt;
Because access keys can be given time limits, if the debtor does not repay the loan by its maturity period his access key expires and the car will no longer start for him. The new owner can now either come and pick it up himself, or if he doesn&#039;t want to (eg he is in another country), he can sell it using the low-trust sales protocol described above and collect the money that way.&lt;br /&gt;
&lt;br /&gt;
Most loans are repaid in multiple installments. The same protocol as above can work in this case by embedding some control data in the extra input/output pair, the ownership key would not change but the signature would cover a command that extends the lifetime of the access key for another month. The vehicle would know how to parse the data out of the transaction.&lt;br /&gt;
&lt;br /&gt;
==Implementation details==&lt;br /&gt;
&lt;br /&gt;
For expiring access keys, the device must have a trustable source of time. Some devices like cars and phones keep time by themselves. In other cases where that&#039;s not practical for some reason, a secure timestamping service can be used. This is a service that signs a message containing the current time and a nonce. The device generates a nonce, and as part of the activation/switch-on protocol, a network connected device like a smartphone sends the nonce to the timestamping service then hands back the signed message. The block chain itself cannot be used as a source of time because there&#039;s no challenge/response aspect - the device has no way of knowing if you&#039;ve handed it the latest blocks or not. Signing the time with a nonce solves this.&lt;br /&gt;
&lt;br /&gt;
Smart phones play a key role in smart property because they have the ability to bridge devices without network access to the network, using Bluetooth or NFC radio. For instance, requiring internet access for a smart lock on a house door is too expensive and impractical. However, a lock with an NFC touchpoint that understands how to check block header progression is quite feasible. The only operations needed to implement Bitcoin-linked smart property is hashing, ECDSA and a small amount of storage. Smartcard chips that implement everything required are common and cheap.&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;/div&gt;</summary>
		<author><name>Jbaczuk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Transaction&amp;diff=65578</id>
		<title>Transaction</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Transaction&amp;diff=65578"/>
		<updated>2018-07-16T16:26:15Z</updated>

		<summary type="html">&lt;p&gt;Jbaczuk: clarify that the miner of the block can but does not necessarily have to recieve the transaction fee, and that this is done by inserting it into the coinbase tx&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:TxBinaryMap.png|thumb|right|Byte-map of Transaction with each type of TxIn and TxOut]]&lt;br /&gt;
A &#039;&#039;&#039;transaction&#039;&#039;&#039; is a transfer of Bitcoin value that is broadcast to the [[network]] and collected into [[block|blocks]]. A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs. Transactions are not encrypted, so it is possible to browse and view every transaction ever collected into a block. Once transactions are buried under enough [[Confirmation|confirmations]] they can be considered [[Irreversible Transactions|irreversible]].&lt;br /&gt;
&lt;br /&gt;
Standard transaction outputs nominate [[address|addresses]], and the redemption of any future inputs requires a relevant signature.&lt;br /&gt;
&lt;br /&gt;
All transactions are visible in the [[block chain]], and can be viewed with a hex editor. A [[block chain browser]] is a site where every transaction included within the block chain can be viewed in human-readable terms.  This is useful for seeing the technical details of transactions in action and for verifying payments.&lt;br /&gt;
&lt;br /&gt;
=== General format of a Bitcoin transaction (inside a block) ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|Version no&lt;br /&gt;
|currently 1&lt;br /&gt;
|4 bytes&lt;br /&gt;
|-&lt;br /&gt;
|In-counter&lt;br /&gt;
| positive integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
| 1 - 9 bytes &lt;br /&gt;
|-&lt;br /&gt;
|list of inputs&lt;br /&gt;
|[[Transaction#general_format_.28inside_a_block.29_of_each_input_of_a_transaction_-_Txin|the first input of the first transaction is also called &amp;quot;coinbase&amp;quot; (its content was ignored in earlier versions)]]&lt;br /&gt;
|&amp;lt;in-counter&amp;gt;-many inputs&lt;br /&gt;
|-&lt;br /&gt;
|Out-counter&lt;br /&gt;
| positive integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
| 1 - 9 bytes&lt;br /&gt;
|-&lt;br /&gt;
|list of outputs&lt;br /&gt;
|[[Transaction#general_format_.28inside_a_block.29_of_each_output_of_a_transaction_-_Txout|the outputs of the first transaction spend the mined bitcoins for the block]]&lt;br /&gt;
|&amp;lt;out-counter&amp;gt;-many outputs&lt;br /&gt;
|-&lt;br /&gt;
|lock_time&lt;br /&gt;
|if non-zero and sequence numbers are &amp;lt; 0xFFFFFFFF: block height or timestamp when transaction is final&lt;br /&gt;
|4 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Principle example of a Bitcoin transaction with 1 input and 1 output only ===&lt;br /&gt;
&lt;br /&gt;
==== Data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Input:&lt;br /&gt;
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6&lt;br /&gt;
Index: 0&lt;br /&gt;
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10&lt;br /&gt;
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Value: 5000000000&lt;br /&gt;
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d&lt;br /&gt;
OP_EQUALVERIFY OP_CHECKSIG&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Explanation ====&lt;br /&gt;
&lt;br /&gt;
The input in this transaction imports 50 BTC from output #0 in transaction f5d8... Then the output sends 50 BTC to a Bitcoin address (expressed here in hexadecimal 4043... instead of the normal base58). When the recipient wants to spend this money, he will reference output #0 of this transaction in an input of his own transaction.&lt;br /&gt;
&lt;br /&gt;
===== Input =====&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;input&#039;&#039;&#039; is a reference to an output from a previous transaction. Multiple inputs are often listed in a transaction. All of the new transaction&#039;s input values (that is, the total coin value of the previous outputs referenced by the new transaction&#039;s inputs) are added up, and the total (less any transaction fee) is completely used by the outputs of the new transaction. &#039;&#039;&#039;Previous tx&#039;&#039;&#039; is a [[hash]] of a previous transaction. &#039;&#039;&#039;Index&#039;&#039;&#039; is the specific output in the referenced transaction. &#039;&#039;&#039;ScriptSig&#039;&#039;&#039; is the first half of a [[script]] (discussed in more detail later).&lt;br /&gt;
&lt;br /&gt;
The script contains two components, a signature and a public key. The public key must match the hash given in the script of the redeemed output. The public key is used to verify the redeemers signature, which is the second component. More precisely, the second component is an [[ECDSA]] signature over a hash of a simplified version of the transaction. It, combined with the public key, proves the transaction was created by the real owner of the address in question. Various flags define how the transaction is simplified and can be used to create different types of payment.&lt;br /&gt;
&lt;br /&gt;
===== Output =====&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;output&#039;&#039;&#039; contains instructions for sending bitcoins. &#039;&#039;&#039;Value&#039;&#039;&#039; is the number of Satoshi (1 BTC = 100,000,000 Satoshi) that this output will be worth when claimed. &#039;&#039;&#039;ScriptPubKey&#039;&#039;&#039; is the second half of a script (discussed later). There can be more than one output, and they share the combined value of the inputs. Because each output from one transaction can only ever be referenced once by an input of a subsequent transaction, the entire combined input value needs to be sent in an output if you don&#039;t want to lose it. If the input is worth 50 BTC but you only want to send 25 BTC, Bitcoin will create two outputs worth 25 BTC: one to the destination, and one back to you (known as &amp;quot;[[change]]&amp;quot;, though you send it to yourself). Any input bitcoins not redeemed in an output is considered a [[transaction fee]]; whoever generates the block can claim it by inserting it into the coinbase transaction of that block.&lt;br /&gt;
[[File:transaction.png|thumb|A sends 100 BTC to C and C generates 50 BTC. C sends 101 BTC to D, and he needs to send himself some change. D sends the 101 BTC to someone else, but they haven&#039;t redeemed it yet. Only D&#039;s output and C&#039;s change are capable of being spent in the current state.]]&lt;br /&gt;
&lt;br /&gt;
===== Verification =====&lt;br /&gt;
&lt;br /&gt;
To verify that inputs are authorized to collect the values of referenced outputs, Bitcoin uses a custom Forth-like [[script|scripting]] system. The input&#039;s scriptSig and the &#039;&#039;referenced&#039;&#039; output&#039;s scriptPubKey are evaluated (in that order), with scriptPubKey using the values left on the stack by scriptSig. The input is authorized if scriptPubKey returns true. Through the scripting system, the sender can create very complex conditions that people have to meet in order to claim the output&#039;s value. For example, it&#039;s possible to create an output that can be claimed by anyone without any authorization. It&#039;s also possible to require that an input be signed by ten different keys, or be redeemable with a password instead of a key.&lt;br /&gt;
&lt;br /&gt;
=== Types of Transaction ===&lt;br /&gt;
Bitcoin currently creates two different scriptSig/scriptPubKey pairs. These are described below.&lt;br /&gt;
&lt;br /&gt;
It is possible to design more complex types of transactions, and link them together into cryptographically enforced agreements. These are known as [[Contracts]].&lt;br /&gt;
&lt;br /&gt;
==== Pay-to-PubkeyHash ====&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
A Bitcoin [[address]] is only a hash, so the sender can&#039;t provide a full public key in scriptPubKey. When redeeming coins that have been sent to a Bitcoin address, the recipient provides both the signature and the public key. The script verifies that the provided public key does hash to the hash in scriptPubKey, and then it also checks the signature against the public key.&lt;br /&gt;
&lt;br /&gt;
Checking process:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is duplicated.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt;&lt;br /&gt;
|&amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Top stack item is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt; &amp;lt;pubKeyHash&amp;gt;&lt;br /&gt;
|OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Constant added.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
|OP_CHECKSIG&lt;br /&gt;
| Equality is checked between the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Pay-to-Script-Hash ====&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_HASH160 &amp;lt;scriptHash&amp;gt; OP_EQUAL &lt;br /&gt;
 scriptSig: ..signatures... &amp;lt;serialized script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 m-of-n multi-signature transaction:&lt;br /&gt;
 scriptSig: 0 &amp;lt;sig1&amp;gt; ... &amp;lt;script&amp;gt;&lt;br /&gt;
 script: OP_m &amp;lt;pubKey1&amp;gt; ... OP_n OP_CHECKMULTISIG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
P2SH addresses were created with the motivation of moving &amp;quot;the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer. They allow the sender to fund an arbitrary transaction, no matter how complicated, using a 20-byte hash&amp;quot;[https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki#motivation 1]. Pay-to-Pubkey-hash addresses are similarly a 20-byte hash of the public key. &lt;br /&gt;
&lt;br /&gt;
Pay-to-script-hash provides a means for complicated transactions, unlike the Pay-to-pubkey-hash, which has a specific definition for scriptPubKey, and scriptSig. The specification places no limitations on the script, and hence absolutely any contract can be funded using these addresses. &lt;br /&gt;
&lt;br /&gt;
The scriptPubKey in the funding transaction is script which ensures that the script supplied in the redeeming transaction hashes to the script used to create the address. &lt;br /&gt;
&lt;br /&gt;
In the scriptSig above, &#039;signatures&#039; refers to any script which is sufficient to satisfy the following serialized script. &lt;br /&gt;
&lt;br /&gt;
Checking process:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| 0 &amp;lt;sig1&amp;gt; &amp;lt;sig2&amp;gt; OP_2 &amp;lt;pubKey1&amp;gt; &amp;lt;pubKey2&amp;gt; &amp;lt;pubKey3&amp;gt; OP_3 OP_CHECKMULTISIG &lt;br /&gt;
| Only the scriptSig is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0 &amp;lt;sig1&amp;gt; &amp;lt;sig2&amp;gt; OP_2 &amp;lt;pubKey1&amp;gt; &amp;lt;pubKey2&amp;gt; &amp;lt;pubKey3&amp;gt; OP_3 &lt;br /&gt;
| OP_CHECKMULTISIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
| true&lt;br /&gt;
| Empty&lt;br /&gt;
| Signatures validated in the order of the keys in the script.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also [[BIP 0016]]&lt;br /&gt;
&lt;br /&gt;
=== Generation ===&lt;br /&gt;
&lt;br /&gt;
Generations have a single input, and this input has a &amp;quot;[[Coinbase |coinbase]]&amp;quot; parameter instead of a scriptSig. The data in &amp;quot;coinbase&amp;quot; can be anything; it isn&#039;t used. Bitcoin puts the current compact-format [[target]] and the arbitrary-precision &amp;quot;extraNonce&amp;quot; number there, which increments every time the Nonce field in the [[block_hashing_algorithm|block header]] overflows. Outputs can be anything, but Bitcoin creates one exactly like an IP address transaction.&lt;br /&gt;
The extranonce contributes to enlarge the domain for the proof of work function. Miners can easily modify nonce (4byte), timestamp and extranonce (2 to 100bytes).&lt;br /&gt;
&lt;br /&gt;
=== General format (inside a block) of each input of a transaction - Txin ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|Previous Transaction hash &lt;br /&gt;
| doubled [[Wikipedia:SHA-256|SHA256]]-[[hash|hashed]] of a (previous) to-be-used transaction&lt;br /&gt;
|32 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Previous Txout-index&lt;br /&gt;
| non negative integer indexing an output of the to-be-used transaction&lt;br /&gt;
|4 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txin-script length&lt;br /&gt;
|non negative integer [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
|1 - 9 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txin-script / scriptSig&lt;br /&gt;
|[[Script]]&lt;br /&gt;
|&amp;lt;in-script length&amp;gt;-many bytes&lt;br /&gt;
|-&lt;br /&gt;
|sequence_no&lt;br /&gt;
|normally 0xFFFFFFFF; irrelevant unless transaction&#039;s lock_time is &amp;gt; 0&lt;br /&gt;
|4 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The input sufficiently describes where and how to get the bitcoin amout to be redeemed.&lt;br /&gt;
If it is the (only) input of the first transaction of a block, it is called the generation transaction input and its content completely ignored. (Historically the Previous Transaction hash is 0 and the Previous Txout-index is -1.)&lt;br /&gt;
&lt;br /&gt;
=== General format (inside a block) of each output of a transaction - Txout ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Description&lt;br /&gt;
! Size&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|non negative integer giving the number of [[FAQ#What_do_I_call_the_various_denominations_of_bitcoins.3F|Satoshis(BTC/10^8)]] to be transfered&lt;br /&gt;
|8 bytes&lt;br /&gt;
|-&lt;br /&gt;
|Txout-script length&lt;br /&gt;
|non negative integer&lt;br /&gt;
|1 - 9 bytes [[ Protocol_specification#Variable_length_integer|VI = VarInt]]&lt;br /&gt;
|-&lt;br /&gt;
|Txout-script / scriptPubKey&lt;br /&gt;
|[[Script]]&lt;br /&gt;
|&amp;lt;out-script length&amp;gt;-many bytes&lt;br /&gt;
|}&lt;br /&gt;
The output sets the conditions to release this bitcoin amount later. The sum of the output values of the first transaction is the value of the mined bitcoins for the block plus possible transactions fees of the other transactions in the block.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Script]]&lt;br /&gt;
* [[Protocol rules#&amp;quot;tx&amp;quot; messages|Protocol rules - &amp;quot;tx&amp;quot; messages]]&lt;br /&gt;
* [[Protocol documentation#Transaction Verification|Protocol documentation - Transaction Verification]]&lt;br /&gt;
* [[Raw Transactions]]&lt;br /&gt;
* [[Coin analogy]]&lt;br /&gt;
* [[Transaction Malleability]]&lt;br /&gt;
* [[Transaction broadcasting]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Vocabulary]]&lt;br /&gt;
[[de:Transaktion]]&lt;br /&gt;
[[es:Transacción]]&lt;br /&gt;
[[pl:Transakcje]]&lt;/div&gt;</summary>
		<author><name>Jbaczuk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Nonce&amp;diff=65568</id>
		<title>Nonce</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Nonce&amp;diff=65568"/>
		<updated>2018-07-11T17:27:37Z</updated>

		<summary type="html">&lt;p&gt;Jbaczuk: changed &amp;quot;leading zeros&amp;quot; to explain how it must meet the target.  Removed confusing language mixing up the terms &amp;quot;target&amp;quot; and &amp;quot;difficulty&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;quot;nonce&amp;quot; in a bitcoin [[block]] is a 32-bit (4-byte) field whose value is adjusted by miners so that the [[hash]] of the block will be less than or equal to the current [[target]] of the network. The rest of the fields may not be changed, as they have a defined meaning.&lt;br /&gt;
&lt;br /&gt;
Any change to the block data (such as the nonce) will make the block hash completely different. Since it is [[wikipedia:Cryptographic hash function|believed infeasible]] to predict which combination of bits will result in the right hash, many different nonce values are tried, and the hash is recomputed for each value until a hash less than or equal to the current [[target]] of the network is found. The [[target]] required is also represented as the [[difficulty]], where a higher [[difficulty]] represents a lower [[target]]. As this iterative calculation requires time and resources, the presentation of the block with the correct nonce value constitutes [[proof of work]].&lt;br /&gt;
&lt;br /&gt;
== Golden Nonce ==&lt;br /&gt;
A &#039;&#039;golden nonce&#039;&#039; in Bitcoin [[mining]] is a nonce which results in a [[block hashing algorithm|hash]] value lower than the [[target]].  &lt;br /&gt;
In many practical mining applications, this is simplified to any nonce which results in a block [[block hashing algorithm|hash]] which has 32 leading zeroes&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=75609.msg837556#msg837556&amp;lt;/ref&amp;gt;, with a secondary test checking if the actual value is lower than the target difficulty.&lt;br /&gt;
&lt;br /&gt;
=== Etymology ===&lt;br /&gt;
The term &#039;&#039;golden nonce&#039;&#039; most likely evolved from the term &#039;&#039;[http://en.wikipedia.org/wiki/Charlie_and_the_Chocolate_Factory#Plot golden ticket]&#039;&#039; as used to refer to a nonce satisfying the mining requirements as early as April 8th, 2011&amp;lt;ref&amp;gt;https://github.com/progranism/Bitcoin-JavaScript-Miner/blob/master/miner.js#L5&amp;lt;/ref&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:Vocabulary]]&lt;/div&gt;</summary>
		<author><name>Jbaczuk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=List_of_address_prefixes&amp;diff=65466</id>
		<title>List of address prefixes</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=List_of_address_prefixes&amp;diff=65466"/>
		<updated>2018-06-14T20:44:35Z</updated>

		<summary type="html">&lt;p&gt;Jbaczuk: change tbc1 to tb1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Blockchain-based currencies use encoded strings, which are in a [[Base58Check encoding]] with the exception of [[Bech32]] encodings. The encoding includes a prefix (traditionally a single &#039;&#039;version byte&#039;&#039;), which affects the leading symbol(s) in the encoded result. The following is a list of some prefixes which are in use in the reference Bitcoin codebase.&amp;lt;ref&amp;gt;https://github.com/bitcoin/bitcoin/blob/0.14/src/chainparams.cpp#L129-L131&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://github.com/bitcoin/bitcoin/blob/0.14/src/chainparams.cpp#L229-L231&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://github.com/bitcoin/bitcoin/blob/0.14/src/chainparams.cpp#L325-L327&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Decimal prefix&lt;br /&gt;
!Hex&lt;br /&gt;
!Example use&lt;br /&gt;
!Leading symbol(s)&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|00&lt;br /&gt;
|Pubkey hash ([[Transaction#Pay-to-PubkeyHash|P2PKH address]])&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;tt&amp;gt;17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|05&lt;br /&gt;
|Script hash ([[Pay to script hash|P2SH address]])&lt;br /&gt;
|3&lt;br /&gt;
| &amp;lt;tt&amp;gt;3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|128&lt;br /&gt;
|80&lt;br /&gt;
|Private key ([[Wallet import format|WIF]], uncompressed pubkey)&lt;br /&gt;
|5&lt;br /&gt;
|&amp;lt;tt&amp;gt;5Hwgr3u458GLafKBgxtssHSPqJnYoGrSzgQsPwLFhLNYskDPyyA&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|128&lt;br /&gt;
|80&lt;br /&gt;
|Private key (WIF, compressed pubkey)&lt;br /&gt;
|K &#039;&#039;or&#039;&#039; L&lt;br /&gt;
|&amp;lt;tt&amp;gt;L1aW4aubDFB7yfras2S1mN3bqg9nwySY8nkoLmJebSLD5BWv3ENZ&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4 136 178 30&lt;br /&gt;
|0488B21E&lt;br /&gt;
|[[BIP 0032|BIP32]] pubkey&lt;br /&gt;
|xpub&lt;br /&gt;
|&amp;lt;tt&amp;gt;xpub661MyMwAqRbcEYS8w7XLSVeEsBXy79zSzH1J8vCdxAZningWLdN3&lt;br /&gt;
zgtU6LBpB85b3D2yc8sfvZU521AAwdZafEz7mnzBBsz4wKY5e4cp9LB&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4 136 173 228&lt;br /&gt;
|0488ADE4&lt;br /&gt;
|BIP32 private key&lt;br /&gt;
|xprv&lt;br /&gt;
|&amp;lt;tt&amp;gt;xprv9s21ZrQH143K24Mfq5zL5MhWK9hUhhGbd45hLXo2Pq2oqzMMo63o&lt;br /&gt;
StZzF93Y5wvzdUayhgkkFoicQZcP3y52uPPxFnfoLZB21Teqt1VvEHx&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|111&lt;br /&gt;
|6F&lt;br /&gt;
|Testnet pubkey hash&lt;br /&gt;
|m &#039;&#039;or&#039;&#039; n&lt;br /&gt;
|&amp;lt;tt&amp;gt;mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|196&lt;br /&gt;
|C4&lt;br /&gt;
|Testnet script hash&lt;br /&gt;
|2&lt;br /&gt;
|&amp;lt;tt&amp;gt;2MzQwSSnBHWHqSAqtTVQ6v47XtaisrJa1Vc&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|239&lt;br /&gt;
|EF&lt;br /&gt;
|Testnet Private key (WIF, uncompressed pubkey)&lt;br /&gt;
|9&lt;br /&gt;
|&amp;lt;tt&amp;gt;92Pg46rUhgTT7romnV7iGW6W1gbGdeezqdbJCzShkCsYNzyyNcc&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|239&lt;br /&gt;
|EF&lt;br /&gt;
|Testnet Private key (WIF, compressed pubkey)&lt;br /&gt;
|c&lt;br /&gt;
|&amp;lt;tt&amp;gt;cNJFgo1driFnPcBdBX8BrJrpxchBWXwXCvNH5SoSkdcF6JXXwHMm&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4 53 135 207&lt;br /&gt;
|043587CF&lt;br /&gt;
|Testnet BIP32 pubkey&lt;br /&gt;
|tpub&lt;br /&gt;
|&amp;lt;tt&amp;gt;tpubD6NzVbkrYhZ4WLczPJWReQycCJdd6YVWXubbVUFnJ5KgU5MDQrD9&lt;br /&gt;
98ZJLNGbhd2pq7ZtDiPYTfJ7iBenLVQpYgSQqPjUsQeJXH8VQ8xA67D&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4 53 131 148&lt;br /&gt;
|04358394&lt;br /&gt;
|Testnet BIP32 private key&lt;br /&gt;
|tprv&lt;br /&gt;
|&amp;lt;tt&amp;gt;tprv8ZgxMBicQKsPcsbCVeqqF1KVdH7gwDJbxbzpCxDUsoXHdb6SnTPY&lt;br /&gt;
xdwSAKDC6KKJzv7khnNWRAJQsRA8BBQyiSfYnRt6zuu4vZQGKjeW4YF&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|Bech32 pubkey hash or script hash&lt;br /&gt;
|bc1&lt;br /&gt;
|&amp;lt;tt&amp;gt;bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|Bech32 testnet pubkey hash or script hash&lt;br /&gt;
|tb1&lt;br /&gt;
|&amp;lt;tt&amp;gt;tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that private keys for compressed and uncompressed bitcoin public keys use the same version byte. The reason for the compressed form starting with a different character is because a 0x01 byte is appended to the private key before base58 encoding.&lt;br /&gt;
&lt;br /&gt;
The following table shows the leading symbol(s) and address length(s) for 160 bit hashes for each of the possible decimal version values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Decimal version&lt;br /&gt;
!Leading symbol&lt;br /&gt;
!Address length&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|up to 34&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Q-Z, a-k, m-o&lt;br /&gt;
|33&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|o-z, 2&lt;br /&gt;
|33 or 34&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|2&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|2 or 3&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|5-6&lt;br /&gt;
|3&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|3 or 4&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|4&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|4 or 5&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|10-11&lt;br /&gt;
|5&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|5 or 6&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|6&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|6 or 7&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|15-16&lt;br /&gt;
|7&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|7 or 8&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|8&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|8 or 9&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|20-21&lt;br /&gt;
|9&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|22&lt;br /&gt;
|9 or A&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|23&lt;br /&gt;
|A&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|24&lt;br /&gt;
|A or B&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|25-26&lt;br /&gt;
|B&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|27&lt;br /&gt;
|B or C&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|28&lt;br /&gt;
|C&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|29&lt;br /&gt;
|C or D&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|30-31&lt;br /&gt;
|D&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|32&lt;br /&gt;
|D or E&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|33&lt;br /&gt;
|E&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|34&lt;br /&gt;
|E or F&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|35-36&lt;br /&gt;
|F&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|37&lt;br /&gt;
|F or G&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|38&lt;br /&gt;
|G&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|39&lt;br /&gt;
|G or H&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|40-41&lt;br /&gt;
|H&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|42&lt;br /&gt;
|H or J&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|43&lt;br /&gt;
|J&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|44&lt;br /&gt;
|J or K&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|45-46&lt;br /&gt;
|K&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|47&lt;br /&gt;
|K or L&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|48&lt;br /&gt;
|L&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|49&lt;br /&gt;
|L or M&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|50-51&lt;br /&gt;
|M&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|52&lt;br /&gt;
|M or N&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|53&lt;br /&gt;
|N&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|54&lt;br /&gt;
|N or P&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|55-56&lt;br /&gt;
|P&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|57&lt;br /&gt;
|P or Q&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|58&lt;br /&gt;
|Q&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|59&lt;br /&gt;
|Q or R&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|60-61&lt;br /&gt;
|R&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|62&lt;br /&gt;
|R or S&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|63&lt;br /&gt;
|S&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|64&lt;br /&gt;
|S or T&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|65-66&lt;br /&gt;
|T&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|67&lt;br /&gt;
|T or U&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|68&lt;br /&gt;
|U&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|69&lt;br /&gt;
|U or V&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|70-71&lt;br /&gt;
|V&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|72&lt;br /&gt;
|V or W&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|73&lt;br /&gt;
|W&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|74&lt;br /&gt;
|W or X&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|75-76&lt;br /&gt;
|X&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|77&lt;br /&gt;
|X or Y&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|78&lt;br /&gt;
|Y&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|79&lt;br /&gt;
|Y or Z&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|80-81&lt;br /&gt;
|Z&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|82&lt;br /&gt;
|Z or a&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|83&lt;br /&gt;
|a&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|84&lt;br /&gt;
|a or b&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|85&lt;br /&gt;
|b&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|86&lt;br /&gt;
|b or c&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|87-88&lt;br /&gt;
|c&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|89&lt;br /&gt;
|c or d&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|90&lt;br /&gt;
|d&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|91&lt;br /&gt;
|d or e&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|92-93&lt;br /&gt;
|e&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|94&lt;br /&gt;
|e or f&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|95&lt;br /&gt;
|f&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|96&lt;br /&gt;
|f or g&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|97-98&lt;br /&gt;
|g&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|99&lt;br /&gt;
|g or h&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|100&lt;br /&gt;
|h&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|101&lt;br /&gt;
|h or i&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|102-103&lt;br /&gt;
|i&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|104&lt;br /&gt;
|i or j&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|105&lt;br /&gt;
|j&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|106&lt;br /&gt;
|j or k&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|107-108&lt;br /&gt;
|k&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|109&lt;br /&gt;
|k or m&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|110&lt;br /&gt;
|m&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|111&lt;br /&gt;
|m or n&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|112-113&lt;br /&gt;
|n&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|114&lt;br /&gt;
|n or o&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|115&lt;br /&gt;
|o&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|116&lt;br /&gt;
|o or p&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|117-118&lt;br /&gt;
|p&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|119&lt;br /&gt;
|p or q&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|120&lt;br /&gt;
|q&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|121&lt;br /&gt;
|q or r&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|122-123&lt;br /&gt;
|r&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|124&lt;br /&gt;
|r or s&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|125&lt;br /&gt;
|s&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|126&lt;br /&gt;
|s or t&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|127-128&lt;br /&gt;
|t&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|129&lt;br /&gt;
|t or u&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|130&lt;br /&gt;
|u&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|131&lt;br /&gt;
|u or v&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|132-133&lt;br /&gt;
|v&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|134&lt;br /&gt;
|v or w&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|135&lt;br /&gt;
|w&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|136&lt;br /&gt;
|w or x&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|137-138&lt;br /&gt;
|x&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|139&lt;br /&gt;
|x or y&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|140&lt;br /&gt;
|y&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|141&lt;br /&gt;
|y or z&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|142-143&lt;br /&gt;
|z&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|144&lt;br /&gt;
|z or 2&lt;br /&gt;
|34 or 35&lt;br /&gt;
|-&lt;br /&gt;
|145-255&lt;br /&gt;
|2&lt;br /&gt;
|35&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Bitcoin Core documentation}}&lt;/div&gt;</summary>
		<author><name>Jbaczuk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Technical_background_of_version_1_Bitcoin_addresses&amp;diff=65442</id>
		<title>Technical background of version 1 Bitcoin addresses</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Technical_background_of_version_1_Bitcoin_addresses&amp;diff=65442"/>
		<updated>2018-06-06T05:36:03Z</updated>

		<summary type="html">&lt;p&gt;Jbaczuk: /* How to create Bitcoin Address */ Finished adding examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:PubKeyToAddr.png|thumb|right|Conversion from ECDSA public key to Bitcoin Address]]&lt;br /&gt;
This article may be too technical for some users. The more basic article on [[Address|Bitcoin Addresses]] may be more appropriate.&lt;br /&gt;
&lt;br /&gt;
A [[Bitcoin address]] is a 160-bit hash of the public portion of a public/private [[Wikipedia:Elliptic_Curve_DSA|ECDSA]] keypair. Using [[Wikipedia:Public-key_cryptography|public-key cryptography]], you can &amp;quot;sign&amp;quot; data with your [[private key]] and anyone who knows your public key can verify that the signature is valid.&lt;br /&gt;
&lt;br /&gt;
A new keypair is generated for each receiving address (with newer [[Deterministic wallet | HD wallets]], this is done deterministically).&lt;br /&gt;
The public key and their associated private keys (or the seed needed to generate them) are stored in the [[wallet]] data file.&lt;br /&gt;
This is the only file users should need to [[backup|backup]].&lt;br /&gt;
A &amp;quot;send&amp;quot; transaction to a specific Bitcoin address requires that the corresponding wallet knows the private key implementing it.&lt;br /&gt;
This has the implication that if you create an address and receive coins to that address, then restore the wallet from an earlier backup, before the address was generated, then the coins received with that address are lost; this is not an issue for HD wallets where all addresses are generated from a single seed.&lt;br /&gt;
Addresses are added to an address [[key pool]] prior to being used for receiving coins. If you lose your wallet entirely, all of your coins are lost and can never be recovered.&lt;br /&gt;
&lt;br /&gt;
Bitcoin allows you to create as many addresses as you want, and use a new one for every transaction.&lt;br /&gt;
There is no &amp;quot;master address&amp;quot;: the &amp;quot;Your Bitcoin address&amp;quot; area in some wallet UIs has no special importance.&lt;br /&gt;
It&#039;s only there for your convenience, and it should change automatically when used.&lt;br /&gt;
&lt;br /&gt;
Bitcoin addresses contain a built-in check code, so it&#039;s generally not possible to send Bitcoins to a mistyped address. However, if the address is well-formed but no one owns it (or the owner lost their wallet.dat), any coins sent to that address will be lost forever.&lt;br /&gt;
&lt;br /&gt;
Hash values and the checksum data are converted to an alpha-numeric representation using a custom scheme: the [[Base58Check encoding]] scheme. Under Base58Check, addresses can contain all alphanumeric characters except 0, O, I, and l. Normal addresses currently always start with 1 (addresses from script hashes use 3), though this might change in a future version. Testnet addresses usually start with &#039;&#039;m&#039;&#039; or &#039;&#039;n&#039;&#039;. Mainline addresses can be 25-34 characters in length, and testnet addresses can be 26-34 characters in length. Most addresses are 33 or 34 characters long.&lt;br /&gt;
&lt;br /&gt;
== Collisions (lack thereof) ==&lt;br /&gt;
Since Bitcoin addresses are basically random numbers, it is possible, although extremely unlikely, for two people to independently generate the same address. This is called a [[Wikipedia:Collision_(computer_science)|collision]]. If this happens, then  both the original owner of the address and the colliding owner could spend money sent to that address. It would not be possible for the colliding person to spend the original owner&#039;s entire wallet (or vice versa). If you were to intentionally try to make a collision, it would currently take 2^107 times longer to generate a colliding Bitcoin address than to generate a block. As long as the signing and hashing algorithms remain cryptographically strong, it will likely always be more profitable to collect generations and [[transaction fee|transaction fees]] than to try to create collisions, as demonstrated by projects like the [https://lbc.cryptoguru.org/ Large Bitcoin Collider] which attempt to generate address collisions.&lt;br /&gt;
&lt;br /&gt;
It is more likely that the Earth is destroyed in the next 5 seconds, than that a collision occur in the next millenium.&lt;br /&gt;
&lt;br /&gt;
==How to create Bitcoin Address==&lt;br /&gt;
0 - Having a private [[ECDSA]] key&lt;br /&gt;
    18e14a7b6a307f426a94f8114701e7c8e774e7f9a47e2c2035db29a206321725&lt;br /&gt;
1 - Take the corresponding public key generated with it (33 bytes, 1 byte 0x02 (y-coord is even), and 32 bytes corresponding to X coordinate)&lt;br /&gt;
    0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352&lt;br /&gt;
2 - Perform [[SHA-256]] hashing on the public key&lt;br /&gt;
    0b7c28c9b7290c98d7438e70b3d3f7c848fbd7d1dc194ff83f4f7cc9b1378e98&lt;br /&gt;
3 - Perform [[RIPEMD-160]] hashing on the result of SHA-256&lt;br /&gt;
    f54a5851e9372b87810a8e60cdd2e7cfd80b6e31&lt;br /&gt;
4 - Add version byte in front of RIPEMD-160 hash (0x00 for Main Network)&lt;br /&gt;
    00f54a5851e9372b87810a8e60cdd2e7cfd80b6e31&lt;br /&gt;
&#039;&#039;(note that below steps are the [[Base58Check encoding]], which has multiple library options available implementing it)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
5 - Perform SHA-256 hash on the extended RIPEMD-160 result&lt;br /&gt;
    ad3c854da227c7e99c4abfad4ea41d71311160df2e415e713318c70d67c6b41c&lt;br /&gt;
6 - Perform SHA-256 hash on the result of the previous SHA-256 hash&lt;br /&gt;
    c7f18fe8fcbed6396741e58ad259b5cb16b7fd7f041904147ba1dcffabf747fd&lt;br /&gt;
7 - Take the first 4 bytes of the second SHA-256 hash. This is the address checksum&lt;br /&gt;
    c7f18fe8&lt;br /&gt;
8 - Add the 4 checksum bytes from stage 7 at the end of extended RIPEMD-160 hash from stage 4. This is the 25-byte binary Bitcoin Address.&lt;br /&gt;
    00f54a5851e9372b87810a8e60cdd2e7cfd80b6e31c7f18fe8&lt;br /&gt;
9 - Convert the result from a byte string into a base58 string using [[Base58Check encoding]]. This is the most commonly used Bitcoin Address format&lt;br /&gt;
    1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Address]]&lt;br /&gt;
* [[Base58Check encoding]]&lt;br /&gt;
* [http://gobittest.appspot.com/Address Address testing suite]&lt;br /&gt;
* [http://lenschulwitz.com/base58 Online Address Validator and Base58 Encoder/Decoder]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
&lt;br /&gt;
{{Bitcoin Core documentation}}&lt;/div&gt;</summary>
		<author><name>Jbaczuk</name></author>
	</entry>
</feed>