2018 – The year of the Blockchain

The last 18 months has seen a phenomenal growth in the interest in Blockchain.  Businesses are moving quickly to embrace it.  This article will examine the technical aspects associated with a Blockchain.

So what is Blockchain?

Elliptic Curves and Blockchain Encryption

Blockchain Finite Fields and Hash Functions

Private and Public key Wallets

Digital signatures and the Blockchain

Bitcoin Mining and the “proof of work” concept

Playing with the SHA256 Calculator

The Bitcoin “Difficulty Parameter”

Blockchain: writing things down forever

So what is a Blockchain?

A blockchain consists of blocks that hold batches of valid and immutable transactions.

Picture of a strand of DNA
A ‘Hash’ is like digital DNA

Each block includes the hash of the prior block in the blockchain, linking the two. A “hash’ might be described as the mathematical DNA of a transaction or piece of information.  And just like DNA the hash of each block is passed down to the hash of the next block.  The linked blocks form a chain, all the way back to the first block – called the Genesis Block.  

Any minor change in any prior block will produce a vastly different hash and cause a major change in the hash of subsequent blocks.  This difference is obvious to other computers in the distribute network and is therefore penalised as per the scoring system described below.

In addition to a secure hash based history, any blockchain database has a specified algorithm for scoring different versions of the history so that one with a higher value can be selected over others. Peers supporting the database don’t have exactly the same version of the history at all times, rather they keep the highest scoring version of the database that they currently know of.  Whenever a peer receives a higher scoring version (usually the old version with a single new block added), they extend or overwrite their own database and retransmit the improvement to their peers.

There is never an absolute guarantee that any particular entry will remain in the best version of the history forever.  Blockchains are typically built to add the score of new blocks onto old blocks.  There are incentives to only work on extending with new blocks rather than overwriting old blocks.  The probability of an entry becoming superseded goes down as more blocks are built on top of it – eventually becoming very low.

In the context of bitcoin, the blockchain is a digital ledger that records every bitcoin transaction that has ever occurred.

A blockchain system consists of two kinds of records:

  • transactions, and,
  • blocks.

This short background will follow the The evolution of “Block Chain” technology.

∧ Table of Contents

  1. Elliptic Curves and Blockchain encryption

    : Such as  (a Third Degree Polynomial) has a specific known solution.

Elliptic Curve for encryption purposes

And Elliptic curves have a unique property, in that you can to “add” solutions of an elliptic curve together to get another solution.

If you draw a line through the curve (that is not horizontal or vertical), it will always intersect the curve at a third point.  This is defined as adding Point P to Point Q.  As shown below:-

Finding unique related points on Eliptic Curve

The only exception is if a line is Tangential to the Elliptic curve.  In this case, the line intersects the curve at one other point only.  And this is defined as “Doubling” of point “P”.  As shown below:-

Unique points with tangential

In the above examples point R is found by reflecting R though the x axis

∧ Table of Contents

  1. Blockchain, Finite Fields and Hash Functions

A finite field, in the context of Elliptical Curve Digital Signature Algorithm (ECDSA), can be thought of as a predefined range of positive numbers within which every calculation must fall. Any number outside this range “wraps around” so as to fall within the range.

The simplest way to think about this is calculating remainders, as represented by the modulus (mod) operator. For example, 9/7 gives 1 with a remainder of 2:

9 mod 7 = 2

Here our finite field is modulo 7, and all mod operations over this field yield a result falling within a range from 0 to 6.

A Hash function is simply a rule applied to data to give a result – in this case a number.  For example, SHA256 is a Hash function that takes an input and has a 256 bit output.  (SHA = Secure Hash Algorithm.  “See Playing with the SHA256 Calculator“)

File                  >

Password       >       SHA256    >    256 bit number

Data                >

In the case of SHA256 there are 2256 possible outcomes.

(Another important Hash algorithm is RIPMED160).

Block Chain technologies (such as Bitcoin), use very large numbers for their base point, prime modulo and order.  The security of the blockchain relies on these values being large, and therefore totally impractical to reconstruct.

In the case of Bitcoin:

Elliptic curve equation:  y2 = x3 +7

