-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new libraries required #40
Comments
I was told that LibWally was designed with embedded in mind, and that is what we are planning on using for bc-seedtool-cli. @wolfmcnally is planning to write some simple cobra & ur code, but is critical pathed on another project. You should coordinate with him, one of those might be a good project for you. |
LibWally supports desktop and mobile platforms and is the right choice for bc-seedtool-cli, but not necessarily for bc-lethekit. It does not support Arduino. However, there is an embedded version of libwally (by stepan snigirev) that
@wolfmcnally, what is the status of a simple (embedded) cbor/ur library that can be (im)ported to Arduino? If there are any branches active Id like to join in and help. The cbor/ur from bc-seedtool-cli is a too heavy c++ to be ported to Arduino. I have written a smallish UR library for arduino myself only for what i'll be needing in lethekit: In conclusion:
cc: @ksedgwic what are your thoughts? |
@gorazdko I'd prefer to go this this direction as I'm comfortable with the underlying security of libwally. However, it looks like this specific repo is more of a build wrapper around libwally itself, which I'd rather not point to as a dependency, and even the author feels it is a bit of a build hack. I'd rather see our own repo that does roughly the same thing, but works the way the rest of our C and C++ builds work. The build method is something that @wolfmcnally has been working on for other repos. I suggest that you both look at https://github.com/diybitcoinhardware/libwally-embedded and see if we can replicate it but with our tooling in a new repo bc-libwally or bc-libwally-embedded or some such. -- Christopher Allen |
I'm a little familiar with libwally because c-lightning uses it. It seems well regarded and generally well maintained. My experience with it has been good. I'm not familiar with the embedding wrapper described. |
I've imported libwally into bc-lethekit, compiled and ran an example without problems. The program storage space of lethekit increased to 54% which is ok. Also, There was one function definition clash with bc-bip39 (bip39_get_word) which we can deprecate (eventually) or fix for now.
All we need is to integrate properly the script into bc-lethekit and call it within install-lethekit. This would restructure libwally-core so that it is understandable for building with Arduino. In addition, we would have to write some code to extract and install the secp256k1 compliant with arduino library folder structure. This way we access the same libwally-core from bc-lethekit and bc-seedtool-cli.
Just like I'll use the library. In the meantime, let me know what you think about the approach of accessing and integrating the library with this repo. |
My UR library (with tests) for Arduino is here: https://github.com/gorazdko/bc-lethekit/blob/ur_encode_lib/seedtool/ur.ino Let me know what you think. |
@gorazdko The UR functionality in seedtool is functional but still what I'd call a prototype, not a full reference implementation. I'm currently architecting the fountain codes piece in Swift, and once I have that I'll most likely be doing a C++ implementation as a separate library that seedtool will then migrate to use. |
Regarding libwally integration: #49 is one attempt at integrating libwally.
|
Ok, I have created https://github.com/BlockchainCommons/libwally-core-embedded however, but I'd really like to see you try to get these changes upstreamed into the upstream LibWally as it is under active development and could require a lot of admin to keep updated. As long as they are active and doing great work, I'd prefer not to lock things here. A harder problem is secp256k1 as I've already forked https://github.com/bitcoin-core/secp256k1 here into https://github.com/BlockstreamCommons/secp256k1-schnorrsig. I'll puzzle through that in a little bit, but it shows the lager problem — I can't seem to merge updates from secp256k1 as the test harness doesn't seem to function anymore. I'd just delete and start over except I've got some issues there about SchnorrSig I'd like to preserve. Will puzzle later. -- Christopher Allen |
@ksedgwic what do you think? |
Did I not clone the correct library? |
Abstract
BIP32
I see 2 options:
bip32 from trezor: this would need to be cleaned up (of altcoin code), it has many dependencies, including secp256k1 (written by trezor). It would probably need tweaking to work on arduino.
there is a library Micro-Bitcoin by stepan snigirev which is also based on trezor crypto. But this library already works out of the box on arduino. It also supports psbts, different types of address derivation etc. It is nice to work with.
QR encoded UR format
From bc-seedtool-cli the following is required:
I will rewrite this (or the necessary subset of it) for Arduino.
Questions
What are your thoughts on bip32 library? I'm thinking second option.
The text was updated successfully, but these errors were encountered: