Using Holochain as a Validated Data Layer for On-Chain Transactions | Joshua Vial - Holochain
Ethereum Denver·Wed, Oct 9, 2024, 12:00 AM
This session will walk through a practical example of using holochain to validate data for decentralised renewable energy generation which enables small scale energy producers to aggregate their data and participate in on and off chain Renewable Energy Credit markets. It will cover a conceptual overview of the system and outline techniques for building high throughput, low latency systems that can integrate with and complement on chain systems. APPLICATIONS FOR ETHDenver 2024: #YearOfTheSpork ARE OPEN APPLY NOW https://ethdenver.com/apply
Transcript
[Music] noon I'm here to talk to you today about Hollow chain and in particular a certain architecture we can do with Hollow chain focused on integrating it in with other blockchain Technologies all right hands up if you know about Hol chain there's some people there's some not people all right I'm going to spend maybe 5 minutes on just a very high level overview of Hol chain and again this talk is a non-technical one it's to give you a sense of the technology and what we can do with it so it is a open source framework for building peer-to-peer applications and one of the things I love most about this technology is it took deep inspiration on how nature coordinates and how nature is organized and it's a very refreshing and different approach to decentralized Computing and peer-to-peer coordination and lots of it comes down into the inspiration taken from the biological world and another thing that is really important to know about this is it runs on consumer Hardware so it's not like you have to download a terabyte of data to run a local node or you have to buy expensive gear for it you can run it on small laptops and people when they're running it in a peer to peer way that builds the network up itself so consumer Hardware is it's something that is easy to uh think is not possible but there's a lot of stuff you can do with just individual laptops individual devices and it's the people who are who are using the applications who are hosting this network so it's truly peer-to-peer it's truly decentralized and there's a lot of Social and Technic techn technical yeah technological implications that come out of these choices this is a whirlwind 5 minutes by the way so uh wave your hands if you want me to go slower and I can um go down a bit uh the security of the network is by peers counter signing and signing stuff with each other and so it's you don't and there's a lot of implications around not having to manage Global state but the way of doing security is a bit different than you're used to in the regular blockchain world the applications that are built they can be public or private you can control who joins them and who participates and the roles within them in a very arbitrary and fine Grand way and as a developer this gives me a ton of choices about the sorts of things I can do with this applications so each application is a standalone peer toer encrypted Network and that means that that that application lives in its own right it's its own Network and you um can join it that way the um runs on the devices the the participants and the thing I want to focus on today is the enforcing a shared set of rules that when you can start to write an arbitrary rule set which everyone publishing something agrees to and validates as true then it starts to have quite profound implications on what you can trust in your systems all right that was backwards so no servers no blockchains no tokens no gas fees it's a way of building stuff which is uh truly peer-to-peer and I want to talk you a bit so that was oh that was a I would did a faster Whirlwind than I thought of um Hol chain so the thing I'd say next is that one of the most important things to think about in the Hol chain world is that it made a very strong decision to not try and make Global consensus easy so instead of saying everyone in the world needs to agree with the state of our Network whether it's ethereum or Salan or whatever it is that everyone who's running node agrees on that Global state by not doing that and by making it so that apps can be independent of each other each one has its state which is isolated from other ones and you can connect them if you want to but you don't have to you can run it fully self- Sovereign you can get a that's is the the decision which made all the efficiencies the data efficiencies the the um latency efficiencies all of that is a consequence of that decision within an application you also don't need to do gole State for the nodes and this means that again you can build applications which can scale I don't want to say infinitely but like nearly infinitely like as the application gets bigger as the user base grows the people joining it don't have a heavier compute load because you're sharding it and decentralizing it amongst the network so that means if you join a really popular Hol chain application and millions of people are using it you don't have to still download a terabyte to sync up like you do syncing up to the ethereum node you can just have your local piece of it and sync up in that way so that um not having global state has lots of big applications and also I realiz this is a non-technical talk so like just wave at me if you want me to not go into that level of detail all right that was Hol chain in 5 minutes now I want to think about a particular application or technology so in Australia there's this thing called renewable energy credits so the government has set targets of renewable energy production and it's essentially a subsidy they give out to energy producers if you produce energy that's renewable for 1 megawatt hour you can earn a credit which is something like $30 $40 but the wholesale price of electricity is something like $ 20 or $30 so you can nearly double the value of the electricity you produce if you can eligible for this Credit in Australia and it's an incentive more people making renewable energy and to get the credits regulation bureaucracy audits it is really useful if your solar farm looks like this if you can have running utility scale energy production you can get access to this system and you can get a subsidy from the government and it helps you out in that way not as useful if your energy system if your solar production looks like this one the regulation doesn't make sense like the work to do to get accredited is not friendly to small producers and also the amount you produce is quite small it takes these solar panels a long time to make a megawatt hour but if they're selling energy back to the grid and they're getting double the price that can make a big difference on how quickly they repay their solar installation so this is the domain I want you to imagine of like okay this is the world and you want to build an application to help small producers um small generators get access to the subsidy from the government using a blockchain application so who's a developer in the room anyone hear build stuff couple of people all right and so if just think in your head like how would you go about building that system like if we're going to use a blockchain it's like okay tokenization well that's easy we can easily create tokens fractionalize ownership of the re okay the renewable energy credits yep that's pretty known you can start to do that but the thing for me is like how would you get it over the line where regulators and Enterprise customers who are used to going to these wholesale exchanges to buy their wrecks that are ordered by XY Z how would they see legitimacy in the work you're doing how would they trust that when you say 100 households went and generated a mega hour of electricity together that they actually did it and that's the bit which is like oh layer 2os cheap gas fees it's still a really hard thing to do because there's just so much data because if you're trying to track to to get data to prove that that this has happened you're going to be talking about okay um sensors measuring the electricity people looking at the um claiming that yes this person has the solar panels on their roof energy bills coming back to them from the utilities Auditors and all this energy you would need to track and all the data you would need to track gets quite big and that just large data sets Don't Really Work Well in blockchain Worlds and so you can build a centralized application but what I've been focusing on for the demo for Hol chain so I help build the the stall that you'll at the main event where we we're showcasing this technology is how can you start to build a validated data layer where you can take large amounts of data and you can have arbitrary data sets you can put them into a blockchain friendly and amenable system which is peer-to-peer encrypted decentralized and a lot of the things we value in the blockchain world and then how can you start to aggregate arbitrary data sets so when when I've been building this demo it's focusing on like okay let's just measure electricity production and send data logs of that into the Hol chain system system and if you're logging data every 10 seconds or 30 seconds those logs get big um how can you start to like have customers say well here's my utility bill and here's the Energy company giving me a subsidy for my energy generated and so on you can look at the weather data on that day you can look at people who said yeah they really do have that amount of solar panels on their roof and the numbers stack up so you can start to look at this data set and you can start to say yeah this you can you can audit it and have faith that the credits that were issued on chain have some validity behind them and the thing I want to point out about this is it's about if you can make it cheap to audit and so that anyone can go in and say well this issuer says they're issuing a hundred of these credits and they're pointing to this application to say here's the raw data to back it up and it is cheap for someone to audit it then there's a um oh yesterday I was hearing someone talk about that if you increase the penalty for breaking the the law people don't it doesn't change how many people break the law or not if you change the probability of getting caught then you reduce the the chances of people breaking it much a lot because if you think you're never going to get caught you don't really care what the consequences are but if it's very likely you will be caught it's much less likely people will cheat and so cheap to audit cheap to validate is what I think this system gives us which is um is what I'm most excited about and interested in in this particular use case um another point before I move on is that this is an arbitrary system what I think Hol chain is exceptional at is building um auditable large validated data stores and linking them up to um blockchains with simple links because if you're putting like lots of validated large data sets into these networks and you've got a lot of control over who can see them and how can see them Etc then you can do whatever you want in the blockchain world where you know it's really good at the tokens at markets at trading and so on so if you can get the the validated tokens into there you can do lots of stuff and to link them up you don't need to do much at all like in your onchain world you're just storing references to this is a a unique reference to the Hol chain app which stores the data and here's a unique reference within that app which points to a set of data that you can audit yourself and it's so it's really easy on the onchain implementation and on the Hol chain world all you're really doing is storing like transaction hashes of saying oh here's a reference to some so tokens onchain so the the linking between the two systems is Trivial technically um and I think combined they will really increase the scope of what you can do with blockchain and onchain stuff all right 9 minutes left um so I started this slide and I was like two Hol chain features I really want to talk to you about and I was like nah three features I was like okay I'm stopping at four before I do a list but I wanted to talk about uh what I think is for people who don't know the technology that much these are the things which allow me to build stuff that I can't imagine with other systems or they can't do easily anyone see the Spanish Inquisition from Monty Python how old is this lot okay to yeah some people oh it's still exciting isn't it okay um here's the first um like feature which I just really love in Hol chain and like all all systems talk about validation like how do you make sure your data is what you want but the way Hol chain does it and the way it means it's like there's the simple version I would say is that you've got lots of peers gossiping to each other and they're sharing signed transactions and signed information if someone in that Network starts to like issue something which is factually incorrect which people can say I've got a sign transaction log which makes this person's lying they can share that they issue a warrant for that node and everyone can just start to ignore them they get ejected from the network quite simply because you can prove that they broke the validation rules and so by having the validation baked into the network one it kicks Bad actors out so it keeps your nodes your your peer-to-peer Network um Integrity high and also it means that when you're writing applications you can think about okay what must always be true for this to be valid and having this this set where I'm just thinking purely in validation mode mode and then I can step away from that world knowing that the whole data set inside the application is sound and then spending all my time thinking about usability and features and so on so the validation in Hol chain takes a little bit to learn but I think it's an exceptional feature and it's done quite differently than I've seen in other systems signals um this is uh the other thing in peer-to-peer systems and like often I find when you're building blockchain applications and um other sort of Novel technology it's really hard to create a a great user experience and having systems where you can start to have like just live updating and websockets type things you have to do a lot of work to get the responsiveness in there when you're dealing with onchain stuff where it's like 10 minutes for a new block to come through or whatnot and even when you're going into the fast layer twos you're still um constrained by that environment so signals one but the thing about the signals is if you imagine a peerto peer so everyone in this room we've all got we're running a node and if you know the address of someone else you you can build applications where those two people can start to have a direct non- intermediated conversation they can start to talk directly to each other they can sign things with each other which they can store privately or they can share with the network and that gives you incredible efficiencies and really low latency when you need it because often when you care about low latency you don't care about low latency with like me to everyone it's like me and you doing things together where you can have direct low latency things which means that as I'm building an application I can start to get these features in there which people feel like oh it just works and they kind of forget about the technology um um couldn't hear you but I heard a noise um okay another thing about um holler chain so feature number three that I love um oh wow I'm talking faster than the time allow um so counter signing and this is uh the idea of when you are doing transactions in a blockchain world and you I want to buy something from you and you want to sell something to me then we basically have to wait for the global state for everyone in the known universe to agree that that's has happened and that takes a long time and that's where a lot of the cost and that's where a lot of the delay comes into blockchains whereas if you and I can just like both sign transactions together and say you sign this and I sign this and then we start to publish it we can start to do that in a way with Witnesses when you need to and you can you can get into it more um you can do it very quickly and easily which is a little bit less secure you can do it a little bit more complex which is more secure but you can scale up the complexity and the Security based off your use case because sometimes you're doing a transaction which is like yeah I'm selling you a billion of insurance I want the whole world to agree I want everyone to witness before I'm going to act on this transaction and other times I'm buying a carton of milk off you and I really don't care about that much security I'd like a finer grain of security and having the ability to go up and down within an application is an incredible amount of flexibility and so counter signing is one of the things you probably wouldn't have seen and if you're diving into Hol chain world have a look at that feature and um finally this is the one that I've used the most for this for the demonstration that we built for the hollow chain uh for the stall at the main event Hol Chain's got this idea of capability tokens and this the thing which I get from this feature is I can now build applications which people who know nothing about wallets who don't have keys and so on can use this application and essentially it is a way for a node who is fully empowered in the network so someone who is running a full agent they have keys they set up they know a lot about Hol chain so a more technical sort of person that someone can interact with that and the node can delegate actions to that person so that's like a sort of complex mouthful in a way but by giving them Keys which I can generate and they can store in their machine they're fully signing transactions you can see who has signed stuff you can you can apply validation rules to their um actions but you can give it do it in a way where they don't need to know anything about Hol chain they don't need to know anything about ethereum or blockchains and you can start to give them the ability to proxy into the network in that way so it's incredibly useful for building like a mobile app which someone can just go to a webite site start doing stuff have no knowledge of our ecosystem but it's starting to being recorded in these decentralized auditable systems and it can be a step stepping stone for people where you can take them on a journey of oh now that you've used this app a little bit if you want to use the full feature set well here go download something locally and and you can go in that way so that's one thing I get from capability tokens another thing and this is probably a combination of capability tokens and validation is that you can start if you think about these agents who are all signing messages to each other and doing transactions and recording stuff in the system you can start to build the validation logic where it won't pass validation unless it's signed by a user token so if you think about um logging into this account with an ethereum wallet so as part of the demo I've built a login with token proof so uh you can log in it proves you have the address um and then you can start to have transactions which are only valid in the hollow chain world if it's signed by that ethereum address so every agent will look at it and go hey is this a valid transaction and unless it's got a signature of that address they'll say no it's not valid which means no agent can act on that behalf so these agents don't act like centralized server admins who can go and tweak the database on you you can build validation logic which is only valid based off secrets that are held by users who know nothing about secrets so the ethereum one isn't easy like okay that's someone who's sophisticated and knows and set up a wallet and whatnot but you can start to think about arbitrary secrets that your users have easily accessible um and that could just be like username password that they make up on the spot or an email or whatnot something which only they know they can use that to sign transactions that the whole network will only validate if that secret is in the possession of that user and so this flexibility with capability tokens to give new people access and also to make the agents a neutral I think I've gone a bit technical again sorry for pitching this as a non-technical talk hopefully it's useful for you um and it's a but that's the thing which has blown my mind most building this application in the last month is just like that's opened up a world of stuff which I can't do in ethereum I can't do that in centralized land there's this set of problems and demands and affordances which Hol chain gives me which is just really exciting so that is the so quick introduction of Hol chain a quick conversation about using it as an auditable um data validation layer which I think is a really strong use case for it um and so what we've built for the demonstration at the stall on the main event it sort of rhymes with renewable energy credits we're calling them human human energy credits and essentially we've got a couple of exercise bikes we've hooked up generators to them so they could generate electricity and we're measuring how much energy they are generating a little bit like how a household would me generate electricity from their solar panels we're aggregating multiple generation claims into a single issuance and then issuing that on chain with a link back to Hol chain so you can say hey this this random person on ethereum has issued some tokens they say they are valid human energy credits prove it follow the link go back to the application and see who cycled when to actually say do you trust that credit or not and there's a lot lots of other things going in that space But that's the store we've built up so it's been a lot of fun also integrating um the thing with Hol chain as well because it's a lightweight client like you can run it on really small devices and I've got a bunch of raspberry pies acting as sensors which are feeding into the application which actually signs the things and integrates with the network and this and I think that's the probably my final message for you would be that often when you're going into ethereum or blockchain land you you're going into an ecosystem which has made some very very conscious trade-offs like we we're going to prioritize security over everything else so it's very expensive and it's very slow um and or you're going into one which is like why we don't care so much about security it's going to be fast and quick and whatnot whereas in Hollow chain you can start to have a broader set of options and you can decide yourself of do you want strong security do you want easy usability do you want lightweight on the lightweight devices um who are your users how do you bring them in and it just gives me this breadth of expression as a developer which I find really valuable so anyway um I'll be around over here if you want to have a chat after this um lovely to see you all and come see us all at the main event take care
Automatic transcript — names and jargon may be misspelled.