Category Archives: Open Source

Magic Marker on a Pig

Well, I’ve been working on Wonka, a rules engine that uses Nethereum to integrate with the Ethereum blockchain, for about 2 years now and…2 years?! How did all that time simply disappear?! In any case…

After playing with it for so long as just code and libraries, I figured that it would be more interesting if there as a GUI (i.e., “a shiny”) to showcase what it can do, on a very elementary level. So, I created a rules editor (i.e., this rudimentary Blazor app) that uses Radzen controls to demonstrate a few key things:

  • How to download a Wonka rules file through IPFS
  • How to instantiate the Wonka engine
  • How to traverse a RuleTree and view its contents
  • How to dynamically add new rules onto a RuleTree
  • How to export a RuleTree into XML form
  • How to execute a RuleTree with a data record
  • This version of the Blazor app just showcases how one can use Wonka to run the rules in the .NET domain and how it could be extended (especially in utilizing Nethereum). Later, I hope to show more advanced functionality, like how one can serialize the RuleTree to the blockchain and then invoke it on the chain.

    Wonka is a little rough around the edges, and this Blazor app is a little clunky…but, together, they get the job done!

    Or so I like to think.

    ONIX Data Library: The Reckoning

    Yes, here it is, the exciting sequel to the ONIX Data library, starring ONIX 3.0!

    Well…maybe it’s not that exciting. Actually, on second thought, it’s the complete opposite of exciting. I guess that it’s still hard to get excited about, since it’s for that niche segment of developers (like me) who deal with both C# and ONIX. In any case, as opposed to the previous version of the library (which supported ONIX 3.0 only minimally), the new version of the library handles much more of the 3.0 standard, and for me, it’s been a labor of…love? No, that’s too strong a word. Labor of…amusement? No. Hmmm…how about labor of scratching an annoying itch? Hmmm…yeah, that fits. Let’s keep that one.

    So, for those scant few from last time, we’re gonna throw another one of those crazy ONIX parties! And those 3 people who put a star on the Github project, you’re invited too! It’s gonna be insane!

    I Always Start with a KISS

    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.