Most of the time in tech, you can stand on the shoulders of giants and reuse great works to your benefit, whether those things be algorithms or engineering methods. But, sometimes, as you venture towards the edge, you realize that you’re now somewhere completely different. You find yourself floating in some unknown ether, and you need to reorient yourself to this new dimension. And the more I play with the Ethereum platform, the more I find myself in that position.
For example, when I first started to create the Wonka rules engine, I had a few plans in mind, with one being to possibly use the Rete algorithm within the project. After all, it provides an efficient solution for a dynamic situation. Specifically, this dynamic situation could be one where a rule at the end might change the data, and then the whole set of data would need to be reevaluated by the rules due to that change. In this case, the Rete algorithm provides a performant method for this possibly recursive set of reevaluations. But that’s in the normal world, not the Ethereum one.
Within most standard computing, there’s minimal cost to using a system’s resources. At worst, you’re paying a cloud provider for cycles; in order to run a limited set of rules, you’re still talking pennies. But in a blockchain environment like Ethereum, where you have a massively distributed database of decentralized shared resources, every execution is an expensively coordinated effort. In order to change the state of the system, the cryptocurrency of the system, Ether, is used to cover the cost of a transaction, which is described as the ‘gas’. And even though the market value for Ether keeps sliding down, it still means that every rule that changes the system is another line item on your ‘gas’ bill. That’s difficult to predetermine since it’s always based on context. Yes, you can run your own private Ethereum blockchain within your own network (instead of the mainnet), and that means you’re not paying real Ether at all…but, in the end, people using blockchains generally still want accurate measures of impending execution.
Which brings us to the ultimate question for anyone using a rules engine within a blockchain like Ethereum: how much is this damn thing gonna cost me to run? Since the answer could be “a lot”, we have to abandon our beautiful, time-proven algorithms and go back to the drawing board. Which is why when you’re dealing with nascent platforms, you have to go back to KISS (i.e., Keep It Simple, Stupid). So, in this MVP version of a rules engine, I did just that, creating a straightforward implementation that just gets the job done. In this current state, its destiny will more than likely be as unwept, unhonored, and unsung. However, at the very least, such a prototype can be used by others to evaluate and perhaps validate the existence of a rules engine in this new space. And, maybe, just maybe, it can serve as the first iteration of something that will eventually become worthy of note.
On a side note, it turns out that getting a ticket to DevCon is a lot harder than I thought.