Comments (9)
There was a recent breaking API change in libsecp256k1 which elements is not yet updated to work with.
For now, in the libsecp256k1 directory, you can try doing git checkout 4c63780
to return to a commit before the API break.
from elements.
I received the exact same error no matter which commit I was checking out. Here's the error replayed again:
$ make CXXFLAGS="-I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static"
g++ -O2 -Wall -I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static -I. contracthashtool.c stolen.cpp uint256.cpp crypto/ripemd160.cpp crypto/sha2.cpp -o contracthashtool -lsecp256k1
contracthashtool.c: In function ‘int main(int, char**)’:
contracthashtool.c:246:75: error: cannot convert ‘unsigned char*’ to ‘secp256k1_pubkey_t*’ for argument ‘2’ to ‘int secp256k1_ec_pubkey_tweak_add(const secp256k1_context_t*, secp256k1_pubkey_t*, const unsigned char*)’
if (secp256k1_ec_pubkey_tweak_add(secp256k1_ctx, keys_work[i], 33, res) == 0) {
^
contracthashtool.c:290:67: error: cannot convert ‘unsigned char*’ to ‘secp256k1_pubkey_t*’ for argument ‘2’ to ‘int secp256k1_ec_pubkey_create(const secp256k1_context_t*, secp256k1_pubkey_t*, const unsigned char*)’
if (secp256k1_ec_pubkey_create(secp256k1_ctx, pub, &len, priv, 1) != 1 || len != 33)
^
make: *** [all] Error 1
Here's my terminal history:
2959 git checkout 4c63780
2960 cd ..
2961 cd contracthashtool
2962 make CXXFLAGS="-I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static"
2963 history
2964 cd ../secp256k1
2965 ls
2966 git log
2967 git checkout 3e6f1e20dc126fa20163f4e0f48cb6ab6f1524f7
2968 cd ..
2969 cd contracthashtool
2970 make CXXFLAGS="-I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static"
2971 cd ..
2972 cd secp256k1
2973 ls
2974 git log
2975 git checkout a83bb4806818e9132d99911312fcf70add261e11
2976 cd ..
2977 cd contracthashtool
2978 make CXXFLAGS="-I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static"
Is anyone able to replicate this error?
compilation info:
$ make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
# vagrant at vagrant-ubuntu-trusty-64 in ~/local/contracthashtool on git:master o [3:39:53]
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
from elements.
Upgrading to a newer version of Ubuntu (14.10)...
from elements.
Hello. Just FYI, the directions @apoelstra gave work fine for me under Ubuntu 15.04. I can't comment on earlier versions of Ubuntu.
from elements.
I tried a new vagrant box with Ubuntu 15.04, I made it successfully to the same step, and I'm now receiving the same error:
vagrant@vagrant-ubuntu-vivid-64:~/local$ cd contracthashtool/
vagrant@vagrant-ubuntu-vivid-64:~/local/contracthashtool$ make CXXFLAGS="-I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static"
g++ -O2 -Wall -I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static -I. contracthashtool.c stolen.cpp uint256.cpp crypto/ripemd160.cpp crypto/sha2.cpp -o contracthashtool -lsecp256k1
contracthashtool.c: In function ‘int main(int, char**)’:
contracthashtool.c:246:75: error: cannot convert ‘unsigned char*’ to ‘secp256k1_pubkey_t*’ for argument ‘2’ to ‘int secp256k1_ec_pubkey_tweak_add(const secp256k1_context_t*, secp256k1_pubkey_t*, const unsigned char*)’
if (secp256k1_ec_pubkey_tweak_add(secp256k1_ctx, keys_work[i], 33, res) == 0) {
^
contracthashtool.c:290:67: error: cannot convert ‘unsigned char*’ to ‘secp256k1_pubkey_t*’ for argument ‘2’ to ‘int secp256k1_ec_pubkey_create(const secp256k1_context_t*, secp256k1_pubkey_t*, const unsigned char*)’
if (secp256k1_ec_pubkey_create(secp256k1_ctx, pub, &len, priv, 1) != 1 || len != 33)
^
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1
vagrant@vagrant-ubuntu-vivid-64:~/local/contracthashtool$
@TheBlueMatt Is the error I'm experiencing possibly something to do with an invalid key?
https://github.com/Blockstream/contracthashtool/blob/master/contracthashtool.c#L290
from elements.
No, you're using a too new version of libsecp256k1.
See Blockstream/contracthashtool#6.
from elements.
Re-reading your previous post about this: just checking out an older version won't make a difference. You also need to compile it and possibly install it before contracthashtool will find/use it.
from elements.
Oh, I can't believe I didn't compile! It's working now. Thanks @sipa for helping to resolve this!
For anyone who may run into this later: I needed to do what @apoelstra suggested, but don't forget to recompile :)
from elements.
Blockstream/contracthashtool#6 was merged, so this should no longer be an issue, and the instructions as posted should work again.
from elements.
Related Issues (20)
- RPC example or tutorial opcodes enabled by liquid HOT 1
- Write and sign custom transaction code HOT 2
- Can´t mint tokens HOT 1
- Can't enable coin control features HOT 5
- Given claim_script does not match the given Bitcoin transaction. HOT 9
- signmessage HOT 1
- Wallet migration fails with confidential transactions HOT 8
- wallet managed by elements-cli receives tx with tokens but doesn't process them (not in the locally parsed TX, not in the balance) HOT 2
- Received funds appear in listreceivedbyaddress, but are not taken into account for the wallet balance and cannot be transferred
- Support for Jade hardware wallet HOT 3
- Confidential peg-in transaction HOT 11
- Sending transactions with 0.01 instead of 0.1 sats/vbyte
- `bad optional access` error at startup HOT 3
- fuzz crash in coins.h
- Refund after next dynafed transition
- add multi-asset support to new `sendall` RPC
- Can't claim peg-in because of invoking getpeginaddress during initial sync
- I would like to issue asset into my wallet HOT 3
- elements-qt 23.2.2rc1 and master crash at shutdown on M1 macOS
- elements-23.2.2 "bad-txns-in-ne-out, value in != value out" error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elements.