Demo - Decentralised Conditional Encryption

Here’s a demo app we (Empiria) put together to show how distributed apps (Dapps) can be built with Anvil:

You can encrypt some data and define a set of conditions which must be met before the decryption key will be made available.

The encryption takes place within your browser, so your plaintext data never leaves your own machine.

At decryption time, a cohort of nodes on the Threshold Network will form a consensus on whether the condtions have been met. If so, each will send you a fragment of the decryption key. Within your browser, the key is then assembled and used to decrypt the data. Again, nothing outside your computer ever sees either the key or the plaintext data.

In order to actually encrypt or decrypt anything, you’ll need an ethereum wallet connected. The Brave Browser has one built in. For any other browser, you’ll need to install an extension. Metamask is a popular choice but there are many others.

5 Likes

Would you mind explaining a practical use for this, to someone who is, and I’m being kind here, as thick as a whale omelette?

It looks interesting, but I …er, my friend … was asking.

1 Like

You could put that encrypted data somewhere public knowing that it can only be decrypted when and if the conditions you specified have been met. And that all happens without you handing any data over to some giant tech company (or anyone else).

The conditions are public, so anyone else can also have confidence that the decryption key will be made available if they are met.

One practical use, for example, has been a musician who encrypted their album, posted that publicly and set a condition that they wanted to receive a certain sum of money in total to their address.

Fans paid small sums each knowing that when the total was reached, anyone would be able to access the music.

The time conditions are interesting too. I could publish something but set the condition to be any time after some point in the future.

1 Like

Is there an advantage to this approach over a more centralized (but still end-to-end encrypted) approach, in which a giant tech company manages the encrypted data for me more efficiently?

The problem this approach addresses is that of key exchange. That has to happen over some kind of channel that both parties have to trust.

If you know the other party somehow, you can exchange keys directly. If you dont, you end up relying on a third party.

This approach decentralises that third party. Instead of having to trust some corporation and/or closed source systems, you instead trust that a network of servers will execute code that you can see for yourself (if you’re so inclined).

4 Likes

At my new employer we work on infrastructure deployment for these kinds of decentralized projects, and I’m trying to show my new colleagues how Anvil could help so this is great timing, thanks @owen.campbell !

2 Likes

The code for the demo is now on github

1 Like