Repository
https://github.com/Papabyte/Hardware-cosigner
https://github.com/Papabyte/Byteduino
In response of Byteduino Task Request
What Will I Learn?
- You will learn how to create your own hardware cosigner
- You will learn how hardware cosigner works
Requirements
- Visual Studio Code with Arduino extension
- Any ESP8266 and ESP32 boards, especially NodeMCU
Difficulty
- Intermediate
Description
In this Byteduino tutorial, we will learn how to create your own hardware cosigner for Byteball. This hardware cosigner will provide an extra layer of security so that every transaction will need the consent of the hardware cosigner we build. We also learn how this hardware cosigner works and make a little change on the code.
Installing the dependencies
For the first step, we need to clone the Hardware-Cosigner projects by @papabyte here. After we have clone it, we need to install the depencies that the hardware-cosigner project use. First, we need to install Byteduino library. However, since Byteduino depends on ArduinoJson and micro-ecc, we also need to install both of them.
Register the private key
To create the hardware cosigner and add it as a multi signature wallet, we need to generate the private key first then apply it in the the code/sketch. There are 2 way to generate the private key, one is by visiting this site, the other one is by creating executing the key-generator script which is shipped with Byteduino library.
generate.js
shipped with Byteduino libraryAfter we have generate our private key, we need to insert it into Hardware-Cosigner code like below. Since in this case we use the testnet wallet, we also need set the hub to point to the testnet which in this case is byteball.org/bb-test
. We also optionally can name our device to our liking. Also, don't forget to set the Access Point that we are going to connect to which in this case is WirelessNet
.
When we have compile and upload the change into the device, we can now pair it by creating Multisignature Wallet using the pairing code provided by the key generator we executed before.
How the Hardware Cosigner works
This hardware cosigner device connected into 2 things. One is the Byteball DAG network where all Byteball transaction distributed. The other one is the WebApp when we open the IP Address of the device in the Web Browser. In general, the cycle of the hardware cosigner can be separated into 3 parts:
- initialization that happen when the device is power on
- stand by for listening ongoing transaction which happen when we open the IP Address of the device in the Web Browser
- sign/deny the transaction when there is a transaction request
sequence diagram on how the hardware cosigner works
When the hardware-cosigner is power on or the reset button is press, that device will try to connect to the Access Point and print the IP Address into the Serial Port whent it's conncected. After that, it will start the webserver and also connect to the Byteball Hub via secure websocket connection. Finally, when it's connected with the Byteball Hub, it will print the wallet info into the Serial Port.
At the stand by phase (when we open the IP Address of the device in the Web Browser), it will do polling and check the ongoing transaction every 2 seconds. When there is a transaction request, the Deny and Sign button along with the transaction details will open in the WebApp served by the hardware cosigner. When the user click Sign button, it will tell the hardware cosigner to sign and accept the transaction then send it to Byteball DAG. In opposite, when the user click Deny button, it will tell the hardware cosigner to sign and refuse the transaction then send it to Byteball DAG.
Video Tutorial
Curriculum
References
- Byteduino Release Announcement
- Latest Testnet Wallet for Linux 64 bit
- sequence diagram on how the hardware cosigner works
Hi @drsensor
Thank you for your video tutorial in response to the Byteduino Task Request. I can see that you have put in great effort to do the tutorial following the guidelines explained in the readme file to walk users through the Byteduino co-signer library.
Here are a few things you can improve on as you do video tutorials:
As mentioned in my last review, it would be great if you can make the font sizes bigger in the video so that people do not need to squint their eyes to figure out the words and codes.
The delivery of the presentation needs improvement. You can try writing out an outline with structured steps so that when you teach, you can lead your users to move from one concept to another easily.
This time noticed that your speech is not so clear as last time. You need to work on speaking in complete sentences and not run on sentences. In that way, your users will know where your thoughts begin and stop.
You have done a good job in writing out the tutorial. For people who have English as their second language, try to keep your sentences short and simple. When sentences are long, people have to read back and forth to understand what you are trying to say.
In your images, the fonts are too small and not clear. Try to enlarge them to a good font size.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi @rosatravels, thank you for the feedback. Actually, this is the first video and the first time I do the recording for making a video tutorial 🙂
Any font size you can recommend?
For the diagrams, I'm not sure if I can resize the font because it's generated by code (there is no config for the font size) and it's in SVG format. So, whenever I zoom in the diagram, it will maintain the font size 😢
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
HI @drensor, for the font size, you an adjust it to a size such that it is easy to read and clear so that we don't need to squint our eyes. Thanks.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You can take a look at tensor's here: https://steemit.com/utopian-io/@tensor/building-a-blockchain-with-go---part-9---the-network-module
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for your review, @rosatravels! Keep up the good work!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi @drsensor!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey, @drsensor!
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit