Building a kitty utopia with Rust & Solidity: I — Kitception
If I leave the world one thing, I’d like it to be this
How did it come to this? My contribution to the world must surely reach further? But one must be humble. “Start with what you can do”.
Sure, I wanted to join the all time greats and have a lasting contribution to the world of encryption, but I also wanted to meme. The meme must be strong.
Birth of the zero-knowledge Community Autonomous Taxation System
It started innocently enough. I was researching this interesting maths/software problem, as one does when they fall down a new tech rabbit hole. Suddenly there they were — the titans of the zero-knowledge proof* world with their hilariously named systems: STARKs, SNARKs, and PLONKs. I swear I am not making this up.
*if you’re lost already, don’t worry, we’ll make it make sense
And I thought: “These people will be remembered for generations. Not for their groundbreaking cryptographic innovations, but for their absolutely top-tier acronym game.”
That’s when I knew my calling. If I wanted cryptographic immortality, I needed an acronym that would make people take notice. Something memorable, something… meme-able.
Enter zkCATS
Zero Knowledge Community Autonomous Taxation System. Is it revolutionary? Maybe. Is it another excuse to put more cats into distributed systems? Absolutely.
First, relieve yourself of any preconceived notions of how the world works *right now*. We need to let our imaginations run free for a moment.
Imagine a future where we don’t have an over-arching powerful sovereign state taking half of our money, but instead we have a system whereby society members voluntarily funnel resources into those areas most needed by their community, based on a system of direct democracy, leveraging distributed ledger technologies and encryption.
You might say we could imagine further, and build a world where we have no taxation at all. Sounds like a dream, but one that might quickly devolve into a Hobbesian state of nature. One in which all domestic cats would have to fend for themselves. It cannot be. Kitizens, unite!
Let’s think of a way we can provide a template for establishing a minimal social contract for monetary contributions — to keep things ticking over, but allow different (kitizen-proposed) percentage distributions to different community causes to be agreed upon, transacted, and then proven cryptographically, while retaining high levels of privacy (zero-knowledge of individual transaction history and balances).
This is the idea I will play with in a fun ongoing project I am using to learn more about zero-knowledge proving systems and smart contract development. These are topics which can be… a little dry. Hopefully my playful analogies will make following along feel a bit less like chewing on dried catnip - but I will admit sometimes they will become a l-iittle stretched.
The problems of centralization
As with all system design problems, we should probably start by having a look at an existing system. Let’s (very reductively) summarize the way the current system is supposed to work with a fun diagram:
Humans (in all their wisdom), have managed to devise a system, which most are born into, whereby they allow a certain percentage — dictated by some much wiser economists and politicians — to be removed from their monetary rewards for labor. Under this system, kitizens would not get to vote on the specifics of the distribution system, but they would cast their vote for a set of delegates and… trust them to do the right thing. As a reward, certain public goods and services would be made made available (security, healthcare, emergency services etc.). Not everyone, not even a majority of the population, would need to agree to the set of delegates, although all should contribute. We won’t go into the weeds with regards to different levels of taxation — for now, this simple model will do.
Points of failure & points for improvement
We can identify several points of failure in this system:
- Firstly, if a kitizen managed to avoid the centralized enforcement of their contribution, they would have an unfair advantage in life over their peers (see the fatcat, top-right). They would still benefit from the public goods, but without contributing.
- Secondly, if certain kitizens did not agree to the set of delegates chosen, or were not there on the day of choosing (like Deb, who was of course sleeping), they would nevertheless be forced to contribute, with the distribution of funds chosen in a way that they didn’t agree with. However they would still benefit from the public goods.
- Thirdly, even if kitizens got their choice of delegates, some of the delegates might not act in their best interest (!), and might distribute the funds in a way that was not fair or representative of the kitizenry (not optimized for public good).
- Finally, although individual balances remain private, they sometimes need to be made transparent to the centralized authority that enforces (👮) and accounts (🧐) for the system. Such audits are the stuff of kitty nightmares and we would prefer to avoid them, while still proving compliance to the other kitizens.
Let’s see if we can replace or improve upon some of these points of failure through decentralization. For now we aren’t going to worry about aspects such as contribution enforcement (kitties generally like a quiet life, anyway), but we will be concerned with accounting.
Our main aims are to keep/improve upon the existing levels of privacy — and see if we can introduce devolution, voluntarism and autonomy, and see if that brings more fairness (social justice) or efficiency into the system.
Introducing voluntarism/devolution, leveraging DLT
Let’s start with the accounting system. Since the invention of Bitcoin and as a consequence the developments in the field of distributed ledger technology (DLT) that allow a public ledger of monetary transactions (a form of triple-entry book-keeping) to be enforced with cryptography, we can posit that (a) the use of a public ledger for accounting and (b) the use of smart contracts to automate certain aspects of monetary re-distribution might produce a fairer system.
Here we introduce devolution of power from the centralized enforcement/accounting services, by routing funds directly to the accounts of those managing the services.
One could argue that, what with the widespread privatization of a lot of public services in the last few decades, this is not a huge leap. We could remove the third party enforcers/accountants from the system and optimize for value to the end-users. This requires the introduction of a trust-less system (although, it’s only really trust-less on the record-keeping level). To address trust at the human level, we would need some kind of reputation system.
We hereby also introduce voluntarism via the use of a public space or Agora for the discussion of, and agreement on, a shared social contract. The space also acts as a way of showing reputation via some kind of badge system (to be worked out later) that lets other kitizens (a) See if you have voted and (b) See if you have contributed to the shared fund.
This Agora could also become a centralized point of failure if it does not also become decentralized in its’ operation and maintenance. However — for all practical purposes - we will use a centrally hosted web application for this, knowing full well that it could be hosted in a more decentralized/communally organized way later on, using a DAO, or technologies such as Holochain.
The other voluntary aspect in this system is that although not everyone necessarily contributes to the common fund, those who chose not to vote or contribute are not guaranteed the provision of public services (see Deb, who now gets to snooze with full responsibility).
How to retain privacy?
You might notice from the diagram we have introduced a new problem that wasn’t there in the previous system. Given the public nature of the public keys (which also act as addresses for sending funds) in the Ethereum blockchain, we now have a potential privacy violation.
Given that many kitizens will not just be making their contributions to the milk fund using Ethereum, but will also have other on-chain transactions — that they don’t want to share with any old snoopy cat — how do we prevent the ability to track these other transactions by simply tracing them from the public service accounts? We need some way of validating that transactions have been made without actually revealing the addresses of the transactions in the Agora.
This is the ZK part
This is the field of mathematics/cryptography that we alluded to earlier — which we are going to thoroughly explore in later blog posts — and can help us here. We’ll be constructing a PLONKish arithmetic circuit (naturally), but for now we’ll just assume this is secret privacy sauce.
That’s it — for the moment. We’ll start the build in the next post. I’ll leave you to mull over the prospects of such an utopian future for our furry friends. If you’d like to contribute on the finer points of the system design, or whether the feline character even has the capacity for such co-operation — go at it in the comments.
When not falling down cryptography rabbit-holes, I can be found working on another side project that got out of hand, https://planitt.io — looking for alpha testers now.
I am also actively looking for new contracts, get in touch at https://nickstebbingsportfolio.netlify.app/