<?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=Friend</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=Friend"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Friend"/>
	<updated>2026-05-01T20:00:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Invoice_address&amp;diff=55880</id>
		<title>Invoice address</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Invoice_address&amp;diff=55880"/>
		<updated>2015-04-02T05:05:14Z</updated>

		<summary type="html">&lt;p&gt;Friend: Noted Rosetta Code and online tool for address validation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;Bitcoin address&#039;&#039;&#039;, or simply &#039;&#039;&#039;address&#039;&#039;&#039;, is an identifier of 26-35 alphanumeric characters, beginning with the number 1 or 3, that represents a possible destination for a Bitcoin payment.&lt;br /&gt;
Addresses can be generated at no cost by any user of Bitcoin.&lt;br /&gt;
For example, using [[Bitcoin-Qt]], one can click &amp;quot;New Address&amp;quot; and be assigned an address.&lt;br /&gt;
It is also possible to get a Bitcoin address using an account at an exchange or online wallet service.&lt;br /&gt;
&lt;br /&gt;
An example of a Bitcoin address is &amp;lt;code&amp;gt;3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy&amp;lt;/code&amp;gt;&amp;lt;!-- anyone-can-spend, null script --&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==A Bitcoin address is a single-use token==&lt;br /&gt;
Like e-mail addresses, you can send bitcoins to a person by sending bitcoins to one of their addresses.&lt;br /&gt;
However, &#039;&#039;unlike&#039;&#039; e-mail addresses, people have many different Bitcoin addresses and a unique address should be used for each transaction.&lt;br /&gt;
Most Bitcoin software and websites will help with this by generating a brand new address each time you create an invoice or payment request.&lt;br /&gt;
&lt;br /&gt;
==Addresses can be created offline==&lt;br /&gt;
Creating addresses can be done without an Internet connection and does not require any contact or registration with the Bitcoin network.&lt;br /&gt;
It is possible to create large batches of addresses offline using freely available software tools.&lt;br /&gt;
Generating batches of addresses is useful in several scenarios, such as e-commerce websites where a unique pre-generated address is dispensed to each customer who chooses a &amp;quot;pay with Bitcoin&amp;quot; option.&lt;br /&gt;
Newer [[Deterministic wallet | &amp;quot;HD wallets&amp;quot;]] can generate a &amp;quot;seed&amp;quot; token which can be used to allow untrusted systems (such as webservers) to generate an unlimited number of addresses without the ability to spend the bitcoins received.&lt;br /&gt;
&lt;br /&gt;
==Addresses are case sensitive and exact==&lt;br /&gt;
Bitcoin addresses are case-sensitive.  Bitcoin addresses should be copied and pasted using the computer&#039;s clipboard wherever possible. If you hand-key a Bitcoin address, and each character is not transcribed exactly - including capitalization - the incorrect address will most likely be rejected by the Bitcoin software.  You will have to check your entry and try again.&lt;br /&gt;
&lt;br /&gt;
The probability that a mistyped address is accepted as being valid is 1 in 2&amp;lt;sup&amp;gt;32&amp;lt;/sup&amp;gt;, that is, approximately 1 in 4.29 billion.&lt;br /&gt;
&lt;br /&gt;
==Proving you receive with an address==&lt;br /&gt;
Most Bitcoin wallets have a function to &amp;quot;sign&amp;quot; a message, proving the entity receiving funds with an address has agreed to the message.&lt;br /&gt;
This can be used to, for example, finalise a contract in a cryptographically provable way prior to making payment for it.&lt;br /&gt;
&lt;br /&gt;
Some services will also piggy-back on this capability by dedicating a specific address for authentication only, in which case the address should never be used for actual Bitcoin transactions.&lt;br /&gt;
When you login to or use their service, you will provide a signature proving you are the same person with the pre-negotiated address.&lt;br /&gt;
&lt;br /&gt;
It is important to note that these signatures only prove one receives with an address.&lt;br /&gt;
Since Bitcoin transactions do not have a &amp;quot;from&amp;quot; address, you cannot prove you are the &#039;&#039;sender&#039;&#039; of funds.&lt;br /&gt;
&lt;br /&gt;
Current standards for message signatures are only compatible with &amp;quot;version zero&amp;quot; bitcoin addresses (that begin with the number 1).&lt;br /&gt;
&lt;br /&gt;
==Address validation==&lt;br /&gt;
If you would like to validate a Bitcoin address in an application, it is advisable to use a method from [https://bitcointalk.org/index.php?topic=1026.0 this thread] rather than to just check for string length, allowed characters, or that the address starts with a 1 or 3.  Validation may also be done using open source code available in [http://rosettacode.org/wiki/Bitcoin/address_validation various languages] or with an [http://lenschulwitz.com/base58 online validating tool]. &lt;br /&gt;
&lt;br /&gt;
==[[Multisignature|Multi-signature]] addresses==&lt;br /&gt;
Addresses can be created that require a combination of multiple private keys.&lt;br /&gt;
Since these take advantage of newer features, they begin with the newer prefix of 3 instead of the older 1.&lt;br /&gt;
These can be thought of as the equivalent of writing a check to two parties - &amp;quot;pay to the order of somebody AND somebody else&amp;quot; - where both parties must endorse the check in order to receive the funds.&lt;br /&gt;
&lt;br /&gt;
The actual requirement (number of private keys needed, their corresponding public keys, etc.) that must be satisfied to spend the funds is decided in advance by the person generating this type of address, and once an address is created, the requirement cannot be changed without generating a new address.&lt;br /&gt;
&lt;br /&gt;
==What&#039;s in an address==&lt;br /&gt;
Most Bitcoin addresses are 34 characters.&lt;br /&gt;
They consist of random digits and uppercase and lowercase letters, with the exception that the uppercase letter &amp;quot;O&amp;quot;, uppercase letter &amp;quot;I&amp;quot;, lowercase letter &amp;quot;l&amp;quot;, and the number &amp;quot;0&amp;quot; are never used to prevent visual ambiguity.&lt;br /&gt;
&lt;br /&gt;
Some Bitcoin addresses can be shorter than 34 characters (as few as 26) and still be valid.&lt;br /&gt;
A significant percentage of Bitcoin addresses are only 33 characters, and some addresses may be even shorter.&lt;br /&gt;
Every Bitcoin address stands for a number.&lt;br /&gt;
These shorter addresses are valid simply because they stand for numbers that happen to start with zeroes, and when the zeroes are omitted, the encoded address gets shorter.&lt;br /&gt;
&lt;br /&gt;
Several of the characters inside a Bitcoin address are used as a checksum so that typographical errors can be automatically found and rejected.&lt;br /&gt;
The checksum also allows Bitcoin software to confirm that a 33-character (or shorter) address is in fact valid and isn&#039;t simply an address with a missing character.&lt;br /&gt;
&lt;br /&gt;
==Testnet==&lt;br /&gt;
Addresses on the Bitcoin Testnet are generated with a different address version, which results in a different prefix.&lt;br /&gt;
See [[List of address prefixes]] and [[Testnet]] for more details.&lt;br /&gt;
&lt;br /&gt;
==Misconceptions==&lt;br /&gt;
===Address reuse===&lt;br /&gt;
&lt;br /&gt;
Addresses are not intended to be used more than once, and doing so has numerous problems associated.&lt;br /&gt;
See the dedicated article on [[address reuse]] for more details.&lt;br /&gt;
&lt;br /&gt;
===Address balances===&lt;br /&gt;
&lt;br /&gt;
Addresses are not wallets nor accounts, and do not carry balances.&lt;br /&gt;
They only receive funds, and you do not send &amp;quot;from&amp;quot; an address at any time.&lt;br /&gt;
Various confusing services and software display &#039;&#039;bitcoins received with an address, minus bitcoins sent in random unrelated transactions&#039;&#039; as an &amp;quot;address balance&amp;quot;, but this number is not meaningful: it does not infer the recipient of the bitcoins sent to the address has spent them, nor that they still have the bitcoins received.&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;From&amp;quot; addresses===&lt;br /&gt;
Bitcoin transactions do not have any kind of origin-, source- or &amp;quot;from&amp;quot; address. See the dedicated article on &amp;quot;[[From address|from address]]&amp;quot; for more details.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Technical background of Bitcoin addresses]]&lt;br /&gt;
* [[List of address prefixes]]&lt;br /&gt;
* [[Exit Address]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Vocabulary]]&lt;br /&gt;
&lt;br /&gt;
[[es:Dirección]]&lt;br /&gt;
[[de:Adresse]]&lt;/div&gt;</summary>
		<author><name>Friend</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Mini_private_key_format&amp;diff=55879</id>
		<title>Mini private key format</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Mini_private_key_format&amp;diff=55879"/>
		<updated>2015-04-02T04:49:30Z</updated>

		<summary type="html">&lt;p&gt;Friend: No more Mt. Gox.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:QR-privkeys-sidebyside.png|thumb|right|QR codes of the same private key, in mini versus regular private key format.  Both codes have the same dot density and error correction level, but the mini key is 57% of the full code&#039;s size.]]&lt;br /&gt;
The &#039;&#039;&#039;mini private key format&#039;&#039;&#039; is a method of encoding a Bitcoin private key in as few as 30 characters so that it can be embedded in a small space.  This private key format was first used in Casascius physical bitcoins, and is also favorable for use in QR codes.  The fewer characters encoded in a QR code, the lower dot density can be used, as well as more dots allocated to error correction in the same space, significantly improving readability and resistance to damage.  The mini private key format offers its own built-in check code as a small margin of protection against typos.&lt;br /&gt;
&lt;br /&gt;
An example key using this encoding is &#039;&#039;&#039;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Usage on a physical bitcoin==&lt;br /&gt;
The way it might appear within a physical bitcoin is on a round card printed as follows:&lt;br /&gt;
&lt;br /&gt;
Side of discs showing mini private key: (from [[Casascius physical bitcoins]])&amp;lt;br/&amp;gt;&lt;br /&gt;
[[Image:Miniprivkeys.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Side of discs showing prefix of bitcoin address (printed on the opposite side):&amp;lt;br/&amp;gt;&lt;br /&gt;
[[Image:Minipubkeys.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
The examples in this article use the private key and Bitcoin address of the leftmost circle in the above two photos.&lt;br /&gt;
&lt;br /&gt;
==Usage in bar codes==&lt;br /&gt;
The mini private key is suitable for use in QR codes.  The recommended settings for maximizing readability are: QR version 3, error correction level Q (near highest, 25% possible lost codeword recovery).  This results in a 29x29 grid.  A minikey QR code can also fit in a 25x25 grid with QR version 2, error correction level L (lowest, 7% possible lost codeword recovery).&lt;br /&gt;
&lt;br /&gt;
The sample private minikey encoded as a QR code on a 29x29 grid looks like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Private_minikey_in_2D_barcode.gif]]&lt;br /&gt;
&lt;br /&gt;
The mini private key is small enough to fit in a one-dimensional barcode while still remaining practical.  Among the most popular one-dimensional barcode symbologies, the one known as &amp;quot;Code 128&amp;quot; is best suited for encoding a minikey due to its favorable data density and support for mixed case strings.  The variant known as &amp;quot;Code 128-B&amp;quot; produces the shortest code for strings containing lowercase characters.&lt;br /&gt;
&lt;br /&gt;
The sample private minikey encoded with Code 128-B looks like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Private_minikey_in_1D_barcode.gif]]&lt;br /&gt;
&lt;br /&gt;
==Import==&lt;br /&gt;
Mini private keys can be imported through the following clients/services:&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
* [[Armory]]&lt;br /&gt;
&lt;br /&gt;
The current mainline (&amp;quot;Satoshi&amp;quot;) client cannot currently be used to import minikeys.&lt;br /&gt;
&lt;br /&gt;
===Web===&lt;br /&gt;
&lt;br /&gt;
* [[BlockChain.info]]&lt;br /&gt;
** Private keys can be imported into a Blockchain.info wallet and bitcoins can be sent to another address immediately upon import without needing to wait for any confirmations.  Even after import, funds remain associated with the private key until they are actually spent to a different address.&lt;br /&gt;
* [[StrongCoin]]&lt;br /&gt;
&lt;br /&gt;
==Decoding==&lt;br /&gt;
The private key encoding consists of 30 alphanumeric characters from the [[base58]] alphabet used in Bitcoin.  The first of the characters is always the uppercase letter S.&lt;br /&gt;
&lt;br /&gt;
To determine whether the minikey is valid:&lt;br /&gt;
&lt;br /&gt;
# Add a question mark to the end of the mini private key string.&lt;br /&gt;
# Take the SHA256 hash of the entire string.  However, we will only look at the first byte of the result.&lt;br /&gt;
# If the first byte is 00, the string is a well-formed minikey.  If the first byte is not 00, the string should be rejected as a minikey.&lt;br /&gt;
&lt;br /&gt;
===Example with SHA256===&lt;br /&gt;
Here is an example with the sample private key &amp;lt;tt&amp;gt;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The string &amp;quot;&amp;lt;tt&amp;gt;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy?&amp;lt;/tt&amp;gt;&amp;quot; has a SHA256 value that begins with 00, so it is well-formed.&lt;br /&gt;
&lt;br /&gt;
To obtain the full 256-bit private key, simply take the SHA256 hash of the entire string.  There is no encoding for line breaks in the string, even if the key is broken into multiple lines for printing.  The SHA256 should be taken of exactly thirty bytes.&lt;br /&gt;
&lt;br /&gt;
 SHA256(&amp;quot;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy&amp;quot;) = 4C7A9640C72DC2099F23715D0C8A0D8A35F8906E3CAB61DD3F78B67BF887C9AB  &lt;br /&gt;
