PSBT encoding : what's the aim of convertBytes function? I'm currently working on PSBT and I try to understand all the part of the original implementation.
Dealing with base64 PSBT encoding: it seems that we convert the buffer from a base 8 to a base 6 using the convertBytes function.
Is someone that could explain me the aim of this conversion ?
PSBT uses Base64 encoding. As every Base64 character has 64 = 26 possibilities, they can store 6 bits of information. The ConvertBits function you link to takes input bytes (which consist of 8 bits each), and rearranges them into groups of 6 bits, which are then mapped to the Base64 character set.
ConvertBits&lt;A,B&gt; is not converting from base-A to base-B; it is converting from base-2A to base-2B.