-
Notifications
You must be signed in to change notification settings - Fork 173
QR Codes content format
Since some kinds of contents in the field of bitcoin can be long, Bither support QR Code pagination. And in order to use less pages of QR Codes, Bither does the following optimizations. These optimizations' main goal is to contain all the content that Bither needs with only digits, uppercased letters and a few punctuations.
#General Encoding Method
- All byte arrays are converted to uppercased hex strings. (source code)
- Uppercased letters in addresses are transformed to
*
followed by the letter. e.g.A
->*A
. And then all the letters are transform to uppercased. In this way, our donation address:1BsTwoMaX3aYx9Nc8GdgHZzzAGmG669bC3
is transformed to1*BS*TWO*MA*X3A*YX9*NC8*GDG*H*ZZZ*A*GM*G669B*C3
. (source code) - Amounts of bitcoins are represented by hex strings for the count of satoshis.
- We use a colon (
:
) to seperate parts of the contents.
#Pagination Method
When we need multiple pages of QR Codes. We add (Total page count minus 1):(current page index starts from 0):
in front of every page. e.g. QR Code Page 1 in 3 pages will be prefixed with 2:0:
.
#Watch Only QR Code Format
Public key byte arrays of all the addresses in cold wallet seperated by colons maybe with a pagination prefix.
#Encrypted Private Key QR Code Format
Following parts seperated by colons.
- The encrypted private key byte array
- The private key initialisation vector byte array
- The scrypt crypter salt byte array
#Decrypted Private Key QR Code Format
Private key in the form used by the Bitcoin dumpprivkey
command.
#Clone QR Code Format
Encrypted private key QR Codes of all the addresses in cold wallet seperated by colons maybe with a pagination prefix.
#Unsigned Transaction QR Code Format
Following parts seperated by colons.
- The address used to send bitcoin from
- The transaction fee
- The address to receive bitcoin
- The amount of bitcoin being sent (not including transaction fee)
- Sha256 hash byte arrays of all the transaction inputs seperated by colons
When all the above makes the content too long, pagination is added in front of every page of QR Codes.
#Signed Transaction QR Code Format
Cold wallet signed transacion QR Codes are made with the following steps.
- Get all the input Sha256 hashes from the unsigned transaction QR Code
- Decrypt the private key using user provided password
- Sign the input hashes using the decrypted private key to make ECDSA signatures
- Build transaction input scripts from the ECDSA signatures and the public key
- Convert all the input script programs to hex strings and join them with colon as separator
- Pagination may be needed
Donate1 : 34FmDRpiATU8j73UxaVqLf1gaZqbK6qHQ4 Donate2: 16WKnAKRE1k6ANnNDuycu6gccr4E2bFUYh Google Play