Blockin
Listen Now
About This Episode
In this episode of DevNTell, Narb welcomes Trevor Miller, a computer science student from Virginia Tech, to discuss his project, Blockin. Miller explains that Blockin aims to be a universal sign-in standard for Web 3.0, extending the capabilities of Sign-In with Ethereum (SIWE) to support any blockchain and natively verify NFT ownership. The session covers the differences between connecting a wallet and signing in, the technical execution of sign-in messages, and the challenges Miller faced while building the project. He also provides a live demo of Blockin's multi-chain support and NFT verification features, highlighting its open-source and modular nature.
Key Takeaways
Blockin is a TypeScript and NPM library designed to create a universal sign-in standard for Web 3.0 that extends beyond Ethereum to support any blockchain.
The standard for signing in with Ethereum (SIWE, EIP 4361) provides a human-readable message for users and is gaining popularity in Web 3.0 apps.
Blockin addresses the limitations of SIWE by providing multi-chain support and natively verifying NFT ownership across various blockchains.
Blockin's modular architecture uses a 'ChainDriver' interface, allowing developers to implement custom logic for specific blockchains with minimal code.
The project is fully open-source, aiming to be a public good with no monetization, token, or private backend requirements.
Timestamps(click to jump)
Episode Transcript
Read full transcriptHide transcript
Hi, everybody. Welcome to what's going to be another great DevNTell. So, if you didn't know, DevNTell is a 30-minute window for members of the DAO to showcase something they're passionate about or have been working on. This can be an awesome project you've been working on, demonstrating unit testing best practices, automation goodies, smart contracts, how to structure a project. Basically, if you've got a passion for something, this is your opportunity to share it with the community. And today, I'm happy to have on Trevor, who is going to be showing off his project, Blockin. Take it away, Trevor.
Thank you. Yeah, so, hello. I'm Trevor Miller. Let me just get my screen shared real quick. Let me know if you guys can see this and if the audio is good. Yep, yep, we can see it, and audio's fine, yeah. Okay, so welcome. Today I'm going to be presenting my project, Blockin, which aims to be a universal sign-in standard for Web 3.0. Before I start, let me just say that whoever wants to ask questions, we don't have to wait till the end. Just interrupt, or if you're confused about anything, just let me know. I will stop periodically, maybe for questions, and then have a Q&A at the end too, if you have any.
Yeah, I just have a question. Maybe you could put in a link, like say Twitter or your website if you have one, in the chat and for us to get more information about the project.
Yeah, for sure. So, would that be which channel would that be in?
So there's on the side, if you at the top right side, there's a little chat icon. If you click that, the chat is embedded in this, in the actual Developers' Voice now.
Yeah, if you put your mouse over the Developers' Voice, you'll see a square box that'll open the chat.
All right, cool. So I'll put in two links actually. First is the demo site that you can follow along with. The second is the documentation site. And yeah, and then those will have links to the code and everything needed for like the NPM and stuff like that. Awesome. Thank you.
Okay, so let's get started. So, I'm Trevor Miller, Trevor Miller.eth, and I am a computer science student at Virginia Tech. I have been building in Web 3.0 for about over a year, I think since like last January-ish, but this is my favorite project so far, I have to say. And I've been in Developer DAO since mint. And actually, if any of you guys remember at mint time, there was like this issue with some of the images not loading and it would just be like a continuous loading spinner. And I actually was lucky enough to get one of those and in compensation, I got sent the one with ID number one. So I held that for a while. So, little fun fact. And then how did Blockin start? Basically, I took an intro blockchain course at Virginia Tech, and my group, it was a group project, and we basically had to do like a deliverable and like a paper by the end of the semester, and that's kind of how it started. And I continued it on throughout the summer and built it out into actually something usable for Web 3.0 devs.
Okay, so I'll start with a little background for connecting versus signing in. So, connecting is what you are probably familiar with with typical dApps. You connect your wallet via MetaMask and then send like a transaction signature every time you want to like add or update to the blockchain. But signing in is more used for like off-chain stuff, like maybe like a private database or just anything off-chain. And for those, you don't need to put it in a transaction format. You just need to like verify that a message was signed correctly, right? So, for signing in, you sign like this generated message and then if you can authenticate who you are, you can be granted access to that off-chain database using your like Ethereum address for example. An example of this is if you guys have used OpenSea. They use transaction signatures for stuff that like actually updates the blockchain, such as like NFT transfers or sales. But then they have their own private backend for stuff like likes, follows, stuff like that, and they have this like sign-in mechanism where you're like authenticated for 24 hours. If you've ever used OpenSea, you might be familiar with that. So, these are two different things. They can be used in combination, so you connect your wallet and then you sign the message with your connected wallet pretty much.
So, the execution flow is pretty similar to signing a transaction. You will be prompted to sign like a uniquely generated message with your private key, such as like this one on the right. And then one thing to note is this won't be added to the chain, it's just checked for signature. So, like if you try and broadcast this message to the network, it won't be formatted correctly. But if the message-signature pair is deemed valid, a resource provider can safely grant access because only the person who signed it should know the private key, so they can grant access to the public pretty much. And this is exactly like a Web 2.0 username-password combination. And then lastly, after being authenticated, the resource provider can choose to handle permissions however they want. So, like once they know that this person is who they say they are, or this address is who they say they are, you can maybe handle future logins with like session tokens or JSON Web Tokens, or you might just want to have them sign it in every time, which is also an acceptable solution.
And if you guys are familiar with Sign-In with Ethereum, this is the standard message format for Ethereum and signing in. And it was defined in EIP 4361, and basically it looks like this message to the right. It outlines everything in a human-readable way, and basically the user knows exactly what they're signing into, what's going to happen, and then also it has different protections against like replay attacks because the nonce is generated each time and stuff like that. And it's currently gaining a lot of popularity with Web 3.0 apps because many Web 3.0 apps aren't fully on-chain through smart contracts or stuff like that. They also might want to use some private database for either for scalability, privacy, anything. There's a bunch of reasons why apps would want to use something not on-chain.
So, with Blockin, we identified a couple places where Sign-In with Ethereum does fall short though. The first problem is that neutral applications not belonging to a specific chain, or like existing Web 2.0 applications like Netflix or maybe like a university, will have like a big user base who all don't prefer the same blockchain. So for example, a neutral application who wants to tap into like some Bitcoin users and some Ethereum users, they can't only use Sign-In with Ethereum because then that just doesn't, the Bitcoin users won't be able to interact with their app. So, Sign-In with Ethereum is limited to one chain and Blockin helps solve this by expanding it to like any chain. And then this transition from Web 2.0 to Web 3.0 will be made a lot easier with Blockin because of this, Sign-In with Ethereum doesn't require or it does limit to just one chain. So, that is the main problem we identified with Sign-In with Ethereum, but some other smaller problems are that the dev tools and libraries that Sign-In with Ethereum currently offers are not the best, and Blockin helps create an easily integrable one. And then many use cases of signing in are not actually natively supported with Ethereum or Sign-In with Ethereum, such as like NFT sign-ins or stuff like that. You have to do everything separately and it kind of just like a bunch of hoops to jump through to reach like a relatively simple simple goal. So, Blockin kind of combines all these into one step.
So, what is Blockin and kind of how does it help? Blockin is a TypeScript and NPM library and it aims, as I said, to be a universal sign-on standard to support any blockchain. And I do want to note that we extend Sign-In with Ethereum. So, anything you can do with Sign-In with Ethereum, you can also do with Blockin. We just take that base and add some existing feature or some more features to expand the usability of sign-ins pretty much. So, as you can see on the right, we have a bunch of different chains. This is the demo site that I dropped a link to in the chat. And basically it allows neutral applications can now let their users choose what chain to sign in with. And it'll all result in the same granted access because their private database, all they need is like an authentication so they can treat every single chain's signing algorithm as the same. So, as you notice here, the chains are not all EVM-compatible, which they don't have to be. So, previously Sign-In with Ethereum was based solely on like the Ethereum signature algorithm and Ethereum like addressing format, but now Blockin helps expand it to other L1s and L2s so you can sign in with pretty much any blockchain. And then we also envision that in the future, you can even do like a hybrid approach where you can allow your users to choose between like an existing username-password Web 2.0 approach or let them sign in with like a Web 3.0 approach such as Blockin as you see here. And then the last thing is that Blockin natively supports signing in and verifying ownership of NFTs on any chain that supports them. So, that is a cool addition to Sign-In with Ethereum that we support. So, let's look in the example use case. I'll keep coming back to this use case throughout the presentation, but think of just Netflix and think if they want to transition to Web 3.0. They'll have they normally have like a family plan and like a standard plan, right? For traditional Netflix accounts. You can think of that as maybe an NFT in Web 3.0. So maybe you have a standard plan NFT and a family plan NFT. And what Netflix can do with Blockin is they can deploy one of these NFTs on every chain that they want to support and then just let users sign in with Blockin on their own chain and it'll query their respective chain to check for ownership of that NFT, which will all result in the same sign-in access. So, if they don't own the asset on their respective blockchain, their sign-in attempt will be denied and they like won't be granted family plan access for example. And basically, this will allow any user who wants to transition to a Web 3.0 approach to not have to choose favorites for blockchain. So Netflix won't be limited to just Ethereum users. They can support maybe Algorand users, Bitcoin users, Solana users.
Okay, so now I'm going to maybe do like a little backwards. I'm going to show you the demo of what it looks like first, and then we'll get more into the technical stuff. So, first let me just open this up just this is the NFT that I'm going to use for verifying ownership of with this address, the Lobby Lobster. And so let me go over here to the demo site. So, if you see here, this little up in the blue banner is what the end user will see. So they'll have like this little display for their like address, connecting and signing in. So you can select whatever chain you want to sign in with. So, for this instance we'll do Ethereum. And then you can connect basically how existing dApps will. So, for here we connect with MetaMask. And as you can see, I'm connected now. And now if you want the user to sign in, you click the sign-in button and it'll pop up with this nice modal very similar to the Web 3.0 modal that you saw with connecting, but it kind of displays everything in a more UI-friendly way, just so that the user is not overwhelmed by like a super long and technical message. And basically this will allow the user to customize their sign-in request. So for example, if they want to like sign in with like the blue banner asset, think of these as like different plans. Like this could be the family plan or this could be the standard plan. For this site we'll do like blue banner red banner. So, let me first select these and you can see that if I sign in with both the blue banner and the red banner, I'll get access to it'll grant me access and I'll get the blue and red banner. You can allow users to just select only one banner. And just think of these as like different dynamic privileges you want for different sign-ins. So maybe you have an admin role or something like that. So, as you see there. And the other neat thing that I mentioned was the signing in with assets, right? So, for example here it it has this asset ID which obviously isn't correct. So if I like attempt to sign in with this asset, it'll Blockin will actually deny me service because I don't own the asset, right? So, you see down here the address does not own the requested asset. But if I sign in with that Lobby Lobster address that I have here, I will be granted access because Blockin will check and verify that I do actually own the NFT. So you see and then you're successfully granted and signed in. So, that's like a little demo of how Blockin works from the end-user perspective and it's pretty much the exact same thing as like signing a transaction but instead you're signing a message and then getting access. The last thing I want to show with this demo is that if you switch chains, for example, let's say like to Algorand, it'll customize the display and then it'll also customize the message to maybe to your Algorand account and like address and then it'll also verify with Algorand's native signature algorithm. So, instead of using the Ethereum signature verification, you use Algorand's native signature verification. So yeah, that's the overview of Blockin like the demo. I think now is a good time to stop and see if there's any questions on anything. I know I kind of went fast, but does anyone have anything so far?
No man, this was great. This is pretty awesome. I guess one question from me is as you were building this, like what kind of challenges did you face, technical or otherwise?
Good question. So, a big thing was that it is very difficult to come up with a good solution that can support like any blockchain. So, we a big struggle that we ran into was how to dynamically support apps that support like multiple chains. So, like it would be pretty easy to just like build like a library just for Algorand sign-in, right? Or just for Ethereum sign-in. But it's kind of that switching off and switching between users. I think that was the biggest problem and then it was also a little difficult because we were kind of in all different directions with within the class project itself. So we pretty much we started off in one path kind of focusing on like more just like authorization assets or like NFTs and then we transitioned to more like sign-in messages and stuff like that. So it was kind of just putting it all together, but I'm pretty happy with how it turned out and everything. Yeah, excellent man.
And you mentioned that you foresee that maybe there's an opportunity to kind of mesh this in with a Web 2.0 sign-in as well. Like could you speak more on that and maybe like an example of what you think could be a use case of that?
Yeah, sure. So, I don't have a like implemented example, but if you can maybe just imagine like, for example here instead of like the chain select instead of like one of these chains, you maybe do like a select like Web 2.0 or select like sign-in with username password. And then like when you select that instead of like a connect sign-in option here, you'll just enter your username password and you'll all be granted the same access similarly as you would be signing in with a chain, it's just authenticated via password instead of your private key. Oh, I see. Okay. Cool. Cool, cool, cool. And is it just you working on this project or are you with a with a group of folks? It's two others. It's I've done a lot more of the dev work over the summer because my project mates have internships, but we all envision to like keep maintaining this and it was pretty even throughout the whole like development process. Awesome.
Does anybody in the crowd have any questions for Trevor? What are some existing competitors that might be similar? So like kind of like WalletConnect, it's a little bit different, right? WalletConnect you have to like sign it every time. But maybe there's other ones out there, so maybe you've heard of like Magic Connect and I think there's like a couple others, but Magic.link, that one also claims to be like a seamless Web 3.0 experience for single sign-on for different dApps and other platforms also, multi-chain support etc. Yeah, what are some competitors or is that completely off?
Um, I would say that we focus a lot more on like Sign-In with Ethereum and the other ones kind of focus more on like a single sign-on solution, if that makes sense. We are I'd say it's more I'm not too familiar with like the Magic.link or anything like that. But what I envision our like competitive advantage would be is the modularity that we provide. Basically as you'll see later in the talk how we can build like a whole ecosystem like open-source of Blockin and actually keep it I'm trying to think of the best way to phrase this but if that kind of makes sense. All right, yeah, it does. Yeah, it's like open-source, it's a little bit different than the other ones. And I'll just put it I'm not affiliated with Magic, but um there's that you can compare. All right, cool.
Yeah, I'll I'll take a look and do more I can get back to you on that. But I'll I'll explain more of the behind the scenes in the the rest of this presentation and maybe that'll answer some some more of it. All right, I like that it's open-source. If there's other open-source projects whether it's like a web wallet or it's a you know mobile wallet. So that's something that if you know a wallet was interested in, they could you know plug your code in and have that you know feature or what not. Interesting. Yeah. We'll get through that with the ChainDriver implementations that I'll explain later. But um, so basically what does Blockin like the library provide? It provides the React UI components that you saw in the demo. Really customizable, you can like customize the modal however you want, you can customize this display however you want. The second thing is functions to help create, verify, and manipulate Blockin sign-in challenges. Basically just parsing, creating, stuff like that. Third is ChainDriver implementations which we'll get to later and then the fourth is starter templates and tutorials. So as I've mentioned, how does it work behind the scenes? Basically customized to blockchain-specific logic and then also you can specify NFTs to sign in with. So, you might be wondering throughout this how does Blockin actually handle all this blockchain-specific logic? Blockchain actually does this through a ChainDriver interface where we define about these 15 functions where you which need to be implemented in order to successfully verify a sign-in attempt. And basically whenever Blockin needs to call a Block blockchain-specific function, it'll just call the currently set instance of this interface.
So we have a setChainDriver function which you need to set before you call one of these functions. And basically it'll just call the currently set ChainDriver and this ChainDriver can be set and unset as many times as needed. So, in our demo example, we have the as you see on the right, the switch case for whatever chain the user is on and it'll dynamically return which driver to use to implement the logic. So, some may need API keys for like blockchain queries, such as like looking up ownership of an NFT, some functions don't, it's kind of just whichever ones you need you might need an API key. And so the thing here, this is more of what we're getting into with the question. Does everyone need to implement their own ChainDriver? So the answer is no because Blockin does provide some pre-implemented ChainDrivers as NPM libraries. So if you see here we implement like our own this is the Ethereum ChainDriver. This uses Moralis SDK and Ethers.js. It can and it can support like the main EVM chains. We also provide a Blockin Algo Driver as an NPM package that uses PureStake and Algo SDK. And it's pretty easy to implement, like you can see this is only 200 lines of code and a bunch of these functions are just like calling Ethers or just calling Moralis. You don't have to like implement a lot of this stuff, it's kind of just choosing which choosing how to handle each function.
So all you have to do with to get access to one of these is to just NPM install it and then import and then like kind of create an instance with your own like Moralis keys and then then you're pretty much good to go with all this blockchain-specific logic. If these ChainDrivers aren't what you're looking for or you want to like add support for a new chain, it's pretty easy to do so and it's only about 200 lines of code. And so over time, we hope to have like a whole collection of open-source ChainDriver implementations both built by Blockin and the community. And then basically if you're just constant building a dApp, you just select plug-and-play which NPM library which ChainDrivers you want to include in your application, all you have to do is just instantiate each time. Okay, and then lastly we have just a little talk on the future plans for Blockin. We plan to continue to add new features to the library, support for more chains and more. If you guys have any suggestions, let me know or leave a comment on GitHub. Our intentions are for this to always be a public good, so fully open-source, no monetization, no token, kind of just a library of code. And then we're looking always looking to onboard applications and expand the Blockin ecosystem. It's a relatively new project, so we actually don't have any current dApps using it, so it would be pretty greatly appreciated if y'all could help spread the word about Blockin. We think it can be useful to many developers in Web 3.0 and especially with using Sign-In with Ethereum and stuff like that.
So, that's about it. I know I went fast. I have a minute left for time but I'll open up to Q&A, feedback, anything. These are the sites if you guys want to learn more. The doc site is pretty thorough if you have any questions too. Could you leave maybe like contact info, whether it's email or LinkedIn like in the messaging and Yeah, for sure. Okay, awesome. Yeah, and I was going to ask about questions about the funding but it looks like you covered it in the previous slide so it's completely open-source no monetary gain. But I guess how do you continue to fund the development, if that makes sense?
Yeah, um honestly we haven't really thought that far, it's pretty new. Но probably if it does like take off and get big, probably through Gitcoin or some other public goods funding. That's kind of what we have in mind. I mean, once we actually have the core base code and the foundation of it working and kind of bug-free, there's not really much else to maintain except for adding new chains. And once we with the ChainDriver implementation, we're able to actually like outsource that. So like if other people want new chains, they can just implement their own ChainDriver. So maintaining it in that sense, like support for new chains can be outsourced and just open to the community. The core library isn't that big actually and won't take too much maintenance once it's like fully working and has some battle-tested and becomes battle-tested. Got it, so it's fully open-source. Yeah, because sometimes there's some projects out there open-source, but then I guess that you know maybe it does something like where it needs to communicate with servers and then it has like a rate limitation and you need like the key, so then there's additional way of having that project continue, if that makes sense.
Yeah, we're it's relatively new like I said, so we'll get around to that when it comes but we're excited and just continuing to maintain it as of now. So, anyone else have a question?
Yeah, I think the last thing I was going to ask is if people do want to help out. I mean you are, we are here in the Developer DAO. What's the best way to kind of get started? Are there open issues people can pick up or anything in particular you're looking for in terms of skill sets? I think the main thing that could help right now is just adding more chains and adding more even like more implementations of existing chains. So for example we use Moralis SDK for the like Ethereum driver right now, but for the paid version that's $40 a month and you might just want to make like an implementation just for Etherscan which is free. So pretty much if you want to add support in that way, that would be amazing. Adding new ChainDriver implementations and then you can either let us know and we can like either host it on the Blockin GitHub itself or maybe have like a kind of like a repository of just all the implemented ones. The other thing I guess is just if there's issues on GitHub or if you're really interested, I can add you to like a chat with other our core team and we can add you to like our little Jira board and stuff like that if that's of interest to you guys. Yeah, that's awesome man.
Yeah, plus one to that. Awesome, awesome stuff, gang. So, unfortunately, we are at time here, but thank you, Trevor, for coming on and showing us this awesome project. Really looking forward to seeing its development here. So, with that, I want to wish everybody a happy Friday, a great weekend, wherever you may be, and we'll catch you back here next week. So, I'm going to be dropping a link in the chat here for folks to claim their attendee POAPs and Trevor I'll send you your kudos via DM. Но other than that, we'll catch you all here next time.
Listen On
Share This Episode
Share on XWatch Episodes Live!
Subscribe to our event calendar and never miss a live episode.
View Event Calendar