diff --git a/.changeset/chilly-dragons-burn.md b/.changeset/chilly-dragons-burn.md deleted file mode 100644 index e27bc315..00000000 --- a/.changeset/chilly-dragons-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@bitauth/libauth': minor ---- - -Add usage guides and API overview diff --git a/.changeset/dry-geese-whisper.md b/.changeset/dry-geese-whisper.md deleted file mode 100644 index 2dea67fd..00000000 --- a/.changeset/dry-geese-whisper.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@bitauth/libauth': patch ---- - -`generateRandomBytes`: always verify unique results across two runs - -Fixes [#119](https://github.com/bitauth/libauth/issues/119). Old behavior is available at `generateRandomBytesUnchecked`. diff --git a/.changeset/grumpy-seals-grow.md b/.changeset/grumpy-seals-grow.md deleted file mode 100644 index 1bec2a78..00000000 --- a/.changeset/grumpy-seals-grow.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@bitauth/libauth': major ---- - -Add support for relative BIP32 derivation - -Relative BIP32 Hierarchical Deterministic (HD) derivation is now supported via the [`deriveHdPathRelative`](https://libauth.org/functions/deriveHdPathRelative.html) utility, and the Libauth compiler has been updated to explicitly use relative derivation by default for `HdKey`s. Absolute derivation has also been enhanced to validate the expected depth of provided HD keys. - -If you application relies on relative derivation but uses [`deriveHdPath`](https://libauth.org/functions/deriveHdPath.html), you'll need to switch to using the new [`deriveHdPathRelative`](https://libauth.org/functions/deriveHdPathRelative.html), as absolute derivation will now fail if provided with a non-zero depth HD key. - -Fixes [#49](https://github.com/bitauth/libauth/issues/49). diff --git a/.changeset/old-islands-scream.md b/.changeset/old-islands-scream.md deleted file mode 100644 index 440f8526..00000000 --- a/.changeset/old-islands-scream.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'@bitauth/libauth': minor ---- - -Add P2PKH CashAddress utilities - -The following utilities are now available: - -- [`hdPrivateKeyToP2pkhLockingBytecode`](https://libauth.org/functions/hdPrivateKeyToP2pkhLockingBytecode.html) -- [`hdPrivateKeyToP2pkhCashAddress`](https://libauth.org/functions/hdPrivateKeyToP2pkhCashAddress.html) -- [`hdPublicKeyToP2pkhLockingBytecode`](https://libauth.org/functions/hdPublicKeyToP2pkhLockingBytecode.html) -- [`hdPublicKeyToP2pkhCashAddress`](https://libauth.org/functions/hdPublicKeyToP2pkhCashAddress.html) -- [`privateKeyToP2pkhLockingBytecode`](https://libauth.org/functions/privateKeyToP2pkhLockingBytecode.html) -- [`privateKeyToP2pkhCashAddress`](https://libauth.org/functions/privateKeyToP2pkhCashAddress.html) -- [`publicKeyToP2pkhLockingBytecode`](https://libauth.org/functions/publicKeyToP2pkhLockingBytecode.html) -- [`publicKeyToP2pkhCashAddress`](https://libauth.org/functions/publicKeyToP2pkhCashAddress.html) - -For usage examples, see [`wallets.md`](https://github.com/bitauth/libauth/blob/master/docs/wallets.md). diff --git a/.changeset/pink-hotels-admire.md b/.changeset/pink-hotels-admire.md deleted file mode 100644 index c3a39cc1..00000000 --- a/.changeset/pink-hotels-admire.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@bitauth/libauth': minor ---- - -Validate all keys prior to compilation, expose `validateCompilationData` - -The compiler now validates all compilation data (i.e. validate all public and private keys), prior to compilation, regardless of whether or not the offending public or private key material is used. This is intended to surface software defects (particularly in the software used by counterparties) as early as possible. diff --git a/.changeset/serious-camels-help.md b/.changeset/serious-camels-help.md deleted file mode 100644 index 812f0d4e..00000000 --- a/.changeset/serious-camels-help.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@bitauth/libauth': major ---- - -CashAssembly: `.signature` is now `.ecdsa_signature` - -All CashAssembly scripts using the `.signature` operation should instead call `.ecdsa_signature` or switch to `.schnorr_signature`. - -Additionally, `signing_serialization.token_prefix` is now available. diff --git a/.changeset/smooth-sheep-fly.md b/.changeset/smooth-sheep-fly.md deleted file mode 100644 index 4f99ac91..00000000 --- a/.changeset/smooth-sheep-fly.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -'@bitauth/libauth': major ---- - -Unify object parameters and error handling across library - -A number of existing Libauth utilities have been modified to adhere to Libauth's object parameter and error handling conventions: - -- CashAddress utilities: - - [`encodeCashAddress`](https://libauth.org/functions/encodeCashAddress.html)/[`decodeCashAddress`](https://libauth.org/functions/decodeCashAddress.html) - - [`lockingBytecodeToCashAddress`](https://libauth.org/functions/lockingBytecodeToCashAddress.html)/[`cashAddressToLockingBytecode`](https://libauth.org/functions/cashAddressToLockingBytecode.html) - - [`encodeCashAddressFormat`](https://libauth.org/functions/encodeCashAddressFormat.html)/[`decodeCashAddressFormat`](https://libauth.org/functions/decodeCashAddressFormat.html) -- BIP32 (HD Key) utilities: - - [`crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode`](https://libauth.org/functions/crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode.html) - - [`decodeHdKey`](https://libauth.org/functions/decodeHdKey.html) ([`decodeHdKeyUnchecked`](https://libauth.org/functions/decodeHdKeyUnchecked.html)) - - [`decodeHdPrivateKey`](https://libauth.org/functions/decodeHdPrivateKey.html)/[`encodeHdPrivateKey`](https://libauth.org/functions/encodeHdPrivateKey.html) - - [`decodeHdPublicKey`](https://libauth.org/functions/decodeHdPublicKey.html)/[`encodeHdPrivateKey`](https://libauth.org/functions/encodeHdPrivateKey.html) - - [`deriveHdPath`](https://libauth.org/functions/deriveHdPath.html) - - [`deriveHdPathRelative`](https://libauth.org/functions/deriveHdPathRelative.html) - - [`deriveHdPrivateNodeFromSeed`](https://libauth.org/functions/deriveHdPrivateNodeFromSeed.html) - - [`deriveHdPrivateNodeIdentifier`](https://libauth.org/functions/deriveHdPrivateNodeIdentifier.html)/[`deriveHdPublicNodeIdentifier`](https://libauth.org/functions/deriveHdPublicNodeIdentifier.html) - - [`deriveHdPrivateNodeChild`](https://libauth.org/functions/deriveHdPrivateNodeChild.html)/[`deriveHdPublicNodeChild`](https://libauth.org/functions/deriveHdPublicNodeChild.html) - - [`deriveHdPublicKey`](https://libauth.org/functions/deriveHdPublicKey.html) - - [`deriveHdPublicNode`](https://libauth.org/functions/deriveHdPublicNode.html) - - [`hdKeyVersionIsPrivateKey`](https://libauth.org/functions/hdKeyVersionIsPrivateKey.html)/[`hdKeyVersionIsPublicKey`](https://libauth.org/functions/hdKeyVersionIsPublicKey.html) - - [`hdPrivateKeyToIdentifier`](https://libauth.org/functions/hdPrivateKeyToIdentifier.html)/[`hdPublicKeyToIdentifier`](https://libauth.org/functions/hdPublicKeyToIdentifier.html) -- BIP39 (Mnemonic Phrase) Utilities: - - [`deriveHdPrivateNodeFromBip39Mnemonic`](https://libauth.org/functions/deriveHdPrivateNodeFromBip39Mnemonic.html) - - [`deriveSeedFromBip39Mnemonic`](https://libauth.org/functions/deriveSeedFromBip39Mnemonic.html) - - [`encodeBip39Mnemonic`](https://libauth.org/functions/encodeBip39Mnemonic.html)/[`decodeBip39Mnemonic`](https://libauth.org/functions/decodeBip39Mnemonic.html) - - [`generateBip39Mnemonic`](https://libauth.org/functions/generateBip39Mnemonic.html) -- Key Utilities: - - [`generateDeterministicEntropy`](https://libauth.org/functions/generateDeterministicEntropy.html) - -Please see the relevant guide(s) for usage examples: - -- [Handling Errors](https://github.com/bitauth/libauth/blob/master/docs/errors.md) -- [Keys](https://github.com/bitauth/libauth/blob/master/docs/keys.md) -- [Addresses](https://github.com/bitauth/libauth/blob/master/docs/addresses.md) -- [Wallets & Transaction Creation](https://github.com/bitauth/libauth/blob/master/docs/wallets.md) diff --git a/.changeset/three-readers-unite.md b/.changeset/three-readers-unite.md deleted file mode 100644 index 6633a860..00000000 --- a/.changeset/three-readers-unite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@bitauth/libauth': minor ---- - -Add support for `decodeTransactionOutputs` diff --git a/CHANGELOG.md b/CHANGELOG.md index e96d0283..1d51ce7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,91 @@ # `@bitauth/libauth` +## 3.0.0 + +### Major Changes + +- [#127](https://github.com/bitauth/libauth/pull/127) [`e5c275f`](https://github.com/bitauth/libauth/commit/e5c275fdc8c9007a443958454346c46e647cf26c) Thanks [@bitjson](https://github.com/bitjson)! - Add support for relative BIP32 derivation + + Relative BIP32 Hierarchical Deterministic (HD) derivation is now supported via the [`deriveHdPathRelative`](https://libauth.org/functions/deriveHdPathRelative.html) utility, and the Libauth compiler has been updated to explicitly use relative derivation by default for `HdKey`s. Absolute derivation has also been enhanced to validate the expected depth of provided HD keys. + + If you application relies on relative derivation but uses [`deriveHdPath`](https://libauth.org/functions/deriveHdPath.html), you'll need to switch to using the new [`deriveHdPathRelative`](https://libauth.org/functions/deriveHdPathRelative.html), as absolute derivation will now fail if provided with a non-zero depth HD key. + + Fixes [#49](https://github.com/bitauth/libauth/issues/49). + +- [#127](https://github.com/bitauth/libauth/pull/127) [`e5c275f`](https://github.com/bitauth/libauth/commit/e5c275fdc8c9007a443958454346c46e647cf26c) Thanks [@bitjson](https://github.com/bitjson)! - CashAssembly: `.signature` is now `.ecdsa_signature` + + All CashAssembly scripts using the `.signature` operation should instead call `.ecdsa_signature` or switch to `.schnorr_signature`. + + Additionally, `signing_serialization.token_prefix` is now available. + +- [#127](https://github.com/bitauth/libauth/pull/127) [`e5c275f`](https://github.com/bitauth/libauth/commit/e5c275fdc8c9007a443958454346c46e647cf26c) Thanks [@bitjson](https://github.com/bitjson)! - Unify object parameters and error handling across library + + A number of existing Libauth utilities have been modified to adhere to Libauth's object parameter and error handling conventions: + + - CashAddress utilities: + - [`encodeCashAddress`](https://libauth.org/functions/encodeCashAddress.html)/[`decodeCashAddress`](https://libauth.org/functions/decodeCashAddress.html) + - [`lockingBytecodeToCashAddress`](https://libauth.org/functions/lockingBytecodeToCashAddress.html)/[`cashAddressToLockingBytecode`](https://libauth.org/functions/cashAddressToLockingBytecode.html) + - [`encodeCashAddressFormat`](https://libauth.org/functions/encodeCashAddressFormat.html)/[`decodeCashAddressFormat`](https://libauth.org/functions/decodeCashAddressFormat.html) + - BIP32 (HD Key) utilities: + - [`crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode`](https://libauth.org/functions/crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode.html) + - [`decodeHdKey`](https://libauth.org/functions/decodeHdKey.html) ([`decodeHdKeyUnchecked`](https://libauth.org/functions/decodeHdKeyUnchecked.html)) + - [`decodeHdPrivateKey`](https://libauth.org/functions/decodeHdPrivateKey.html)/[`encodeHdPrivateKey`](https://libauth.org/functions/encodeHdPrivateKey.html) + - [`decodeHdPublicKey`](https://libauth.org/functions/decodeHdPublicKey.html)/[`encodeHdPrivateKey`](https://libauth.org/functions/encodeHdPrivateKey.html) + - [`deriveHdPath`](https://libauth.org/functions/deriveHdPath.html) + - [`deriveHdPathRelative`](https://libauth.org/functions/deriveHdPathRelative.html) + - [`deriveHdPrivateNodeFromSeed`](https://libauth.org/functions/deriveHdPrivateNodeFromSeed.html) + - [`deriveHdPrivateNodeIdentifier`](https://libauth.org/functions/deriveHdPrivateNodeIdentifier.html)/[`deriveHdPublicNodeIdentifier`](https://libauth.org/functions/deriveHdPublicNodeIdentifier.html) + - [`deriveHdPrivateNodeChild`](https://libauth.org/functions/deriveHdPrivateNodeChild.html)/[`deriveHdPublicNodeChild`](https://libauth.org/functions/deriveHdPublicNodeChild.html) + - [`deriveHdPublicKey`](https://libauth.org/functions/deriveHdPublicKey.html) + - [`deriveHdPublicNode`](https://libauth.org/functions/deriveHdPublicNode.html) + - [`hdKeyVersionIsPrivateKey`](https://libauth.org/functions/hdKeyVersionIsPrivateKey.html)/[`hdKeyVersionIsPublicKey`](https://libauth.org/functions/hdKeyVersionIsPublicKey.html) + - [`hdPrivateKeyToIdentifier`](https://libauth.org/functions/hdPrivateKeyToIdentifier.html)/[`hdPublicKeyToIdentifier`](https://libauth.org/functions/hdPublicKeyToIdentifier.html) + - BIP39 (Mnemonic Phrase) Utilities: + - [`deriveHdPrivateNodeFromBip39Mnemonic`](https://libauth.org/functions/deriveHdPrivateNodeFromBip39Mnemonic.html) + - [`deriveSeedFromBip39Mnemonic`](https://libauth.org/functions/deriveSeedFromBip39Mnemonic.html) + - [`encodeBip39Mnemonic`](https://libauth.org/functions/encodeBip39Mnemonic.html)/[`decodeBip39Mnemonic`](https://libauth.org/functions/decodeBip39Mnemonic.html) + - [`generateBip39Mnemonic`](https://libauth.org/functions/generateBip39Mnemonic.html) + - Key Utilities: + - [`generateDeterministicEntropy`](https://libauth.org/functions/generateDeterministicEntropy.html) + + Please see the relevant guide(s) for usage examples: + + - [Handling Errors](https://github.com/bitauth/libauth/blob/master/docs/errors.md) + - [Keys](https://github.com/bitauth/libauth/blob/master/docs/keys.md) + - [Addresses](https://github.com/bitauth/libauth/blob/master/docs/addresses.md) + - [Wallets & Transaction Creation](https://github.com/bitauth/libauth/blob/master/docs/wallets.md) + +### Minor Changes + +- [#127](https://github.com/bitauth/libauth/pull/127) [`e5c275f`](https://github.com/bitauth/libauth/commit/e5c275fdc8c9007a443958454346c46e647cf26c) Thanks [@bitjson](https://github.com/bitjson)! - Add usage guides and API overview + +- [#127](https://github.com/bitauth/libauth/pull/127) [`e5c275f`](https://github.com/bitauth/libauth/commit/e5c275fdc8c9007a443958454346c46e647cf26c) Thanks [@bitjson](https://github.com/bitjson)! - Add P2PKH CashAddress utilities + + The following utilities are now available: + + - [`hdPrivateKeyToP2pkhLockingBytecode`](https://libauth.org/functions/hdPrivateKeyToP2pkhLockingBytecode.html) + - [`hdPrivateKeyToP2pkhCashAddress`](https://libauth.org/functions/hdPrivateKeyToP2pkhCashAddress.html) + - [`hdPublicKeyToP2pkhLockingBytecode`](https://libauth.org/functions/hdPublicKeyToP2pkhLockingBytecode.html) + - [`hdPublicKeyToP2pkhCashAddress`](https://libauth.org/functions/hdPublicKeyToP2pkhCashAddress.html) + - [`privateKeyToP2pkhLockingBytecode`](https://libauth.org/functions/privateKeyToP2pkhLockingBytecode.html) + - [`privateKeyToP2pkhCashAddress`](https://libauth.org/functions/privateKeyToP2pkhCashAddress.html) + - [`publicKeyToP2pkhLockingBytecode`](https://libauth.org/functions/publicKeyToP2pkhLockingBytecode.html) + - [`publicKeyToP2pkhCashAddress`](https://libauth.org/functions/publicKeyToP2pkhCashAddress.html) + + For usage examples, see [`wallets.md`](https://github.com/bitauth/libauth/blob/master/docs/wallets.md). + +- [#127](https://github.com/bitauth/libauth/pull/127) [`e5c275f`](https://github.com/bitauth/libauth/commit/e5c275fdc8c9007a443958454346c46e647cf26c) Thanks [@bitjson](https://github.com/bitjson)! - Validate all keys prior to compilation, expose `validateCompilationData` + + The compiler now validates all compilation data (i.e. validate all public and private keys), prior to compilation, regardless of whether or not the offending public or private key material is used. This is intended to surface software defects (particularly in the software used by counterparties) as early as possible. + +- [#127](https://github.com/bitauth/libauth/pull/127) [`e5c275f`](https://github.com/bitauth/libauth/commit/e5c275fdc8c9007a443958454346c46e647cf26c) Thanks [@bitjson](https://github.com/bitjson)! - Add support for `decodeTransactionOutputs` + +### Patch Changes + +- [#127](https://github.com/bitauth/libauth/pull/127) [`e5c275f`](https://github.com/bitauth/libauth/commit/e5c275fdc8c9007a443958454346c46e647cf26c) Thanks [@bitjson](https://github.com/bitjson)! - `generateRandomBytes`: always verify unique results across two runs + + Fixes [#119](https://github.com/bitauth/libauth/issues/119). Old behavior is available at `generateRandomBytesUnchecked`. + ## 2.1.0 ### Minor Changes diff --git a/package.json b/package.json index 3941e082..d19ea915 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitauth/libauth", - "version": "2.1.0", + "version": "3.0.0", "description": "ultra-lightweight library for Bitcoin Cash, Bitcoin, and Bitauth", "type": "module", "main": "./build/index.js",