Closed mrfelton closed 3 years ago
You can pass any network directly, so we removed support for all the networks.
Anyone can pass in any network whenever they want.
This is all you need.
{
bech32: 'bcrt',
pubKeyHash: 0x6f,
scriptHash: 0xc4,
validWitnessVersions: [0],
}
manually checking prefixes before decoding is something that the library should handle. Please support regtest again
Yes! Please bring this back 🙏
Made a PR for this https://github.com/bitcoinjs/bolt11/pull/49 @junderw
manually checking prefixes before decoding
Your application knows what network it should be using. If your application is regtest, it only needs to pass regtest to decode and then the library will make sure it is a invoice for regtest.
The problem with answering the question "What network is this?" is that we can't possibly know all the possible future networks using lightning invoices. So there has to be a line drawn, and there should be a way for other networks to use the library (passing the network param).
The line was drawn to not include regtest. Because anyone using regtest (which is for automated testing) should know they are looking for regtest invoices ahead of time and can just as easily pass in the network parameter.
That said, dealing with this problem at a more structural level by changing the way this library deals with networks is something I don't have the bandwidth for right now... so we'll re-draw the line in the sand and kick the can down the road for now.
yes that makes sense. If it were me I would draw the line just past bitcoin regtest :)
Published as 1.3.2
Seems that in latest code regtest is no longer a recognised network