-
Notifications
You must be signed in to change notification settings - Fork 204
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
Error in transaction parsing: Incorrect pubkeyhash length #369
Comments
p.s. it was ver 0.6.12. Without that "strict" the same error as above. |
confirmed this is an inelegant way to fail for a nonstandard output. @pputnik this is caused because the output 195 in that tx appears to be custom and doesn't have an address in the traditional sense. @mccwdev happy to create a pr to handle this properly. I suggest supporting script_type=nonstandard. This has the side effect of allowing malformed strings p2tr, etc strings pass through without raising errors, instead being misidentified as type unknown or nonstandard. happy for an alternative approach. |
@arshbot could you please explain why it "doesn't have an address in the traditional sense"? Thank you. |
@pputnik when you "send" bitcoin, you're really just putting a new lock (scriptpubkey) on a subset of coins you own. We use the same kind of locks all the time, most of the time use a pubkey in some form/fashion/placement. These patterns of locking and pubkey storage often map to an address type (p2pkh, p2sh, p2tr, etc). But not always. Addresses are probably poorly named for what they actually are (but great name for ux). They're basically part template to describe where to find corresponding signature when spent, and part fingerprint to correlate to a sensitive signing material. Sometimes you aren't using a typical way of storing the pubkey. Sometimes you aren't using a typical way to correlate signing material.
not at all, that's irrelevant. It's because the output script
is not a specific pattern. I mean look at this, it's not even a lock. I don't know what this bit of data is, but i think anyone could spend this utxo. This is further confirmed by the input script in the corresponding spending tx
because there's no real lock in the output script, all the input script has to do is toss a 1 (aka |
Thank you for the explanation. Whilst the library author is away - could you please share your fix, either in the form of PR or not? Thank you very much. |
PR is probably best, but I won't go to the effort unless the maintainer ACKs the approach. The problem is two-fold:
|
@arshbot, thanks for you clear explanation and analysing the problem. I noticed, if you disable caching the transaction is correctly parsed (the incorrect output is ignored). But trying to access the address results in an exception. The problem is indeed that the Output, Key and Address objects do not support unknown scripts and should probably ignore them if a strict=False option is set. If you have some ideas and would like to fix these issues with a PR, you are more then welcome. The reason for the strict option, which defaults to True, is to avoid creation of incorrect transactions or output scripts that can result in loss of funds. |
@arshbot, please ^_^ |
Way to reproduce:
The error:
The only reason I can think about - it's a block reward but unlike what I've seen before, there are many recipients (not one).
Could you help, please?
The text was updated successfully, but these errors were encountered: