glacier

Earlier today, I created a Raspberry Pi Trezor (cold wallet) for cryptocurrency using that cool Adafruit 1.3″ OLED bonnet.

PiTrezor

It seems to reasonably work from a fork of the original code. It presents itself to the Trezor Bridge software and to your workstation as a slave USB device. I suppose you could think of the entire thing as a smart USB thumb drive, if you will.

The code image is smaller than you’d normally expect (50MB). I’ll get in there and take it apart later from a software standpoint.

Notes:

  • The interface is beautiful on the small screen with attractive fonts and functional animations.
  • I don’t love websites which only work with a single browser. In this case, it’s Google Chrome of course and it was necessary to install that for Trezor to work at all.
  • The standard screen assumes that the buttons are positioned below it, not so for the Adafruit hat. So you just have to guess that the furthest button equals the right-most button and it all works out.
  • The GPIO pin layout of the OLED bonnet is different from the native Trezor device so of course, the bootloader upgrade routine doesn’t work as expected. It will be necessary to recompile and reload the image in order for this to work. I’ll have to review all that to see how it affects me to I don’t love anything in the cryptospace which can’t keep up to the current state of the art.
  • Having the micro USB cable sticking out of the side of the Pi just seems awkward so I’ll work up a serial connection to the GPIO pins with a USB plug tail and incorporate all this into a slick-looking case.
  • I don’t think I enjoy the website interface for selecting other cryptocurrencies. I think I like the KeepKey version of this better, to be honest.
  • Although Trezor suggests they’re compatible with other currencies, they seem to only be able to do Ethereum via a third-party. The hand-off to that third-party provider was about as ugly as it gets and I aborted. You shouldn’t have to create multiple accounts to simple store a wallet.
  • Unless I gain more confidence with all this, I won’t be putting any money in the wallet but it’s an interesting exercise.

understanding blockchain

Bitcoin is a relatively new phenomenon, getting its start only nine years ago. Since that time, it is now enjoys a market cap of about US$150B at the time of this post. That’s an admittedly-large sum of money for something that’s completely digital and you can’t hold in your hand at the end of the day. I guess it shares the same status then with stocks, bonds, mutual funds and other trading instruments that are a bit ethereal, if you ask me. That said, though, it has come a long way since its inception and there are a thousand or so copycats in one form or another. And yet, does the average person know anything about the underlying code and how it’s implemented?

I thought I’d put together a collection of terms to shed some light on the underlying technology to make it easier to understand.

Node

A node is a single identifiable unit in a variety of storage systems. It often includes a unique ID of some kind to make it distinguishable from its neighboring data. A node could be as simple as the following:

1,This is the data part
2,And this is more data

Linked List

A list is usually something like a comma-separated list of data. A linked list is one in which each new bit of data points back to the previous one in some way. And there are even varieties of this in which the new data points backward and the existing data points forward as well. Here is another example which includes backward-facing pointers:

{ID=1,Data="This is the data part",Previous=0},
{ID=2,Data="And this is more data",Previous=1}

Hash

In the cryptographic world, a hash is usually a large number which was generated from a collection of data. You should assume that the same collection of data as seen later would continue to produce the exact same hash as an output. Furthermore, no other collection of data should produce the same hash. Here’s another example with short versions of hashes included:

{ID=1,Data="This is the data part",Hash="5a285ab1945",PrevHash="00000000000",PrevID=0},
{ID=2,Data="And this is more data",Hash="b6f7f023f02",PrevHash="5a285ab1945",PrevID=1}

This storing-of-the-previous-hash-value in each record is important to prevent any tampering by someone else.

Digital Wallet

Now that you know what a hash is, it’s not too difficult to imagine that a digital wallet (financial account) is represented by one of these as well.

Transaction Ledger

A financial ledger in the form of two paper-based books is something that accountants used to fill out to maintain a company’s finances. A ledger is a history of all the adding and subtracting for the different accounts.

If the data part in our examples above actually represent those +/- activities and correctly identify a pair of financial accounts, then this might be an excellent way of publicly keeping a record of how much different accounts hold in some form of currency.

Block Number

