Bitcoin Forum
November 18, 2025, 05:14:14 PM *
News: Pumpkin contest voting
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Casascius Minikey Tool  (Read 160 times)
ObjectInSpace (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 27


View Profile
November 10, 2025, 06:28:59 AM
Merited by odolvlobo (10), ABCbits (5), vapourminer (4), Cricktor (2), nc50lc (1), mcdouglasx (1)
 #1

Hi all,

I wrote a simple tool for expanding minikeys.

Given the minikey, it outputs the corresponding address, and private key in wallet import format.

Example:

Code:
iex> Minikey.expand("S4b3N3oGqDqR5jNuxEvDwf")
[
  mode: :uncompressed,
  minikey: "S4b3N3oGqDqR5jNuxEvDwf",
  address: "1GAehh7TsJAHuUAeKZcXf5CnwuGuGgyX2S",
  private_key: "5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ",
  raw_public_key: "04d0de0aaeaefad02b8bdc8a01a1b8b11c696bd3d66a2c5f10780d95b7df42645cd85228a6fb29940e858e7e55842ae2bd115d1ed7cc0e82d934e929c97648cb0a",
  raw_private_key: "0c28fca386c7a227600b2fe50b7cae11ec86d3bf1fbe471be89827e19d72aa1d"
]

This tool is only 100 lines of code, has no dependencies other than the programming language, and can be run completely offline.

https://codeberg.org/objectinspace/minikey
BattleDog
Member
**
Offline Offline

Activity: 98
Merit: 120


View Profile
November 12, 2025, 01:05:17 PM
 #2

That's actually a neat little tool. A minikey format is 30 Base58 chars starting with "S" (there's also a legacy 22-char variant from early Series 1 coins).

The validity check for these is super specific: You append "?" to the minikey and SHA-256 it and if the first byte isn't 0x00, you reject it. The actual private key is just SHA-256(minikey).

That's the whole trick, and it's worth, I think, making the tool scream loudly when the check fails.

ObjectInSpace (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 27


View Profile
November 13, 2025, 02:35:33 PM
 #3

That's actually a neat little tool. A minikey format is 30 Base58 chars starting with "S" (there's also a legacy 22-char variant from early Series 1 coins).

The validity check for these is super specific: You append "?" to the minikey and SHA-256 it and if the first byte isn't 0x00, you reject it. The actual private key is just SHA-256(minikey).

That's the whole trick, and it's worth, I think, making the tool scream loudly when the check fails.

Thanks for the comment!

The tool actually handles all of this. Cool
nc50lc
Legendary
*
Offline Offline

Activity: 2968
Merit: 7975


Self-proclaimed Genius


View Profile
November 14, 2025, 05:17:45 AM
 #4

That's the whole trick, and it's worth, I think, making the tool scream loudly when the check fails.
The tool actually handles all of this. Cool
It just says "Invalid minikey, typo?" when the checksum failed though.
It's not loud enough for him. (jk)

Anyways, I think the length should be 30 by default since the previous 22 is depreciated.
Even if its "generate" feature is suggested to use for testing purposes only, some people will undoubtedly use it given that it's now referenced in mini private key Bitcoin Wiki article. (ref)

ObjectInSpace (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 27


View Profile
November 14, 2025, 06:29:34 AM
 #5

Anyways, I think the length should be 30 by default since the previous 22 is depreciated.
Even if its "generate" feature is suggested to use for testing purposes only, some people will undoubtedly use it
That's a good point, thanks. I've updated the default length to 30.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!