Update on my work on Ledger App Hive

in HiveDevs3 years ago (edited)

image.png
Image credit (@thepeakstudio)

I'm continuing my work on Ledger App Hive and I am pretty confident it will be finished and submitted for official review soon.

Previous posts regarding Ledger app:

Source code

I decided to rewrite the app from scratch. The old codebase was a bit messy and it would be really hard to work on it. Sometimes it's just easier to start from scratch. I only adopted the ASN1 DER encoding, proposed by netuoso for communication between Ledger device and PC/mobile.

It's basically finished. The new codebase is built on top of the latest boilerplate (provided by Ledger) and utilizes their newest SDK. Thanks to this, I was able to write the code in a way that will work on both Nano S and Nano X the same way (except for the fact that Nano X has a bigger display).

The new codebase compiles with 0 warnings and produces 0 bugs when tested with Clang Static Analyzer. This is the requirement that needs to be met before submitting the app for official review.

make[1]: Leaving directory '/app'
scan-build: Removing directory '/app/output-scan-build/2021-08-16-224415-44-1' because it contains no reports.
scan-build: No bugs found.

New user experience

New SDK allowed me to redesign the user experience. Now, you can loop through the entire transaction back and forward. The previous version allowed you to verify every transaction field only once and it was really easy to accept or reject the transaction by mistake. Ledger has also some functional/design requirements and the new version follows them.

And, as I already said, it's working on Nano X.
Screenshot from 2021-08-17 00-39-42.png

This is a view from the simulator because there is no way to sideload the unofficial app to Nano X.

Unit tests

During the last two weeks, I put a lot of effort into unit testing the app (which is not only required by Ledger company but also very useful in the matter of stability and security). I covered most of my files with unit tests written in ANSI C, using cmocka framework. This will minimize potential problems, like buffer overflows/underflows etc which are really common on apps written in C.

Screenshot from 2021-08-16 22-24-29.png

Functional tests

Those need to be done yet, but I already prepared a Javascript library that is fully featured and can be used not only to communicate with the physical device but also with the simulator/debugger. The next step will be to create automated tests, to verify signatures for specified test transactions.

I'm already using it to broadcast transactions to our testnet. It shouldn't take long to finish this part.

Screenshot from 2021-08-17 01-04-32.png

Progress since the last update

  • Make it compatible with a new SDK and 2.0 firmware version
  • Make it working on both Nano S and Nano X devices
  • Add Approve and Reject screens before signing the transaction
  • Prepare user guide and developer's documentation for Ledger Team
  • Develop a working version of the Hive companion app
  • Submit the app for the official review

We're close.


Follow me to be up to date with incoming development updates!


Click on the image to vote for @engrave witness:

banner_engrave 100.png

Sort:  

Very nice! Thanks for the update looking forward to add in Hive to my ledger!

We're closer than ever ;)

Sweet we can secure our hive accounts soon.

It's already possible but I wouldn't recommend doing so before it's completely finished ;)

Coolies,, awaiting the final release

Wow, what a great work. I wonder how long it took you to come to the whole of this work because i know that it takes a lot of time, energy, and capital to come up with such wonderful design in computer programming You did a nice work. Congratulation bro.

It took much longer than I would like to spend on it but someone needs to do that ;) I've read the entire ledger documentation a few times, to understand any aspect of it. And also coding in a low-level language like C is challenging (that's why I put a lot of effort into tests).

Good job, and more** **strength to your effort bro****. I believe this's just the beginning because much more is expected from you.

Awesome! We can't wait to add Ledger integration to Keychain.

Will contact you soon with an appropriate and ready-to-use js library. It could be developed prior to the official ledger app release. You can install the current dev version of an app on your ledger if you have one.

That would be great! On top of signing TX, I'll need operations to encode/decode and sign buffers.
I don't think we will have time to work on it ahead of release, we still have our hands full between the extension refactor and the mobile App, but we will make it a priority for sure when it comes out.

Ok, so we will get back to it.

Looking forward to completion of this project.

Incredible how you guys work for Hive and how the community helps to finance it, I know this almost $400 are not much for a coder considering how much good programmers earn nowadays but surely helps! Hive is incredible.

It is, that's why we're doing this ;)

This is fantastic news! Thank you for all your valuable time and energy to enable this integration.

Newbie type question on this matter.
What's the benefit of adding it to your leger? Would you still be able to vote with it curation rewards? 3% APR etc? or is it pretty much just locked up on that wallet?

There's no such thing as "holding hive on ledger" (it also applies to any other coin). You only hold your private keys on hardware, which means you need to use it physically to sign your transactions. Consider it like a "password manager" from which you cannot retrieve the private keys directly. This is the ultimate solution because you're not able to compromise your keys even if you try hard.

For example, I added one of my ledger development keys to my account:

image.png

In this case, I have no knowledge about my private key paired with this public key. It's impossible to retrieve it but I can use my Ledger Nano S to sign any transaction (which I did for example here: https://hiveblocks.com/tx/7c90e542263e8abae146aa787b0f347c008ac187)

You will be able to make governance votes etc. I already pointed this out in my previous post as I plan to make Hive Ledger targeted to governance and DHF. This could allow some bigger stakeholders to securely keep HIVE and HBD and take part in the blockchain live without the need to store the keys somewhere on a PC or mobile.

Good stuff appreciate the feedback and explanation on this.

Thank you! We really need this.

For sure, it will hopefully bring some big players to us.

now that is some serious magical effort. well done dude!!!!

Fantastic effort. App development can be frustrating and tedious, but ultimately, once you've finally got that minimal viable product rolled out and you can begin adding more and more features, it feels very rewarding.

Congratulations!

@engrave I admire your dedication, you are doing a great job. I also admire your humility to receive criticism and improve in the development of the application. :-)

Will we be able to place a Hive bet directly from the ledger?

Odrt.gif

What is a "Hive bet"?

Power Up

Sure. It's just a normal transaction that you can sign with your ledger.

Good job

Keep up the hard work and positive results on HIVE! @engrave

Thanks ;)

Congratulations @engrave! Your post has been a top performer on the Hive blockchain and you have been rewarded with the following badge:

Post with the highest payout of the day.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Big Thanks & Congrats on bringing HIVE to LEDGER / Hardware Wallets.
This is a crucial need and was a missing piece since long time.
It is now safer to operate without headache and worry from any browser without trusting the browser extensions, websites and soft-wallets!

That's a nice message, isn't it? I had already feared that a Ledger connection would not be pursued further.

I'm slowly getting closer ;) This is something I would love to use by myself as a cold wallet so I will finish it for sure.

!BEER

The hive blog has a forum about updates on my work on the Ledger application Hive. You can get the official submitted reviews and can visit https://www.proessaywriting.com/buy-coursework/ to finish your academic work easily. It includes a JavaScript library for Ledger nano. They are offering the latest boilerplate. Join it for more.

Congratulations @engrave! Your post has been a top performer on the Hive blockchain and you have been rewarded with the following badge:

Post with the highest payout of the week.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Hi, I'm writing here as I can't join on discord, I can't log in on dblog.pl as is not secure and I wanted to add some post on website.

 3 years ago  Reveal Comment

Do you mean dblog.org? There is no live demo page, you can try it for yourself, it's free and will take a minute. All themes are free to use.

 3 years ago  Reveal Comment

Screenshots are provided in a post you commented under. You can also log in and change themes with a single click, it will take a second to change the theme and refresh your blog.

 3 years ago  Reveal Comment

Depends on the domain, just use it and you will know everything.