Now that you know what a hash is, that unique identifier/number for each node or block of data is yet another hash number.

Merkle Tree

Since a block can store not one but several transactions in it, the method of storing the data is important. A merkle tree is a way of storing data with individual hashes on each branch plus combined hashes as well at the point of intersection of those branches.

So as we described above, a block can have multiple transactions stored in it. Each individual transaction would include a hash and the accumulation of transactions also gets a combined hash for the sake of safety.

Miners

A Bitcoin miner is a computer whose job it is to create and add blocks to this public ledger. More accurately, though, a miner is usually a single graphics card in a computer which has been setup to mine coins. It requires a fair bit of processing power to do what should be a simple task.

Nonce

A nonce is usually an integer and in our context, it means a special integer which—when added to the contents of a block—produces a hash which begins with four zeroes. As you might have guessed, it requires a bit of work to produce a working hash for a block of transactions and this is the “work” which Bitcoin miners do, for example.

When the correct nonce is guessed and a valid hash produced, it is published along with the block. If this is unique work and was done first then the miner might be rewarded with an amount of digital coin.

Blockchain

A blockchain, then, is a public, distributed ledger of groups of transactions stored in blocks. Each block has been assigned a hash which was programmatically difficult to produce. Each block includes information about the previous block in the chain, making it nearly impossible to alter after-the-fact.

A blockchain allows a digital wallet (as identified by a hash) to have a balance which is the collection of +/- transactions into that account.

 

happiness is a warm coin

A Bitcoin is a type of cryptocurrency in which money is represented by an accumulation of agreed-upon virtual coins in a very long accounting ledger.

I’m a miner. Similar to the gold rush days in California in the 19th century, I mine coins using a hardware rig in my apartment. The miner, per se, is a high-end graphics card typically seen in a gamer’s computer—it represents about 70% of the overall cost of everything going on. The coins in this case aren’t Bitcoin but Ethereum, a popular alt-coin, if you will.

The overall process looks like this:

  1. Buy parts for a computer and assembly them
  2. Install some sort of operating system and software to mine the currency you’re interested in
  3. Buy something called a cold wallet on which to safely store your currency and a fire-proof safe
  4. Generate a wallet for the type of currency that you’ll be mining, Ethereum in this case
  5. Generate a receiving address for this wallet
  6. Configure the mining software to use your receiving address
  7. Choose a mining pool (akin to joining a co-op of miners who will collectively mine together and share the profits) and configure the mining software for this group
  8. Configure the mining pool’s interface so that you select how often you are compensated from the monies owed to you
  9. Turn it on, let it run and monitor the progress

Today, I was rewarded with my first pay-out from this mining pool. It’s not a huge sum of money at the moment but I couldn’t be more pleased because I understand about the nature of accumulated interest…

happiness

Reverse Inflation

Fiat currency (dollar bills, for example) suffers from something called inflation. If you’re old enough, you’ve experienced the ever-decreasing value of the dollar when you wish to buy a gallon of milk or some other familiar commodity (whose price continually increase year after year).

According to the Bureau of Labor Statistics consumer price index, the dollar experienced an average inflation rate of 2.09% per year. Prices in 2017 are 42.2% higher than prices in 2000.

Perhaps one of the biggest reasons why fiat currency loses so much value is because 1) it is no longer backed by gold and 2) anytime the major banks feel like it, they just print more of the stuff in a process called quantitative easing. In earlier days, the federal government would have needed to issue bonds to investors and then later to pay off these debt instruments. Now, it just prints more paper currency without fearing the negative effects of doing so.

Now imagine a type of currency which enjoys reverse-inflation, an ever-increasing value instead of a decrease. Ethereum seems to have an average increase of 64% per month in its recent history. Imagine buying a gallon of milk three months ago for $4.00 and three months from now you could buy it for a mere $0.27. Of course, Ethereum might crash completely and be worthless—that’s the nature of something like this. At the moment, though, it looks like something worth maintaining over time.

The Future

It’s difficult to guess what the future holds for these types of currencies. I would guess that the quantitative easing of fiat currency would be enough to erode our confidence in the value of those paper currencies which should translate into people migrating to these cryptocurrency alternatives.