1

I am working on a tiny C++ bitcoin application for a university project. I'm using Blockcypher API to create transactions, but I faced a problem with signing transaction's hash that returns one of the methods. Are there any simple C++ libraries that will allow me to sign this hash with secp256k1 ECDSA? Also, library must work for Android NDK development.

Maybe I have found one, but I have a problem with installation, and I don't exactly know if I can use it with Android NDK.

Thanks for all answers!

  • That link is an older fork of libsecp256k1 with MSVC support added (see Jannes' answer) – Pieter Wuille Jun 7 '16 at 17:01
2

Maybe libsecp256k1, which is what Bitcoin Core itself uses. Not sure about Android usability, but it compiles on many architectures.

  • 2
    Libsecp256k1 is pure C89, with optional assembly optimizations (including ARM, since very recently). It may need some tweaks to work on Android NDK, but should otherwise work fine. Feel free to report any issues around that on the issue tracker: github.com/bitcoin-core/secp256k1 – Pieter Wuille Jun 7 '16 at 17:04
0

You may want to check out Spongy Castle, which is the Android-specific port of Bouncy Castle. I've used Bouncy Castle in C# to secpk2561 functions, so I assume Spongy Castle will have what you need, although it will be Java and not C++.

Also check out this question on SO: https://stackoverflow.com/questions/29778852/how-to-create-ecdsa-keypair-256bit-for-bitcoin-curve-secp256k1-using-spongy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.