Using Bitgen
Using Bitgen
================================
* brainwallet
* bulk
* dice
* hash
* hex
* mnemonic
* random
* (vanity)
random
======
The "random" command generates a new keypair using /dev/random
as the entropy source. This is very convenient, but the
generated address is only as secure as the input from /dev/random.
Example invocation:
$ bitgen random
dice
====
The "dice" command takes 100 throws from a 6-sided dice as random
input and converts that to a private key. The 100 numbers from 1 to 6
gives 256 bits of entropy for the bitcoin private key.
Example invocation:
$ bitgen dice
16251625162416241624162416241624162416426124614261426142125125162634361436142615216
52165212121212616
brainwallet
===========
The "brainwallet" command takes a salt a long arbitrary string as input
and converts that to a 256 bit private key.
Note that the salt is not secret, its purpose is to make your
private key unique.
The bitgen brainwallet key derivation is done using the KDF Argon2,
of the input string followed by sha256.
Example of passphrases:
"This is a sEnTeNcE with (10-5-2)+0-1 strrrrange WoRdS: Hyberfurtic, Megasilver and
Fillitelling
which will end Very vEry veRy verY VERY soon! Over and out. Bye bye.
Sill there? Good night gentlemen and ladiEs..."
Using both upper and lower case characters, numbers and special characters
will improve the entrophy and therefore the security of passphrase.
Example invocation:
$ bitgen brainwallet [email protected] "This is! my oWn way of having a
SecureNiceGoodPerfectIncredibleAmazing sec ret that only I kno w about"
hash
====
The "hash" command takes the sha256 hash of the input string to
generate the key pair.
At least 200 characters are needed, and bitgen will not accept less
than that.
Example invocation:
$ bitgen hash sdfkljsdklfjsklfjskldfjdkjkjdejdjdjdfjslakiusiodfuiosduio
cdhjklsdjsdjkhfiljfhskljhfsjkfhjkdhfjsdhfjksdfhsjkhfjkhdjhdjdjdjdjdjdjd
jdjdfhskjdfhsdjklfsklfjsklfjsdklfjskljfsdklfsdjklhfsdhfshfjkhdjkhvhvhvb
vbxcbxchjbvxjbvxjkcjcvhjskjfhsjkhfdhfskjrhwyuiuuduuduududududisfusydfui
sdfysufyujsdfdfhalsdflaksdjaklsdjakljjjdjdjjdjdjdjjddkfjsjdfskdfsdjjdjd
jjwjqjqjqosbgdfisgodghsodghdoghsopsdhjksmudjdbhjdhjhjdhhsdjkhfjkhdjkhsd
jkhfjksdklfjskljfklsdjfkldjkkkdkkdfksfjsdlfjkskdfjskldjfkjkkkdkdkdkdkkd
kekekekekekkekekdfjfkgjksfjslkdfjkljfkjbjbjnjmmmdmdmsdfkjsdklfjklsfdsdf
ydyydydydydyddasiufyisdifoosdfosdufsodfuiuduududfdudiifdufsdifdiusidufs
jfdjsdlfkjsdlkjfdslkfjslkdflkjdslkfdjlkjkdkdkkdkdkdkdkfjsdkjfksjdfjdkdk
hex
===
The "hex" command is used to give the raw private key in hex format.
This could be used if you have a given private key in hex format
and need the corresponding public address and WIF.
With a 16-sided dice it could also be used to generate a new key pair.
Example invocation:
$ bitgen hex f2a123b23bbbcbb12f123231239aacabcefefaefabcbcb6347f734623748f3f3
mnemonic
========
The "mnemonic" command should be used when the mnemonic sentence for
a private key is known. The mnemonic could for example have been
generated by another command such as "random" or "dice".
Example invocation:
$ bitgen mnemonic "verify animal uncle jazz royal sudden rough edge couple broom
private fiscal useful latin salt just slice boss worry hand casino piece sound
inch"
bulk
====
The "bulk" command is used to generate many key pairs with a single
command. The "bulk" command use /dev/random as input for the
private key. The numbers of address pairs to generate should be
specified on the command line.
Example invocation:
$ bitgen bulk 10
vanity
======
The vanity command is used to generate "vanity" bitcoin addresses,
which means addresses that starts with a specified string.
This address starts with the string "1Peter", which makes the
address look more personal than a complete random string.
In bitgen version 0.8, the support for vanity addresses is a bit slow,
and can therefore only be used for short prefixes.
Prefixes with 6 characters (plus the leading "1")
are however possible to use. With enough patience perhaps even 7?
1a
1aa
1bye
1hello
1peter
Example invocation:
$ bitgen vanity 1bit
The mini private keys have been used to print private keys
hidden inside physical coins. The small space makes the short
private keys easier to use than a full WIF key.
Note that the entropy is smaller for mini private keys than
normal bitcoin private keys.
mini
====
The "mini" command generates new mini private keys.
The start value with searching for a mini private key is taken from
/dev/random.
Example invocation:
$ bitgen mini
miniToWif
=========
The "miniToWif" command converts a given mini private key to the
corresponding private key in wif format and the public address.
Example invocation:
$ bitgen miniToWif SoYit5uXp13A4nYbGmLwMzG6MnEDbY
Payment requests
================
reqPayment
==========
The "reqPayment" is used to create an invoice for the specified
public bitcoin address. Optional parameters are the amount to pay,
a label, a message, and the last payment date.
The amount, label and message are encoded into the QR-code.
Example invocation:
$ bitgen reqPayment 1CXfBhBtbLv8jRoJ2ZtAnoCq2Adgdi6HDt
$ bitgen reqPayment 1CXfBhBtbLv8jRoJ2ZtAnoCq2Adgdi6HDt 0.1
$ bitgen reqPayment 1CXfBhBtbLv8jRoJ2ZtAnoCq2Adgdi6HDt 0.1 "Payment"
$ bitgen reqPayment 1CXfBhBtbLv8jRoJ2ZtAnoCq2Adgdi6HDt 0.1 "Payment" "Please pay"
$ bitgen reqPayment 1CXfBhBtbLv8jRoJ2ZtAnoCq2Adgdi6HDt 0.1 "Payment" "Please pay"
"19 jun 2016"
pubAddr
=======
In this case you youself mightbe the recipient of the public address.
pubaddr can for example be used when you need to send bitcoins to your
own address.
Example invocation:
$ bitgen pubAddr 1Phsu4GfjHc6o4gACWHcFi2WL2f1ZtN6gh
Hierarchial random generation
=============================
The HR option is for advanced users, and requires more understanding
of the underlaying cryptographic operations.
genRoot
=======
The "genRoot" command generates a new root key pair to use for
bitcoin address generation. A generation method should be specified,
such as for example "dice" or "random".
Example invocation:
$ bitgen genRoot random
root_9493E6C8_priv.privroot
root_9493E6C8_pub.pubroot
genPub
======
The "genPub" command takes a public root key as input and generates a
bitcoin public address from that. In order to do so a 256 bit
random number is used. In the current bitgen version only /dev/random
is used for this random number generation, but future versions will
support the other methods as well, "dice", "hex", etc.
However, the private ps-files will not contain any private key
that can be directly used (WIF). Instead a 256 bit random number
will be included. That random number is called "private index".
Knowledge of this "private index" will not be enough to spend
the funds in the bitcoin address. This means that this information
is not as critical as the original private root key.
Even so, it is recommended to keep this information just as secure
as the original private root key.
Example invocation:
$ bitgen genPub root_9493E6C8_pub.pubroot
genPriv
=======
The "genPriv" command is used to recover private keys that
corresponds to bitcoin addresses generated with "genPub".
Providing both parts will give the private keys to access the funds.
Example invocation:
$ bitgen genPriv root_9493E6C8_priv.privroot
1LZcyGzhLiKrnb7Ekkt2wK7QZZvAAhS2vf.privindex
infoPrivate
===============
The "verifyPrivate" commands gives information about a private key in
wif format. It also verifies that the given string is a
valid private key.
Example invocation:
$ bitgen infoPrivate 5KQNfT4KZnRGC2GstzAZDMQMBznA3Ex9dUnzEmjYoRoLnTPbR5a
verifyAddress
=============
The "infoAddress" commands verifies that a public bitcoin address
is a valid.
Example invocation:
$ bitgen infoAddress 12oN6MMEFdxCRxodxRdu9m1hawifP5Sqr2
Input of secret information
===========================
Bitgen commands are given on the command line, and this may include
information used to generate a private key, for example dice throws.
However, this very sensitive information often ends up in a
local history file, which could be read by someone else.
Bitgen has an option to read sensitive information from standard input
instead of from the command line. This will prevent the information
from beeing stored in a shell history file.
$ bitgen dice -
This will read the dice throws from the standard input.