Read multi part CRYPTO-PSBT data #68
Replies: 3 comments 5 replies
-
Please watch the Blockchain Commons Tech Overview video. It will answer many of the questions you just asked. |
Beta Was this translation helpful? Give feedback.
-
Have you looked over our UR Introduction for Developers? There is also a mentions a list of third-party libraries that support UR in a variety of languages (right now Java, Python & Rust in addition to the reference C++ implementation) at https://github.com/BlockchainCommons/crypto-commons#bc-ur — I also think there is a Javascript implementation out there, but it doesn't seem to be in that list (any lurkers know where it is?) I hope that one of these helps solves your problem. -- Christopher Allen |
Beta Was this translation helpful? Give feedback.
-
@vemla-solutions Please also see: (and the linked docs) If there's something more you think is necessary in those, let me know. |
Beta Was this translation helpful? Give feedback.
-
Could you please advise or reference to a description of how to read the multipart crypto-psbt data?
When I get an animated QR code displayed, I get a sequence of parts like:
UR:CRYPTO-PSBT/195-7/LPCSSRATCSSGCYWZJOUORDHDCAGASWLEKKFYYLWNLGLNMDWYFGBYLELFSRMKDPDLWYUYOSEOJTIOADAEAEAEKKOEVYPD
UR:CRYPTO-PSBT/196-7/LPCSSSATCSSGCYWZJOUORDHDCALUMSDPOXIECYLAENGSRKKOVWMNRLHFHENYJSHDPDBNHGBYTSNYZSTKZCTDHEYKVYKK
UR:CRYPTO-PSBT/197-7/LPCSSKATCSSGCYWZJOUORDHDCAWZJLHLBZFXETOEMUDYFSYNRKEEWSFNHDSWYTFHNLTALTHYBSAHURBYVWKGRDNEJNKI
etc.
But how to join them into 1 transaction? I had an impression that there are 7 parts for this one, and then the same 7 parts should be rotated in sequential order, e.g. 196-7 would be the first part, because mod(196,7) = 0 and then 7 parts are displayed in sequential order, but it looks like it is not the case. I see there are some parts repeating, but they are not on 7 cycle and also are displayed quite randomly in my opinion.
I checked documentation and for PSBT there is no clear description present, e.g.
https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-1-overview.md
says "[A Guide to Using URs for PSBTs] (pending)" and no link.
What I reached so far is bytewords decoding each part, and then CBOR decoding each part and then I get the following for the first part, for example:
LPCSSRATCSSGCYWZJOUORDHDCAGASWLEKKFYYLWNLGLNMDWYFGBYLELFSRMKDPDLWYUYOSEOJTIOADAEAEAEKKOEVYPD
bytewords decoded:
8518C30718CA1AF270DCBA581D49C68A7944F7F18D8695EE46118A82C3982D2FEEDBA7336E670100000079A2E1A8
CBOR decoded:
[195, 7, 202, 4067482810, h'49C68A7944F7F18D8695EE46118A82C3982D2FEEDBA7336E6701000000']
195, 7 and the partial message at the end are easy to understand, but what are 202 and 4067482810? They seem to be repeating in each part as well. Should they be the hints of how to glue the parts and the order to select?
I will appreciate any guidance here.
Also if you can share any guidance of how to get a transaction that can be broadcasted once all parts are glued, will be also helpful. Or will it be just glued hex-coded transaction that can be immediately used for the network broadcast?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions