Category Archives: “Smart contracts”

The Neverending Ethereum Disaster

This month Bitcoin almost split in two, pulling back from the brink at the last minute. Of course, there is no solution in sight for the dire scaling problems of Bitcoin, but who cares as long as the exchange rate keeps rising against the weakening US dollar?

Etherereum should be so lucky. After the DAO disaster in 2016, followed by several hard forks that rewrote history, you would think that sensible people would have headed for the hills. Of course that’s not happening.

This fall has seen yet another disaster. One of the most used wallets experienced a bug which led to the freeze of a large amount of Ethereum. I don’t really understand the bug itself, but somehow the coins were consigned to accounts that can no longer be managed. You can see your money, but no one can get it.

Just as baffling as the bug, there seems to be little urgency to fix it. It’s been a week now, and there seems to be little idea of what can be done, and shockingly little indication that anything will be done soon.

Stan Higgens writes in Coindesk that “Parity Floats Fix for $160 Million Ether Fund Freeze”, but the actual text indicates that there is no fix in sight except maybe a hard fork due in 2018 [2]. In other words, you are out of luck if you are wanting to use some of those millions of Ether any time soon.

The good ship Ethereum is like the Titanic, except when it sinks they roll back time and sail again—to sink all over again.

It is important to point out that these disasters in Ethereum are mostly not due to the core protocols and cryptography that define the distributed ledger itself. The DAO went down with all hands because of a bug in executable contract code, and the Parity Wallet ran aground due to the wallet code (related to executable contract code, I think), not the ledger itself.

The point is, security is an end-to-end thing <<link>>. People who talk about how invulnerable the core ledger is supposed to be are missing the point: Ethereum or any cryptocurrency is only as secure as the weakest link between two users. And there are a lot of links: wallets, APIs, servers, networks, mobile devices, and OS code, to name a few. And there are people in the chain, too, heaven help us.

At some point, you have to ask whether Ethereum is creating more problems than it is solving.

  1. Stan Higgins, Parity Floats Fix for $160 Million Ether Fund Freeze. Coindesk.November 13 2017,
  2. Parity Technologies, Parity Technologies Multi-Sig Wallet Issue Update, in Parity Technologies Blog. 2017.


Cryptocurrency Thursday


Yet Another Blockchain Use Case: Sharia Compliant Transactions

Blockchain technology, like classical bookkeeping, is generally culturally and morally neutral. Smart contracts, a la Ethereum, are technical expressions of contract conditions, which can refer to pretty much any body of law or custom.

A new initiative is setting out to develop Sharia compliant contracts on top of Ethereum. The general idea appears to be to encode Islamic principles in the logic of the programs, to ensure that proper rules are followed. These rules are supposed to prohibit charging interest, gambling, and speculation, among other behavior.

The compliant contracts will presumably structure transactions and trades in ways that do not cross the line. Furthermore, the public nature of the contracts and the distributed ledger will make the compliance (or any slippage) visible to anyone—a significant motive for good behavior.

I’m no expert on these topics, but I gather that there are centuries of practice that defines ways to get business done without straying from Sharia. This framework will encode these practices in formal logic and executable code.

That’s pretty neat.

One advantage of using this kind of executable contract is that there are likely to be cases where a transaction needs to be very carefully structured to achieve the goal that might have been achieved by, say, an interest bearing loan, without violating Islamic principles. The digital technology will make it possible to create, validate, and execute even complicated transactions easily and quickly. There should be no performance penalty for complying with Islamic principles, even if there should be extra hoops to jump through behind the scenes.

Of course, there are some interesting challenges.

It’s one thing for programmers to create a logical framework, but its quite another thing to show that it truly, accurately, and completely complies with any given legal principles, Islamic or other. A significant part of this work will surely be careful review and documentation of the logical framework’s compliance. Just what needs to be proven about the logic of the contract, and just what kind of proofs would be adequate? That will be an interesting body of literature, indeed.

Overall, this could be a ground-breaking effort. To date, much of the work on smart contracts has been from a non-Islamic perspective (and sometimes without any legal framework at all). It will be interesting to see how the deep historical principles of Islam are expressed in this a-cultural medium, and it may inspire other religious and ethical frameworks. I am not aware of any other similar efforts.

(For one example, how about encoding the various Creative Commons licenses into standard smart contracts? Perhaps that has already been done.)

This project also makes me think.

I wonder if it will be possible to automatically translate between different executable contracts. Can I have a button to “make this ‘smart contract’ be Sharia compliant”?  Perhaps tools could have a high level specification of what is intended, and then options for creating concrete contracts within one or more legal frameworks.  That would be kind of cool.

