Smart Contracts with Privacy - Case Study - Buying Renewable Power by Paul Brody | Devcon SEA
Devcon·Thu, Oct 9, 2025, 12:00 AM
Speaker
Getting the world’s industries to switch to renewable power is immensely important for our planet’s future, but renewable power purchasing agreements turn out to be complicated to manage and administer. Buyers and sellers must interact indirectly through the electricity market and agreements contain complex rules. Keeping track of these is complicated and expensive - UNLESS you have a blockchain-based smart contract. This is how we did it, using ZK for privacy, on chain! Speaker(s): Paul Brody Skill level: Intermediate Track: Real World Ethereum Keywords: Privacy, Zero-Knowledge, Use Cases, enterprise Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum, https://warpcast.com/devcon Learn more about devcon: https://www.devcon.org/ Learn more about ethereum: https://ethereum.org/ Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on Swarm, IPFS and more. Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. Devcon SEA was held in Bangkok, Thailand on Nov 12 - Nov 15, 2024. Devcon is organized and presented by the Ethereum Foundation. To find out more, please visit https://ethereum.foundation/
Transcript
[Music] on Twitter you know I promised a joyful and uplifting presentation I lied uh this is going to be pretty pragmatic and realistic I'm going to tell you about how to use ethereum and specifically smart contracts to do something useful and interesting with privacy uh so couple key topics for today number one let's press the magic button we're not we're having technical difficulties so first item I want to talk about is the business case for privacy and as soon as the clicker works we will advance to the next slide which it's not doing it's not doing that so anyway I'm going to talk from a little bit of memory so pretty much every business agreement comes down to something very simple I've got money you've got stuff and I would like to exchange my money for your stuff under the terms of a business agreement and the challenge with that is that for companies they want that information to be private how much money you have how much stuff you have what you're buying where it's going that's all like super secret sensitive business information oh it's working now so business case for privacy as I said companies want to do very simple stuff exchange money for stuff under under the terms of an agreement with privacy and blockchain is actually this incredible piece of infrastructure for doing this way more efficiently so we can tokenize the money we can tokenize the stuff and we can turn all the business terms and conditions into a programmable set of rules that can be implemented very easily to make this work however we need two kinds of privacy number one we need privacy about the transfer of assets and payments right how much I'm paying you what you're giving me where it's going that stuff needs to be private but secondly we also need privacy for the ter terms and conditions of our agreement like it's really important if I can read the agreement between company a and Company B and it says I'm going to buy 500 widgets at $10 a piece I mean I kind of gave away all the information that you need to know anyway so we need these two kinds of privacy and in particular uh pseudo privacy or mixers or things like that aren't really good enough for businesses because if a lot of companies do lots and lots of recurring business with each other and eventually if you do enough of these types of transactions you're going to be traceable even in a public mixer environment and most business assets are not fungible tokens money might be fungible but the things that you're buying are often not fungible and anything that's nonf fungible becomes instantly traceable in a public environment so it's really hard to design without leaking information and that's some of the stuff that we've really been working on now before I talk to about how I just want to take a second and talk about like what is the uh value proposition like why is this worth doing and I want to share with you a very specific example which is around the use of smart contracts for business automation uh about five years ago ey and Microsoft worked together to replace the procurement system for the Xbox video game network with a set of smart contracts and the idea here was to replace uh an existing system which had a traditional Erp system uh and it was sort of semi-automated at the end of each month they would look at all the transactions they would manually apply some of the rules that they had implemented between Microsoft and their 3,000 odd gaming suppliers well it took on average in the old system about 45 days to calculate how much they were owed and go through all the individual contracts and special rules when we turn those into blockchainbased smart contracts the beauty of these kind of smart contracts is they're basically scripts right doesn't matter as long as the rules that you and I have agreed upon are logical and clear then I can automate them and they can run properly and the result was that we basically took a process that used to take 45 days and we brought it down to about five minutes right that is a good Improvement and we did it for about half the cost of the existing system so the value proposition of being able to take a complex business agreement and turn it into an automated smart contract is incredibly large the problem that we had at the time was we didn't know how to do this under privacy on a public blockchain right eventually where we want to go to is his ability to put together tokenization with smart contracts and in a way that you can create a complete business model that's running on chain in this picture what we have is you know a very typical supply chain right raw materials they get manufactured they get transported they get put in a warehouse they get sold to a customer and then they get supported now every single item in a traditional manufacturing supply chain we can represent as a token some of the things are fungible token tokens most of them are non-fungible tokens anything with a serial number becomes a non-fungible token right and so basically in this picture stuff moves from left to right and money moves from right to left and the set of smart contracts governs this movement of the process away and not only can we run the business process for about half the cost but we can also run the supply chain much more efficiently we think we can typically if we move from traditional supply chain models to a tokenized supply chain model model with all the rules of preventing double spend you can actually cut maybe as much as 20% of the inventory from your supply chain and have the same service level so in short this is worth crazy amounts of money now let's talk about a specific use case that we are implementing for clients and rolling out worldwide and this is renewable energy and I want to talk about why renewable energy is such an incredible use case and application and how we got there I want to start with with the road map for privacy that we are working on at ey we've got two applications that we're building I talked about two types of privacy that we want to do one is privacy of moving stuff around and the other is privacy of the terms and conditions of a business agreement so for the privacy of tokenization and moving things around we have created a layer 2 ZK rollup called Nightfall Nightfall allows you to move around fungible and non-fungible tokens uh it's an eum compatible layer too so it actually can run on top of the main net it can also run on top of say a layer two as a layer three so Nightfall is for moving stuff around Starlight is a transpiler that basically takes a solidity smart contract and turns it into a set of zero knowledge circuit our idea our concept is to get each one of these pieces working independently and then bring them together so you can have this full uh busines to business kind of complex road map both of these to be clear are although they are largely developed by ey we have put them into the public domain they are public domain open- Source contribution to the ethereum ecosystem they're are no proprietary gchas here there are no surprise like you know uh special uh terms and conditions in the open- source license it is full public domain we have relinquished all owners ship to these assets thank you sir that is how much we love and believe in the ethereum ecosystem and we have been on this journey for a while by the way I know uh we getting a lot of attention from uh the Noir uh program that's launched this week um I tell you that we started about the same time as the folks at Aztec and we are across most of our team is across town from them in London uh and one of the things that Delights me so much is to come to Devcon and see how much competition is now in the Privacy space like I I really believe that even if we lose a competitive race with some of the other Solutions we win but I'm I'm not yet given up on losing um we have been on this journey for a while even though the the the numbers didn't sort of look out correctly we started in 2017 and here we are in 2024 we're on Nightfall version 4 knall version 3 which is currently in production is a ZK optimistic rollup ZK for privacy optimism for finality Nightfall version 4 which we showed off earlier this year and will be in production next year is a ZK ZK rollup so one ZK for privacy and one for uh instant finality all right let's talk about renewable energy and exactly how we implemented this so the way that renewable energy contracts work and the reason why they're such a good candidate for uh zero knowledge uh applications is that they are kind of complicated and this is a simplified version very simply you got a power buy you got some they got a factory they want electricity they want a lot of electricity they're going to buy it from uh somebody but maybe they're a large company they have a good social responsibility plan they have committed to become carbon neutral so what power buyers do is they reach an agreement with a renewable energy seller somebody who's got solar facilities battery facilities whatever it is it's renewable and and fully green here's the problem electrons are fungible right you might want to have your locally produced organic artisanal electrons but actually the way it works is you have to take what the power company is giving you and so what happens is the power buyer basically buys electricity from the power company at whatever the market price is in their environment the power company in turn buys power from a whole bunch of suppliers some of them are very green some of them are not so green uh the agreement exists between the renewable seller and the renewable buyer and what the smart contract does is basically keeps track of the market price that the power buyer paid to the electric company and the difference between that and the agreed upon price and then they settle up usually every month or so if one party owes the other and there's there's usually complex terms and conditions like a commitment to buy a certain minimum amount of power in the Grid or a certain like maximum price that they have to pay and the idea is that uh they are basically providing the incentive and enough financial value to the renewable provider to structure long-term investment and these renewable energy contracts are incredibly important because a lot of these solar facilities wind facilities they could not be built without the advanced commitment of buyers like these kinds of factories or other companies that are committed to be carbon neutral these Advanced commitments that they make they're often five or 10 years at a certain price for a certain number of megawatts these are incredibly important to guaranteeing the revenue that provides the investment funding to build these kinds of facilities right so that's what the structure is so a little bit like you know video game contracts with thresholds and minimums and rebates renewable energy contracts can be quite complex to build this renewable energy contract we went through a a multi-step process which I want to explain we started by just creating a solidity smart contract without privacy that did that followed the terms and conditions that we wanted to implement and once we had that working we created a modified solidity application which we call a solidity application and all we did was Mark up the variables and the logic that we want to be private so we have a little guide on how to do this uh and then we put that into the Starlight transpiler and what that does is it spits out a zero knowledge circuit a whole application that you can run on chain which we call a zap right for a zero knowledge app uh and please don't ask me who is in charge of our naming but uh uh it's a there's a lot of Z's in there uh and so um the idea here is to keep it very simple and starlight itself came out of a really important learning experience we had so about three or four years ago we tried to teach our research team our PhD mathematicians tried to sit down and teach our devel how to write zero knowledge circuits using tools like zres it was a spectacular train wre like it just did not work at all our solidity developers were like this is too difficult I don't like this I don't want to do this and so we went back to the drawing board and we said we need to find a way to make this much easier and much simpler and you just should have to do some minor changes to a solidity smart contract and that's how we ended up with Starlight so Starlight is really designed to be as easy as possible it allows you to take a solidity application that you know already works and turn it into a zero knowledge application um you still have to think very carefully about how to design it in such a way that you're not going to leak really sensitive metadata because if you're not careful you will accidentally end up Le leaking metadata um but the goal is to get to the point where anybody can do applications um it's as I said it's public domain and open source you can go and try it out yourself there are currently about a 100 compan companies worldwide that are designing and testing applications using Starlight and in particular we've been working very closely with the Central Bank of Brazil we have about uh 60 or 70 banks in Brazil that are testing out Starlight based applications and we for the last year we've been working really hard to refine the uh Starlight application development process and tooling right now where we are is that uh we are in a kind of a stateless environment so the Starlight application receives data it calculates the amounts owed uh but it does not store anything on chain it doesn't store any commitments even offchain it's a stateless component uh and transactions are relatively inexpensive um provided you deploy them on a layer 2 Network the future path is that we want to integrate Starlight with onchain payment and with some level of offchain State full storage of things like the amount of electricity consumed and the amount of money paid so that you really have a proper continuous record of the entire set of business transactions uh but that's that's the goal as I said we we're following a kind of crawl walk run strategy and the goal is to start and build things that are very very pragmatic and useful to business users uh rather than try to like bite off the whole thing at once so we have fundamentally a bit of a different approach than say Aztec or some of of the others who are I think have a very ambitious and kind of complete approach uh we welcome participation our content it's public domain it's open source uh all of our tools are open and available and we publish them on the ey blockchain site on GitHub so uh that's um really important to us we have many many contributors but underpinning all of this is kind of a long-term commitment from ey to invest in privacy because we believe it is the one thing that enterprises need in order to get fully engaged with onchain business and to give up this fixation that a lot of people have with private blockchains uh lastly we are here we have an impact Booth our research team is here uh both and and and quite a few members of our engineering team as well we would love to talk to you about how to help you make privacy enabled applications that are regulatory compliant right they will not lend you know end you up in jail I feel like you know I myself would not do very well in prison um so I don't want to go there um and then lastly uh I want to I'm ready to take a couple uh uh questions but I also want to share with you my little QR code it is it will take you to a website uh that will give you what we call a proof of Paul nft uh which is minted on the polygon uh proof of stake blockchain and we made a special one just for Devcon uh so I'm am I on time have we got enough time for a couple minutes of questions yeah we've got some time we've got about six seven minutes perfect so we've actually got a lot of questions but feel free to ask some more on here so it looks like the top question here is why did you build Nightfall rather than contribute to other open source ZK Roll-Ups well at the time that we got started there weren't any other open source ZK Roll-Ups I mean this was seven years ago and by the way almost all the the ZK rollups that are out there are ZK for scaling not ZK for privacy and in fact one of my frustrations was you know s eight years ago when we got started down this path everyone's like hey we got to fix the scaling problem for ethereum and while I agree with that and I'm really pleased with the progress that ethereum has made on scaling I think it's incredible uh at the end of the day for business users there's no scaling the scaling problem is not a problem until you solve the Privacy problem without privacy no business user is going to touch ethereum and I want every business agreement in the future to be on ethereum awesome well how do you tokenize real world assets without them being centralized that's a great question um so I think uh let's see here I guess the quick answer is I think for individual companies they are those those assets are going to be if if you're tokenizing your own assets it is going to be to a certain degree centralized in your company and this is kind of an issue that we've talked a lot with a lot with other people is in certain circumstances there are some things where only one participant really knows the status of that asset the only company that knows where your UPS or FedEx package is is UPS or FedEx right and so you have to accept that and one thing that is a really cool thing is there's a process a well accepted business process from the world of trafi it's called a um a sock audit right which is a systems and organizations control and what it is is you have an independent organization come in and assess your reporting mechanism and so uh in the cases where you can't have proper decentralization you should have external auditing and testing to make it more reliable and I think we have time for one more question can you talk about the Brazilian cbdc and how the experience is of using Starlight on Drex and for my sake can you explain what Drex is yes so Brazil has um a really cool they've had some really cool thoughts about their cbdc so as many of may know cbdcs are really struggling with acceptance and and success because they they don't offer a lot of value the Brazilian Central Bank has taken note of that and they've really thought a couple of steps ahead and they've said you know what if we want our cbdd cbdc to be successful we really uh should consider making it programmable and in an evm environment which I think is fantastic now I have urge them to go one step further and just plug their whole cbdc into public ethereum not sure they're ready for that yet but what is exciting about this is that um uh in this environment Brazil has a clear banking secrecy laws and so if I want to trade with you if I want to do a transaction with you the Brazilian government doesn't just say privacy is nice the Brazilian government says You must respect the privacy of your users you must build privacy enabled applications and so they have been testing a number of different privacy Solutions what I think is really exciting about Starlight compared to some of the other ones is that it is our our whole goal in building Starlight Nightfall is to be 100% compatible with an evm environment where you use native ethereum tokens like erc20 is and 721s you preserve all of the true native ethereum functionality around like the prevention of double spend the proper management of assets our goal is not to create something new it's to to make these things fully compatible and transparent in a very straightforward way so we we want to make it simple and I think that's a big part of the value proposition we'll see how Drex evolves right but I think this idea of like fully programmable privacy respecting kind of cbdc evm is quite exciting thank you and I actually lied you have about three minutes left for this Q&A so fantastic it looks like we've got a couple other questions what made you choose ZK over Oasis Sapphire or the secret Network I assume that's because you guys started back in 2017 it's partly because we started back in 2017 but it's also because again we we want uh we want True full native privacy and one of the things that's also really important to us is that we don't want any kind of um offchain systems that are required we don't want any uh special uh security like uh Hardware security modules or proprietary tools our goal is to have a fully open source ethereum native privacy application with no uh kind of builtin tax or license or or you know system so that was our goal is is to be completely open and another question it's more applicable but like I'm curious all the smart contracts that you've developed for um Nightfall and Starlite are they compatible with con like just any smart contract and being converted into ZK circuits are there any changes required to satisfy those constraints so there are some changes and and the the basically the the the Starlight kind of user guide explains how to make those changes you really do have to be careful you know if you design what you what you end up with is like a black box and so if you're not careful you know you if I have a black box and I put and I have only two parties in it and I put in $10 and you put in two widgets doesn't matter how fancy the logic is in there the from an external point of view you know that your contract is basically saying the pricing is $5 a widget right you you've leaked all the meaningful information so you have to really carefully design your application so that it is um uh it it is uh optimal for preserving privacy I before I've got one minute left I want to talk about this one around privacy uh for governments uh and and how Regulators do this kind of thing and here's I want to share with you kind of the one really really important Insight that we have learned in terms of working effectively with regul lers it's really important to help them understand privacy and anonymity are not the same thing so when we design nightall which is our privacy layer to in order to use it you need to have an Enterprise identity certificate this doesn't mean that your transactions are visible and there are no back doors in the system but externally governments and Regulators can see who is transacting they cannot see what you're doing they cannot see with whom you are transacting but they can see that you are trans AC in they can the these Enterprise ID certificates x.509 can only be issued to companies that can pass basic backgrounds and sanctions checks as well so I would not call it by the way kyc but it is identity it is a legally accepted form of business identity in many countries including the United States and uh if a regulator comes to you you can tell them what you're doing and very importantly you can also prove to them that what you're sharing with them is truthful so I think we're
Automatic transcript — names and jargon may be misspelled.