0

as a follow up to here:

Verifying a bitcoin trx on the Unix cmd line with OpenSSL?

and here:

How does the ECDSA verification algorithm work during transaction?

I use the pizza trx, and verify at the command line (using openssl), that produces expected result. When I want to check in graphical BITCOIN QT 0.13.1 client, s.th. fails. What I did so far:

I have these values in the files:

pizza.sighex
30450221009908144ca6539e09512b9295c8a27050d478fbb96f8addbc3d075544dc41328702201aa528be2b907d316d2da068dd9eb1e23243d97e444d59290d2fddf25269ee0e

pizza.keyhex
3056301006072a8648ce3d020106052b8104000a034200
042e930f39ba62c6534ee98ed20ca98959d34aa9e057cda01cfd422c6bab3667b76426529382c23f42b9b08d7832d4fee1d6b437a8526e59667ce9c4e9dcebcabb

pizza.hash2
c2d48f45d7fbeff644ddb72b0f60df6c275f0943444d7df8cc851b3d55782669

(Attention: in the original webpage the double hash was given by amaclin in reversed order!)

 $ xxd -r -p <pizza.sighex >pizza.sigraw
 $ xxd -r -p <pizza.keyhex | openssl pkey -pubin -inform der >pizza.keypem
 $ xxd -r -p <pizza.hashhex >pizza.hash2
 $ openssl pkeyutl <pizza.hash2 -verify -pubin -inkey pizza.keypem -sigfile pizza.sigraw

--> Signature Verified Successfully

now try in Bitcoin Core, the uncompressed public key hashes to this Bitcoin address:

17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ

The signature as base64 encoded string:

$ echo 30450221009908144ca6539e09512b9295c8a27050d478fbb96f8addbc3d075544dc41328702201aa528be2b907d316d2da068dd9eb1e23243d97e444d59290d2fddf25269ee0e | base64 -

MzA0NTAyMjEwMDk5MDgxNDRjYTY1MzllMDk1MTJiOTI5NWM4YTI3MDUwZDQ3OGZiYjk2ZjhhZGRiYzNkMDc1NTQ0ZGM0MTMyODcwMjIwMWFhNTI4YmUyYjkwN2QzMTZkMmRhMDY4ZGQ5ZWIxZTIzMjQzZDk3ZTQ0NGQ1OTI5MGQyZmRkZjI1MjY5ZWUwZQo=

Entered into the QT client, I always get a "Message verification failed". So I try from scratch, I go to the tab "sign message", and enter this: pubkey hash:

1DHG9SbeW3SXNpvbRUG3txXm1yDZTPKY9X

hash value:

56cc00a443f7b457ac3ec4bf1cc10ab3fa0c97fb173c27465b35766d313cd18c

and click "sign", to receive a base64 (?) encoded string:

IKWqGIVDCcpTBgFNushFeOlDj/08B4LEzYl4LDrWLLKnPQrqaSjjFYrdeWGXH9eIgHw7F7bkRtPpwC6jOur+R8k=

Now I should be able to enter these three values in the verify tab, so I cut and paste them into the fields, and they fail as well. I couldn't find any relevant information on how to use the Bitcoin Core 13.1 client. I am looking for some description or some reference, that explains underlying logic. Any help appreciated :-)

0

The message signing function in Bitcoin Core uses a different extra compact format for encoding signatures. The algorithm is also intentionally incompatible (through an extra hashing step) with the one used in transactions, to avoid people being tricked into signing a transaction.

  • Does this apply to transaction signatures as well? Is the openssl cli unable to sign a transaction sigHash? – JBaczuk Aug 15 '18 at 2:40

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.