Comments (9)
There is a method in pycoin/services/bitcoind.py called "bitcoind_agrees_on_transaction_validity" that is useful for checking agreement of bitcoind and pycoin that you might find useful.
There is a bug in pycoin that causes some (but not all) multisig transactions to not validate when they should. I have a test case which currently fails, so I just need to track down what's wrong. I think it's a problem in my implementation of OP_CHECKMULTISIG.
You should be able to partially sign with just one key. I seem to remember that I have a test case that does this...
from pycoin.
That test case is in tests/pay_to_test.py, in test_multisig_one_at_a_time().
Looks like a great starting point to learn pycoin tx internals, thanks. I shall rewrite my gist as test case,
checking if Gavin's transaction signature is ok and than trying to recreate it from scratch.
That problem in the implementation of OP_CHECKMULTISIG, do you think it is in
tx/script/vm.py, or deeper in ecdsa.possible_public_pairs_for_signature()? In other words,
do you think eval_script() reads bad data from script and feeds it into possible_public_pairs_for_signature() or the signature_hash and sig_pair are correct?
from pycoin.
My gut feeling is that the problem is possible_public_pairs_for_signature. A prior implementation of OP_CHECKMULTISIG did the naïve thing of trying every signature with every public pair... that one probably worked (although it predated the test that now fails).
from pycoin.
I changed the implementation of OP_CHECKMULTISIG to the earlier version
and unfortunately the tx_test.py still fails at the same point.
(You can see what code I actually run the test against at 9e519b4)
from pycoin.
The transaction couldn't be validated because signature_hash in vm.py is wrong!
If I put the correct signature_hash, the transaction validates.
(Actually, I force the correct script into signature_for_hash_type_f.)
Please, checkout: 689e067, and run tests/ga_multisig_test.py.
from pycoin.
I came up with the solution: PR #73.
What do you think?
from pycoin.
Unfortunately, now pay_to_test.py fails.
I think that's because Tx.sign_tx_in() does not handle P2SH input correctly. I took care of it in 6a365a8
from pycoin.
@gitmarek I can confirm your fix works. Pycoin now correctly signs multisig transactions.
from pycoin.
Merged (squashed) in 9333471
from pycoin.
Related Issues (20)
- need function HOT 2
- Error when creating an address using readme HOT 2
- pycoin==0.90a dissapeared from pypi HOT 2
- ku: command not found
- [Bounty] Faster address generation HOT 14
- 10000 btc address convert to hash160 HOT 1
- cant parse - cat 1.txt | xargs -n1 ku | grep hash160 HOT 6
- Remove wrapping / in output HOT 1
- How to create network and sign transaction by parameters of network? HOT 3
- The bip84_as_string method is not added to network HOT 1
- Error "absurdly-high-fee, (code 256)" HOT 1
- Release with P2TR support HOT 2
- P2TR: unknown expression PUSH_81 HOT 6
- error while signing HOT 1
- pycoin\ecdsa\__init__.py file is 0KB HOT 3
- Pycoin does not work with latest Ubuntu (22.04 Jammy) (ripemd160 has been deprecated in OpenSSL-3) HOT 4
- How to generate many addresses from a parent address HOT 3
- How to send coins with privately HOT 1
- check_tx gone HOT 2
- python 3.11 HOT 4
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 pycoin.