New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Unlock Protocol 🛠 Integrating Membership Smart Contracts

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join us for an Unlock Protocol workshop titled, "Integrating Membership Smart Contracts". Some of the most skilled web3 developers, designers and product builders from all around the globe came together for a weekend-long hackathon at ETHGlobal New York 2023. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Music] ER at unlock protocol and today I'm going to show you uh I mean make a quick introduction of what unlock is and if we have enough time we'll do a live coding session usually go very fast but I'll point to the GitHub as well so you can use this so first uh quick agenda unlock protocol overview then we'll jump into some Dev tools uh all of our ecosystem of tools then how to add unlock to a front-end use case and again that's the live coding session then more about smart contracts about hooks about UI and finally a bunch of links that you can use for your hacks tonight tomorrow and obviously hopefully you'll win the hackathon on Sunday um somebody is very kindly Distributing a little leaflet with QR codes on this with links to the docs Etc so please use that my name is Juliana I am the CEO and founder at unlock protocol I am French uh I am prior to unlock I was the founder of a company called superfeeter which was sold to medium the blogging platform I still think people know what medium is uh in 2016. uh I'm a big open source fan I worked with w3c World Wide Web Consortium people don't know what it is usually in that space But that's basically people that actually normalize or write this spec of how the internet should work uh it's fun but it's annoying and I'm also a member of the graph Council uh which is their kind of Dao governance thing uh you can find me as julian51 on all of the things yes all of the prior 50s were taken or use my blog at uber.com which is talking gated by the way uh and if you get a membership to read some of my posts it's five bucks a month a year it's cheap uh let me know and then I'll pay coffee when we meet in person what is unlocked protocol unlock protocol is a protocol for memberships simply speaking it's a system to create membership and sell access nfts in minutes within your apps within your content etc etc it is used for memberships like you know a gym membership a club membership is used for subscription like your Netflix account could be should be will eventually be an nft can be used for ticketing a ticket to a conference a ticket to an event is an nft that gives you access to uh physical space it's used for what we call token gating and that's what we'll see in a couple minutes but also for things like certification your degrees your driving license are should be nfts that have an expiration date or maybe not actually your diplomats forever but your driving license expires every five years I think in the US I should know this because I have one but also can be used for gaming so for example you can unlock a certain you know level that you can access for a day a week a month etc etc it is obviously fully open source so all of the code that we've ever returned at unlock is open and uh ready for your inspection I guess uh it's also Community government we have a Dao with people that are Community participating in contributing new code new updates uh every day at this point a bunch of apps a bunch of libraries and a bunch of their Dev tools and it will go uh into that in a couple minutes we have a pretty diverse team of people against me but also people from Google Facebook oh the evil people uh from GoDaddy and a bunch of other uh organizations so wait I talked about nft membership and enft could work well no because most nfts were not built to be memberships they are built to be Collectibles and so for example they're Perpetual if you're a business and you sell regular nfts to make Revenue well I've got some good news you're going to make some money maybe on the first couple days but then you will never ever sell more nfts you can hope on royalties but as we hopefully by now all know royalties are a lie they actually are not enforceable so there is no way your business can make money on an ongoing recurring way well that's why we've created kind of a new kind of nft there UFC 721 that have an expiration date to allow to have kind of time-bound nfts so nfts that are valid only for a certain time that allows you to do for example recurring Revenue where you can say okay the nfcs expire every month unless the user the owner of the nft pays a bit more every month and again Netflix account that's how they work basically you pay every month I think now it's almost 15 bucks but you pay 10 a month for it to be renewed and extended for another month and when you stop paying well the account actually expires um it is also unlock has been built so that it can support multiple payment mechanisms obviously crypto payments so native currencies on all of the chain that we're deployed on at this point it's all the 12 different evm networks we'll talk about this in a couple minutes but also you can use any erc20 token so you can say hey I actually don't want to be paid in you know in Matic or in East because these are fluctuating currencies I'd rather be paid in usdc in die in Euro C in any erc20 that is absolutely possible it has a mechanism to do unchain verification that's the normal nft verification but also off chain where we have a mechanism for owners of NFC to sign it and provide that signature in the form of a QR code for example that anyone can scan to verify that indeed the owner of the nft sign and still owns the nft uh they can be made transferable or non-transferable as we call them sold Bound in that space But I think more importantly they can also be programmatically transferable so maybe allow transfers if the user does something or unless something else is true and obviously we go from a model where all of the nft contracts are immutable they're you know put out there and if there's any issue in them well too bad they're there forever to something that becomes programmable or upgradable in a way that allows developers like yourself change the behavior of the contract so you might say okay at first I will not allow refunds but maybe after a couple years I will allow refunds and it is possible to keep the same contract without having to re-mint everything and say hey these nfts initially they were not refundable now they are refundable so first so good so unlock I was just a leading to this a couple seconds updateable you can change all of the properties of the membership contract so including the price including the duration you go for maybe a month-long membership to something that is a quarterly based membership you can change the price from something that is like five dollar a month to seven dollar a month uh Netflix uh you can go from a limited Supply to a larger Supply you can go from having only one manager for the contract to multiple managers which are could be apps that can change how these memberships work etc etc they're also as I said upgradable so the protocol itself is on I think version 11 I should know this as well but we're just about to move to a new version and that means that when the new the protocol has new features uh maybe support for things that it didn't have earlier you can decide to opt in for these new uh for these new features of the protocol you cannot upgrade to a random version otherwise it doesn't become standard anymore you can only upgrade to version that have been Community approved by the Dow and finally and maybe this is one of the interesting part for you guys the smart contract themselves are programmable through the concept of hooks so you can change how the contract behaves based on some custom logic so for example one thing that people always ask is like hey can I do something where maybe the price of the nfts change based on how many have been sold and you can actually absolutely do that with the hooks so you can have a system where maybe the price at first is one usdc and then every time somebody buys you double that and so obviously that's going to get very expensive very quickly in a programmatic way so you don't actually have to go manually poke the contract to change the contract somebody buys price goes up somebody buys price goes up etc etc key use cases um event ticketing so there's been a ton of events that I've used unlocked for uh ticketing including actually some Global hackathon a few years back recurring subscriptions uh or actually ECC as well if you guys were in Paris I know if Mexico is Vietnam happening in the next couple weeks are using unlock for ticketing uh you can do recurring subscription I mentioned you know Netflix but there is a many at this point I'd say a good 20 different websites that are using unlock for monetizing blogs or video content uh in a recurring way so you pay every month and your nft gets extended and you can get keep access time-based membership we haven't seen a few dowels use unlocked for this where they have a seasonal approach where you say okay these membership are valid for three months at the end of the three months they expire and they're not automatically renewed but that's kind of seasons to make sure that the dough has active memberships we have certification and credentials so we have a company that is using unlock to re-certify its financial advisors every year error so basically they give them an nft if they've uh they cannot be that they cannot transfer obviously they give them an nft that shows that they've been certified and at the end of the year it expires unless uh the person who was certified actually recertifies by going through you know some online presentation Etc uh used for gaming as well there has been a couple games that you use to unlock uh for different things so either unlocking levels or unlocking different capabilities for their players used also for loyalty with a platform called Chasm I don't know if you guys have heard it but um they're building kind of loyalty program like your Starbucks kind of loyalty thing on top of unlock and that's another example attendance nfts uh sometimes called poapps people use unlock for this and also my least favorite category the digital Collectibles the pfps and all of the nft crap that hopefully is on the way out at this point um let's go a bit deeper into a specific use case so event ticketing I mentioned a few conferences uh what's interesting here is like 100 of what the crypto user I mean 100 of the crypto payment goes to the organizers uh which is pretty cool um it is end-to-end ticket so you're actually not buying through a platform you're actually buying through the smart contract as an attendee uh and then the organizers of the conference can decide whether they want to you know allow people to resell their tickets or not which I think is pretty powerful but you can also create and for me that's the power of blockchain interoperable experiences Beyond just the event itself so you can say hey maybe before the conference uh anybody was bought a ticket they have an nft well you know what I'm going to use Snapshot you guys are familiar with snapshots yes no snapshot is a voting system um snapshot.org pretty cool thing uh off-train voting but you can make it so that only people that have a ticket to the conference can vote on what is going to be the food or what's going to be the main speaker which I think is cool you can also create uh maybe token gated uh channels on uh warpcast forecaster people know work podcaster maybe you know about social networks and only participants only attendees of the conference are able to participate which I think is another cool example of how this membership goes beyond just a hey you only have a ticket to go attend the thing now you have an NFC that gives you access to many different things across the web sorry for hitting the mic here um tickets act as a membership and card to connect uh with the community of people that have the same obviously uh nfts in their wallets uh example a couple weeks ago dapcon in Berlin actually that was last weekend feels like forever uh nearly a thousand attendees uh all using unlock uh for ticketing uh I'll spare you some of the details but yeah basically if you buy the nft you get a QR code as well uh which you can show to the organizers and prove that you have um a ticket also people got swag uh through the nft which is really cool like the sponsors were able to airdrop other nfcs and a bunch of other things to the attendees at the conference and knowing that they're only the attendees of the conference because they had the nft that proved that they added tickets another key uh use case of the protocol is subscription so tokenable and experiences I mentioned my blog a couple minutes ago but again there's about a 20 different website that you do that at this point and what's really interesting is like for these businesses it creates ongoing recurring Revenue so think of like a patreon or a sub stack like model where as a Creator instead of selling one-offs things and then hope that I'm going to be able to sell more and more of these I can just tell my fans hey you guys are interested in following my content why don't you pay every week every month every day to get some of that content uh we support as I said both crypto and credit card uh we have an integration with stripe as well in integration with cross mint uh which make this really easy so direct relationship between the creators and the members no way somebody can say Hey you know your content is not good enough or your content is too adult from my platform I'll kick you out uh no middleman and that applies to content to software think of like in-app purchase I'm sure you all have mobile phones uh you might have in-app purchases in this while they're currently records in a database either at Apple's or Google servers you can make them nfts and say hey if the user has an NFC in there what I'll show them you know dark mode or whatever is the uh the feature that I want to tokengate or not inside of my app so really kind of creating kind of permissionless app stores uh is a is a really cool idea here any question no so far so good um an example here we have a Community member mentioned one of these 20 guys but um I actually don't know their guys uh D5 robots they're providing uh trading tips uh via their telegram Bots and you cannot access the telegram groups unless you have one of their nfts uh they are fairly expensive nfts I think like uh something like a 100 200 bucks a month or something like this or actually 100 bucks uh three days and then 200 bucks a month uh but that's a cool example of using unlock for that I have three more minutes so it's going to be really short uh time membership uh let's keep that uh example people no cabin is a kind of a club for people that are cool and want to hang out together in the forest uh they're using unlock for memberships uh definitely a very cool use case here uh going back to the use cases uh the ecosystem and tooling so we have a dashboard obviously a front end where you can use to deploy inspect your contract do a bunch of things this is completely optional obviously the front end itself is just a front end you can replace with your block Explorer of choice or an application that you build yourself you can use that to change the characteristics of your block of your blog of your uh contract as well as do something like airdrop membership and others I would definitely invite you to check that out if you get study it's the easiest way um we also have a checkout UI which is an easy way for people who don't want to build kind of the whole checkout flow say hey all right cool I want to enable credit card I just check a bunch of boxes and then users are going through the checkout UI and as I said we support multiple types of payments we also have developer tooling so sub graphs uh hopefully you guys are familiar with subgraphs but it's basically a way to aggregate a bunch of information coming from chains uh we have a JavaScript library called unlock JS we have a paywall which is actually the checkout UI that I just described as well as hooks at the contract level so we also have web hooks but these are smart contract hook that allow you to alter how the contracts uh behave multiple types of integration uh anything that works with Windows 721 721 which is one of these two uh nft specifications will work great with unlock so framework like ethers third web web PJs wag me you mean you name them VM I think is the new hot thing uh you can just use unlock there we also have integration with platforms like magic like privy like Stripes super free Dimension all of these again uh selfie to Ping us on Discord to get more the typical protocol ecosystem uh thing I'm not going to have time to show you the live coding but I'll share the link in our Discord uh basically it's a random blog that you can read uh content on and really as in with less than 50 lines of code you can create a token gate that basically requires users to connect their wallets prove that they have an NFC if they do they can read the content if they don't they're prompted to purchase one of these so they can read this again pretty basic um and the unlock specific part here is I'd say five lines uh everything else is like normal uh wag me and webp or sorry ethers uh JavaScript that allows you to add the blockchain to your web app um there's a YouTube video as well so if you're not tired of hearing me you can actually watch me uh do that demo live um I've done it a multiple icon oops sorry don't play don't play uh we also have a quick way to do token getting on the back end so your you know rails Django um I mean um whatever node.js application can you talk on getting on the back end so no need for you to just do front-end uh token getting the mechanism is pretty much the same as usual to connect the white ask them to sign a message verify the signature of the message on the back end check whether the signer of the message has an nft if they do great you serve the content if they don't no you don't serve the content that's really really basic um we also have a mechanism to create a bonding curve the thing that I described here where the price of the nfts uh go up every time somebody purchase one you can also make cool stuff where price goes down if nobody has purchased in a while etc etc we have multiple types of hooks that can be called and can be used to again change the behavior of the uh of the app one really fun one is the on token URI hook it's a way to kind of change the metadata that the nft is serving or the nft contract is serving uh when somebody's querying it so you can make these Dynamic nfts that basically look different based on the hour of the day Etc I just got a stop sign so I'm going to just move on quickly quickly quickly to uh the last slide uh oh actually uh if you want to add unlock membership to your um so if you want to add monetization to your app this weekend definitely use unlock uh you should you know do that uh and think about how to make money uh you also maybe win a prize and you can scan that QR code to get to our YouTube page where there's a ton of me uh and a bunch of other people as well uh if you are interested in hacking on top of a log we also have a booth so please stop by there another QR code and they're all on the papers that we just distributed as well and we're available on Discord this time is not on the QR on the paper so please scan that one if you just need to take one picture all right thank you very much everyone

Automatic transcript — names and jargon may be misspelled.