Prime modulo = 2256 – 232 – 29 – 28 – 27 – 26 – 24 – 1 = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F

Base point = 04 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798 483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419 9C47D08F FB10D4B8

Order = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141

Private and Public Keys and Wallets

To produce a “Private Key”, the Block Chain protocol chooses a point on the elliptical curve, eg. Point “E”  i.e. The Base Point.

A Private Key is just a number – “N” (such that, 0 <= N <= 2256)

The Public Key associated with a Private Key is simply the Point “E”, added to itself “N” times.  I.E. P = NxE

For Bitcoin, the address associated with the key is the RIPMED160 Hash of the SHA256 Hash of the Public Key.

Wallets are simply files that contain the Private and Public Keys and the addresses.  Wallets usually contain many keys and may also contain labelling information for transactions, such as “Loan Payment” etc.

∧ Table of Contents

Digital Signatures and the Blockchain

The Elliptical Curve is used to construct a Digital Signature , (or Signature Hash), to sign the data.  The data can be of any length.    The first step is to “Hash” the data to create a number containing the same number of bits as the order of the curve (256).  The mathematics is quiet involved, so for simplicity I will just outline the steps.  (If you require further information click here for a full worked example using small numbers.

  1. Hash the Data to create a number containing the same number of bits as the order of the curve i.e. 256 bits.
  2. Calculate the point (x,y) = k * G, using scalar multiplication.
  3. Find r = mod n (if r = 0 return to step 1). Modulo Arithmetic Calculator Here
  4. Find s = (z + r * d) / k mod n.  (If s = 0, return to step 1)
  5. The signature pair is (r, s).

To verify the signature with the Public Key, a third party would perform the following steps:

  1. Verify r and s are between 1 and n-1
  2. Calculate w = s-1 mod n
  3. Calculate u = z * w mod n
  4. Calculate v = r * w mod n
  5. Calculate the point (x, y) = uG + vQ
  6. Verify that r = x mod n. The signature is invalid if not.

You may verify that these steps work by  here

Blockchain transaction flow

∧ Table of Contents

  1. “Bitcoin Mining” and “Proof of Work”

Miners are not so much solving a math problem as they are spending a lot of effort making guesses until they guess correctly.

Bitcoin works by having a linked set of “blocks” of transaction records that document who has what bitcoin. To make bitcoin work, they needed some way to ensure that the record of blocks is immutable, i.e. nobody can change it.

The way they accomplished this was to create the concept of mining. Miners take a current set of transactions, which includes a link to the last set accepted, and make many trillions of guesses, each time putting a number into the “nonce” field of the block header. The block, including the “header” and “Nonce” is then a “hashed”.  For Bitcoin, the SHA-256 hash function is used.  Then it is just a simple “IF” statement:

If the output of the hash is below a threshold value, then the block is valid…

And the block will be added to the chain and considered valid by other miners.  The miner who guessed correctly is paid with a freshly minted Bitcoin.  Hence, a new coin enters the system and other miners remain incentivised to process blocks.

∧ Table of Contents

Playing with the SHA256 Calculator

You may test the above procedure by playing with the SHA256 calculator.  Just type in a line you want hashed – e.g.: Hello Dolly.  Note the hash produced.

6F813C0EEBC8AC32C0A84A7D6FA19985394516D55E5862B1AB6C541F1355EE96

Then add a number until the first digit of the hash is zero.

My inputs looked like this:

Hello Dolly

12342453

And the resultant Hash was:

04540EE2809F31C0B0DD30B8D9CF640EE8CA4F4F47638652B37CE34CCAE062FD

Essentially, this is what miners do.  However they are looking for a number that will produce many more leading zeros.  I.E. A much smaller number – or threshold value.    Try SHA256 for yourself.

The Bitcoin ‘Difficulty Parameter”

The “threshold value” above, is the “Difficulty Parameter”.  The lower this value is set the more difficult it is to provide a guess “Nonce” that will produce a Hash low enough to be accepted and agreed as valid by other miners.

Difficulty is adjusted every two weeks to ensure that a new valid block is produced approximately every ten minutes or so. Difficulty is based upon  how much time it took to find the last 2016 blocks (i.e. 60mins/10 * 24hrs * 14days). As an example:-   If it took only one week, then the “difficulty” should double – so that no matter how much mining is happening worldwide, a new block continues to be created every 10 minutes on average.

Blockchain:- Writing things down forever

The blockchain is a permanent and agreed, self auditing ledger.  Anything written to it is written in indelible ink.

Any attempt to change an entry will change the Blocks Hash (Digital Signature) and invalidate the block and every other subsequent block in the chain…

This would be immediately noticed by all the other computers in the distributed ledger.  (All of whom keep a full and current copy of the last agreed upon blockchain (or ledger).

Bitcoin is merely a currency that is tracked on the Blockchain. There are possibilities for many more.

Please see my subsequent articles on Blockchain and Bitcoin.

As always,please like and share this article if you found it useful.

And you may download  Satoshi Nakamoto original white paper here –

Download Satoshi Nakamoto

Read the original white paper now!

Get instant access to the most important Financial Technology paper ever written!!

∧ Table of Contents

 

We all worry about internet privacy.  Who could be eavesdropping upon you at that free hotspot café you so love?  Giggling at your personal Facebook posts – or more seriously – spying upon your business plans?

Privacy in the “Internet of Things” age is a complex and growing concern.  You may recall the famous case of Hackers taking control of a moving vehicle via the vehicle’s entertainment system – honking the horn, controlling the stereo, switching on the wipers and ultimately turning the vehicle off entirely!!

Scary stuff…   But on a less dramatic scale what protection may we expect from our devices and suppliers?  And what is the legal framework that this is based upon?

An IoT ‘Technology Aware’ Conceptual Framework for Privacy

It has been suggested that four modes of regulation be applied in cyberspace.  Namely:

  • Law – which includes prohibitions and sanctions for online defamation and copyright infringement.
  • Social Norms – which may involve a user ensuring the behavior of their avatar conforms to the community expectations in an online world eg:
  • Markets – Which regulates the price paid for access to the internet and access to information on the internet, and,
  • Architecture – which is the code, hardware or software that shapes the appearance of cyberspace.

Broadly, these concepts are what is already applied in the real world.

Spying through a keyhole (privacy compromised)

 

Further to the above, the Australian Law Reform Commission (ALRC), recommends that Agencies and Organisations work together to ensure that individuals are ‘empowered’ with the ‘requisite knowledge of how to protect their privacy’.

What does that mean?  In short, Industries will develop their own “Privacy Code”, for approval by the Privacy Commissioner.  And once that code has been approved, it is binding upon the organisations that have agreed to be bound by it.

That seems simple enough.  So how might these principles be applied to some of our more innovative technologies?

Location Detection Technologies

These days, location detection technologies such as GPS are included as a standard feature on many new mobile phones.  Location detection technologies provide ‘real time’ information on the position of the device and consequently the user of the device.  Furthermore, they can provide details as to the physical movements of an individual.  As such they have the potential to impact heavily upon an individual’s privacy.  The issue has been addressed by the European Union Directive on privacy and electronic communications.

Centrally the Directive provides that:

  • Location data must be anonymised before processing (unless consent has been provided by the user of the service).
  • Service providers must notify users, before consent,
    • As to the type of information to be processed,
    • The purpose and duration of location data processing, and,
    • Whether the data will be transmitted to a third party for the purposes of providing ‘value added services’.
  • Users’ must be given the opportunity to withdraw consent at anytime, and,
  • Processing of location data is restricted to that which is necessary for the purposes of providing the value added service.

Smart Cards and Privacy

The use of Smart Cards – particularly in the financial world – has potentially far reaching privacy concerns.  Obviously, the cards are linked to individuals for transacting purposes.   What this means is that the individual may ‘lose’ the ability to transact anonymously.  The ALRC warns that widespread use of Smart cards could enable the collection and storage of vast amounts of information about the activities of an individual.  By way of example they could:

“generate records of the date, time and location of all movements on public and private transport systems, along with details of all goods purchased, telephone use, car parking, attendance at the cinema, and any other activities paid for by smart cards”.

Potentially, this information could be used to generate highly detailed profiles of the user to market goods or services to them. Or of the possibility of unscrupulous government agencies seeking to capitalise upon, and/or abuse such information to the detriment of the individual.

Also of concern are smart card schemes that are used by numerous agencies or organisations.  Notably, they may lack a central data controller.  This means it is ‘unclear who is accountable for the use, disclosure, accuracy and security of personal information collected by the system’.

It should also be noted that “Function Creep” – (i.e. as technology improves more and more information is collected) – and the security of the smart card data pathways have been raised as privacy concerns.

Governments have moved to protect the privacy rights of individuals.  For example in 2004 the Council for Europe stated that the collection of personal information via a smart card system be for a “legitimate and specific purpose”.  They also require that suppliers offer an, ‘appropriate level of security given:

  • The state of the technology
  • The data stored on the card, and,
  • The security risks.’

Similarly, the Australian Government insists that Smart card systems include data protection clauses in agreements with third parties about the supply of smart cards.  Suppliers are also required to perform “Privacy Impact Assessments”, during the design of Smart Card systems.  And to ‘produce comprehensive privacy policy statements’ and to revise these statements ‘whenever a third party adds additional functionality to an existing smart card deployment’.

In conclusion, one can only assume that ignoring those long and wordy legal looking Terms and Conditions, with the ‘tick box’ at the bottom, is done so at the peril of your own privacy.

Do you worry about your privacy on the Net?

Thief stealing data from a smart phone (privacy compromised) 

 

Sales forecasting for new telecommunications products

Telecommunications sales forecasting….can be tricky.

Many executives and entrepreneurs are apprehensive about forecasting for entirely new communications technologies.  (There is just no historical data to rely upon).

Make a wrong decision here and it could cost you your, profit margin, your job or even your entire business.

This article will reveal a forecasting model that has stood the test of time.  To give you the best possible chance of accurately forecasting sales for your new telecommunications products.

Product Lifecycle approach to Telecommunications Sales Forecasting

Given that there is no “historical” sales data to rely upon, how can we scientifically forecast sales?  Well, we can go to established theory – The Product Life-cycle.

  • Introduction Phase: Usually characterized by slow growth.  Possibly due to –
  1. Smaller advertising budgets
  2. Poor distribution channels
  3. Poor/no sales training for frontline salespeople
  4. Pent up market demand (or lack thereof)
  • Growth: The period of fastest uptake by the market.
  • Maturity: The point of market saturation i.e.  when everyone who wants your product has bought it…  (The total market for your product).
  • Decline: As sales drop-off

The above three phases give rise to the famous squiggly “S-shaped” curve we are familiar with from our first year Marketing.

Telecommunications-Product_life-cycle_curve
The Product Lifecycle

It is a useful starting framework but how do we get some real numbers out of this “without historical data”?

The Three things you must know about New Tech Telecommunications Sales Forecasting

  1. The Maximum Saturation point: The time in the future when you estimate everyone who wants your product has made a purchase.  And the total lifetime number of units to be sold.  (I.E.  Years and Units).
  2. The Inflection Point of the Product: The time when the product is selling its fastest.  After this the sales rate begins to taper off and we enter the second part of the characteristic “S-curve”.  The inflection point is the point in time where you expect half the total lifetime sales of your product to be made.
  3. The Delay Factor: Or the amount of time you expect your product to languish in the “Introduction Phase”.

The Product Lifecycle Formula

From the above, you simply plug your variables into the following formula, and it will produce for you the estimated units sold for each month of your Product Life Cycle.

New Product  Forecast  =                                 S

————————–

1  +  B e^-aT

Where:

S =  Long run saturation level of the new product

T =  Time Index (1,2,3…..)

a =  Delay Factor (0-1)

I =  Inflection Point  ( the point where 1/2 of the saturation point is reached)

B =  e^Ia

It produces the signature “S-shaped” Curve of the Product Life Cycle.  (As below).

Telecommunications_life_of_product_sales
Telecommunications New Product Lifecycle Sales Forecast

 

So there you have it!

As stressful as sales forecasting for new-tech is, the consequences of doing it in a haphazard fashion are even worse.  When you consider what is at risk, a clear and methodical method of sales forecasting is a must.

Please click here for additional information .  And

Learn about “e” here.

Relaxed

After over 20 years in the fields of finance and sales – having seen thousands of Start-ups – I recommend this Simple 3 Step process.

Alternatively

You can Subscribe to Tranquility Halo – and for a limited time I will send you Free of Charge, my New-Tech Automated Sales Forecast Calculator and The Tech Forecaster’s Cheat Sheet!

Simply Subscribe in the sidebar!

 

The Immense Power of Exponential Growth

My father taught me to play Chess.  And I am still a terrible player.  However, I do remember a wonderful little story about exponential growth he wove around the origins of the game.

Legend has it that an Indian King was presented with a beautifully hand-crafted chess board by a chess-master mathematician.  Delighted with the magnificent piece the king asked what the mathematician might like in return.  Humbly, the mathematician requested that a grain of rice be put on the 1st square, 2 on the second square, 4 on the third….. doubling at each successive square.   The King quickly agreed to his humble request.

Things were going really well (at first) and are summarised in the following table.

Square Number

Grains on that Square Total Rice on Board

1

1 1

2

2

3

3

4 7

4

8

15

5

16

31

6

32

63

7 64

127

8 128

255

After the first row, the total amounts to 255 grains of rice – barely half a cup full.  And some interesting relationships emerge.  The total rice on the board is given by

2(Square Number) -1. 

For example:

Square Number

2(Square Number) – 1

Total Rice on Board

1

21 – 1

1

4

24 – 1

15

8

28 – 1

255

Then, square 12  =

212 – 1

4095

Based on this how much rice might the King owe at the end of the second row of the Chess Board?

And at the end of the first half of the board? I.E. on the 32nd square?

16

216 – 1

65,535

32

232 – 1

4,294,967,295

So at the half way point (i.e. the 32nd square on the Chess Board), the King owes the mathematician over 4 Billion grains of rice.

Clearly the mathematician had a plan…

Continue reading

Why Grandma budgeted with money in jars?

As promised, I’m back with the second installment of my thoughts on exponential behaviour.

My Grandmother had money in jars for everything…. Rent, food, housekeeping, buttons, even pin money…  everything!

You may recall my last blog outlining the relationship between exponential numbers, science and finance.  (This has always been a fascination of mine – I mean, interest rates and satellite orbits?? Why?)

Well “e” (or 2.71828…) is a very unique number….

We’ll get to that in a minute.  Let’s examine natural phenomena –  Bacterial growth rates.

Binary Fission
Bacteria reproduce by “binary fission”

Let’s assume a single bacterium is put in a jar at 11pm.   The bacterium reproduces itself every minute, i.e. the number of bacteria in the jar doubles every minute.  The number of bacteria increases in the sequence 1,2,4,8, etc.   After 1 hour the jar is completely full….

I ask you at what minute is the jar half full?

That’s right –  at 11:59 pm

And at 11:58 pm it is a quarter full.

And at the 11:57 pm it is an eighth full.

And so on, right back to the original bacterium.

Why is this important?

Well, interest rates work that way too!  We all know that your money is unlikely to double every minute, but it will double.  For example, at 10% your money will double every seven years.  And this is easy to calculate…. Just divide 70 by your interest rate:

70/10 = 7 years

The math is based on the natural logarithm of 2 (ie doubling), and 100Ln 2 = 69. Whatever, use your calculator…  but trust me its close enough to 70.

Another question…

At 11:58 pm, how many bacteria would have realized that they were running out of room?

And if you retire at age 65 and your money is invested at 10%, how old are you at 11:58pm?

Yep, that’s right….  You are 51 years old.

Have you got enough money in your jar?

e” – where Finance meets Science

Many of you would know I am  a trained accountant.  Most would not know that my original training was in science and engineering.  It’s that aspect of my life the I would like to write about now.

All of you would however be familiar with the concept of interest rates.  A nightly topic on the news, interest rates determine how much spare cash we have after the mortgage payment.  And the total mortgage paid is a simple calculation.  To save time, I’m going to skip the math…  but the formula is:

FV = PV(1+r)^t

Where:

FV = Future value

PV = Present Value

r  =  Interest Rate

t  = time

its the formula for calculating the total amount you pay – and, (just like me), its not very sexy!

The Cool Thing though, is if you have a greedy banker!!

Continue reading