Decentralized, Not Fragmented: Using Community Agreements to Connect dApps with Ken & Brandon Mitch
Ethereum Denver·Mon, Oct 9, 2023, 12:00 AM
We believe community agreements are the future of the web. They allow communities to determine for themselves the relationships among their members and how they want their tools to work. Decentralized should not mean fragmented and we think these portable community agreements can play a crucial role in helping make sure our tools work together to best serve communities. In this way, we can create a multiplayer internet that derives authority from each community's smart contract rather than a centralized intermediary. We'll discuss how community agreements can help developers connect their applications and allow for united interoperable suites of tools that together provide a superior experience and value proposition for communities. For example, we'll outline how to use an open-source ethereum package manager (epm.wtf) built on ERC-2535's modular contract architecture to compose existing contracts into a shared community agreement.
Transcript
thank you um well our talk today is called decentralized not fragmented using Community agreements to make the apps interoperable first we wanted to uh let everyone know that contrary to what your crypto portfolio tells you that we are currently in a bull market uh literally we are in the beef Palace auction Arena of the National Western Stock Show event center so consider yourselves lucky oh thank you um all right a little bit about us uh this is Ken I'm Brandon we're both full stack devs we've worked together across various companies over the past 10 years now we're both founding members of meme which we'll get into in a minute but first here are a few fun facts about us so Ken is an aggressive typer uh yeah I've uh I've had three uh two MacBooks where I've broken the enter key on them three times I have a very strong Pinky an avid ketchup Enthusiast I don't know I am I do love ketchup also yeah what else did I put on here uh oh yeah I like to 3D print stuff um and I Foster a lot of dogs he's a he's a good human uh me on the other hand I have a degree in design and oil painting so I have no idea why I'm here I grew up in a town of 600 people and I won a trophy for Reserve Champion feeder steer at the county fair when I was a kid and if you did not grow up in a town of 600 people or you've never been to the National Western Stock Show you probably don't know what that means moving on now that you know a little bit more about us let's talk about memes so meme helps people build tools for portable communities and we Define portable communities as groups of people linked by a shared purpose and not the platforms on which they operate we let you define your community once and then collaborate everywhere so developers in the room uh have heard the adage build once deploy anywhere and we feel that same principle should apply to communities and we do that through what we call Community agreements so technically speaking meme Agreements are on-chain smart contracts deployed owned and controlled by the communities themselves and within that agreement you're able to define the roles and the rules for the community that can be extended across any tool or application your community uses so I don't know if you see the graphic there but essentially this community is made up of Alice and Bob and then within that Community agreement they've defined that Alice is an editor editors can approve posts for publishing paid members can access posts via ipfs and lit and then editors share member fees equally so we feel that tools should bend to the communities and not the other way around meme helps communities connect existing tools or build your own tools on top of the community including tools for collaborative publishing which will get into in a little bit here and we think those tools should be composable and interoperate according to the community's design so this is a visual of kind of the stack that we've been building so at the top here are some Primitives that we've defined that exist across all communities so communities need to be able to discuss uh transact value create content and collect content and then at the bottom uh these are sort of the technology Primitives that uh we think allow communities to do those things so shared state so the community and its members should be the same across all applications that the community is using storage so a place to store the things the community is creating and collecting access to that storage so making sure that the data is encrypted and only accessible by the members of the community that should have access to that content and then the roles themselves that Define that access and then that middle piece is where all the billing is happening right now so at the very lowest level the meme protocol is our open source nft smart contract layer and that's kind of where we'll be focusing the majority of the talk today as well on top of that we've built an agreement SDK so uh any web 2 or web3 Savvy developer can come in and start to build uh applications on top of our stack without having to know solidity code and then at the very top level it's obviously the application layer so extensions and D apps built on top of your community and now here's a little bowl dance party break if you look it's it's the maybe you can't see his face but it's the smile that really gets me Dan single um all right so now we're actually going to move into kind of the like get into more of the contract level stuff and really start talking about upgradable smart contracts um and then how we're kind of applying those in what we're doing um so just some of the benefits for upgradable smart contracts in general you know you get faster iteration Cycles easier to Dev you can actually fix bugs as they're found rather than having to totally redeploy contracts and migrate everyone over um and you can actually share the same implementation across multiple contracts so you can have like one where you're implementing it and then um share that logic kind of across a bunch of other proxies which also reduces size and the overall deployment costs so you may be familiar with ERC 1167 this is the kind of common pattern used across a lot of upgradable smart contracts right now the minimal proxy contracts that you can see over here on the left we've got a user interacting with a contract so that would be like you're making a contract call through metamask but really what that's doing is it's just forwarding it on to another contract behind the scenes that has all the logic but all the data gets stored at that proxy contract level so you can actually imagine multiple proxy contracts all using that same like implementation logic so that again cuts down on deployment costs um the uh there there are a few limitations there though because you only have a single implementation contract and you run into something uh some things like the 24 kilobyte limit on Smart contract size so I actually started hitting this when we were experimenting with putting nft metadata entirely on chain um and I hit that 24 kilobyte limit I'm like what the hell do I do now um so I then came across ERC 2535 which is the diamond proxy pattern so instead of it's the same kind of concept you have a proxy contract but then instead of one implementation contract you can actually have as many as you want behind it and so that lets you get around that 24 kilobyte limit you can actually segment your things segment your logic out into kind of code bundles that have very specific purposes you can more you know easily test those things um and so the diamond proxy pattern this is kind of a visual representation it was created by Nick Mudge it uh recently moved into final status so it's actually an accepted standard now um so yeah you can see here like each facet is would be an implementation contract so you might have an ownership facet you might have an ERC 721 facet you might have an access control facet and the diamond itself is kind of the sum of all of those things attached onto it and it gives you a lot of flexibility because you can actually swap those things out and that's the kind of upgradability part so this is a getting a little even more granular on it and so the way that it works is that the diamond proxy itself keeps a mapping of function signatures to address of where it's implemented so if I have a contract that implements you know token URI then I have a mapping in my proxy contract that says when someone calls token URI I'm going to use delegate call to forward that onto this particular one and then you know return the results or whatever um and so that gives us lots of flexibility really down to the function level itself uh super powerful so let's see yeah like normally you'd need to Fork a contract make changes redeploy an entirely different contract with these you can actually um you can you can use like as many of them as many functions on each of those implementation pieces as you want or as few as you want so you can also Imagine uh this works really well for if you have let's say a really well audited ERC 721 contract but for your purposes you really just want to swap out one function maybe it's that token URI function you want to return some slightly different metadata you could have it so that you are pointing you know everything except that one function at the this well-audited erc721 contract and then you could deploy a contract that has a single function that implements token URI and do whatever you want with that so it gets really powerful and makes things very composable um and so that's that's going to lead me into EPM which is a tool that I built that really came out of just us iterating on our contracts and me wanting to more quickly deploy changes and test things so there's been some great tooling around like hard hat plugins and scripts to like do these upgrades for Diamond contracts um but you know it's mostly all CLI or like kind of scripts one-off things it's not super easy to like rock so EPM is really a graphical user interface to manage these Diamond contracts in a visual way um so yeah so uh EPM ethereum package manager kind of uh paying homage like npm node package manager I come from JavaScript typescripts a lot of back you know coding background um so what what this tool will let you do is search and deploy or attach any of these facets alter functions um and you can upload your own and deploy them it also support regular contracts if you just want to upload a regular contract and deploy that um and so what does it look like so when you come in here to uh epm.wtf um you can create what's what I've called a bundle so you can basically Define uh like pull in a bunch of facet implementation contracts and then toggle on or off the functions that you want to use and then save it and so you can see kind of down here um I can't really see um so you can see in here so like this is like a base uh 721 facet that I've got and so like maybe I just have a basic thing that handles sale distributions and it sends it to like one single address when you mint an nft like if you pay for it but uh you can see I've turned it off here and then actually further up there's another one that also implements that function and maybe there you have it sending like multiple people you have multiple splits going out to various people um so yeah so this is kind of a once you've defined that bundle or maybe you're just using a bundle that someone else has has defined um you'd go through and deploy each of those implementation contracts um unless someone else has already deployed it and then you can Leverage What they've already deployed and save yourself on costs um and then once you've selected all those there's two more transactions so you'd have to deploy your proxy contract so you deploy a diamond proxy contract and then the second one is doing what's called a diamond cut which puts uh like essentially creates that mapping of what functions are going to what implementation contracts and then once you've deployed it you can actually go in and just drop your contract address in or go to the my contracts part on there and you can continue to adjust or add facets or turn on or off functions I've also added the ability to download typescript types like that'll just generate them so that it's easy to pull into your project and um and do it there's some example react code that you can see that you can expand and it'll show you how to kind of quickly just start working with that on the front end download the ABI um you know a lot of that stuff so this is just kind of showing again like um you can toggle things on and off and once you're satisfied that you know you've got got what you want just like kind of any upgradable contract you could uh you know rescind ownership and say okay it's good and now it's now it's locked now it's an immutable contract so just because we start with something that's upgradable doesn't mean that it always has to stay that way um so yeah and really the goal I guess when we're we're thinking about this holistically from like our meme stack is that we want people to be able to plug in at any layer which is why we want to give people easy apis to work with or an SDK um but we also want people to actually own their Community agreements so when you go and deploy through meme.wtf um you deploy a community agreement and nft contract you are the owner of that contract you could rescind ownership of course if you wanted to um but then you could also take that and go to EPM and totally customize it for whatever your needs are and with that we're going to talk about uh another tool that we are have been working on that is kind of a little higher up in the stack uh yeah so um symphony is the name of one of the first apps that we're building on top of this stack uh to allow collaborative publishing uh today's Symphony lets a community use a Discord to decide what to tweet uh to a shared account and if you want to try it out it's live today you can go to build.meem.wtf Symphony we'll be adding more Platforms in the future so for example you could use slack as an input to decide what gets published to forecaster lens or paragraph but for now you can start to get the idea of how we're trying to break down the barriers of different platforms and make them interoperable so to sidestep any technical difficulties of a live demo we've just got some screenshots here so how well you can see them but after you onboard your community create your community smart contract with meme you can then enable Symphony so in this case we're showing how you can connect your existing Community Discord shared Twitter account that you want to publish to um and then at the bottom there is where you go and start to add rules and So within a rule you can Define which Discord channels the bot will listen to um or who or what roles can vote to approve content for publication to Twitter and then you decide on emoji that's used for the votes along with the number of votes required for approval there's also a veto step in there so if you want certain roles to be able to veto certain things so that they don't get blasted out to Twitter regardless of how many people in the community want it to you can do that and then we're going to continue to iterate on that publishing process to to make it more advanced in the future so here you can see just an example of a Post in Discord that got one unicorn emoji and Symphony then tweeted that out to our Xerox meme Twitter account as seen here uh so yeah that's basically the first implementation of one of our apps um built on top of Meme and in the future we hope to build many many more apps and hopefully maybe some of you would be interested in building with us uh so with that we want to thank you for coming out to the uh beef Palace auction arena for our talk if you want to get in touch and learn how to build with us or Define what portable communities means we'd love for you to get in touch we've got our twitters and podcaster handles at the top there or you can just scan the QR code or go to build dot meme.
wtf slash Denver yeah I would say also if you have any communities that would be interested in using this type of publishing software um definitely come talk to us because we want to get you onboarded and then we're really looking for kind of pull from the community to decide what the the next things are that we're going to enable in terms of inputs and outputs for this definitely looking at not just Twitter output but you know also longer form publishing things like that as well so um I think with that we can open it to any questions if there if there are any yeah Dean Dino hey sorry um we don't know him Zen boy here uh so it sounds like you're open to working with Discord communities that will have a channel where they whatever they're posting on the channel will be published to Twitter that's like one of the functions yeah that's where we're starting with it so publishing to Twitter is where we've started with it um but we you we can imagine there also being multiple steps in there so maybe it's like you it could be more of a curation process which you've also experimented with where maybe it's like anyone is reacting in one Discord Channel Once there's enough reactions from the general Community those would go into like a curators channel where only people with certain roles um would then you know curate it further and you can imagine there being many steps in that process before it finally gets published out okay great and any anybody can uh to just contact you guys and you're going to roll this is there a cost to that or uh no free free yeah okay yeah you can um check it out at meme.wtf right now cool well thank you everyone for coming out I think so [Applause] foreign
Automatic transcript — names and jargon may be misspelled.