Video Summary and Transcription
Welcome to the talk about digital ownership using blockchain and NFTs. Explore NFTs and their integration with blockchain. Learn how to create NFTs using Remix on the Sepoia test network. Deploy and access the smart contract on the blockchain. Connect your wallet and grant access to NFTs. Understand the blockchain structure and its authentication capabilities. Connect your wallet with the frontend and interact with it. Explore blockchain connections with Chainlink. Understand gas fees and account abstraction in blockchain transactions. Learn about ownership, account recovery, and data storage on the blockchain. Discover how blockchain can be used for public information, databases, and its energy costs. Gain insights into blockchain functionality and data storage.
1. Digital Ownership with Blockchain
Welcome to the talk about digital ownership using blockchain and how to prove ownership with NFTs and blockchain-based accounts.
Welcome, everyone. And I'm here to talk about ownership, about digital ownership using blockchain. And we are doing this understanding how to store accounts in blockchain, and I'm coding live with you.
At least I'm deploying a smart content in the blockchain live now to show how this is working. Before that, these are my contacts. Feel free to contact me if you like later. And let's start on this way.
Can you imagine having your favorite social account network blocked? Did it happen? No? Or maybe a fake social account. This happens with me a lot. And asking money to my friends. My mom is a specialist in getting, especially on WhatsApp, she gets some messages that are supposed to be me, but she already knows that's not me, but this happens a lot. And this is something that we can avoid using another kind of account that can prove your ownership. And this is I'm here to show you how to do that.
We are using blockchain. So first of all, yes, if you would like to get the presentation, it's here. And when I talk about the blockchain, I'm talking about a kind of system where we have first, immutability and transparency. This is the base of the blockchain. So we are talking about systems that we can trust a bit more, and they are not centralized out of the consensus between what's happening in that system is decentralized. So it's used to be a most fair system. And this is talking about NFTs because we are using NFTs to make our assets, to make our account. And an NFT, it's on, it'll be on the blockchain. And an NFT is a kind of token that is unique. So when we create a smart contract, that is an NFT collection, each NFT on this collection will be unique and each collection is unique as well. So we can guarantee that this will be a unique account that you are creating. And if it is done by your account, it's associated with you. So you can prove the ownership of that. And especially when we talk about digital access, we can think that, okay, we start with the username and password. Maybe now some of you are using fingerprints or even my computer, it's my face to unlock my computer. And then we can evolve more and more to really use NFTs and accounts based on blockchain. It's always evolving.
2. Exploring NFTs and Blockchain Integration
Why NFTs? They provide ownership, privacy, and control. Examples include Forbes' NFT for exclusive news access and group membership verification. I'll give an overview of the process and share a tutorial. I'm using React, Next.js, Vim, and Solidity for programming, and deploying on the Ethereum testnet.
And so, why NFTs? When we talk about NFTs, we can talk, imagine that here in this conference, we could have your past being an NFT as well happening, other conferences more related to blockchain, but this is expanding. And you'll be so proud to have this and to show this and to have this really connected with your account. This can be something. And even you can have some kind of privacy if you design the system to do that. Or, at least for sure, you have more control related to your account. This is the point.
And here I have some examples for you. Like, do you know that Forbes has a path that is an NFT to access all the news that happens over there? Or even the other, the access token experiences is related to another collection as well. So this is the Forbes that we have exclusive benefits related to this. Or we can have this other one. They are so cute. And yes, it's another kind that you can prove that you are part of some group and nobody can pass this like saying that they are you. This is some examples for you. So let's build it.
And before I really go to my smart account, I'll show you an overview of this. I'll share after, during the talk, I'll share with you a Git book, a tutorial. And you can do this step by step later. It'll be so fun for you as well. Well, I'm using React, Next.js to be my interface. And I got the package to communicate with the blockchain. This is the Vim. Also I'm using Solidity. This is the language to program smart contacts. And I have a smart contact to deploy it now, live. And I'm using the Ethereum blockchain, one of the testnets. This is not a real one, but this is a network that is around the world. Anyone can use. We can interact with each other here. And this is two tests. Let's go.
3. Creating NFTs with Remix on Sepoia Test Network
This is a tutorial on using Remix, an environment to create smart contracts on the browser. The contact defines the language version and imports a library for creating ERC71 NFTs. The NFT, named Open Access, allows minting a piece in the collection. The grant access function makes it easy. I'm connected to my wallet and ready to deploy on the Sepoia test network.
And this is the tutorial that I talked before. So if you got the other QR code, you already have this. So this is easy for you.
So let me go to the code. I'm using this. This is Remix. It's an environment to create smart contacts on my browser. So I don't need to install nothing more to create this on my browser. And this is my contact itself. Let's see if this is big enough for you. It can be better. So this. So on my contact I'm defining the version of my language. I'm importing a library that is really creating the NFT for me. NFT has different standards. And I'm using this kind of NFT standard, the ERC71. My NFT is called Open Access. And it's this. Every person that would like to have an NFT, it's only minting a piece on this collection. This is the grant access function. It's so easy.
So it's time to deploy this live for you. I'm connected here with my wallet. So we used to have wallets, and NFTs would be stored in your wallet for all the owners. And I must unlock this again because I was out. So this is my wallet. I am in the Sepoia test network. And I'm ready because I am connected here. I'm ready to deploy. So if I came here, deploy.
4. Deploying and Accessing the Smart Contract
Remix creates a transaction with the contact's bytecode, which is then sent to my wallet. After signing and paying a fee, the contract is published on the blockchain. I have a deployed contract that I can prove is transparent using a blockchain explorer. Each smart contract has a unique address. I copy the address and access my code. The code includes components for creating the view, checking access, constants, images, and the ABI for communication with the front end. Let's go to the front end.
What are we doing now? Remix is creating a transaction with the bytecode of my smart contact and send it to my wallet. I sign this on my wallet and pay a small fee. And then I can have this published in the blockchain. So if I came here, I'm waiting to have this confirmed. So contract, in fact, is confirmed now. And if I come back, scroll here, I have a deployed contract that I just did now. If I'd like to be sure that I did now, I can prove this for you. Remember this is transparent. And you can see this as well.
So this is a blockchain explorer. And you can see 24 seconds ago. It's now. We are doing this together, okay? So this is the address of my smart contact. Each account or each smart contact has your own address, unique address. I'm copying it. And then I came to my code. This is my code. And I have an environment variable here. That is my token address. Let's save it. And before go, I can show what I have here. I have some components related to how I may access, creating the view itself, checking the access, the constants. I have two images that are here as well. And I have the ABI is the way that I am doing the communication between my smart contact and this front end. And this is this. Let's go to the front end itself. It's here.
And this will be the end. Oh, no, you should not see this now. Okay.
5. Connecting Wallet and Granting Access
To connect my wallet with the front end, I refresh and verify the connection. After authorization, the VIP image is locked until I grant access. Granting access creates an item in my NFT collection that proves ownership. Confirmation on the blockchain involves validation by the decentralized network and the creation of a block with the transaction.
This is the basic, okay? So first of all, I must connect my wallet with my front end, my application. Let's do it. Probably I must refresh a bit more because I was doing different things a few minutes ago. Let's see if I'm really connected. Local host, yes. I can see here that I'm connected. I am in the right account. This is my application running. And okay.
Connect. Okay. I'm connected now. I already authorized this in my wallet. And you can see that I cannot see that beautiful image, VIP image, that you saw before. That can be anything you'd like. What is the kind of content that you'd like to unlock with your NFT? You can discover that. So when I click on grant access, I'm creating that pass. So I'm creating one item on my NFT collection that gives me the right, gives me the access. So I'm confirming this. And because this is created from my account, I can prove that I am the owner of this.
Let's come back here. It's pending yet. It seems that we must wait. This will be confirmed on the blockchain. So what's that? On the blockchain, when we send transactions, the transactions will be in a waiting area. And then we are talking about a decentralized network. This network will validate my transaction. And one of the node validators will create a block including my transaction. The other validators, you say, okay, this is okay. And this is the block in the blockchain.
6. Blockchain Structure and NFT Authentication
The blockchain structure is confirmed. I need to improve the frontend for automatic refresh. Grant access is no longer available as I already have an NFT. NFTs can be used for authentication in various systems, ensuring privacy and attachment to the user's wallet and identity. Each individual can be considered a unique and dynamic NFT, adaptable to their life. The smart contract is integrated with React using the VIM library and the Cepolha test network.
This is the structure of the blockchain. And you can see now that's confirmed. So if I refresh this again, I must create a better frontend that refreshes this automatically. I didn't yet. You can help me. I connect the wallet again.
And now, I don't have the grant access anymore because I already have an NFT on this collection that proves my access. So I am a VIP person now for it. And imagine, where you can use this? What kind of systems? Any system that today you use another different kind of authentication, you could use this kind of NFTs to authenticate the systems. And nobody can get your password. You can attach it with your wallet, with your identity. Even you can create your identity.
Imagine, for example, that I used to say that I am an NFT. And each of you are an NFT as well. And why that? Because we are unique. And even if we change ourselves, like, I know that I'm being older. I hope to not be fat. But yes, I'm change. And you as well. And we can say that we are dynamic NFTs. Still unique, but we can have different stats and different things in our NFTs that can update with us, with our life. This is another thing for you to think about. So let's come back to my presentation to understand a bit more what I did.
And this is the smart contract that I show you. Okay. It's a basic, basic smart contract. I already talked about it. This is how I integrated this with React. So I'm using this library called VIM. And I'm using Cepolha, that test network.
7. Connecting Wallet and Frontend Interaction
I can check if I have the Metamask wallet extension. The frontend connects to the wallet and retrieves contract information, including the address and API. It checks for the presence of an NFT and grants access accordingly. You can test the published version by installing a web wallet. Dynamic NFTs can update based on real-time data, such as NBA player performance and real estate ownership history.
And this is the way that using this library, I can check in my browser if I have some wallet injected. So that wallet that you saw before is one of the wallets called the Metamask. And it's an extension from my browser. And here I'm checking if I have a wallet like that.
This is the frontend itself. I'm connecting the wallet, getting the information related to my contract. What I need to interact with any contract in the blockchain. I need the address. I just create a new one with you. And I need the API, the application binary interface. It means that I must know which kind of functions I have to input or output and which parameters I have on that. And this is what I'm doing on this part.
So the frontend itself, it's only in that component that I showed you before. I'm checking if I have or I don't have the NFT. If I have it, it's good. If I don't have it, so I can't have the access. Could I have more than one NFT? Yes, I can. But in this case, I'm only checking if I have or no. And this is in the same way that I was running that application local for you, that this is the local. If you go here, you can have that in a published way and you can test later. In order for you to test it, you must create the wallet. You must install a web wallet in your computer. This is the point. Then you can test this as well.
I already talked about the dynamic NFTs and this is something really interesting. We have some NFTs related to NBA games as well and players where you have the card and the card is updating according with the points of that player. This is real as well. And this is one of the examples. We have examples related to real estate. Imagine that the NFT can represent, for example, an apartment and you can see the owner, you can see how the history is related to that apartment and including proving this.
8. Blockchain Connections and Chainlink
Blockchain connections with external systems are crucial for transparency and trust. Chainlink, an oracle provider, facilitates these connections. Their developer hub offers resources, boot camps, and multilingual support. Feel free to ask questions. Thank you for having me.
We have this in the government systems, but we could have this in the blockchain as well. And I can tell you that to have this kind of connections between blockchain and everything that we have outside the blockchain is the key now. This is the point. This is the way where you can have systems that can be more transparent, that can have more trust. And this connection is one of the key points.
And we have tools to do this already. I work on Chainlink and I didn't tell you what Chainlink is until you understand a bit more. Chainlink was a company created to do that, to connect blockchains with the outside world. This is what we call oracles. Oracles is to do this kind of connections. And Chainlink has a set of services to do that. And if you'd like to know more, you have our developer hub. In the developer hub, we have content, articles, documentation. And also, we used to do some boot camps. And the boot camps are, the last boot camp, it was two weeks, two hours per day, and we started from zero, create your wallet in the first day, create your first smart contract in the second day, and go day-by-day. The last boot camp, we included it in other languages. We did in English, Spanish, Portuguese, and Turkish. By the way, I am from Brazil. So I did the English, Spanish, and Portuguese. And also, Mandarin, we have it, but it was not me. But it's nice, including to have local languages and to learn in your local language as well.
This is the presentation. If you didn't get it before, it's your chance now. I am awaiting your questions. Yes, let's go a bit forward. This is me again. Okay, okay. And... Thank you so much. It's my pleasure to be here.
9. Gas Fees and Account Abstraction
Gas fees in blockchain transactions can be paid by the user or by other systems. Signing messages without sending transactions avoids fees. Layer 2 blockchains have significantly reduced costs. Account abstraction allows other users to pay fees. Wallet passwords and key generation are essential.
Who is going to pay for gas in the network? Does this mean the user has to pay on every sign-in? So for authentication, does that cost gas each time? It depends. And first of all, what is gas? Gas is a piece is the basic token from each blockchain. And yes, we must pay transactions in order to have a validator validating your transaction when adding the blockchain. You can pay the fees, but also there are some systems that can pay the fee for you. And also we have another kind of message that you are only signing a message in a cryptographic way. And when you sign messages, you are not sending the transaction itself, so you are not paying the fee. So we have at least these three options. But yes, we have the fees.
Another point related to the fees is that in the beginning, when we talk about blockchain, maybe you hear about, oh, this is so expensive. And it was. But now we have, we say the layer 2 blockchains, these other blockchains that are based in a blockchain, but they have more capabilities, with a cost almost zero. Like it's cents of cents of cents. So it's nothing now. So it's a tiny fee, in the grand scheme of things. Because I think that's a related question, is, I think I've seen somebody put in there. There, that's again, one thing that discourages me from using the blockchain is that every action requires money. Is this a necessity of running it? Yeah, I think I already told you about this, it's the same, yeah. So you just have to be smart with how you write your contracts. Yes. And also now, we have, in the blockchain space, we are talking so much about account abstraction. And account abstraction is a different kind of wallet where you can have other users paying your fees as well. So this is being so common, and we don't talk about this anymore. This is the point. Is that, and this is me just learning off some of these questions here as well.
So if we make an abstraction of storing users in the blockchain, is this what you're talking about right now, the authentication layer as an abstraction? Isn't the solution very similar to OAuth, because you still need to have a wallet password? Or is it different? Yes, this is interesting. Yes, you must have the wallet password as well. Not exactly that password that you saw me typing. I can't forget that, in fact. What I can't forget is the key that generates my wallet. We used to have a key like with 12 words, 24 words.
10. Ownership, Account Recovery, and Data Storage
When using blockchain, it is important to own and protect your keys. Account abstraction allows for the recovery of accounts through trusted third parties. Data can be stored on-chain or off-chain depending on the system design and the need for transparency.
This key you can't forget, or at least you must save this as well. And it's not like a bank that if you lose your password, you ask the bank or ask the company and get another password. You must save the password. The other difference related to this, when you are trusting in a third party to have your password or to have your authentication, what happens if this third party was compromised? And this will not happen if you are owning your keys. And we used to say that we are talking about to have a world where you must have more responsibility to own your own privacy and your own keys.
Okay, so it's because you can move that or remove it. Exactly, yeah. And this probably comes into it. If I lose access to my blockchain account or my wallet, there is no support. Is that just... Exactly. So this is why you need to be able to recover the passphrases to get it to you. But this is something that in the beginning of blockchain, like I started in 2017, and this was a huge problem. But exactly now with the concept of account abstraction, you can have accounts where you can add other people to be like a third party that you trust and he can prove that you is your account and then on this way we can recover some kind of accounts. But it depends on the design of the account.
Yes. You can store any kind of data inside the contract. And it depends on the design of your system what is interesting to you to have on chain and what is better to have off-chain. For example, we used to store images that are big off-chain and we used to store basic information on chain. When you bring information to the blockchain and especially to the public blockchains, you must think about the transparency. It means that the information is public. Can we have some kind of zero knowledge proof or some kind of abstraction of the information? Yes we can but we must be conscious about the kind of information that you add on blockchain and it will be public.
11. Public Information, Databases, and Energy Costs
When adding information to a blockchain, it becomes public. Use cases for a normal database alongside a blockchain include storing private data and improving search capability. The energy costs of blockchain depend on the type of blockchain used, with proof of stake systems being less expensive.
It means that the information is public. Can we have some kind of zero knowledge proof or some kind of abstraction of the information? Yes we can but we must be conscious about the kind of information that you add on blockchain and it will be public.
And I think this is a really good follow-up question. When you talk about when to use a normal database versus storing data on a blockchain, I guess that's where we were talking about the abstraction, like do we want to put private data on the chain? Is that how we connect these things? So what are the use cases for a normal database when you're building out these applications or do you build these alongside?
It's interesting for example, sometimes we used to have a blockchain systems when we have different entities that don't trust each other. And even if you would like to not trust any entity, the blockchain is the best way to have the system. This is the point. But also when we have inside the blockchain, we used to have companies that get the blockchain data and add it in a normal database to have better indexes. So think that the blockchain will not be the best system to search things and to have the index inside. You must have an external database as well.
So if more data is stored in blockchains instead of central trusted institutions, and again I guess that depends what you mean by trusted, it costs too much energy effort worldwide or are there solutions to reduce the energy costs of this? No, this is interesting because it depends on the type of blockchain. And today, a different kind of blockchains that they are not based in, we call it proof of work, that we must use the energy of your computer to prove that transaction or to create a block. We used to, now a lot of blockchains use proof of stake systems that we must stake some value to participate in the validation. So this is less expensive now. So this is not something that we worry about now.
12. Blockchain Functionality and Data Storage
The blockchain.com website being offline does not affect the blockchain itself. The energy costs of blockchain depend on the type of blockchain used, with proof of stake systems being less expensive. Storing data in blockchain differs from Git as it involves sending transactions to a network where validators secure the system and prevent rewriting or changing of data.
One day, a person came to me, hey the blockchain, it's off, it's not working. Because the blockchain.com website was offline. But in fact, it didn't affect the blockchain because we have nodes around the world. It's only the explorer that's showing that transaction that was off, not the blockchain. Very funny, yeah. So it's like the internet in a box. Exactly. But it's right here.
This is interesting again about data storage. So if more data is stored in blockchains instead of central trusted institutions, and again I guess that depends what you mean by trusted, it costs too much energy effort worldwide or are there solutions to reduce the energy costs of this? No, this is interesting because it depends on the type of blockchain. And today, a different kind of blockchains that they are not based in, we call it proof of work, that we must use the energy of your computer to prove that transaction or to create a block. We used to, now a lot of blockchains use proof of stake systems that we must stake some value to participate in the validation. So this is less expensive now. So this is not something that we worry about now.
How is this different from storing data in Git? Oh, the first difference is in this case you have people that are in that same account or the same company that are approving to push your commit and fly data. But we are talking about to send a transaction to a system where a person who is approving a transaction didn't know you, are not in the same company, can be anyone in that network. And one validator approve, the other validators you check if this is right. And because of this, we have this system being more secure. So you can't rewrite, you can't change, well, you can rewrite commits and change them and it's kind of okay. Yes. Exactly.
Thank you all.
Comments