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

deserialize a psbt Error #1

Open
JCZuu opened this issue Feb 25, 2025 · 0 comments
Open

deserialize a psbt Error #1

JCZuu opened this issue Feb 25, 2025 · 0 comments

Comments

@JCZuu
Copy link

JCZuu commented Feb 25, 2025

Hello,An error occurred when I used your test case to parse psbt
void main() { group('PsbtV2', () { test("deserialize a psbt", () { final psbtBuf = base64.decode( "cHNidP8BAgQCAAAAAQQBAQEFAQIB+wQCAAAAAAEOIAsK2SFBnByHGXNdctxzn56p4GONH+TB7vD5lECEgV/IAQ8EAAAAAAABAwgACK8vAAAAAAEEFgAUxDD2TEdW2jENvRoIVXLvKZkmJywAAQMIi73rCwAAAAABBBYAFE3Rk6yWSlasG54cyoRU/i9HT4UTAA=="); final psbt = PsbtV2(); psbt.deserialize(psbtBuf); expect(psbt.getGlobalInputCount(), 1); expect(psbt.getGlobalOutputCount(), 2); }); }); }

The specific error code is as follows:

Uint8List _getGlobal(PSBTGlobal keyType) => globalMap.get(keyType.value, _b(), false)!;

Only the psbt provided in the test case can pass the test.
But when I use my own psbt and the psbt officially provided by ledger, they both fail.
This psbt is mine:
cHNidP8BAFUCAAAAAcZE7yk3pZNCgHllQSNQhmuuTaiBacfTqgaBDre5F+FMAAAAAAD+////ARAnAAAAAAAAGXapFL6ywm4CpAwtya2//p4vnOUoCj9RiKwAAAAAAAEA4QIAAAAAAQFprQBNv5vr56FZRyv9sl+2yIphY7kd+XehuMl2ywqTsAEAAAAAAQAAgAIQJwAAAAAAABl2qRS+ssJuAqQMLcmtv/6eL5zlKAo/UYis8AcAAAAAAAAWABSbUZ6NZSWIb5Kn+/obtWoZwSJfRAJHMEQCIC+ji+vfp2Q/rq3adFnRHDtEfl0cKgfuzlAdvMhTf7I+AiBue+FPIlWXq7PpYvgbP6ZgVsgv/oXxTjPPcM8lbV/HaAEhAqL1woAQTGeWCf2PCXFBK/dVmeilDpEBOL51m+TLHWsYAAAAACIGA2noDcnRLeMJho/S6J/puxlVWfSogpMZNvbT/6VRgELtGAm8S6gsAACAAAAAgAAAAIAAAAAAAAAAAAAiAgNp6A3J0S3jCYaP0uif6bsZVVn0qIKTGTb20/+lUYBC7RgJvEuoLAAAgAAAAIAAAACAAAAAAAAAAAAA

The following psbt is officially provided by ledger:
cHNidP8BAFUCAAAAAVEiws3mgj5VdUF1uSycV6Co4ayDw44Xh/06H/M0jpUTAQAAAAD9////AXhBDwAAAAAAGXapFBPX1YFmlGw+wCKTQGbYwNER0btBiKwaBB0AAAEA+QIAAAAAAQHsIw5TCVJWBSokKCcO7ASYlEsQ9vHFePQxwj0AmLSuWgEAAAAXFgAUKBU5gg4t6XOuQbpgBLQxySHE2G3+////AnJydQAAAAAAF6kUyLkGrymMcOYDoow+/C+uGearKA+HQEIPAAAAAAAZdqkUy65bUM+Tnm9TG4prer14j+FLApeIrAJHMEQCIDfstCSDYar9T4wR5wXw+npfvc1ZUXL81WQ/OxG+/11AAiACDG0yb2w31jzsra9OszX67ffETgX17x0raBQLAjvRPQEhA9rIL8Cs/Pw2NI1KSKRvAc6nfyuezj+MO0yZ0LCy+ZXShPIcACIGAu6GCCB+IQKEJvaedkR9fj1eB3BJ9eaDwxNsIxR2KkcYGPWswv0sAACAAQAAgAAAAIAAAAAAAAAAAAAA

Both my psbt and the official psbt can be parsed using the bitcoin-cli tool. However, the psbt in the test case cannot be parsed using the bitcoin-cli tool.
What should I do about psbt?
Looking forward to your help.
Thank you very much.

@JCZuu JCZuu changed the title 6a80 error when get address deserialize a psbt Error Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant