The Most Significant Future Risk Around Blockchain: ECDSA … and Meet IOTA
The security world has fallen head over heals for Elliptic Curve Cryptography (ECC) methods, and ECDSA (Elliptic Curve Digital Signature Algorithm) is becoming the standard in creating keys and to sign for transactions. For exchange key it is ECDH (Elliptic Curve Diffie Hellman) that often creates our secure connections.
But quantum computers have both ECC and RSA is their sights. But what’s at risk? Well a core risk is around keys used in ECDSA and the signatures added to the blockchain, including within Ethereum and Bitcoin. With this they use the ECDSA method to create the keys for the wallet and to sign for transactions.
With ECDSA, we create a random 256-bit private key, and then can easily derive our public key. It is then extremely difficult to find the random value which generated the given public key:
The private key is used to sign for transactions, and the public key proves that a given private key has been used. But with Shor’s algorithm we are able to reverse back the private key for any public address, and thus take over control of a person’s wallet.
As an alternative we can use hash-based signature, and which are used by IOTA. They are simpler from ECDSA, but are also quantum robust. For IOTA the method used is the Winternitz one time signature scheme (W-OTS). As it is only used once, we should not sign for a transaction with the same details (and this could be easily spoofed).
Winternitz one time signature scheme (W-OTS)
W-OTS uses relatively small key and signatures sizes, and is thought to be quantum robust. It generates 32×256 bit random private keys. We then have these a number of times, and is defined by a parameter (w). If we use w=8, we hash the private keys by (2w). This creates 32×256 bits public keys. The signature is the created by taking eight bits at a time, and then the 8-bit binary int (n) is subtracted from 256 and the private key is the hashed 256-n times. The signature is then 32 hashes which are derived from random private keys. To verify the signature, the recipient parses the hash of the signature (using 8 bits at a time, and extracting the 8 bit int, n). The signature is then derived from the signature.
The method is:
- Initially we create 32 256-bit random numbers. These 32 values will be our private key.
- We then hash each of these values 256 times. These 32 values will be our public key.
- We now take the message and hash it using SHA-256. This produces 32 8-bit values (N1, N2 … N32).
- For the signature we take each 8-bit value in the hash of the message, and then hash 256-N times (where N is the value of the 8-bit value).
- To prove the signature, we take the message and hash it with SHA-256, and then take each 8-bit value. We then hash the 8-bit signature value by the number of times defined by the message hash value (N1, N2..). The result for each operation should equal the public key value.
This is illustrated below:
A sample run which just shows the first few private key and the first public keys:
Hashing number: 256
==== Private key (keep secret) =====
==== Public key (show everyone)=====
==== Message to sign ===============
Message: The quick brown fox jumps over the lazy dog
==== Signature =====================
The signature test is True
A demonstration of the method is given here.
Getting Ready to Tangle
- 1st Generation. These cryptocurrencies, such as Bitcoin, Litecoin, Monero and Bitcoin Cash, basically just store and transfer value, but have suffered from poor scaling and a weak architecture. The overheads involve relatively high transaction fees and transaction times.
- 2nd Generation. These cryptocurrencies, such as Ether, Neo, and Lisk, have platforms that support decentralised applications (dApps). This generation adds coding and smart contracts, and supports logical operations. A high-level code is then translated into byte code for the Blockchain.
- 3rd Generation. These cryptocurrencies aim to create properly distributed systems, and many use DAG (Direct Acyclic Graph). A traditional Blockchain just sequentially stores transactions and which can take some time to create a consensus through the building of blocks. With DAG, each of the transactions becomes a block, and it thus speeds up the consensus mechanisms.
Many of new cryptocurrencies differ greatly from Bitcoin. Ripple, for example, is not like Bitcoin, and is used for the fast consensus on money transfers, and which can achieve rates of clearing that approach Visa and Paypal. Another interesting one is IOTA, and it has IoT devices in its sight:
IOTA and DAG
IOTA uses a method called Tangle to create a scaleable infrastructure for transactions. It is likely that the crash is due to the database for Tangle being too large for some hosts, and that they have crashed. The IOTA team are thus busy updating their system to cope with the limits, and also to support more limited devices in the future.
IOTA aims to provide a new foundation for IoT devices and M2M (Machine-to-machine) communications, and overcome many of the existing problems of blockchain. Overall it is described as the:
“Economy of the Future”
and it adds a new innovation of blockless ‘Tangle’, and which has no transactions fees and no limits on scaling. The network transaction speed then grows with new activity, and where it is built around transactions and not miners, and thus does not centralise its activities. As there are no miners, there are no conflicts of interest. As there are no fees, it can also support nano payments (extremely small transactions of crypto currency).
A bit of a tangle
The Tangle uses a DAG (Directed Acyclic Graph) for its infrastructure rather than a blockchain to store its ledger. Blockchain methods have rate limits as nodes must agree to the whole chain (and where forks and branches are discarded), The Tangle supports new branches to be created, and which will eventually merge back again. This supports a faster overall throughput, and for consensus to be built through nodes submitting their transactions, and also checking the validity of recent ones.
In his ground-breaking paper [academic paper], Sergio Demian Lerner outlined that in a DAG there were no fixed blocks, and that each transaction brings with it, its own proof of work. Within this he defined the usage of a fast cache for the most recent transactions, and where older transactions cannot be used as a reference.
Within Tangle a DAG is created and where vertices represent transactions, and edges represent approvals. The first transaction is defined as the genesis, and all the IOTA tokens are created from this. On a new transaction from a node, a new vertex is added to the DAG, along with two previous transactions which it is approving. The approval process means that the node has verified the history of the transactions and that they seem to be valid. This check is normally related to the balance on the accounts, so that there are no double-spends and there are are no bogus transactions. If a transaction is approved by large number of nodes, it is part of the consensus, and then cannot be altered. The amount of work required to create the consensus for a transactions is large, and would require the spamming of the network.
In the example in the paper, Sergio defines the DAG before a join transaction arrives and afterward (see diagram below). The system allows for two conflicting transactions to be included in the DAG-chain, as long as the second does not references the first (see figure below, with transactions 2 and 3). Each transaction then has a confirmation score. As more transactions are added onto one transaction or the other, the confirmation score will increase (a). A transaction will no children will have a score of zero. If a transaction appears twice, the one with the highest score will win. In (d) a new transaction has arrived and which conflicts with transactions 2 and 3.
Still work in progress
IOTA is still under development, and the nodes going off-line are just part of its growing pain. Unfortunately is not quite a proper DAG as it still requires proof-of-work. ByteBall is more closer aligned to DAG [here]. A major selling point for Byteball is that it supports conditional payments, where if a condition is not met by the other party, you will get your money back.
So could DAG solve the current issues with blockchain? Well blockchains needs to overcome the usage of hard forks. It is also under risk from influential miners. And finally … it is a tortoise compared with the hare that is the current payments network.
With Bitcoin consuming the energy of Ireland just to create its consensus mechanism, we need to find new ways of creating our ledger.
IOTA is evolving and building new types of systems. It doesn’t come with the flaws of Bitcoin or Ethereum, and creates a faster consensus and does not require miners to consume vast amounts of energy.
But here’s a sales pitch:
- IOTA is truly distributed.
- IOTA has no transaction fees.
- IOTA has no scaling issues.
- IOTA has no network scaling problems.
- IOTA has no miners (and uses transactors rather than miners).
- IOTA is quantum robust.