You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current fiattokenfactory implementation, the recipient addresses are validated by bech32.DecodeToBase256() .
This will cause the following issues for Segwit and Taproot, which are bech32 encoded by combining the segwit version and base32(5-bit) bytes.
For Segwit, the validation will fail due to that decoded 5-bit bytes can not be converted to base256 (the first byte needs to be trimmed)
For Taproot, the validation passes but the decoded base256 byte slice is not the actual taproot output key (the first byte needs to be trimmed when converted)
Possible solution:
Remove conversion to base256. Using bech32.Decode() instead of bech32.DecodeToBase256(), the validation will pass for all bech32(m) encoded addresses including Segwit and Taproot.
Then, use the decoded 5-bit bytes as the address bytes if needed, such as blacklist. This will eliminate the chain-specific differences.
The text was updated successfully, but these errors were encountered:
In the current fiattokenfactory implementation, the recipient addresses are validated by
bech32.DecodeToBase256()
.This will cause the following issues for Segwit and Taproot, which are bech32 encoded by combining the segwit version and base32(5-bit) bytes.
For Segwit, the validation will fail due to that decoded 5-bit bytes can not be converted to base256 (the first byte needs to be trimmed)
For Taproot, the validation passes but the decoded base256 byte slice is not the actual taproot output key (the first byte needs to be trimmed when converted)
Possible solution:
Remove conversion to base256. Using
bech32.Decode()
instead ofbech32.DecodeToBase256()
, the validation will pass for all bech32(m) encoded addresses including Segwit and Taproot.Then, use the decoded 5-bit bytes as the address bytes if needed, such as blacklist. This will eliminate the chain-specific differences.
The text was updated successfully, but these errors were encountered: