Back to All Episodes
Season 2Episode 72

Subscription Memberships with Unlock Protocol

July 1, 2023
32m
1 Guest

Listen Now

About This Episode

In this episode of DevNTell, Narb welcomes Christopher Carfi, Head of Marketing at Unlock Protocol. Christopher shares his journey from traditional software development to the world of web3, eventually joining Unlock Protocol. He provides a comprehensive overview of Unlock Protocol, a series of smart contracts designed for creating memberships and subscriptions on-chain. Christopher discusses various use cases, including event ticketing, recurring subscriptions, and certifications. He also demonstrates the Unlock Dashboard, showing how easily developers can deploy and manage membership contracts. The episode concludes with a live demo of front-end and back-end coding integrations using the protocol, highlighting its flexibility and developer-friendly tools.

Key Takeaways

1

Unlock Protocol offers a robust set of smart contracts for creating time-bound, recurring, and programmable memberships on the blockchain.

2

Common use cases for Unlock Protocol include event ticketing, digital subscriptions, certification credentials, and loyalty programs.

3

The protocol supports a wide range of payment options, from native blockchain tokens and ERC-20s to traditional credit card payments through bridges.

4

Unlock Protocol's 'hooks' allow for custom logic to be integrated into contract behaviors, such as dynamic pricing or specific access controls.

5

Extensive developer tooling, including the Unlock Dashboard, UnlockJS library, and specialized hooks, makes it easy to integrate memberships into web applications.

Featured Guest

CC

Christopher Carfi

Head of Marketing @ Unlock Protocol

Unlock Protocol

Episode Transcript

Narb

Alright, we're live. GM, GA, GE everybody! Welcome to what is going to be another great DevNTell. So if you didn't know, DevNTell is a 30-minute window for builders to showcase something they are passionate about or been working on in web3. This can be an awesome project you've been working on, demonstrating new testing best practices, automation goodies, smart contracts, how to structure projects, etc. Basically if you've got a passion for something, this is your opportunity to share it with the web3 community. And today I am ecstatic to have Chris from Unlock Protocol on the show. Welcome Chris!

Christopher Carfi

Thank you Narb! Great to be here.

Narb

Happy to have you man! I guess we can start with a brief introduction. Maybe you can tell us a little bit about yourself, how you got into software development, web3 and Developer DAO?

Christopher Carfi

Certainly. So software development back in the early pleistocene, actually was a comp sci major, did dev for a number of years, did a bunch of consulting, moved out to the Bay Area during one of the internet bubbles and joined a number of different startups. So I have been with a few startups, a lot of big companies. I headed up global content and community at GoDaddy for about six years and started exploring crypto and crypto-oriented things in 2013. Really, really dove in in the last couple of years, hooked up with Julien who's the CEO and founder at Unlock about a year and a half ago and joined the project full time at the beginning of 2022.

Narb

Awesome! Yeah, sounds like a very familiar story a lot of folks found themselves in web3 with. Excellent man. What do you have in store for us today?

Christopher Carfi

So I've got a number of things. I know we've got a pretty tight 30 minutes here, so first 15 or so background, what is Unlock Protocol, what are the use cases, what are some of the tools and frameworks and types of resources that are out there. And then the last 15, if the demo gods are supportive, I'm going to do a live demo deploying a smart contract actually from the Unlock Protocol dashboard and then show you a couple of places that you can use those contracts both on the front-end as well as back-end. Those last two I'm going to give kind of a quick overview, but we do have some really, really detailed videos actually given by Julien, our CEO and founder, who actually wrote a lot of the protocol itself that you'll be able to reference on YouTube.

Narb

Awesome. Yeah, let's get into it.

Christopher Carfi

Cool. So what I'm going to do is drop my camera here and go to presentation mode. We're going to get the big infinite regress thing here for just a second, and that's okay. And then we'll get into the presentation. And Narb, if for some reason things are not showing up the way they should, just give me a shout out and let me know and we will get going. So what is Unlock Protocol? It is a protocol for developing memberships and subscriptions and the smart contracts to support that. We'll talk through the ecosystem, tooling, we'll show a couple of things that we can do with both our dashboard to deploy a smart contract as well as some front-end and back-end use cases, and then I'll make sure that everybody has access to the resources, our Discord, myself, and the rest of the team as well.

Christopher Carfi

Again, I head up marketing for Unlock, originally a dev though, so I can speak both sides of the business pretty fluently typically. And I'm C Carfi on all things from Discord, Twitter, Blue Sky and the like. So Unlock is a set of smart contracts and a protocol to create memberships and subscriptions and be able to sell access NFTs and we'll talk about what that means in a minute. Use cases: memberships, subscriptions, ticketing, we see a lot of DappCon and other folks, ETHChicago that's coming up, those are all going to be using Unlock for ticketing. Certifications, gaming. It's an open source protocol, obviously was founded in 2018 and has been in constant development since then by Julien, myself and the rest of the team.

Christopher Carfi

So when folks typically think about access NFTs and memberships and such, we think typically ERC-721s. And so it's like, so great, what does Unlock do? You can use any NFT in order to do that and actually NO. You can't. And the reason being, when you really start to think about membership, when you really start to think about subscription and the various use cases for that, there are things that you want to think about.

Christopher Carfi

So the first is a normal out-of-the-box ERC-721 is perpetual. If somebody has that membership, they are a member of that group forever. If you're running a business, that is really, really, really bad because what that means is you have sold this thing once and yeah, maybe if the marketplace supports it, you'll get royalties if it gets resold, but you've basically given away perpetual access to all of your benefits forever. So you want to have, you need to have time-bound NFTs if you actually want to build businesses on-chain that have a membership or subscription component. Unlock as a protocol does support recurring subscriptions on-chain. We'll talk through a couple of those use cases. This allows us to set up businesses and use cases and implementations that can get continuous revenue. We support all sorts of different payments from native payments in whatever the native token is of one of the chains we support to arbitrary ERC-20s, so we could use Code tokens if we wanted to pay for memberships all the way up through credit card bridges and such, we support all of that. The memberships can be either transferable or non-transferable, so literally a flip of a switch you can make the Unlock membership NFTs soulbound. And we'll talk about what it means to move from this hypothetical thing of everything on-chain is immutable. Actually we want it to be updatable and we'll talk about why that matters.

Christopher Carfi

So the protocol again, it creates membership NFTs. Those NFTs are ERC-721s. The protocol itself is updatable. When you deploy a contract, you own that contract and you can update a number of different terms of that membership from duration and price and a whole host of other things. The protocol itself is upgradeable. We're on version 13 and we work very hard to make everything backward compatible. And programmable. And we'll talk about what this means especially on the back-end, being able to when someone is purchasing, when somebody is transferring, when somebody is airdropping, when various things are happening, you can actually have custom code that you hook into the protocol in a very simple hook-based mechanism. So the key use cases that we see: event ticketing, recurring subscriptions and I'll talk through a bunch of these in detail. Time-based memberships, certifications and credentials, we'll come back to that one. We're seeing gaming apps, loyalty, attendance NFTs and of course digital collectibles. I'm going to talk through the first three of these in detail.

Christopher Carfi

So event ticketing, we're seeing a ton of this and all of those eight use cases that we just talked through, all of those are different types of memberships. If you think about an event, what is an event? It's a membership to be at a particular place on a particular date for a particular time. And once somebody has that membership, then of course you can extend that to give those folks discounts next year, you can give them access to the live videos, you can give them all sorts of different additional benefits other than just showing up on that day.

Christopher Carfi

We see folks like DappCon using this, they have an event with about a thousand plus folks, they're doing all of their ticketing on-chain and by the way, if any of your projects are doing events, please do on-chain ticketing. It just perks me when I see folks doing Eventbrite or something like that for events. It's like, okay, if we want this technology to be successful, we actually have to use it ourselves. So if you have an event, please do so. Almost don't care if it's on Unlock or using Unlock or not, but just please do your ticketing on-chain. So DappCon is using Unlock for all of their ticketing, if you're going to be at DappCon in Berlin, you're actually going to be using Unlock tickets.

Christopher Carfi

Subscriptions, this is a super interesting one. We've cracked the code on how to do recurring subscriptions on-chain. Since again, Unlock membership NFTs are time-bound, a subscription is a membership and then another membership after it. So after you put those memberships end-to-end, you have a recurring subscription and at that point you have a business. DeFi Robot is a great, great example of this, if you go to portal.defirobot.org, you can see the URL down in the bottom there. They're pulling in somewhere between 150,000 and 200,000 US dollars per year doing recurring subscription access to all of their analysis. They have a three-day subscription and a one-month subscription, the one-month ones are equivalent of like 200, 250 USD and so they're actually making a really, really, really nice business out of doing on-chain subscriptions to their content and all of this is automated.

Christopher Carfi

Time-based memberships, again some folks do seasons and they drop a perpetual membership but it just says 'oh this was only good for season one'. If you have a more frequent or more complex type of situation, you want to do time-based memberships, you can do this for a season, a year, a month, what have you. The folks over at Cabin, this used to be Cabin DAO, it's now Cabin City. This is a global networked city that is all being built both IRL and on-chain. They're using Unlock for all of their ticketing and all of their memberships and again, you can either pay for one or they have their native token which is a Cabin token and can pay for that membership using that Cabin token and then the membership is represented by an Unlock powered NFT as well.

Christopher Carfi

Some of these other use cases: certifications and credentials. There's a great one out there called CDAA, which are the Certified Digital Asset Advisors. They are folks who are certifying financial planners and all of their certifications are on-chain, you can actually view them through Etherscan, you can look at those, they've obviously flipped the bit to make those soulbound because you don't want somebody taking the test, passing the test and then transferring that to someone else. Gaming: Pixels, if you've played that game or seen that, it was developed through Thirdweb who we've got a great partnership with. All of their memberships are powered with Unlock as well and some of these other use cases.

Christopher Carfi

So for ecosystem and tooling, the way to think about this is we've got the core protocol and we'll get into the docs and the resources you have there. On top of the core protocol, we've actually built Unlock Labs, which is the organization I work for, has built a convenience application that is a DApp and I'll actually give you a live demo of that in a couple of minutes here. That is an optional UI layer on top of the protocol, everything that's done through that DApp you can do directly programmatically as well. The main things you can do are create and manage and upgrade those smart contracts that you have created for your projects that represent membership. You can upload what that membership card is going to look like and we'll see that. You can do airdrops, you can do airdrops in bulk, you can do a whole host of other things. There's also a convenience app that is a checkout, so with a couple of clicks you can actually develop a checkout and it feels very much like a Shopify or an Amazon checkout that you can either just attach to a link on an existing website or obviously you can programmatically have all of that work integrated with your app as well. You can collect details at whatever level you want for any metadata you might need to do other things, so it might be asking for email address during checkout, you have that and you can actually associate it with a wallet. If you're giving away swag, you might want to ask for T-shirt size or location or any of those kinds of things as well and of course we do support all the expected types of payment systems.

Christopher Carfi

We do a lot of the information tracking of these memberships using subgraphs, so if you've used Graph Protocol, we're deeply, deeply integrated, we're on a number of different chains. UnlockJS is a TypeScript library that makes it really easy to develop apps. This paywall app is the or paywall library is one that makes it very easy to make these checkout experiences as well and then we'll talk a lot more about hooks. Hooks are ways to extend the base smart contracts while still making them backward compatible and I'll talk through the six or seven different ways you can use those hooks.

Christopher Carfi

We've integrated with a lot of different parts of the ecosystem, so if you want to do magic links for identity and authentication you can do that. We're integrated with Stripe and Superfluid, Uniswap and ETHPass so you can actually display these membership NFTs in an Apple wallet or a Google wallet, a whole host of different things and again, since Unlock itself is ERC-721 based, all of this stuff just works, which is great. Again, we've worked with pretty much the who's who of folks in the ecosystem. I noticed that Developer DAO does a lot of stuff and its own management through Guild and so both on the front-end, you can only mint a membership if you are a member of a Guild, we're able to support that and on the back-end, if you are in a Guild then you can mint a membership, there are different ways that you can do that. We're on, like I said, eight or nine different chains all in the EVM ecosystem as well.

Christopher Carfi

So with that, again hopefully demo gods are going to support here. What I'm going to do first is I'm actually going to deploy a smart contract using that UI that I had talked about. Everything that's happening, it's actually doing that on-chain and everything that we're doing here you can do programmatically as well, but I just wanted to show this one helper app that we created in order to make it really easy to get the smart contracts out there so then you can do other things either with a front-end or back-end type of app.

Christopher Carfi

So I'm going to go over here, if one goes to the unlock-protocol.com website, got everything here, obviously all the stuff that you would expect, libraries and code examples and tutorials and stuff. What we're going to do today though is we're going to go in and we're going to launch the app. I'm already connected with my wallet so it'll pop up for us, which is nice. And this is my dashboard. So what I'm seeing here, locks are the term of art we use for the smart contracts that are deployed by the protocol. These are all of the different membership contracts that I have deployed. Obviously I do a lot of demos and have done a bunch of different projects and such. Keys are the term that we use for the actual NFTs, the tokens themselves. So if you are a user, if you're a holder of a membership, you can see your keys, you can see your NFTs that you have and obviously those are all visible on OpenSea as well.

Christopher Carfi

So what I'm going to do is I'm going to go out and I'm actually going to create a smart contract. I'm going to create a lock and I'm going to create a, let's say Developer DAO right now, I know, you know, if you have the 721 then the the one that you can get off OpenSea, you can get access to the Discord basically forever. I'm going to say, hey, what if Developer DAO actually wanted to only have a seven-day trial membership that expired at the end of those seven days? How would we do that? So I'm going to go in and you saw I just clicked 'create lock', I'm going to do that. I'm going to throw this in, and I think I have some Goerli in my wallet, we'll find out in a second. We're going to call this Developer DAO One Week Trial Membership. And again, you can set all of these traits, all these metadata items. So what's the duration of the membership? This one is going to expire after seven days. What that means is it's just like your gym membership: you still have it in your wallet after that, but anybody by inspection looking at it can see it is expired. So you still have it but it is no longer valid and any system that's checking for the validity of that membership NFT will say 'No, you can't get in'.

Christopher Carfi

You can cap your quantity if you want, so if you only want to have a hundred or a thousand or ten thousand memberships you can do that. I'm going to say we want to have an unlimited number of memberships here. And currency and price. So out of the gate, you can do whatever the base coin of the chain is that you're on, a couple of different stable coins or you can also put in the contract of an arbitrary ERC-20 and actually charge in that as well, so you can say, you know, I need to have 400 Code tokens or whatever to get a membership you can do that. I'm going to make these free and I'm going to say go. So okay, doing it on Goerli, it's a one-week trial membership, it's good for seven days, unlimited supply and it is free. Yep, looks good to me. Okay, we got that. We're going to pay a little gas and while this is going, I'm just going to kind of walk through this. Hopefully we can see everything that is going on. Let's see if this pops a new window for us here. It is saying pending so we're just going to wait for Goerli to do its thing.

Christopher Carfi

And if it hasn't hit in the next 15 or 30 seconds or so, then I'll go back and start talking about some other things and we'll come back and take a look at this. Okay, now we're seeing success! Good. So let's go back here and so I can go, obviously this is all happening async and it'll pop up in my list here when it does when it does show up under Goerli. And it's still working, we're optimistic on this, so we'll show it on here before it's actually deployed. And so we'll come back to that in a sec after I'm sure that it has actually done, okay, now we're seeing success! Good. So let's go back here and there it is. So now I can go in and I can manage this smart contract, I can manage this lock. So I'm going to dig in, I'm going to go in here and I can see I haven't sold any at this point, there are no members yet, I don't have any balance in my wallet. First thing I want to do is I actually want to update what the membership card looks like. So I'm going to go in, I'm going to go to this metadata editor. I'm on Goerli, that's the name of it. I'm doing it for all the keys, so I'm not going to specify, I could actually change the visual representation token by token if I want to, but what I want to do here is I actually want to go in and I want to update my file.

Christopher Carfi

And I'm going to go here, I'm going to go there, I'm going to say that is the one that I want. And you know I can change description, this is stuff that will propagate out to say OpenSea and such, and I'm going to save my properties. So once I do this, I saw a little toast right there, said it was saved, this is good. So now if I go back to my locks list here, hopefully everything worked and everything propagated the way it was supposed to and eventually this will show up with the new image on it. We'll come back and check that in a second.

