This just updates the proposed 0.19 release to use `secp256k1-jdk` instead
of a more generically defined crypto provider API.
We may want to consider doing this in the 0.18 release or moving
some ECKey definitions into `o.b.base` but this change does not
address either of those proposals.
* Make the static field ECKey.CURVE (which is a Bouncy Castle
type) package private and provide the ecDomainParameters() accessor
for those who really need it.
* Use the accessor in DefaultRiskAnalysisTest
* We will not update code within the `o.b.crytpo` package
to use the accessor, since we intend to migrate all/most
of those usages to the `java.security` types.
We do not need to specify the curve for each instance as
bitcoinj uses SECP256K1 curve exclusively.
This change reduces per instance memory usage, simplifies the API,
and reduces public API dependence on Bouncy Castle.
One two-arg constructor is deprecated and replaced with a single-arg
constructor that no longer requires the curve parameter.
Just to be extra safe, in the deprecated method we validate the curve
argument and make sure it is the P256K1 curve.
Also correctly mark private `bits` field as @Nullable, and improve
JavaDoc and other comments.
* Move/refactor utility methods from `SegwitAddress` to `Bech32`
* Add `Bech32.Bech32Bytes` class for wrapping `Bech32` 5-bit byte arrays
* Have existing `Bech32.Bech32Data` class extend `Bech32.Bech32Bytes`
* Add `encodeBytes` and `decodeBytes` to `Bech32` for encoding/decoding arbitrary `byte[]`
* Add tests for Nostr NIP-19 test vectors
Migrate `@Nullable` from JSR 250 (Common Annotations) to Jakarta
Annotations.
Jakarta Annotations supports Java modules, so this is necessary
to migrate to running `wallettemplate` on the module path.
* Don't set it in `Block.readTransactions()` (this is a performance and
a layering issue)
* When received from the network (or simulating network reception in a test)
only set `source` to `NETWORK` if it was previously `UNKNOWN`.
This test is useful for performance comparisons with
`streamEntireBitcoindBlockchainAsBuffers()`.
With adding to the `TxConfidenceTable` removed from `Block.read()` and
on a fast, modern laptop, `streamEntireBitcoindBlockchainAsBuffers()`
currently takes under 2 minutes while `streamEntireBitcoindBlockchainAsBlocks()`
takes over 5 minutes.