Blockchain Part II – Trusting the Process

Two weeks ago, we took a look at what a blockchain is.  This week we will build on that base and will start to take a look at potential uses for the transportation industry.

One area that we did not go in depth on was how does a blockchain encrypt data.  Let’s look at a simple example based on one that recently appeared in the Economist.  The data from each transaction in the blockchain gets put through a cryptographic “hash” function that will distill it down into a string of numbers with a fixed length.  This will create the “header” to the data that will be stored.  This “hash” is a one-way street.  While it is relatively easy to go from the data to its hash, it is next to impossible to go from the hash to the data.  What this means to us is that if you make one, seemingly insignificant change to the data, this hash function will return a different value.  This is how any unauthorized changes get noticed.

Let’s back up a bit.  A cryptographic hash function is basically just an equation that takes the data and uses a formula to turn a specific transaction set into a number.  This could be as simple as A=1, B=2, C=3, etc.  Alternatively it could be much more complicated, rearranging the alphabet and numbers, giving values for special characters, etc.  Once the equation has been done once, the program will look at the length of the result and determine if it is the right length.  If it is too short, then it will get padded with some additional zeros.  If it is too long then the result will go back through the equation to get reduced (similar to when we all did reducing fractions back in grade school).

Take a set of 4 transactions – for our purposes, consider them to be 4 different pro bills.  Each pro bill has a shipper, consignee, piece count, weight, and rate.  The data on each pro bill are different.  A blockchain will run that data through a mathematical function to create the “hash” value of a length specified by the application – let’s say 16 characters for this example.  Pro bill A will be put through the function and get a unique hash.  The same will happen with the other 3 pro bills.  Now the program will take the hash values for pro bill 1 and pro bill 2, run them through the function again to get another unique hash value.  The same will happen with pro bills 3 and 4.  This system of combining is called a Merkle Tree.  Now we take these two hashes through the function again to get a final hash that will get put into the header along with a date stamp and a special value called a nonce.   For now consider the nonce to be a random value that helps to make cracking the security difficult and time consuming.

For a very simple example, let’s assume that the data set only includes numbers.  Additionally the equation only adds the numbers together with the hash value of the block before it and then ends with a count of the numbers involved (example – 983 would give a count of 3). The hash needs to have a length of 8 characters.  A further simplification is that we will not use a date stamp or a nonce value – they are not necessary to see what happens.  The first transaction is for 234 pieces, 2 skids, 4213 pounds and a declared value of $8000.  The equation will calculate this as 0+234+2+4213+8000 = 12449.  The count is 12.  So far we have 1244912 which is only 7 characters long.  To get to a length of 8 we will pad this with a single zero at the start to get a value of 01244912.  Now let’s say we have a revision and this now weighs only 4210 pounds.  This goes through the addition to get a value of 12446.  The count is still 12.  The result is still only 7 characters so the padded result is 01244612.  As you can see this does not match the original hash, indicating that something has been changed.  The header does not tell you what has changed only that something does not match.

Now that this first block has been entered into our chain, the hash value from this first block will serve as a value that contributes to the hash of the second block.  In our example we then would have a first value of 01244912 and then add the other pieces of information to it, do the count and then see if the length is ok.  What this means is that any changes to previous data blocks will also be exposed.  The big “so what” is that this creates a secure and transparent ledger that will allow a member to follow a chain backwards and be able to easily note where changes have occurred.   You will still have to examine the records to see what has changed.  However if the values match then you can trust that things have not changed and that you can trust that block of information.  In effect other parties have “audited” the transaction and also agreed that it is the same, something that you are likely (currently) paying someone to do.

Next week we will look at more practical examples of what a blockchain can (will) do for your trucking business.