📚Mission 5 - Neo
Learning to sign transactions with NeoLine
Last updated
Learning to sign transactions with NeoLine
Last updated
We are learning a lot of new things. In the last mission, we understood more about Neo organization and how to become more active in their ecosystem.
Today we are going to introduce two new concepts, first is to connect to an app using your NeoLine wallet that we created in mission 1 and the other signing transactions to authorize the interaction between your wallet to the app in Neo network.
As we have already learned, a blockchain is formed by numerous blocks of transactions, and for each transaction it is necessary to use GAS to complete it. We currently do not have GAS in our wallet, as the MELK token has no financial value and on the Neo network, the token used to pay the fees is GAS.
However, there is a type of operation that fits the concept of gas free, that is, it is not necessary to use GAS to be carried out. It is called a signature.
Signatures have been used for a long time in our society, and they serve as an authentication mechanism, proving your identity through a signature. In the web3 world, we also have this signature process, which is widely used in login systems. For this, we have a common image of the login paradigm in the different phases of the web:
Signatures serve to prove that you own the wallet, that is, that you have its private key, which is often used to log into systems, as shown in the paradigm above.
With the arrival of web3, login will be much simpler, using signatures to prove your identity. In addition to being a much faster and more convenient format, it is as safe as the previous methods.
For today's mission, we are going to learn in practice how to sign a message using NeoLine and GhostMarket DApp, a cross-chain non-fungible token (NFT) marketplace. We will talk more about NFTs in another mission, for now let's understand how to connect and sign a message.
Remember: be careful where you connect your wallet for authentication. Malicious websites may use your data for harmful purposes.
To access the GhostMarket website, visit: https://ghostmarket.io/
Your screen should look like this:
Note that at the end of the screen we have a button, which says “Connect Wallet”:
Once you do that, a popup should appear for you to addd your wallet, click on "Add wallet"
Select Neo N3 network and Neoline Wallet and log in in your wallet.
If your NeoLine is not opened, you should see a screen to enter your password.
Here NeoLine is asking for the password to unlock your wallet, which we don't have access to, and it's just for you to log into the wallet account.
If you are already logged into NeoLine, this screen will not appear.
The second step is the consent you give to the site so that it can read your public address and with that it can identify your wallet balance. You have two options, you can 1) Select "Allow and no longer remind" the site to get connected to your wallet always without providing consent again, 2) you choose "No longer allowed" and the site will have to always request your consent for your wallet to be connected. For this exercise you can choose the first one "Allow and no longer remind" .
Click “Connect” to proceed.
You should now see the following:
You should now see a pop up message from you wallet requesting you to sign a message, the message is for you to confirm the action of creating a profile in their app, once you authorize by clicking yes, your profile will be created and a random username will be allocated to you.
You should now see your newly created username appearing on the top left of your profile
Let's personalize this username, but in order to do that we will have to sign another message. Click on "View profile" just below your username:
On your profile page that just opened, click on "Edit":
You will be prompt to verify your wallet, click on "Confirm"
A New "SIGNMESSAGE" is now displayed by your wallet, and once you sign you will have access to your profile settings and edit functionalities, click "Yes"
Now, on your profile Settings, go to the username box and enter your desired username, in this case I updated mine from lyqnny to melkdao.
This confirms your profile has been updated and you can also view in your account details, note down the username you just created.
Congratulations! You signed for the first time with your wallet. No information was registered on the Blockchain and so there was no need to pay fees and gas.
The site now has your accomplished signature, and having knowledge of the message that was signed, it can validate that you are the holder of the private key relative to the wallet's public address.
This ensures that only you and no one else can generate this signature. This process proves your identity. It is a simple, effective and secure login system.
Head over to Mission 5 channel on discord and post the username you just created in GhostMarket.
Click on the icon at the top right of your screen:
This shows the details for your connected wallet, if for any reason you want to disconnect your wallet simply click on this icon
Ok, now that we have connected our wallet to the app I will show you how to sign a message. In order for us to do that, let's create a profile in this app. Go to the icon on the top right , and click on "Create profile"
Once you have chosen your username, go to the end of the page and click on "Update Profile" the app will automatically save your new username and the message "Profile successfully updated" will appear.