C++ and secp256k1

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!

Guest_User

Posted 2016-06-07T12:44:37.780

Reputation: 53

That link is an older fork of libsecp256k1 with MSVC support added (see Jannes' answer) – Pieter Wuille – 2016-06-07T17:01:40.223

Answers

2

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

Jannes

Posted 2016-06-07T12:44:37.780

Reputation: 6 046

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: https://github.com/bitcoin-core/secp256k1

– Pieter Wuille – 2016-06-07T17:04:13.170

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

Jestin

Posted 2016-06-07T12:44:37.780

Reputation: 8 599