One huge caution I would have for this project is to look carefully at the blockchain software and protocol. While any given executable contract might be Sharia compliant, if the transactions are executed and recorded on an open system, the other data there is almost certainly not Sharia compliant. The ethical records will be in the same data blocks with everything else: on-line gambling, speculative bets, interest payments, and so on. And the transactions will be processed by software that also processes all these other activities.

The question will be whether this approach is acceptable or not. Is it OK to handle, at least indirectly, all these other transactions?  Or should the software only be used for compliant transactions?

This concern could be mitigated by a private blockchain that only handles Sharia compliant transactions. (Perhaps Ripple might be a better match than Ethereum, since it already is designed after a Halawa network, and let’s you control who you trust.)

I would also urge that the consensus mechanism be examined carefully. Nakamotoan consensus depends on mining that has an incentive system that may or may not be consistent with Sharia. The Nakamoto block reward strongly resembles a lottery or slot machine, which seems problematic to me.

Ethereum may be moving to a proof-of-stake method, and there are other possibilities. These alternative ‘math problems’ might have significantly different ethical implications.

This project is quite interesting, and will bear watching as it develops. I’d like to see blockchain technology put to socially positive use.

  1. SettleMint, SettleMint to create Sharia compliant financial products for the Islamic Development Bank member countries. 2017.
  2. Sujha Sundararajan, Islamic Development Bank to Research Sharia-Compliant Blockchain Products. Coindesk.October 20 2017,
  3. Bernardo Vizcaino, Saudi Arabia’s IDB plans blockchain-based financial inclusion product, in Reuters – Fintech. 2017.


Cryptocurrency Thursday

Cryptocurrency Spins Out Into The Woods?

Is cryptocurrency technology heading down a path to disaster?

This summer Bitcoin is dominated by the ongoing crisis of “governance”, which is leading to fork after fork. It is increasingly evident that Nakamotoan “decentralized” and “consensus” based decision making is less than optimal for something serious like digital money.

The Bitcoin “community” (and we must use the term loosely) is, as Alyssa Hertig trenchantly says, a “Culture of Infighting”.


This has also been a year of multiplying “Initial Coin Offerings”, ICOs. Aided by an ever more automated process, practically anyone can whip up their own tokens, have a quick online auction, and pick up a quick mill or more. Cool!

(And I do mean “quick”. ICOs are infamous for their opaque online auctions that last a few minutes and are sucked up by big players.)

If this sounds like selling unregistered securities (on unregulated markets), the US Securities and Exchange Commission agrees. The SEC Guidance is pretty simple: if it looks like a security, then it is covered by US laws. Period.

Has this dampened enthusiasm? Not much, though it has been a boon for lawyers as people try to thread the needle to avoid regulation, yet still cash in.

As Avtar Sehra comments, the world of ICOs is now exploring various “workarounds” that resemble the “creative” business models of Pachinko parlors. These efforts basically try “to execute undercover securities issuances”.

It’s questionable how well this will work. The SEC tends to be pretty unforgiving of such shenanigans.

And Sehra makes the important point that pouring effort into this penny ante quick money stuff is neglecting the real opportunities that may exist to use this technology within the legal framework.

These workarounds “may be limiting the vision and creativity required to see the true scale of what ICOs and digital tokens could represent; blinding many in the industry to possible risks if they take the wrong path.”

Honestly, it seems to me that cryptocurrency technology is charging down the wrong path, ignoring warning signs and shoving aside the grown ups.

  1. Alyssa Hertig, Bitcoin’s Battle Over Segwit2x Has Begun Coindesk.August 30 2017,
  2. Avtar Sehra, The New Pachinko? Exploring the Economics of Initial Coin Offerings Coindesk.August 20 2017,
  3. US Securities and Exchange Commission, SEC Issues Investigative Report Concluding DAO Tokens, a Digital Asset, Were Securities. 2017: Washington, DC.



Cryptocurrency Thursday

Shock Report: “Smart Contracts” Are Subject To Interpretation

To hear enthusiasts for “Smart Contracts”, they are magic. The meaning of the contract is enshrined in code, and executed by computers. Cryptographic signatures and blockchain protocols assure that the contract is executed correctly and honestly. Once written, no human intervention is needed or, indeed, possible.

Entire businesses are created on this basis, so called Distributed Autonomous Organizations. Once created, these DAOs chunk along mechanically, executing business “autonomously”. No one disagrees about the results, mistakes and conflict are not possible.

This is better than magic. It’s the magic of capitalism raised to the power of magic!

What could possibly go wrong?

In the very drafty basement of this castle in the air lies the claim that these executable contracts are not only always and completely correct, but also accurately and unambiguously express the intentions of the humans involved.

The former would be an historic first in the history of software, and the latter would be an historic first in the history of human thought.

You don’t have to take my word for it.

This month, the International Swaps and Derivatives Association (ISDA) issued a whitepaper, “Smart Contracts and Distributed Ledger – A Legal Perspective” [1]

The ISDA is a group that publishes standards for contract language for derivative contracts. These people define what “is” is, and what “means” means.

With all the nitter-natter about doing derivatives trading using executable “contracts” on a blockchain, the ISDA has taken up the question of just hos “contract-y” these so-called contracts may be.

The report is rather long and dry, and generally extremely well thought out.

The key point probably is:

Certain operational clauses within legal contracts lend themselves to being automated. Other non-operational clauses – for instance, the governing law of a contract – are less susceptible to being expressed in machine-readable code. Some legal clauses are subjective or require interpretation, which also creates challenges.” (p. 3)

Basically, some “smart contracts” are simple bits of code that do something. But an actual derivative contract has a lot more in it that “operational” clauses, and you can’t leave them out. Furthermore, it’s those “non-operational” parts that are the subject of interpretation and dispute. Very few law suits are about account numbers or dollar amounts, they are always about whether and how rules apply.

The bottom line is that “smart contracts” will be subject to interpretation and dispute, period. The question is how to make them work well.

It is important to note that the ISDA report is talking about contracts in the legal sense of the word, an agreement recognized by law. While enthusiastic techies may imagine that they can declare their code to be outside any conventional legal system, it is generally the case that judges will decide what they have jurisdiction over. Code that isn’t recognized in a jurisdiction is probably not a contract in that jurisdiction, no matter how cunning it is.

Which means that the ISDA’s opinion is relevant, to say the least.

The “non-operational” language includes common phrases such as “good faith”, and “ordinary practice”. The report points out that these terms are intended to be subject to interpretation, if only because it is never possible to state all possible future conditions. They also point out that these terms may be interpreted differently by different authorities, which is why it is important to specify which authority will rule.

The report suggests hybrid contracts, part of which are machine executable, and part of which are interpreted by humans. This will require standardization of executable contract code, so the contracts will work everywhere. In short, the report concludes that ISDA has a critical role to play.

  1. International Swaps and Derivatives Association, Smart Contracts and Distributed Ledger – A Legal Perspective. 2017.


Cryptocurrency Thursday

A Quantum-Safe Blockchain?

I noted earlier that the arrival of quantum computing (QC) is a dire threat to the Internet in general and cryptocurrency in particular. Despite the rhetoric about how groundbreaking the Nakamotoan blockchain [2] was, the implementation of Bitcoin is hardly technically cutting edge. Based on easily available cryptography currently used on the Internet, there was no consideration of the expected arrival of QC. It has arrived [3], and Bitcoin is obsolete.

What is to be done? That is not clear. There are no known ways to make the current Bitcoin protocol and data structures “quantum safe” let alone secure the rest of the Internet that Bitcoin relies on.

Last week there was excitement about an announcement from the Russian Quantum Center, which reports that they have developed “the first quantum safe blockchain” [1]. I’m far from expert on Quantum Key Distribution (QKD), but the basic idea is to replace public key based digital signatures with QKD. This addresses the greatest vulnerability in the blockchain. (I’m not positive that this addresses all the vulnerabilities, but I really don’t understand this technology very well.)

This is a good idea, indeed, an obvious approach. Problem solved!

Actually, it’s not clear that this theoretical solution is even relevant to Bitcoin in the real world.

First of all, QKC is a method for sharing keys between trusted parties (and it is rare and expensive).   This is great at the root of networks, where there are a relative handful of peers and steps can be taken to establish trust. The current PKI systems, on the other hand, are open source, ubiquitous, and equally available to everyone. We don’t need any “root” to be able to establish trust between us.

It’s not clear how soon we’ll all be able to exchange keys with each other via QKC. Until then, this technology is controlled by the big boys. That’s quite a problem for the decentralized philosophy of Nakamotoan blockchains. If we have to trust the root key managers, then we might as well have centralized servers, no?

Maybe the quantum internet will be deployed quickly, though IPV6 still isn’t fully deployed after 25 years, and there is a whole lot more “net” than there used to be. Depending on what this new architecture looks like, it might or might not be the right stuff for peer-to-peer protocols to run on, anyway.

The system described in the paper is essentially a whole new protocol. I’m not sure how it could be retrofitted on a system which already has zillions of records stored. Even if things were “quantum safe” from now on, would the old transactions be secure and trusted? I dunno.

Regardless of the ultimate usefulness of this or any other “quantum safe” blockchain, it is hard to see how it could ever be adopted by Bitcoin. For the past two years, we have seen Bitcoin thrash, unable to implement a very simple technical upgrade to deal with block sizes.  How in the world will it implement something even more radical, something that may require new hardware and fundamental changes to the system? I’m not holding my breath.

My own guess is that Bitcoin and other similar cryptocurrencies with come down with a sudden crash when quantum equipped hackers break in and steal everything. The end will be swift and irreversible.

It is more likely that this QKD technology will appear in private blockchains, running on private networks. On the other hand, if you have already built a trusted network with QKD, then you may not actually get much benefit from using a blockchain. I dunno. We’ll have to see.

  1. E.O Kiktenko., N.O. Pozhar, M.N. Anufriev, A.S. Trushechkin, R.R. Yunusov, Y.V. Kurochkin, A.I. Lvovsky, and A.K. Fedorov, Quantum-secured blockchain. 2017.
  2. Nakamoto, Satoshi, Bitcoin: A Peer-to-Peer Electronic Cash System. 2009.
  3. National Security Agency, Commercial National Security Algorithm Suite and Quantum Computing FAQ. National Security Agency CNSS Advisory Memorandum MFQ U/OO/815099-15, 2016.


Cryptcurrency Thursday

Blockchain Use Cases: Theme Parks?

Jegar Pitchforth writes in Coindesk about “5 Ways Theme Parks Could Embrace Blockchain” [1]. His basic idea is that theme parks are historically “early adopters” and pioneers of technology, and should pioneer the use of blockchain technology.

He specifically identifies five use cases:

  1. Ticketing
  2. “Fastpass tickets” (i.e., specific deals)
  3. Theme Park Currency (Branded)
  4. Audience Surveys
  5. Pay audience to advertise


These are scarcely new ideas. Indeed, the entire article refers to existing programs. The point must be, and the question is, what does blockchain technology bring to the table? How would a blockchain be better than current technology?

Let’s look at his use cases to see what value blockchain brings, if any.

In the case of ticketing, it seems that the main advantage is that a blockchain system can be securely accessed by any smartphone.   Current systems work fine, as far as I know, and wearable technology makes it even more convenient than a smartphone.

The “Fastpass” use case has the potentially interesting wrinkle of using “smart contracts” to implement markets for these ‘rights’. Guests could trade and bargain for seats on rides, and so on.  Or there could be various conditions attached (“You can ride if you and 3 of your friends show up in 15 minutes….”)

Assuming that this kind of activity is a desirable feature (and for some fantasy worlds, I’m not sure that you want people diverting attention to such matters), it isn’t clear that blockchain is any better or worse than any other technology. After all, so called “smart contracts” are really, really simple logic, which can easily be built into a conventional database.

The idea of Theme Park Currency is nothing more or less than digital tokens or coupons, with a ton of general purpose overhead. Since these ‘coins’ are essentially private tokens issued by the park, they aren’t “decentralized” at all. In that sense, blockchain is a terrible choice, completely incongruent with the use case.

The last two hinge on using the cryptocurrency as loyalty points to incentivize the victims guests. This may or may not be desirable thematically (and is certainly ethically problematic when children are involved), but you don’t need a blockchain or private cryptocurrency to make it work.

Overall, there is little technical or logical reason why blockchain technology is especially well suited for any of these use cases. Indeed, to the degree that blockchain is generic and invites attention to commerce it is interfering with the effort to create a magic world and to command total attention and immersion.

It is true that a blockchain-based solution might be cheap and easy compared to creating a secure private network. However, much of the cost and effort must go into the user experience not the back end details, so I’m not sure if there would be much cost savings.

Most of the features of the blockchain are actually irrelevant to these use cases. The data systems of a theme park are extremely private and highly localized. What is the advantage of using an open, internet-wide data system?

Above all, the entire theme of a “theme park” is trust. We hand over part of our life to the designers, trusting them to give us a safe and enchanting experience. Ticketing, tokens, and whatever else must all be integrated to be part of this trusted experience. What is the advantage of using a “trustless” technology to implement this deeply trustful system?

Overall, it looks to me like you could use blockchain technology, but there is hardly a compelling case to do so. And if you do, it will be necessary to integrate it into the overall magic, which likely will mean that the blockchain should be invisible. If it is done right, you’ll never know it is there.

Actually, a successful deployment would be very good for blockcahin technology in general, because it would have to create a safe and wonderful user experience.  To data, the “user experience” with blockchains is very, very weak. A Disney quality interface would lift all boats.

For example, a blockchain system requires guests (including children?) to manage cryptokeys  In the theme park this must be safe, intuitive, and generally invisible.  Developing cool metaphors and UI to do this would be a great thing to see, and would advance the whole field.

  1. Jegar Pitchforth, 5 Ways Theme Parks Could Embrace Blockchain (And Why They Should) May 16 2017,


Cryptocurrency Thursday

A Bad Idea Implemented with A Bad Idea

Let’s be clear. I find gambling to be boring and stupid myself, and I don’t admire gambling businesses that are built the weaknesses of people. Casino and other on-site gambling is a bad idea, but at least it gets people out in the world a little bit. Online gambling is a really, really bad idea, enabling people to feed their worst inclinations in the privacy of their own home.

You won’t b surprised that I’m not a big fan of the new initiative by an opaque company called Better Gaming, who are building an Ethereum Slot Machine: a slot machine that uses Ethereum smart contracts.

The innovation here is that this game is running entirely in a smart contract. No servers are required to operate the game, unlike existing online casinos.

Running “entirely in a smart contract” isn’t quite accurate: there is no server, but much of the logic runs on your local device.  However the logic of the gambling machine is implemented with smart contracts, which is the main point.

Readers of this blog know that I have a low opinion of “smart” contracts, Ethereum or otherwise. So, I’m especially excited to see this poorly designed technology used to implement the inherently bad idea of a slot machine. Not.

Obviously, the game itself isn’t innovative. They have gone to great trouble to replicated the behavior of these ubiquitous one-armed bandits. The “innovation” is to eliminate the server, in a fully decentralised and provably fair.” system.

For once, this Distributed App (Dapp) is actually solving a real problem: trusting your online gambling provider not to cheat is, well, a gamble. Gamblers can’t win, but they want to lose honestly.

The game’s logic has to be wholly processed within the smart contracts so that anyone who wants to can see that the game is playing by the rules and can’t cheat

Of course, they are also “solving” another problem, how to run an unregulated gaming operation, “off shore” from everywhere. Cryptocurrency is, if nothing else, a perfect digital “poker chip”, easy to move around, and not tracked by annoying tax agencies or vice squads. This slot machine isn’t taxed or regulated, and all the money goes…who know where it goes?

To give them their due, there are a couple of legitimate technical innovations in this product (at least according to their write up).

First of all, they made the user app asynchronous from the blockthain. It’s extremely important to give instant gratification to the lab rat gamer, and the blockchain has too much latency to always respond instantly. So they worked out protocols to mask the delay, presumably with caching on your local device. This is a significant achievement, and certainly caught Corin Faife’s attention in Coindesk. If this is successful, it may be a model to emulated by every Dapp.

A second technical feature is the random number generation (RNG). As Donald Knuth pointed out all those years ago, “Random numbers should not be generated with a method chosen at random.” [2] This group uses the blockchain with its pseudorandom hash in its random umber generation. I’m not sure what their method is, exactly, but this is a rather clever idea because the hashes are already very solid pseudorandom numbers.


Overall, this is yet another example of how bad ideas sometimes inspire brilliant software. This sounds like it will be a very solid implementation of a bad idea (a digital slot machines), and it will make excellent use of a bad idea (Distributed apps using Ethereum contracts), with some creative technical wrinkles. Sigh.

One sign that this is technology whose time has come: the Better Gaming  folks are already making legally licensed online games, and presumably making money.  Yet they believe it is worth building with this new tech, even though they are well aware that the powers-that-be will not easily approve it.  They should get credit for a gutsy technical gamble, and it shows just how promising this technology is.

it’s so new that we don’t expect regulators to fully grasp nor appreciate the implications overnight and there will need to be lots of discussion and negotiation before existing gaming jurisdictions license such activity.”

  1. Corin Faife, Watch This Ethereum Slot Machine Make Payouts in Real Time. Coindesk.April 21 2017,
  2. Donald Knuth, The Art of Computer Programming: Vol. 2: Seminumerical algorithms (3 ed.). Boston, Addison-Wesley, 1997.
  3. Jez San, 1st Demonstration of real-time casino games built with Ethereum Smart Contracts, in Medium. 2017.


Cryptcurrency Thursday