Skip to content
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

Problem in sign_transaction() with private key #7117

Closed
ghost opened this issue Mar 19, 2021 · 1 comment
Closed

Problem in sign_transaction() with private key #7117

ghost opened this issue Mar 19, 2021 · 1 comment
Labels
bug 🐞 CLI/RPC ▶ topic-transactions 📑 related to logic in transaction.py topic-wallet 👛 related to wallet.py, or maybe address_synchronizer.py/coinchooser.py
Milestone

Comments

@ghost
Copy link

ghost commented Mar 19, 2021

There is something weird happening in the sign_transaction() code that seems to make it ignore the “privkey”

On electrum console:

>>> payto('mucWYULuBUfgmy5VPTxECcd7SaSamQsZHC', 0.00001,unsigned=True)

Returns:
"cHNidP8BAKACAAAAAiHTZFukTzP/9v4mZtwIAnm8NLUxxmiIcpcSqAsgSjKhAQAAAAD9////3X+Q1RrPmNxFrXSJMWqYOGjHXha/FP/rnq4BYDp7TaQBAAAAAP3///8C6AMAAAAAAAAZdqkUmp7Cs1p2YMgNrjjdgG/fmw/eaP2IrHTBEAAAAAAAGXapFPDcCT9/sbds/QZhDVNZ1llWdswriKynmx0AAAEA4QIAAAABi6jPnw/wtEw4nkoc0lwHcGNtlczvFh4xNUJkfUNaX9AAAAAAakcwRAIgNzs5iZBRd/LjbX49Arln0DCSdH/nu9O6eywkYjqIU4wCIHvnnuHZgQYMK+Z4P0lGzhvaH2RnGzSe8UpKb+zAR6ceASEDDeQ8XtTGJy0gzjvs8/t6/Vw8z7XVjd/fMEeYHgsAXg39////AsABBwAAAAAAGXapFBzT62W84srp9UVEtl5Gs60fCxhyiKxAQg8AAAAAABl2qRTw3Ak/f7G3bP0GYQ1TWdZZVnbMK4isl5sdAAABAOECAAAAAU45I2FYcW6RsLIXDr6dazWdE56ev/8WPyuv0L7JiQ0EAAAAAGpHMEQCIHA0DeuVyiXvhsTHqVObXI97g1GUFjVFAxH5FM2cL0XqAiA/p1duAyq1rkdjx49cISRXMhPJVihv12ZYLZRiUV3GVAEhAz9nN+QKOmCHvFi8W4K0J/ntJtcQuP4vcL/dPWKr6890/f///wLoAwAAAAAAABl2qRSQNQlZdQs7OORR3xa9WVe3ZJv10oisrIQBAAAAAAAZdqkU8NwJP3+xt2z9BmENU1nWWVZ2zCuIrJebHQAAAAA="

Now signing with this command signtransaction(tx, opt_privkey)

>>> signtransaction("cHNidP8BAKACAAAAAiHTZFukTzP/9v4mZtwIAnm8NLUxxmiIcpcSqAsgSjKhAQAAAAD9////3X+Q1RrPmNxFrXSJMWqYOGjHXha/FP/rnq4BYDp7TaQBAAAAAP3///8C6AMAAAAAAAAZdqkUmp7Cs1p2YMgNrjjdgG/fmw/eaP2IrHTBEAAAAAAAGXapFPDcCT9/sbds/QZhDVNZ1llWdswriKynmx0AAAEA4QIAAAABi6jPnw/wtEw4nkoc0lwHcGNtlczvFh4xNUJkfUNaX9AAAAAAakcwRAIgNzs5iZBRd/LjbX49Arln0DCSdH/nu9O6eywkYjqIU4wCIHvnnuHZgQYMK+Z4P0lGzhvaH2RnGzSe8UpKb+zAR6ceASEDDeQ8XtTGJy0gzjvs8/t6/Vw8z7XVjd/fMEeYHgsAXg39////AsABBwAAAAAAGXapFBzT62W84srp9UVEtl5Gs60fCxhyiKxAQg8AAAAAABl2qRTw3Ak/f7G3bP0GYQ1TWdZZVnbMK4isl5sdAAABAOECAAAAAU45I2FYcW6RsLIXDr6dazWdE56ev/8WPyuv0L7JiQ0EAAAAAGpHMEQCIHA0DeuVyiXvhsTHqVObXI97g1GUFjVFAxH5FM2cL0XqAiA/p1duAyq1rkdjx49cISRXMhPJVihv12ZYLZRiUV3GVAEhAz9nN+QKOmCHvFi8W4K0J/ntJtcQuP4vcL/dPWKr6890/f///wLoAwAAAAAAABl2qRSQNQlZdQs7OORR3xa9WVe3ZJv10oisrIQBAAAAAAAZdqkU8NwJP3+xt2z9BmENU1nWWVZ2zCuIrJebHQAAAAA=", privkey="cVtE728tULSA4gut4QWxo218q6PRsXHQAv84SXix83cuvScvGd1H")

But it’s not signed
Attention if you are attempting to sign a transaction using a wallet that doesn't contain the key, it won't work... even if you pass the private key.

I have discussed this issue in https://bitcointalk.org/index.php?topic=5324169.msg56576409#msg56576409

@SomberNight SomberNight added CLI/RPC ▶ topic-transactions 📑 related to logic in transaction.py topic-wallet 👛 related to wallet.py, or maybe address_synchronizer.py/coinchooser.py bug 🐞 labels Mar 24, 2021
@SomberNight SomberNight added this to the 4.1.0 milestone Mar 24, 2021
@SomberNight
Copy link
Member

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 CLI/RPC ▶ topic-transactions 📑 related to logic in transaction.py topic-wallet 👛 related to wallet.py, or maybe address_synchronizer.py/coinchooser.py
Projects
None yet
Development

No branches or pull requests

1 participant