<?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=Object+In+Space</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=Object+In+Space"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Object_In_Space"/>
	<updated>2026-05-24T20:50:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Mini_private_key_format&amp;diff=70839</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=70839"/>
		<updated>2025-11-11T07:02:07Z</updated>

		<summary type="html">&lt;p&gt;Object In Space: /* Creating mini private keys */ convert Casascius Bitcoin Utility red link to link to GH repo, and add link to my utility too.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:QR-privkeys-sidebyside.png|thumb|right|Comparison of QR codes of the same private key, encoded in mini private key format (left) and [[wallet import format]] (right). 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;
[[Image:Redeemed Denarium physical bitcoin.jpg|thumb|right|A minikey in a small space on a physical bitcoin]]&lt;br /&gt;
{{sample}}&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 for the purpose of being embedded in a small space. A private key encoded in this format is called a &#039;&#039;&#039;minikey&#039;&#039;&#039;. This private key format was designed for and 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;
Casascius Series 1 holograms 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 optionally support the 22-character format as well to allow redemption of old Casascius coins. Use of the 22-character format for future applications is discouraged due to security considerations; the standard 30-character format should be used instead.&lt;br /&gt;
&lt;br /&gt;
An example key using this encoding is &#039;&#039;&#039;S6c56bnXQiBjk9m{{taggant private key}}qSYE7ykVQ7NzrRy&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
===Physical bitcoins===&lt;br /&gt;
{{multiple image|align=vertical|width=300&lt;br /&gt;
|image1=Miniprivkeys.jpg&lt;br /&gt;
|image2=Minipubkeys.jpg&lt;br /&gt;
|footer=Paper disc inserts for [[Casascius physical bitcoins|Casascius coins]] with minikeys on the obverse (top) and corresponding address prefixes on the reverse (bottom)&lt;br /&gt;
}}&lt;br /&gt;
Minikeys are used extensively on physical bitcoins, because their small size allows them to be printed and read easily even on tiny surfaces inside the coins. Typically, a small paper or plastic disc is placed behind a tamper-evident security hologram on the back of a metal coin or bar, with the minikey printed on the inside such that it can only be read if the security hologram is removed.&lt;br /&gt;
&lt;br /&gt;
Some physical bitcoins include a window in the security hologram to view the back of this disc, which includes the prefix of the address corresponding to the hidden minikey.&lt;br /&gt;
&lt;br /&gt;
===1D barcodes===&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;
===2D barcodes===&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;
==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;
* [[Electrum]]&lt;br /&gt;
&lt;br /&gt;
[[Bitcoin Core]] cannot currently be used to import minikeys directly, although it can be used in conjunction with the conversion tools listed below.&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;
===Conversion tools===&lt;br /&gt;
&lt;br /&gt;
These tools can convert a minikey into its corresponding address, and private key in [[wallet import format]], where it can be used with any compatible software.&lt;br /&gt;
&lt;br /&gt;
* [https://codeberg.org/objectinspace/minikey Minikey] is a simple 100-line open-source tool with no external dependencies other than the programming language.&lt;br /&gt;
* https://www.bitaddress.org/ can also convert minikeys - although be sure to run the software offline rather than entering the minikey directly into the website, where it could be intercepted.&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;S6c56bnXQiBjk9mq{{taggant private key}}SYE7ykVQ7NzrRy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The string &amp;quot;&amp;lt;tt&amp;gt;S6c56bnXQiBjk9{{taggant private key}}mqSYE7ykVQ7NzrRy?&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;S6c56bnXQiBjk9{{taggant private key}}mqSYE7ykVQ7NzrRy&amp;quot;) = 4C7A9640C72DC2099F23715D0C8A0D8A35F8906E3CAB61DD3F78B67BF887C9AB  &lt;br /&gt;
&lt;br /&gt;
This sample key in [[wallet import format]] is &amp;lt;tt&amp;gt;5JPy8Zg7z4P7RSLsiqcqyeAF1{{taggant private key}}935zjNUdMxcDeVrtU1oarrgnB7&amp;lt;/tt&amp;gt;, and the corresponding [[Bitcoin address]] is &amp;lt;tt&amp;gt;1CciesT23BNionJe{{taggant address}}Xrbxmjc7ywfiyM4oLW&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;S6c56bnXQiBjk9{{taggant private key}}mqSYE7ykVQ7NzrRy?&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;S6c56bnXQiBjk9{{taggant private key}}mqSYE7ykVQ7NzrRy&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 [https://github.com/casascius/Bitcoin-Address-Utility Casascius Bitcoin Utility]. [https://codeberg.org/objectinspace/minikey Minikey] is also capable of generating minikeys.&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;
==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>Object In Space</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Mini_private_key_format&amp;diff=70838</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=70838"/>
		<updated>2025-11-11T06:57:25Z</updated>

		<summary type="html">&lt;p&gt;Object In Space: /* Import */ Add Electrum, Bitaddress.org, and my Minikey tool to the Import section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:QR-privkeys-sidebyside.png|thumb|right|Comparison of QR codes of the same private key, encoded in mini private key format (left) and [[wallet import format]] (right). 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;
[[Image:Redeemed Denarium physical bitcoin.jpg|thumb|right|A minikey in a small space on a physical bitcoin]]&lt;br /&gt;
{{sample}}&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 for the purpose of being embedded in a small space. A private key encoded in this format is called a &#039;&#039;&#039;minikey&#039;&#039;&#039;. This private key format was designed for and 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;
Casascius Series 1 holograms 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 optionally support the 22-character format as well to allow redemption of old Casascius coins. Use of the 22-character format for future applications is discouraged due to security considerations; the standard 30-character format should be used instead.&lt;br /&gt;
&lt;br /&gt;
An example key using this encoding is &#039;&#039;&#039;S6c56bnXQiBjk9m{{taggant private key}}qSYE7ykVQ7NzrRy&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
===Physical bitcoins===&lt;br /&gt;
{{multiple image|align=vertical|width=300&lt;br /&gt;
|image1=Miniprivkeys.jpg&lt;br /&gt;
|image2=Minipubkeys.jpg&lt;br /&gt;
|footer=Paper disc inserts for [[Casascius physical bitcoins|Casascius coins]] with minikeys on the obverse (top) and corresponding address prefixes on the reverse (bottom)&lt;br /&gt;
}}&lt;br /&gt;
Minikeys are used extensively on physical bitcoins, because their small size allows them to be printed and read easily even on tiny surfaces inside the coins. Typically, a small paper or plastic disc is placed behind a tamper-evident security hologram on the back of a metal coin or bar, with the minikey printed on the inside such that it can only be read if the security hologram is removed.&lt;br /&gt;
&lt;br /&gt;
Some physical bitcoins include a window in the security hologram to view the back of this disc, which includes the prefix of the address corresponding to the hidden minikey.&lt;br /&gt;
&lt;br /&gt;
===1D barcodes===&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;
===2D barcodes===&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;
==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;
* [[Electrum]]&lt;br /&gt;
&lt;br /&gt;
[[Bitcoin Core]] cannot currently be used to import minikeys directly, although it can be used in conjunction with the conversion tools listed below.&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;
===Conversion tools===&lt;br /&gt;
&lt;br /&gt;
These tools can convert a minikey into its corresponding address, and private key in [[wallet import format]], where it can be used with any compatible software.&lt;br /&gt;
&lt;br /&gt;
* [https://codeberg.org/objectinspace/minikey Minikey] is a simple 100-line open-source tool with no external dependencies other than the programming language.&lt;br /&gt;
* https://www.bitaddress.org/ can also convert minikeys - although be sure to run the software offline rather than entering the minikey directly into the website, where it could be intercepted.&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;S6c56bnXQiBjk9mq{{taggant private key}}SYE7ykVQ7NzrRy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The string &amp;quot;&amp;lt;tt&amp;gt;S6c56bnXQiBjk9{{taggant private key}}mqSYE7ykVQ7NzrRy?&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;S6c56bnXQiBjk9{{taggant private key}}mqSYE7ykVQ7NzrRy&amp;quot;) = 4C7A9640C72DC2099F23715D0C8A0D8A35F8906E3CAB61DD3F78B67BF887C9AB  &lt;br /&gt;
&lt;br /&gt;
This sample key in [[wallet import format]] is &amp;lt;tt&amp;gt;5JPy8Zg7z4P7RSLsiqcqyeAF1{{taggant private key}}935zjNUdMxcDeVrtU1oarrgnB7&amp;lt;/tt&amp;gt;, and the corresponding [[Bitcoin address]] is &amp;lt;tt&amp;gt;1CciesT23BNionJe{{taggant address}}Xrbxmjc7ywfiyM4oLW&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;S6c56bnXQiBjk9{{taggant private key}}mqSYE7ykVQ7NzrRy?&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;S6c56bnXQiBjk9{{taggant private key}}mqSYE7ykVQ7NzrRy&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;
==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>Object In Space</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:List_of_address_prefixes&amp;diff=64141</id>
		<title>Talk:List of address prefixes</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:List_of_address_prefixes&amp;diff=64141"/>
		<updated>2017-10-30T07:59:24Z</updated>

		<summary type="html">&lt;p&gt;Object In Space: /* BIP 0173 */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Shouldn&#039;t the line&lt;br /&gt;
128	5	Bitcoin Private key	5Htn3FzuH3b1X5VF2zLTsAQzBcyzkZNJsa2egXN8ZFJTCqQm3Rq&lt;br /&gt;
be&lt;br /&gt;
128	t	Bitcoin Private key	tHtn3FzuH3b1X5VF2zLTsAQzBcyzkZNJsa2egXN8ZFJTCqQm3Rq&lt;br /&gt;
according to&lt;br /&gt;
127-128	t	34&lt;br /&gt;
?&lt;br /&gt;
--[[User:ThePiachu|ThePiachu]] ([[User talk:ThePiachu|talk]]) 01:59, 27 June 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
What is the policy regarding addresses which are not altcoins but which relate to protocols being built on top of bitcoin? I think there is value in some kind of registry for such protocols to prevent address clashes, and help users know the purpose of different addresses. But I don&#039;t want to overstep if that&#039;s not the purpose of this page.&lt;br /&gt;
--[[User:gidgreen|gidgreen]] 7 July 2014 (GMT)&lt;br /&gt;
&lt;br /&gt;
* I&#039;m not sure what you mean by that. Altcoins abusing bitcoin&#039;s blockchain are still altcoins. Also note that the version byte is for a version, not a namespace. CoinSpark seems to be inserting a &amp;quot;features&amp;quot; in the address. It makes sense to have this, I think, but it should be based on version 5 addresses (p2sh), not the obsolete version 0 (p2pkh)... Perhaps more importantly, this should be proposed on the development mailing list and made a BIP before appearing on this page. --[[User:Luke-jr|Luke-jr]] ([[User talk:Luke-jr|talk]]) 20:47, 7 July 2014 (UTC)&lt;br /&gt;
** CoinSpark is not an altcoin. It&#039;s a protocol for enriching bitcoin transactions via OP_RETURNs. Of the 5 features on the current roadmap, one is a variant on the idea of colored coins (I don&#039;t know if you would call that an altcoin or not) but the rest are all about making regular bitcoin transactions easier and more useful. I imagine it will be one of many such protocols which come out during the coming years, and I think there is sense in avoiding addressing clashes between these different protocols. As you say, [http://coinspark.org/developers/coinspark-addresses/ CoinSpark addresses] encode several types of information but this is not really appropriate for a BIP since it&#039;s not an enhancement to the bitcoin protocol itself. (Think TCP/IP and the Web.) So what mechanism would you suggest for avoiding addressing clashes? [[User:Gidgreen|Gidgreen]] ([[User talk:Gidgreen|talk]]) 06:28, 20 July 2014 (UTC)&lt;br /&gt;
*** If it&#039;s not Bitcoin, it doesn&#039;t belong on the Bitcoin Wiki or in the Bitcoin blockchain. If it is Bitcoin, then a BIP is appropriate. BIPs are for any Bitcoin Improvement Proposal, not just select parts of the system. --[[User:Luke-jr|Luke-jr]] ([[User talk:Luke-jr|talk]]) 17:58, 20 July 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
It seems odd that keys (HD and WIF) are listed in a table of &amp;quot;address prefixes&amp;quot;.&lt;br /&gt;
--[[User:evoskuil|evoskuil]] 28 September 2015&lt;br /&gt;
&lt;br /&gt;
== [[BIP 0173]] ==&lt;br /&gt;
&lt;br /&gt;
This page and [[Address]] need to be updated to account for [[BIP 0173]] and [[Segregated Witness]].&lt;/div&gt;</summary>
		<author><name>Object In Space</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Invoice_address&amp;diff=64140</id>
		<title>Talk:Invoice address</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Invoice_address&amp;diff=64140"/>
		<updated>2017-10-30T07:58:49Z</updated>

		<summary type="html">&lt;p&gt;Object In Space: /* BIP 0173 */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WikiProject|Protocol|quality=QNR|importance=HIGH}}&lt;br /&gt;
During the described process of generating a bitcoin address, can it further be explained which parts are the private key or how they are computed too?&lt;br /&gt;
&lt;br /&gt;
:Please see [[Technical background of Bitcoin addresses]] for that information --[[User:Atheros|Atheros]] 08:42, 9 December 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This wiki says a bitcoin address can have a length between 27 and 34 characters. But acc. to &amp;quot;https://bitcointalk.org/index.php?topic=278814.msg2978906#msg2978906&amp;quot; bitcoin addresses with only 26 (!) characters are also possible as well. What is written there appears plausible to me, so maybe someone skilled can verify, and if confirmed, correct the text in this wiki. --[[User:Michael_S|Michael_S]], 14:13, 7 December 2013 (CET)&lt;br /&gt;
&lt;br /&gt;
== [[BIP 0173]] ==&lt;br /&gt;
&lt;br /&gt;
This page and [[List of address prefixes]] need to be updated to account for [[BIP 0173]] and [[Segregated Witness]].&lt;/div&gt;</summary>
		<author><name>Object In Space</name></author>
	</entry>
</feed>