Comments (6)
The user was kind enough to give me the evidence, I can now see that the error is in Joinmarket code; the transaction being deserialized contained marker bytes (which are not actually a valid part of a transaction), which aren't valid. So, closing. Sorry for the trouble.
from python-bitcointx.
The exception happens here:
python-bitcointx/bitcointx/core/serialize.py
Lines 304 to 313 in 3215fc9
This corresponds to the following code in Bitcoin Core: https://github.com/bitcoin/bitcoin/blob/409afd715351592a00ad5a0e5400858f6e734eef/src/serialize.h#L344-L346
It is possible that in some places the decoding calls ReadCompactSize
with range_check = false
, but bitcointx does not call deserialize with allow_full_range = True
in the same case (edit: no, this only happens in case that is not relevant to tx decoding)
Needs investigation.
from python-bitcointx.
The ability to skip this check was added to ReadCompactSize
in October: bitcoin/bitcoin@1d3ec2a, the code in bitcointx is of course based on older code (edit: even if it enables skipping the check with allow_full_range=True
, this is only used in PSBT code)
from python-bitcointx.
But the relaxation of this check only happens when processing ADDRV2_FORMAT
for BIP155, so should not matter for transaction decoding.
The python code for the compact size deserialization seems to be corresponding to the C++ code, so I'd say the problem is somewhere in the other part of data.
If the user has the transaction hex data, maybe good idea could be to ask them to try decoderawtransaction
RPC of Core to check if it is really correct
from python-bitcointx.
I agree that it is certainly far more likely to be an error outside this library, feeding in invalid transaction data. But I thought asking the question in abstract is certainly worthwhile, as if such a thing were possible, I'd certainly need to know about it.
Thanks for looking into it!
from python-bitcointx.
I think we cannot fully exclude the possibility that the problem is in the lib, because the problem might be in incorrect deserialization code before the execution got to this compact integer deserialization. But without looking at data that caused the problem, it would be hard to search for the error - would need to audit almost all of serialization code just hoping to spot the (possibly non-existent) error. If we could have at least some definitive result (even without having the data at hand), like "there exists a hex string that is parsed successfully by decoderawtransaction, but gives this error when parsed with bitcointx", then putting extra scrunity on bitcointx deserialization code might be justified
from python-bitcointx.
Related Issues (20)
- Taproot support HOT 18
- BIP32 test vector 5 should be added to tests and checked HOT 5
- How to handle libsecp256k1 ABI non-guarantees of stability HOT 5
- CPubKey class and invalid pubkeys - should the API be changed ?
- Potential problem with RIPEMD160 removal from newer OpenSSL versions by default HOT 2
- On MacOS-latest, openssl import fails (openssl is used for non-strict sig verification) HOT 1
- Consider adding scriptWitness to CTxIn
- sign-psbt.py example does not support electrum's testnet xpub encoding for p2wsh HOT 3
- Adding bech32 spending example HOT 4
- libbitcoinconsensus undefined symbol HOT 4
- Use libsecp256k1 v0.2.0? HOT 11
- Incompatibility with OpenSSL 3 HOT 9
- psbt.sign not support pubkey type witness_v1_taproot HOT 1
- CScript.witness_version() returns 0x51 instead of 1 for taproot HOT 13
- Iibbitcoinconsensus is deprecated by Core
- secp256k1 library not found HOT 2
- Consider OP_1NEGATE handling in CScriptOp (as per linked issue from Core) HOT 1
- Issues with configure bitcointx to work with libsecp256k1 HOT 2
- tapInternalKey issue while creating the transaction
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 python-bitcointx.