Bitcoin Forum

Bitcoin => Wallet software => Topic started by: Isbitis on July 21, 2021, 11:56:00 PM



Title: Hello does anyone knows how reedem casascius Bitcoin?
Post by: Isbitis on July 21, 2021, 11:56:00 PM
Hello does anyone knows how reedem casascius Bitcoin?


Title: Re: Hello does anyone knows how reedem casascius Bitcoin?
Post by: BitMaxz on July 22, 2021, 12:26:37 AM
If your casascius coin has a sticker on the back with a mini private key you can redeem it with Electrum.
You can download Electrum wallet from https://electrum.org/

And then use this format below when importing the mini private key

Code:
p2pkh:Your mini private key


Title: Re: Hello does anyone knows how reedem casascius Bitcoin?
Post by: nc50lc on July 22, 2021, 04:27:03 AM
-snip-
Code:
p2pkh:Your mini private key
You'll have to remove the prefix "p2pkh:".
For some reason, adding a prefix before a mini-private key will disable the "next" or "sweep" in Electrum's import or sweep private key.


Title: Re: Hello does anyone knows how reedem casascius Bitcoin?
Post by: odolvlobo on July 22, 2021, 07:10:17 AM
You can find more detailed information here: https://en.bitcoin.it/wiki/Mini_private_key_format


Title: Re: Hello does anyone knows how reedem casascius Bitcoin?
Post by: khaled0111 on July 23, 2021, 08:45:27 PM
For some reason, adding a prefix before a mini-private key will disable the "next" or "sweep" in Electrum's import or sweep private key.
When you want to sweep or import a mini private key, Electrum will convert it to a full-size private key and generate a "p2pkh" address from it by default.
https://github.com/spesmilo/electrum/blob/07219cc4c6435011afacda546f652cea91d98cd4/electrum/bitcoin.py#L666

One of the conditions for Electrum to recognize a private key as a valid mini key is that its first character must be an "S". If you add p2pkh in front of it the "text[0] == 'S'" condition will fail and the next button will remain disabled.


Title: Re: Hello does anyone knows how reedem casascius Bitcoin?
Post by: nc50lc on July 24, 2021, 05:56:11 AM
https://github.com/spesmilo/electrum/blob/07219cc4c6435011afacda546f652cea91d98cd4/electrum/bitcoin.py#L666

One of the conditions for Electrum to recognize a private key as a valid mini key is that its first character must be an "S". If you add p2pkh in front of it the "text[0] == 'S'" condition will fail and the next button will remain disabled.
Thanks, without looking at the code, my initial guess was: it's because of the checksum: SHA256(mini-privKey + ?) =  0x00 first byte; and it includes the "p2pkh:" to hash.
Pretty close but it's the last (third) 'condition'.

So they've also included to check for "S" as the first character of what's actually pasted there.


Title: Re: Hello does anyone knows how reedem casascius Bitcoin?
Post by: Kakmakr on July 26, 2021, 02:49:17 PM
For some reason, adding a prefix before a mini-private key will disable the "next" or "sweep" in Electrum's import or sweep private key.
When you want to sweep or import a mini private key, Electrum will convert it to a Full-size private key and generate a "p2pkh" address from it by default.
https://github.com/spesmilo/electrum/blob/07219cc4c6435011afacda546f652cea91d98cd4/electrum/bitcoin.py#L666

One of the conditions for Electrum to recognize a private key as a valid mini key is that its first character must be an "S". If you add p2pkh in front of it the "text[0] == 'S'" condition will fail and the next button will remain disabled.


Can you explain the difference between the Mini Private key and the Full-size Private key? Is this something like a URL shortener where you make it easier for people to remember the Private Key?

I have swept many Private keys into Electrum from my Paper wallets, but I have never seen this before. OP ..thank you for posting this, I learn something new every day.  ;)


Title: Re: Hello does anyone knows how reedem casascius Bitcoin?
Post by: hosseinimr93 on July 26, 2021, 03:57:31 PM
Can you explain the difference between the Mini Private key and the Full-size Private key?  
Almost any integer between 1 and 2256 can be turned into a full-size private key. A big difference of mini private keys with other formats is that, not every 256-bit number that can be encoded in a full-size private key can be encoded in mini private key format too.
The other difference I know is that there is no way to convert other formats of private keys to a mini private key.


Is this something like a URL shortener where you make it easier for people to remember the Private Key?
A mini private key (even the shortest format which includes 22 characters) is still difficult to be memorized.
A mini private key can be used when there is no enough space for writing a full-size private key.


Title: Re: Hello does anyone knows how reedem casascius Bitcoin?
Post by: pooya87 on July 27, 2021, 02:36:21 AM
Keep in mind that mini-private keys represent a smaller "entropy" size that is used to derive the 256-bit key. The algorithm is that they start from a 256-bit number then shrink the string representation of it to smaller number of characters (eg. 30) and this final string acts as the input to SHA256 to get the 256-bit key.