&lt;br /&gt;
This sample key in [[wallet export format]] is &amp;lt;tt&amp;gt;5JPy8Zg7z4P7RSLsiqcqyeAF1935zjNUdMxcDeVrtU1oarrgnB7&amp;lt;/tt&amp;gt;, and the corresponding [[Bitcoin address]] is &amp;lt;tt&amp;gt;1CciesT23BNionJeXrbxmjc7ywfiyM4oLW&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Command line verification ====&lt;br /&gt;
To calculate SHA256 from the command line on OSX or Linux devices:&lt;br /&gt;
&lt;br /&gt;
 echo -n &amp;quot;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy?&amp;quot; | shasum -a 256&lt;br /&gt;
&lt;br /&gt;
That should output a line of text like &amp;quot;&amp;lt;tt&amp;gt;000f2453798ad4f951eecced2242eaef3e1cbc8a7c813c203ac7ffe57060355d  -&amp;lt;/tt&amp;gt;&amp;quot;. Since the first two characters are &amp;lt;tt&amp;gt;00&amp;lt;/tt&amp;gt; the verification passes for the mini key &amp;lt;tt&amp;gt;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Check code==&lt;br /&gt;
The mini private key format offers a simple typo check code.  Mini private keys must be generated in a &amp;quot;brute force&amp;quot; fashion, keeping only keys that conform to the format&#039;s rules.  If a key is well-formed (30 Base58 characters starting with S), but fails the hash check, then it probably contains a typo.&lt;br /&gt;
&lt;br /&gt;
If the SHA256 hash of the string followed by &#039;?&#039; doesn&#039;t result in something that begins with 0x00, the string is not a valid mini private key.&lt;br /&gt;
&lt;br /&gt;
==Creating mini private keys==&lt;br /&gt;
Creating mini private keys is relatively simple.  One program which can create such keys is [[Casascius Bitcoin Utility]].&lt;br /&gt;
&lt;br /&gt;
Mini private keys must be created &amp;quot;from scratch&amp;quot;, as the conversion from mini private key to full-size private key is one-way.  In other words, there is no way to convert an existing full-size private key into a mini private key.&lt;br /&gt;
&lt;br /&gt;
To create mini private keys, simply create random strings that satisfy the well-formedness requirement, and then eliminate the ones that do not pass the typo check.  (This means eliminating more than 99% of the candidates.)  Then use the appropriate algorithm to compute the corresponding private key, and in turn, the matching Bitcoin address.  The Bitcoin address can always be computed from just the private key.&lt;br /&gt;
&lt;br /&gt;
It is strongly advisable to avoid using the digit &amp;quot;1&amp;quot; in minikeys unless it is being printed in such a way where a user is unlikely to mistake it for the lowercase letter &amp;quot;l&amp;quot;.  Few clients and redemption tools are prepared to tell the user that their entry containing the letter &amp;quot;l&amp;quot; should actually be the number &amp;quot;1&amp;quot; - rather, they will simply reject the code and may leave the user confused.&lt;br /&gt;
&lt;br /&gt;
In all cases, you &#039;&#039;&#039;must&#039;&#039;&#039; use a secure cryptographic random number generator to eliminate risks of predictability of the random strings.&lt;br /&gt;
&lt;br /&gt;
==Casascius Series 1 coins==&lt;br /&gt;
&lt;br /&gt;
Casascius Series 1 Physical Bitcoins use a 22-character variant of the minikey format, instead of 30 characters.  Everything is the same other than the length.  To properly implement minikey redemption, services and clients MUST support the 30-character format, but MAY support the 22-character format as well.  Use of the 22-character format for future applications is discouraged due to security considerations.&lt;br /&gt;
&lt;br /&gt;
==Python Code==&lt;br /&gt;
The following code produces sample 30-character SHA256-based mini private keys in Python.  For real-world use, &#039;&#039;random&#039;&#039; must be replaced with a better source of entropy, as the Python documentation for &#039;&#039;random&#039;&#039; states the function &#039;&#039;&amp;quot;is completely unsuitable for cryptographic purposes&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import random&lt;br /&gt;
import hashlib&lt;br /&gt;
&lt;br /&gt;
BASE58 = &#039;23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz&#039;&lt;br /&gt;
&lt;br /&gt;
def Candidate():&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Generate a random, well-formed mini private key.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return(&#039;%s%s&#039; % (&#039;S&#039;, &#039;&#039;.join(&lt;br /&gt;
        [BASE58[ random.randrange(0,len(BASE58)) ] for i in range(29)])))&lt;br /&gt;
&lt;br /&gt;
def GenerateKeys(numKeys = 10):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Generate mini private keys and output the mini key as well as the full&lt;br /&gt;
    private key. numKeys is The number of keys to generate, and &lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    keysGenerated = 0&lt;br /&gt;
    totalCandidates = 0&lt;br /&gt;
    while keysGenerated &amp;lt; numKeys:&lt;br /&gt;
        try:&lt;br /&gt;
            cand = Candidate()&lt;br /&gt;
            # Do typo check&lt;br /&gt;
            t = &#039;%s?&#039; % cand&lt;br /&gt;
            # Take one round of SHA256&lt;br /&gt;
            candHash = hashlib.sha256(t).digest()&lt;br /&gt;
            # Check if the first eight bits of the hash are 0&lt;br /&gt;
            if candHash[0] == &#039;\x00&#039;:&lt;br /&gt;
                privateKey = GetPrivateKey(cand)&lt;br /&gt;
                print(&#039;\n%s\nSHA256( ): %s\nsha256(?): %s&#039; %&lt;br /&gt;
                      (cand, privateKey, candHash.encode(&#039;hex_codec&#039;)))&lt;br /&gt;
                if CheckShortKey(cand):&lt;br /&gt;
                    print(&#039;Validated.&#039;)&lt;br /&gt;
                else:&lt;br /&gt;
                    print(&#039;Invalid!&#039;)&lt;br /&gt;
                keysGenerated += 1&lt;br /&gt;
            totalCandidates += 1&lt;br /&gt;
        except KeyboardInterrupt:&lt;br /&gt;
            break&lt;br /&gt;
    print(&#039;\n%s: %i\n%s: %i\n%s: %.1f&#039; %&lt;br /&gt;
          (&#039;Keys Generated&#039;, keysGenerated,&lt;br /&gt;
           &#039;Total Candidates&#039;, totalCandidates,&lt;br /&gt;
           &#039;Reject Percentage&#039;,&lt;br /&gt;
           100*(1.0-keysGenerated/float(totalCandidates))))&lt;br /&gt;
&lt;br /&gt;
def GetPrivateKey(shortKey):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Returns the hexadecimal representation of the private key corresponding&lt;br /&gt;
    to the given short key.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    if CheckShortKey(shortKey):&lt;br /&gt;
        return hashlib.sha256(shortKey).hexdigest()&lt;br /&gt;
    else:&lt;br /&gt;
        print(&#039;Typo detected in private key!&#039;)&lt;br /&gt;
        return None&lt;br /&gt;
&lt;br /&gt;
def CheckShortKey(shortKey):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Checks for typos in the short key.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    if len(shortKey) != 30:&lt;br /&gt;
        return False&lt;br /&gt;
    t = &#039;%s?&#039; % shortKey&lt;br /&gt;
    tHash = hashlib.sha256(t).digest()&lt;br /&gt;
    # Check to see that first byte is \x00&lt;br /&gt;
    if tHash[0] == &#039;\x00&#039;:&lt;br /&gt;
        return True&lt;br /&gt;
    return False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Friend</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Technical_background_of_version_1_Bitcoin_addresses&amp;diff=51121</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=51121"/>
		<updated>2014-09-15T19:16:17Z</updated>

		<summary type="html">&lt;p&gt;Friend: Added link to online address validator and Base58 decode/encode.&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 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.&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 (65 bytes, 1 byte 0x04, 32 bytes corresponding to X coordinate, 32 bytes corresponding to Y coordinate)&lt;br /&gt;
    0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6&lt;br /&gt;
2 - Perform SHA-256 hashing on the public key&lt;br /&gt;
    600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408&lt;br /&gt;
3 - Perform RIPEMD-160 hashing on the result of SHA-256&lt;br /&gt;
    010966776006953D5567439E5E39F86A0D273BEE&lt;br /&gt;
4 - Add version byte in front of RIPEMD-160 hash (0x00 for Main Network)&lt;br /&gt;
    00010966776006953D5567439E5E39F86A0D273BEE&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;
    445C7A8007A93D8733188288BB320A8FE2DEBD2AE1B47F0F50BC10BAE845C094&lt;br /&gt;
6 - Perform SHA-256 hash on the result of the previous SHA-256 hash&lt;br /&gt;
    D61967F63C7DD183914A4AE452C9F6AD5D462CE3D277798075B107615C1A8A30&lt;br /&gt;
7 - Take the first 4 bytes of the second SHA-256 hash. This is the address checksum&lt;br /&gt;
    D61967F6&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;
    00010966776006953D5567439E5E39F86A0D273BEED61967F6&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;
    16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM&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;/div&gt;</summary>
		<author><name>Friend</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Base58Check_encoding&amp;diff=51120</id>
		<title>Base58Check encoding</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Base58Check_encoding&amp;diff=51120"/>
		<updated>2014-09-15T19:09:21Z</updated>

		<summary type="html">&lt;p&gt;Friend: Added link to Base58 Encode/Decode online tool and Perl code.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A modified Base 58 [http://en.wikipedia.org/wiki/Binary-to-text_encoding binary-to-text encoding] known as &#039;&#039;&#039;Base58Check&#039;&#039;&#039; is used for encoding [[Bitcoin address|Bitcoin addresses]].&lt;br /&gt;
&lt;br /&gt;
More generically, Base58Check encoding is used for encoding byte arrays in Bitcoin into human-typable strings.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
The original Bitcoin client source code explains the reasoning behind base58 encoding:&lt;br /&gt;
&lt;br /&gt;
base58.h:&lt;br /&gt;
 // Why base-58 instead of standard base-64 encoding?&lt;br /&gt;
 // - Don&#039;t want 0OIl characters that look the same in some fonts and&lt;br /&gt;
 //      could be used to create visually identical looking account numbers.&lt;br /&gt;
 // - A string with non-alphanumeric characters is not as easily accepted as an account number.&lt;br /&gt;
 // - E-mail usually won&#039;t line-break if there&#039;s no punctuation to break at.&lt;br /&gt;
 // - Doubleclicking selects the whole number as one word if it&#039;s all alphanumeric.&lt;br /&gt;
&lt;br /&gt;
==Features of Base58Check==&lt;br /&gt;
Base58Check has the following features:&lt;br /&gt;
* An arbitrarily sized payload.&lt;br /&gt;
* A set of 58 alphanumeric symbols consisting of easily distinguished uppercase and lowercase letters (0OIl are not used) &lt;br /&gt;
* One byte of version/application information.  Bitcoin addresses use 0x00 for this byte (future ones may use 0x05).&lt;br /&gt;
* Four bytes (32 bits) of SHA256-based error checking code.  This code can be used to automatically detect and possibly correct typographical errors.&lt;br /&gt;
* An extra step for preservation of leading zeroes in the data.&lt;br /&gt;
&lt;br /&gt;
==Creating a Base58Check string==&lt;br /&gt;
A Base58Check string is created from a version/application byte and payload as follows.&lt;br /&gt;
# Take the version byte and payload bytes, and concatenate them together (bytewise).&lt;br /&gt;
# Take the first four bytes of SHA256(SHA256(results of step 1))&lt;br /&gt;
# Concatenate the results of step 1 and the results of step 2 together (bytewise).&lt;br /&gt;
# Treating the results of step 3 - a series of bytes - as a single big-endian bignumber, convert to base-58 using normal mathematical steps (bignumber division) and the base-58 alphabet described below.  The result should be normalized to not have any leading base-58 zeroes (character &#039;1&#039;).&lt;br /&gt;
# The leading character &#039;1&#039;, which has a value of zero in base58, is reserved for representing an entire leading zero &#039;&#039;&#039;byte&#039;&#039;&#039;, as when it is in a leading position, has no value as a base-58 symbol.  There can be one or more leading &#039;1&#039;s when necessary to represent one or more leading zero bytes.  Count the number of leading zero bytes that were the result of step 3 (for old Bitcoin addresses, there will always be at least one for the version/application byte; for new addresses, there will never be any).  Each leading zero byte shall be represented by its own character &#039;1&#039; in the final result.&lt;br /&gt;
# Concatenate the 1&#039;s from step 5 with the results of step 4.  &#039;&#039;&#039;This is the Base58Check result.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Encoding a Bitcoin address==&lt;br /&gt;
Bitcoin addresses are implemented using the Base58Check encoding of the hash of either:&lt;br /&gt;
* Pay-to-script-hash (p2sh): payload is [[RIPEMD160]]([[SHA256]](redeemScript the wallet knows how to spend)); version 0x05 (these addresses begin with the digit &#039;3&#039;)&lt;br /&gt;
* Pay-to-pubkey-hash (p2pkh): payload is [[RIPEMD160]]([[SHA256]](ECDSA public key the wallet knows the private key for)); version 0x00 (these addresses begin with the digit &#039;1&#039;)&lt;br /&gt;
&lt;br /&gt;
The resulting hash in both of these cases is always exactly 20 bytes.&lt;br /&gt;
These are big-endian (most significant byte first).  (Beware of [[bignumber]] implementations that clip leading 0x00 bytes, or prepend extra 0x00 bytes to indicate sign - your code must handle these cases properly or else you may generate valid-looking addresses which can be sent to, but cannot be spent from - which would lead to the permanent loss of coins.)&lt;br /&gt;
&lt;br /&gt;
==Encoding a private key==&lt;br /&gt;
Base58Check encoding is also used for encoding [[private key|ECDSA private keys]] in the [[wallet import format]].&lt;br /&gt;
This is formed exactly the same as a Bitcoin address, except that 0x80 is used for the version/application byte, and the payload is 32 bytes instead of 20 (a private key in Bitcoin is a single 32-byte unsigned big-endian integer).&lt;br /&gt;
For private keys associated with an uncompressed public key, such encodings will always yield a 51-character string that starts with &#039;5&#039;, or more specifically, either &#039;5H&#039;, &#039;5J&#039;, or &#039;5K&#039;.&lt;br /&gt;
&lt;br /&gt;
==Base58 symbol chart==&lt;br /&gt;
The Base58 symbol chart used in Bitcoin is specific to the Bitcoin project and is not intended to be the same as any other Base58 implementation used outside the context of Bitcoin.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Value&lt;br /&gt;
!Character&lt;br /&gt;
!Value&lt;br /&gt;
!Character&lt;br /&gt;
!Value&lt;br /&gt;
!Character&lt;br /&gt;
!Value&lt;br /&gt;
!Character&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|2&lt;br /&gt;
|3&lt;br /&gt;
|3&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|5&lt;br /&gt;
|5&lt;br /&gt;
|6&lt;br /&gt;
|6&lt;br /&gt;
|7&lt;br /&gt;
|7&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|9&lt;br /&gt;
|9&lt;br /&gt;
|A&lt;br /&gt;
|10&lt;br /&gt;
|B&lt;br /&gt;
|11&lt;br /&gt;
|C&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|D&lt;br /&gt;
|13&lt;br /&gt;
|E&lt;br /&gt;
|14&lt;br /&gt;
|F&lt;br /&gt;
|15&lt;br /&gt;
|G&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|H&lt;br /&gt;
|17&lt;br /&gt;
|J&lt;br /&gt;
|18&lt;br /&gt;
|K&lt;br /&gt;
|19&lt;br /&gt;
|L&lt;br /&gt;
|-&lt;br /&gt;
|20&lt;br /&gt;
|M&lt;br /&gt;
|21&lt;br /&gt;
|N&lt;br /&gt;
|22&lt;br /&gt;
|P&lt;br /&gt;
|23&lt;br /&gt;
|Q&lt;br /&gt;
|-&lt;br /&gt;
|24&lt;br /&gt;
|R&lt;br /&gt;
|25&lt;br /&gt;
|S&lt;br /&gt;
|26&lt;br /&gt;
|T&lt;br /&gt;
|27&lt;br /&gt;
|U&lt;br /&gt;
|-&lt;br /&gt;
|28&lt;br /&gt;
|V&lt;br /&gt;
|29&lt;br /&gt;
|W&lt;br /&gt;
|30&lt;br /&gt;
|X&lt;br /&gt;
|31&lt;br /&gt;
|Y&lt;br /&gt;
|-&lt;br /&gt;
|32&lt;br /&gt;
|Z&lt;br /&gt;
|33&lt;br /&gt;
|a&lt;br /&gt;
|34&lt;br /&gt;
|b&lt;br /&gt;
|35&lt;br /&gt;
|c&lt;br /&gt;
|-&lt;br /&gt;
|36&lt;br /&gt;
|d&lt;br /&gt;
|37&lt;br /&gt;
|e&lt;br /&gt;
|38&lt;br /&gt;
|f&lt;br /&gt;
|39&lt;br /&gt;
|g&lt;br /&gt;
|-&lt;br /&gt;
|40&lt;br /&gt;
|h&lt;br /&gt;
|41&lt;br /&gt;
|i&lt;br /&gt;
|42&lt;br /&gt;
|j&lt;br /&gt;
|43&lt;br /&gt;
|k&lt;br /&gt;
|-&lt;br /&gt;
|44&lt;br /&gt;
|m&lt;br /&gt;
|45&lt;br /&gt;
|n&lt;br /&gt;
|46&lt;br /&gt;
|o&lt;br /&gt;
|47&lt;br /&gt;
|p&lt;br /&gt;
|-&lt;br /&gt;
|48&lt;br /&gt;
|q&lt;br /&gt;
|49&lt;br /&gt;
|r&lt;br /&gt;
|50&lt;br /&gt;
|s&lt;br /&gt;
|51&lt;br /&gt;
|t&lt;br /&gt;
|-&lt;br /&gt;
|52&lt;br /&gt;
|u&lt;br /&gt;
|53&lt;br /&gt;
|v&lt;br /&gt;
|54&lt;br /&gt;
|w&lt;br /&gt;
|55&lt;br /&gt;
|x&lt;br /&gt;
|-&lt;br /&gt;
|56&lt;br /&gt;
|y&lt;br /&gt;
|57&lt;br /&gt;
|z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The algorithm for encoding address_byte_string (consisting of 1-byte_version + hash_or_other_data + 4-byte_check_code) is&lt;br /&gt;
&lt;br /&gt;
    code_string = &amp;quot;123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz&amp;quot;&lt;br /&gt;
    x = convert_bytes_to_big_integer(hash_result)&lt;br /&gt;
    &lt;br /&gt;
    output_string = &amp;quot;&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    while(x &amp;gt; 0) &lt;br /&gt;
        {&lt;br /&gt;
            (x, remainder) = divide(x, 58)&lt;br /&gt;
            output_string.append(code_string[remainder])&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
    repeat(number_of_leading_zero_bytes_in_hash)&lt;br /&gt;
        {&lt;br /&gt;
        output_string.append(code_string[0]);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
    output_string.reverse();&lt;br /&gt;
&lt;br /&gt;
==Version bytes==&lt;br /&gt;
Here are some common version bytes:&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;
!Use&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|Bitcoin pubkey hash&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|3&lt;br /&gt;
|Bitcoin script hash&lt;br /&gt;
|-&lt;br /&gt;
|21&lt;br /&gt;
|4&lt;br /&gt;
|Bitcoin (compact) public key (proposed)&lt;br /&gt;
|-&lt;br /&gt;
|52&lt;br /&gt;
|M or N&lt;br /&gt;
|Namecoin pubkey hash&lt;br /&gt;
|-&lt;br /&gt;
|128&lt;br /&gt;
|5&lt;br /&gt;
|Private key&lt;br /&gt;
|-&lt;br /&gt;
|111&lt;br /&gt;
|m or n&lt;br /&gt;
|Bitcoin testnet pubkey hash&lt;br /&gt;
|-&lt;br /&gt;
|196&lt;br /&gt;
|2&lt;br /&gt;
|Bitcoin testnet script hash&lt;br /&gt;
|}&lt;br /&gt;
[[List of address prefixes]] is a more complete list.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [http://lenschulwitz.com/base58 Online Base58 Decoder, Encoder, and Validator]&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
* [https://github.com/bitcoin/bitcoin/blob/master/src/base58.h &amp;quot;Satoshi&amp;quot; C++ codebase (encode/decode using BigNum library)]&lt;br /&gt;
* [https://github.com/luke-jr/libbase58 libbase58 C code (decode and encode, no external libraries needed)]&lt;br /&gt;
* [https://gitorious.org/bitcoin/libblkmaker/blobs/master/base58.c libblkmaker C code (decode only, no external libraries needed)]&lt;br /&gt;
* [http://lenschulwitz.com/b58/base58perl.txt Base58 Decode, Encode, and Validate in Perl]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
&lt;br /&gt;
[[es:Codificación Base58Check]]&lt;/div&gt;</summary>
		<author><name>Friend</name></author>
	</entry>
</feed>