Building Decentralized Web3 Infrastructure Is Hard When It's Actually Decentralized

ETHBarcelona Talks · July 2024 · 24:43

Derek Pierre talks about the difficulty of building web3 infrastructure that is truly decentralised. The talk covers the compromises teams make with node providers and shared services and what real decentralisation requires. It points out that many apps depend on a few providers even when the contracts are decentralised. Presented at ETHBarcelona.

Speakers

Topics

From ETHBarcelona Talks, hosted by ETH Barcelona.

Transcript

same it's a building decentralized web 3 infrastructure is hard when it's actually decentralized but your speaker will be Derek Pierre so give him a round of applause as he makes his way up to the stage sorry hi there everybody uh I'm Derek per I'm a contributor at threshold uh if you haven't really heard that name before you may have heard us as Maybe new Cipher and or keep uh so right around maybe around January 2022 uh new Cipher and keep were working on two were separate projects working on uh different threshold cryptography

protocols so if you want to think about threshold cryptography in general it's this concept of splitting cryptographic operations across uh independent entities as a way of securing the operation so in other words you're not relying on a single entity to perform some operation you're relying on some group of them to collectively uh perform that operation but the interesting part is that you don't need all of them you only need a threshold of them so some minimum number so you can think of it as you know 10 out of 20 or 11 out of 20 uh to complete some operation and you might think well you know why exactly do I need this and so it's increased security

it also solves an availability problem uh so you think of nodes that you know maybe some entity goes down you still have some buffer that allows the operation to continue um and so new Cipher and keep on their own were working on these protocols in keep's case they were working on tbtc which is this cross Chain Bridge cross chain bit Bitcoin Bridge so you know lots of people are there holding Bitcoin uh but want to participate in defi perhaps and so you want to use your your Bitcoin on the ethereum blockchain um and so ke worked on this ability to have a distributed wallet so you have a bunch of entities controlling

a wallet on your behalf uh because typically centralized custodians you know you have to trust them to hold on to your actual Bitcoin um and trust that they won't run away with it um and so keep's case that was less of an issue it's trust minimized because you have these number of nodes and collectively they have to come together to do anything um and in new Cipher's case we were working on uh this thing called proxy re encryption which is this endtoend encrypted uh data sharing protocol uh so you think of you know you want to share data with some other person you want to Grant access to them how do you do that without the the thing granting access

getting gaining control to your private material and so uh new cyer was working on that and we had a network of nodes so did uh keep and so as a result you know we thought hey you know we're kind of working together um on or working on the same kind of protocols why not work together and put something together that everyone can use and that's how threshold network was born and so fundamentally threshold network is just a collection of interfaces and run times that perform threshold crypto cryptographic operations you just think of it as that and so uh that happened in January of 2022 we've been going strong since since

then uh proxy re encryption has relaunched on the threshold Network so has tbtc uh T tbtc has actually been improved uh some of the scaling issues that they had before and one of the big things I wanted to talk about today is uh why when projects talk about being decentralized why is that difficult and when projects talk about yeah down the road we're going to become decentralized is that feasible and why that can be a tricky tricky process so uh just to start things off threshold access control is what um we

sort of talk about when it comes to proxy re encryption and we're adding this thing called conditions based decryption and what that means is you can encrypt data for anyone and add conditions to that data where the data could only be decrypted if that person satisfies some condition you can think of that condition as do you own an nft so think of you being maybe a content creator and you say hey I want to share data with only people who buy this nft and if people buy this nft the data can be decrypted for them using the threshold Network so basically threshold access control is this collection of CBD and PR

that allows you to sort of maintain access controls so a example is Master file so this is a project that's building upon threshold access control and they are that content creator maintaining control over their data and how they share it with uh customers or people who just want to consume that content uh masterfile has been working very hard on this digital decentralized digital Rights Management so you as a content creator how do I want to share my data do maybe I sell my data and I say it can't be resold for instance how how can you do that in a decentralized

way and so masterfile has been using uh our protocol to to to add this functionality to their system and provide that functionality to um content creators and so how this conditions based decryption kind of works is that it's built on top of something called distributed key generation and all that is that you might think that's a lot of technical mumbo jumbo all that is is it's a collection of nodes getting together to generate a encrypting key so each node generates a piece of cryptographic material uh that contributes to this encrypting key and then from then on

only let's say you take it's 20 nodes let's say come together to create this key you can encrypt data with that key and only require some threshold of them say 11 of 20 of them to decrypt data right and so the the important thing there is that no individual entity in this case nodes on a network can decrypt the data by themselves they need a threshold of them in this case in the example 11 of 20 so you as a as a as a consumer of data you get the data encrypted you go to the network and say hey I think I satisfy this condition I need you to decrypt this for me and so

all that happens is that you talk to 11 out of 20 nodes they will each decrypt part of it or this decryption fragment you collect 11 of them and then you can decrypt the data no problem and the nodes will check to to make sure that you satisfy some conditions so what that looks like so the node generate a key some data owner that could be a content creator for instance takes their data attaches some conditions to it that those conditions can be anything uh onchain related so it could be a time condition like you can only access this data after a certain block time or you can only access this data if you

have a certain balance of eth for instance in your wallet um and so those conditions get attached the data gets encrypted and stored somewhere so on our Network it's only Access Control it's not storing of the data you can store your data wherever you want whether that's ipfs rwe Etc and then next up now you the the the the ENT or the person that wants to consume this data gets it from Storage says okay I have this encrypted data with some conditions in it let's say in this case it is that you as the owner has to own some amount of eth right so the condition has says you know the the

person trying to access the data their wallet has to have a certain amount of eth in it now you could do something funny right you say well okay I just input whatever wallet I want right if I just put put put in vitalik's wallet for and then uh the condition will pass but in this case you actually have to sign uh a message with that wallet to prove that you own it and that's just a regular I don't know if you've heard EIP 712 signature um so you send all that up to the the nodes the nodes say okay this is the condition this person has proved that they own this wallet by having a valid signature I can verify that signature on chain no problem and as a result each node will say okay you you

satisfi the condition I will decrypt only part of it only the part that I can and you will collect all of these fragments and then together once you have the fragments you can decrypt the the data is decrypted for you no problem and so back to the original reason for the talk which is why is that difficult so in that system there's a lot of moving parts and when uh projects talk about being decentralized you really have to think about the different components and the different parts of the protocol that uh lend to them actually being decentralized so an example would be

nodes so you have nodes on a network how do you make sure those nodes are independent because the one thing about threshold cryptography again if you get a threshold of them to come together and do something they can do it them individually can't and so collusion is your enemy and so you have to make sure that nodes are independent right how do you make sure that uh one entity doesn't control 20 nodes on your network and therefore can be can control an entire sort of Access Control um uh key right so Independence is a big thing on top of that how do you incentivize nodes to how do you incentivize people

to run nodes for your protocol right that's where uh crypto economic protocols come into play you know staking um fees uh another thing about fees is that nodes have to be sustainable so if they are running a node on your network one incentive for sure is for it to be economically sustainable if they're losing money running a node why would they run a node right so they're staking rewards they's taking fees that are generated from the network um some other things to think about are uh node Discovery so you have a bunch of nodes how do they talk to each other how do they interact with the protocol how do they start up right who

do they connect to to to to to start can they connect to any node do they have to connect to a centralized node because that's very different right that centralized node goes down no node can start up uh um and things like a distributed key generation protocol a lot of projects may be able to generate anybody can generate an encrypting key that's very easy it's Public public key cryptography but can you generate in a decentralized fashion where no one knows the private key at all right you can generate a public key but nobody should know the private the entire collected private key instead uh if you saw in the previous diagram those things are are split

apart right so each node only has a piece of it and the private key is never constituted anywhere and so these are all of the the different issues that come up and that's before you even talk about having a threshold decryption scheme or threshold scheme for that matter um and so it's very the scheme itself is very easy but all of the other uh parts of the stack is where uh the difficulty lies now there we go there we go

so so when you are working with protocols that provide web through infrastructure like we do right we provide threshold cryptography some of the things you got to ask are you know how many nodes are in the network obviously you don't want a small number because collusion is a lot easier if you have a small number of nodes um independence of course incentivization how do you prevent collusion not only as part of the protocol but as part of do you slash if uh there are misbehaving nodes and somehow you're able to detect that hey these nodes got together in a in a malicious way to circumvent uh the protocol uh a big thing particularly when it comes to rewards tend to be

token Supply so how are rewards distributed right is that a manual process is that based on contracts um another thing is governance so the big so with threshold threshold is a dow it's Community owned it's run by a dow there's no um single entity that controls anything our contracts are owned by the da um and so as a result uh you know if you are run by a DA or if you are run by a commercial entity rather what can you do even as a dow what can you do right so let's say the Dow owns the contracts do you have things

like uh what's the threshold for votes to go through governance votes is there a time lock that uh allows for a certain amount of time between uh vote being passed and in action of that vote right so that if there's something malicious going on people can detect it is there a way to prevent that vote if uh that's necessary if it's something that for whatever reason passed through governance but is actually malicious to the network um and what are sort of the governance procedures for that and in terms of software you know it it's more so I mean we've all T I'm sure we're all

used to open source but not all projects have open source software is the code open sourced can anyone see it is the client code open source is the is the operator code open sourced um you know how is it downloaded is it a closed system and more so how is development done how's the research and and uh investigation and design done is it done in public is it done in private Etc so these are a lot of things to ask because they matter when it comes to actual decentralization so an example would be for us on the threshold Network when we launch our

conditions based decryption CBD uh project um what we're not compromising on is the trust that's built into the system so it's trust minimized right this is a distributed network no one entity is trusted and so as a result right now our goal is to launch with a permissionless group of nodes so that means any node on the network is uh can be used um but instead what we do is we say as a as a roll out sort of an alpha version it's still decentralized but what's different is we might limit the size of the the group just to make sure

that you know designs are working as we expect um things like uh minimum Stakes for instance things like uh what what group are we sampling from right so uh it's still decentralized but maybe we say you know people have to noes have to specifically opt into this application and then we will uh sample them and so you end up in a system where initially we're going to start off with smaller groups but as things progress uh we will increase features like increase the size of the

cohort uh maybe increase allow for higher minimum Stakes uh uptime requirements actually be able to verify the dkg on chain right now it can be locally verified um and so over time what's going on is the decentralization part of it is always there but what's changing is the features moving forward right maybe another thing to think about is some of these nodes there's such a thing as node degradation right nodes decide to go down it's a threshold so you do have some buffer but what you can do is you can say Hey what if I can recreate the same cohort using the same key uh with a different group of nodes

in a secure fashion so that's something that we're working on it's not going to be available initially but over time it will be um and so uh just to something up a little bit planning to decentralize is not the same as decentralization uh and I'm not saying that there is malicious intent in saying that you're planning to decentralize I'm just saying that you want to ask the right questions in that what's the what's the actual plan to decentralize and what are some of the hurdles that you're going to hit going from a any kind of centralized pro project to a actually decentralized project

because it's very different when you control the nose so think of you know Amazon kmass or something right imagine them trying to go decentralized in one step it's just not feasible um the other thing is anybody who talks about doing centralized thres decryption it is basically equivalent to web 2 because if they control the nodes again collusion is your enemy and it's very easy to collude with yourself and then in our case our goal is to run about 50 to 100 nodes on a on an initial launch uh and that we hope to have that this month uh we do have a test net where we run our own nodes and that is

definitely not decentralized but it's a test net we don't expect people to run production code on there that's just um that's just for people to test out uh our our system um but that's purely for a test n and it acts the same way it's just that we control the nodes truthfully um that's available now for hacking on in fact some members of our team are working on a hackathon project uh Justin mes is launching his uh his album using conditions based decryption where uh basically it's like a revealer case where you know you pay people can contribute to the album and you pay some amount of money and when it hits a certain amount of money then the

album gets decrypted and now anybody could listen to it so it's pretty cool and so if you want to reach out to us we're the threshold Network you can reach out to us on Discord um and on Twitter as well follow us on Twitter and uh happy to take any questions that people may have sure uses and yep Master file yep what uh my question is very simple what

is exactly threshold because it seems like an ipfs but it's also very similar to a blockchain but uh I don't know question it's really a decentralized storage or what what is a good question so it is threshold is just a network of nodes providing threshold cryptography in this case uh it's providing access control so you can think of it as an access control layer right so the data gets stored somewhere separate doesn't matter where it is truthfully it could be even on S3 if you wanted um but what happens is when somebody wants to actually access the data then they hit the network the

network then checks conditions in this case and says says hey you're allowed you are allowed to have I'm allowed to decrypt the data for you and I will decrypt it in a threshold cryptog in a threshold manner does that make sense yeah checking the conditions what uh what exactly how does it work the nodes can check uh the chain that they're on or anything on the internet do it act as oracles or great great question so uh the conditions based on blockchain so it can be an RPC condition so you know if you're checking someone's balance it could be an arbitrary

contract uh now if you want now our goal is to be multi-chain right so any chain uh but initially uh we will be we'll be supporting eth and polygon and the only limitation there there's no the only limitation is that because the nodes are decentralized each node has to have a connection to the relevant chain and so we kind of have to make sure that nodes are able to connect to any chain and that's sort of a interesting dilemma like do you have them just provide uh infura endpoints for instance or do they just use like their infura ID and then you just derive the chain but initially it would be eth and polygon U but that but it could be any onchain

condition so that could be a contract call obviously a read contract call or an RPC call yeah add on sure um so I'm looking into how to get signers it's like particle is doing something like that um so to get a signer uh that is doing threshold signing um but then I want to check does someone have a Google account does some someone have a GitHub account so is that possible with thresh as so in terms of conditions uh check in that somebody has like a Google Google account would be like a kind of a web two uh sort of setup besides checking some conditions

on chain also checking conditions off chain is that is it purely onchain at the moment it's purely onchain um just because you know when you go offchain it becomes a question of oracles and who are you trusting therefore right uh whereas on chain it's very easy to check right and you don't have to trust anybody it's on it's Byzantine Fon sure okay maybe one more or all right all right thank you very much