-
Notifications
You must be signed in to change notification settings - Fork 69
Description
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.