Comments (7)
I agree that there should be a standard placeholder, but my gut feeling has been to put a 0000...0 signature the same length of a standard signature. This way, a partially signed transaction is exactly the same length as the final transaction, which makes it a bit easier to calculate the required transaction fees. I think this is better than OP_0 even though it doesn't match the defacto "standard" that others have adopted. What do you think?
from pycoin.
Well, you have an excellent point about fees. By the way, right now, the signature is not all zeros. Anyway, if you want to try to champion another standard, I support that. I agree, OP_0 is not exactly the best placeholder. However, if the majority of users settle on OP_0, that is what you should go with.
from pycoin.
I had this same issue trying the cryptocorp api and had to monkey patch pycoin to make it work
from pycoin.
Sebastian, can I take a look at your patch?
from pycoin.
If using 0.53 from GitHub, then the following code works well:
ScriptMultisig._dummy_signature = lambda x, y: "\x00"
If using 0.52, there appears to be a bug and ScriptMultisig.solve needs a rewrite.
from pycoin.
We endup fixing the input and redeem script
from pycoin.ecdsa import generator_secp256k1
from pycoin.serialize import b2h, stream_to_bytes
from pycoin.key.BIP32Node import BIP32Node
from pycoin.tx.pay_to import ScriptMultisig
from pycoin.tx.script.tools import *
from pycoin.tx.script import der
def dummy_signature(sig_type):
order = generator_secp256k1.order()
r, s = order - 1, order // 2
return der.sigencode_der(r, s) + bytes_from_int(sig_type)
def fix_input_script(inp, redeem_script):
"""replace dummy signatures with OP_0 and add redeem script for digitaloracle compatibility"""
dummy = b2h(dummy_signature(1))
ops1 = []
for op in opcode_list(inp.script):
if op == dummy:
op = 'OP_0'
ops1.append(op)
# FIXME hack to add redeem script omitted by pycoin
ops1.append(b2h(redeem_script))
inp.script = compile(' '.join(ops1))
from pycoin.
As of d09b5e0, you should be able to pass in
signature_placeholder=OP_0
as a kwarg to Tx.sign
to use OP_0 as your placeholder.
from pycoin.
Related Issues (20)
- 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
- Documentation for Liquid and elements HOT 1
- Issue with Litecoin (LTC) parsing
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.