Open shuaixr opened 2 weeks ago
Thanks for your PR! Is there any way we can simplify the bitcoin address check with a simple regular expression and checksum function? Just a random question. I haven't done any research yet.
Is there any way we can simplify the bitcoin address check with a simple regular expression and checksum function?
sure, I'll add a regular expression, first using regex then the checksum.
sure, I'll add a regular expression, first using regex then the checksum.
Is it possible to simplify the implementation in this way and reduce the bundle size without losing relevant functionality? The current implementation contains a lot of functions and seems quite complicated.
Is it possible to simplify the implementation in this way and reduce the bundle size without losing relevant functionality? The current implementation contains a lot of functions and seems quite complicated.
I can use crypto.subtle.digest instead of a library/src/actions/btcAddress/sha256-uint8array.ts file. It's supported in Node 15+, Bun, Deno, and browsers. i think all other functions are still necessary
update:
I noticed crypto.subtle.digest
is async, so I'm not sure if the whole action needs to be async.
I've already simplified the code as much as possible, and the Bech32 decoding has removed any parts unrelated to validation: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#reference-implementations
Thank you for your research. I want to let you know that I am focusing on our v1 release first before reviewing this PR.
Perform checksum validation for a btc address