Invalid checksum error
Closed this issue · 3 comments
RohanKapurDEV commented
Running the following code gives me an error that reads: 'Invalid checksum'. Code below:
var x = Address.addressToOutputScript("bc1qe43dk6yptz2e5aamxfc4sp33s6ga4v4xcrzhyv");
Does anyone know what this is?
RohanKapurDEV commented
This does not seem to give me an error when working with legacy addresses like: 18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX.
Only seems to happen with P2WPKH addresses from what I can tell. If anyone has the fix to this but doesn't have the time to do it, let me know what exactly to do step by step and I'll try to get this done as it is quite urgent for me.
SFzxc commented
@RohanKapurDEV Which version are you using? Did you update the version (current version is 2.0.1) ?.
I have nothing with the above code.
import 'package:dio/dio.dart';
import 'package:bitcoin_flutter/bitcoin_flutter.dart';
main() {
var scriptPubKey = Address.addressToOutputScript('bc1qe43dk6yptz2e5aamxfc4sp33s6ga4v4xcrzhyv');
print(scriptPubKey); ## [0, 20, 205, 98, 219, 104, 129, 88, 149, 154, 119, 187, 50, 113, 88, 6, 49, 134, 145, 218, 178, 166]
}
RohanKapurDEV commented
Yeah, my bad. It works fine! Thanks.