<p>As it is already being <a href="https://bitcointalk.org/index.php?topic=58243.0" rel="nofollow">discussed on the forum</a>, the standard is currently not in use by anyone, so its implementation details can change over time.</p>

CC BY-SA 3.0
2012-01-14T23:06:54.483Z
2012-01-14T23:06:54.483Z
ThePiachu
<p>There are two formats of <a href="https://en.bitcoin.it/wiki/Mini_private_key_format" rel="nofollow">mini private keys</a>, one is based on SHA-256, other on PBKDF2. In the instructions for decoding the second one, we read:</p>

<p>"The iteration count is determined as follows: 2 ^ (n/4) rounded to the nearest integer, where n is the second byte."</p>

<p>Does the rounding refer to the value of (n/4), or 2 ^ (n/4)? For example, for n=9, we have:</p>

<pre><code>n/4=9/4=2.25
2^(n/4)=2^(9/4)=4.75682846
</code></pre>

<p>If we round the result of the second equation, we get 5, but if we round the result of the first equation, we get:</p>

<pre><code>2^2=4
</code></pre>

<p>Which is a bit of an inconsistency.</p>

<p>Where should one apply rounding for calculating the proper PBKDF2-encoded mini private key?</p>

<p>EDIT:
Moreover, should the division by 4 should be carried out arithmetically (rounding the number to nearest integer, with 0.5 being rounded up), or by a logical shift (the number is rounded down).</p>

<private-key><private-key-format>
Mini private key, PBKDF2 rounding
ThePiachu
# Mini private key, PBKDF2 rounding

(Asked by: username_0 on 2012-01-11)

There are two formats of mini private keys, one is based on SHA-256, other on PBKDF2. In the instructions for decoding the second one, we read:
"The iteration count is determined as follows: 2 ^ (n/4) rounded to the nearest integer, where n is the second byte."
Does the rounding refer to the value of (n/4), or 2 ^ (n/4)? For example, for n=9, we have:
n/4=9/4=2.25
2^(n/4)=2^(9/4)=4.75682846

If we round the result of the second equation, we get 5, but if we round the result of the first equation, we get:
2^2=4

Which is a bit of an inconsistency.
Where should one apply rounding for calculating the proper PBKDF2-encoded mini private key?
EDIT:
Moreover, should the division by 4 should be carried out arithmetically (rounding the number to nearest integer, with 0.5 being rounded up), or by a logical shift (the number is rounded down).

**Tags:** private-key, private-key-format


---

## 1 answers

### Answer by username_0 on 2012-01-14. Score: 0 | Accepted answer

As it is already being [discussed on the forum](https://bitcointalk.org/index.php?topic=58243.0), the standard is currently not in use by anyone, so its implementation details can change over time.


---