Christopher Carfi

And I want to show some of the other things that you can do from this screen. So all of these different settings for the smart contract you can get into. So you can change the name, you can change the symbol, base token URI, all of the membership things, so again I talked about making something soulbound. By default it is not but if I flip this toggle, it will be. How long it lasts, how many are in the supply, maximum number of keys per address. If you think about your Netflix membership, you only have one of those but sometimes you might want to have more than one membership, so you can do that. You can cancel things from either side. You can take payments, you can change price, enable credit card payments, renewals which we can talk about a bit. We've got a whole bunch of different roles and things like that as well. So those are the things that you can manage for the contract once you have one, managing your membership. You can airdrop keys to folks, again you can update the properties of the NFT, you can do verification if you're doing events to check folks in.

Christopher Carfi

Create checkout URL is pretty interesting, this is a thing that you can do and for this one you can go in and actually create what this checkout looks like and so you can go through you can say, okay here is the particular membership and this is just a link to the one that you have created. Once you have that, you can specify a whole bunch of other things, but you can either just copy this as a URL or you can get the JSON file if you're putting it in your own apps. So wanted to just kind of give that quick overview of what the front-end looks like and make sure that folks had a an understanding of that. And then what I'm going to do is I'm going to hop back over to the presentation in the last eight minutes here or so and just show a quick overview of some of the other things that are out there.

Christopher Carfi

So in addition to that demo, so on the front-end side, if you're developing front-end types of apps we've got a bunch of different things, we've got a demo that's out here and this particular demo, and again I'm not going to go through the full thing, it's a JavaScript based demo. It's to token-gate a section of a website, so once you've deployed that smart contract and you have the contract address, you could use Wagmi or a number of other types of libraries. And what this is doing is sets up a website, sets up a page and then particular components on the page are only displayed if somebody has a valid, that is not expired, membership NFT that either that they've purchased through that checkout or that has been airdropped to them. So what I'm going to do is I'm just going to kind of flip through some of the quick things that are here. And again, this was the one that we did at ETHGlobal and we'll share this YouTube link with you as well. But what this is saying is just setting up a super basic app here. From that, the app right now all it does is it prints out a header and then it's got a component that is the body of that. That component is just printing a line of text '42, the answer is 42'. We go through and once we install some of the dependencies that are there, we get those things set up, we set up the provider. We have a default RPC, you can use Infura or whatever you want if you want to do that. We get all of the different connectors and such in and then we basically wrap that component with the logic of: if somebody has a valid key then it is token-gated in this case, and if they don't then it'll get rejected. So what we're going to do is we're going to set up that token-gating component. This is all React based, we're installing some other dependencies there, setting that up and again right back here we saw briefly lock address and again that's the address of the contract that is deployed, very similar to the one that I did in the in the live demo there. So you wrap that component, set it up and we're checking a balance of function, the balance of function in Unlock returns a value of how many valid NFTs you have. If you know, one then you have a valid a valid NFT at that time, if it's zero then you don't. And we also set it up so you can connect your wallet, we've got some easy ways to do that with Sign-In with Ethereum and some other ways of doing that as well. And then once you are set up, again just flipping through this real quick here, it will go through, we set up that checkout again if somebody wanted to purchase one and then we're going to hook that up to a button on the site. And so what happens is somebody connects their wallet to the site, it sees that they don't have a membership at this point and so it's going to show a button that says 'buy membership'. If they do, go through and they click on that, it's going to take them to that checkout, they purchase or renew their membership, goes through and either mints or renews that membership NFT, goes back to the site and now since they have a live membership, now you see that field or that that component that was there. So this is the kind of stuff you can do very, very quickly and easily and again, this was a live 15-minute demo from concept to working app that we did at ETHGlobal Waterloo.

Christopher Carfi

