TUTORIAL: Bank Tutorial 1

Every BitPoint has an issuer. In previous years, this was just a hard-coded string. But this year, I’ve altered the Mint to generate BitPoints where the Issuer is the “CommonName” that is in the cert. You can now use the Mint to get info printed on bitpoints or to verify them.

YOU DO NOT NEED YOUR OWN MINT.

But, if you’re creating one to experiment, this is how it’s done.

First, make sure you have a private key and certificate for the Mint (not shown). The Mint cert doesn’t have to be signed by the root for the code to work at this point.

Second, create a mint using the following command:

PYTHONPATH=<path to playground src/> python -m apps.bank.PrintingPress create <mint cert> <mint private key> <path to store the new mint>

Third, create some bitpoints:

PYTHONPATH=<path to playground src/> python -m apps.bank.PrintingPress mint <number of bp to generate> <mint cert> <path to mint>

This command will create a file of serialized bitpoints in the local directory. It can take a while to generate a large number. For testing, start with 100.

Fourth, optionally, print info or verify the bitpoints:

PYTHONPATH=<path to playground src/> python -m apps.bank.PrintingPress info <filename of bitpoints> all
BitPoint: 00000000000000000196 (Issued Tue Feb  9 22:04:04 2016 by 20161 Playground Official Mint)
BitPoint: 00000000000000000197 (Issued Tue Feb  9 22:04:04 2016 by 20161 Playground Official Mint)
BitPoint: 00000000000000000198 (Issued Tue Feb  9 22:04:04 2016 by 20161 Playground Official Mint)
BitPoint: 00000000000000000199 (Issued Tue Feb  9 22:04:04 2016 by 20161 Playground Official Mint)
...
PYTHONPATH=<path to playground src/> python -m apps.bank.PrintingPress validate <bitpoint file> <mint cert>
00000000000000000085 is valid
00000000000000000086 is valid
00000000000000000087 is valid
00000000000000000088 is valid
00000000000000000089 is valid
00000000000000000090 is valid
...

This shouldn’t affect anyone too much. I only mention it because a few people have been working on projects related to this, and they might want to look at the code in apps/bank/Exchange.py and Mint.py to see the mechanics. For those of you interested in seeing how to extract the Common Name programatically, this may also be helpful.

I’ll have more details about how you might practically verify BitPoints in a later tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *