Note, bitcoin-ts was renamed to Libauth in June 2020.

New Release: CashAddress Error Correction for Javascript

The latest release of bitcoin-ts now supports encoding, decoding, and error correction for CashAddress, the address format used by BCH.

The latest release of bitcoin-ts now supports encoding, decoding, and error correction for CashAddress, the address format used by Bitcoin Cash and SLP (Simple Ledger Protocol).

The update includes the first Javascript implementation of error correction for CashAddress (based on cashaddressed by Amaury Séchet). It can correct up to two mistakes in the CashAddress format, enabling more helpful user experiences in situations where users must speak or type addresses.

The output of this example Gist demonstrating CashAddress support. Note the “Did you mean […]?” error correction message at the bottom. You can also try it online.

As with the rest of bitcoin-ts, the code is fully portable — only universal APIs are used, so the same code runs on both Node.js and browsers.

The library is also written so projects can use tree-shaking to import only the methods they use. Importing all CashAddress functionality should add less than 1KB to a project’s bundle.

TSDocs are included, so documentation is easy to review in your editor. You can also read it online.

If you find this useful, please star the bitcoin-ts GitHub repo. Thanks!