On the back-end there's a lot of things that we can do and I'm going to talk through this in the last couple of minutes here. So on the back-end you can actually integrate the smart contracts into other things that you are doing as well. The important thing to note here is we have a lot of customizability into the way these contracts work that you can extend by writing your own code. So when somebody is granted or airdropped a key, what is there special stuff that you want to do other than just dropping it in their wallet and you can do that. When a key, when a membership is extended, so they already had one, they're on a subscription plan and then they extend it or renew it, is there extra special stuff other than just updating the expiration date? You can do that. When someone purchases it, when somebody cancels it, you can when somebody grabs the token URI, you can look at things. This is great for doing things like dynamic visual NFTs. When you're checking to see if somebody has a valid key, this is where you can do things like: oh, if somebody has this and this and this from these other smart contracts or these other conditions or follows you on Twitter, those are the types of things that you can check to see if somebody has a valid key and then also do things on transfer. And so we've got is actually a back-end application here that you can take a look at and what this one is is for every time a purchase is made, every time a key is minted, the price doubles, so it's sort of a bonding curve sort of thing. So I'm just going to flip through this one because I know we are tight on time.

Christopher Carfi

So TLDR, if you want to add memberships or subscriptions or monetization to your project, Unlock is the dead simple way to do that and it's going to save you weeks to months if you use the protocol. So you can do all sorts of different things, as a creator you can create memberships and very easily integrate them into websites. As a dev you can get into as much granularity as you want. We've integrated and partnered with, you know, Livepeer and Lens and XMTP and a bunch of other folks. We've got a ton of resources for you, so we've got tutorial videos and again, Narb will share all these links for you so if you do want to take a picture of the screen cool, but we'll have all the stuff available for you as well. So we got tutorial videos, we've got a ton of docs and examples and example code and such, both in the Unlock GitHub as well as a couple of other places as well. We also have a ton of end-user friendly plain language guides of how to do things for, you know, how do you integrate into WordPress, how do you do those types of things that are not super dev specific but still super useful if you're trying to get up and running quickly. So we've got all those things out there and obviously we have our own Discord at discord.unlock-protocol.com. So with that, thank you, I know we've got a couple of seconds left but trying to keep everybody's day on time. So Narb, back to you!

Narb

That was excellent, Chris! And you made it through with one minute to spare. That's excellent.

Christopher Carfi

Oh okay, I could have talked a little bit longer!

Narb

I know, I know, ah yes! Chris, as this is only 30 minutes long, but yeah, thank you so much for coming on. Um, really appreciate you taking the time to to give folks a overview of Unlock Protocol. Um, I have a few questions um that we might be able to get in but just want to know, do you have any use case studies around the loyalty side of things and whether or not any companies web2 or web3 have integrated Unlock Protocol with their existing loyalty programs?

Christopher Carfi

Yeah, there are a number. Probably the one that's furthest along is we've got a really interesting integration. So there's a web3 CRM platform out there called KAZM (K-A-Z-M) and if folks are aware of Web3 Academy, which is a great content resource and kind of zero to one web3 training course, they're doing all of their loyalty and such using Unlock as the membership NFT and then managing it through KAZM as the front-end to manage all of their loyalty points and such. So if you if you check out Web3 Academy and go through and join theirs, you're actually on the back-end you're actually using Unlock but you don't even need to know it which is the sign of a good protocol.

Narb

Excellent. Yeah, I will check that out. And yeah, if folks have any questions for Chris, like he mentioned, you can reach him on Twitter or Discord with the C Carfi handle. And with that, I want to present our viewers here with our, thing, QR code to claim your mint kudos today for being an attendee. So...

Christopher Carfi

Oh I'm totally doing that too even though I wasn't an attendee! I'm totally doing it.

Narb

I got a special one for you as well I'll I'll share it with you, but yeah, you get two! Yeah, so you'll have up to one hour to claim your mint kudos. So you'll want to take out your regular QR code scanner, scan this bad boy and claim your kudos. And yeah, like I said, you'll have up to the top of the hour to claim that and with that, just want to wish everybody a very happy Friday, happy weekend, happy July 1st to our friends in Canada and happy July 4th upcoming to our friends in the states. And yeah, we'll catch you back here next week, eh!

Christopher Carfi

Awesome. Thanks Narb! Thanks everybody! Talk to you soon, I hope.

Narb

My pleasure. See ya! Bye!

Listen On

Share This Episode

Share on X

Watch Episodes Live!

Subscribe to our event calendar and never miss a live episode.

View Event Calendar