Commit Graph

47 Commits

Author SHA1 Message Date
ClaytonNorthey92
d988b86027 Added test for client.GetChainTxStatsAsync() in rpcclient. This sets up a test websocket server to run the tests. Also, ensure these are run within a timeout, since they rely on concurrency 2023-11-02 16:16:11 -04:00
yyforyongyu
d4f519f5dc
gomod: clean go mod files
Resulted from running `go mod tify`.
2023-09-04 12:04:16 +08:00
Olaoluwa Osuntokun
0aaa7c5e7b
Merge pull request #1979 from kcalvinalvin/merkle-calc-fast
blockchain, integration, mining, main: Rolling merkle root calculation
2023-08-10 15:05:40 -07:00
Calvin Kim
3ba9feeeee blockchain, btcutil/bloom: BuildMerkleTreeStore returns chainhash.Hash
BuildMerkleTreeStore used to return a pointer, but it is changed to
return a chainhash.Hash directly.  This allows the compiler to make
optimizations in some cases and avoids a memory allocation.
2023-08-03 15:23:17 +09:00
0xEclair
7f0fb2ad3b psbt: finalizer add proper sighash flag
psbt: fix missing sighash flag when finalizing
psbt: test finalizer add proper sighash flag
2023-07-17 18:35:13 +08:00
Carsten Otto
725b36bf09 btcutil: format BTC amounts with trailing zeroes
so that sat amounts can be read without counting zeroes

before:
 350sat = 0.0000035 BTC
3500sat = 0.000035 BTC

after:
 350sat = 0.00000350 BTC
3500sat = 0.00003500 BTC

fixes #1995
2023-07-04 18:19:07 +02:00
cui fliter
e160bb6922 multi: remove repetitive the
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-06-26 15:40:51 +08:00
Calvin Kim
ba5407615d multi: Run gofmt on the entire repository
The doc formatting changes introduced in the recent go version is
increasing the diff for all of the new commits.  Formatting it all in
this commit will help the readability of future PRs by reducing the
diff.
2023-06-21 22:31:09 +09:00
ziggie
b554add716
psbt: add verification method for psbt input data
the new InputsReadyToSign method makes sure that inputs have either
the nonWitnessUtxo or the witnessUtxo data set.
2023-03-21 09:09:42 +01:00
Oliver Gugger
bb0a2f3790
psbt: add unit test for unknowns 2023-01-27 15:30:46 +01:00
Oliver Gugger
6c81c664bb
psbt: use pointer slice for global unknowns
To unify the way the unknown fields are handled, we change the global
ones to a slice of pointers as well. This makes it easier to add
generic handler code for unknown fields, if they are uniform across the
levels (global, input, output).
2023-01-27 15:30:45 +01:00
Oliver Gugger
5ebbb1bb91
psbt: encode global unknowns 2023-01-27 15:30:44 +01:00
Oliver Gugger
19c7c3d853
psbt: allow Unknowns in outputs 2023-01-27 15:30:43 +01:00
Oliver Gugger
2dbc98bdf3
psbt: fix formatting and typos 2023-01-27 15:30:42 +01:00
Oliver Gugger
734ab735b9
psbt: export Bip32 encode/decode functions 2023-01-27 15:30:41 +01:00
Oliver Gugger
866b3dc0a3
base58: fix decoding issue 2022-11-18 20:55:50 +01:00
Robyn
586729ca07
btcutil/psbt: add method Packet.GetTxFee
This commit adds a GetTxFee method to the psbt.Packet structure. The method returns the PSBT's fee.
2022-11-04 14:49:51 +00:00
Darioush Jalali
3ec3acc6fb
go mod tidy in btcutil/ 2022-07-11 16:30:53 -07:00
Darioush Jalali
f46068f38e
bump version to v0.23.0 2022-06-30 15:59:56 -07:00
Darioush Jalali
d9c09e0315
Bump btcd version in btcutil package 2022-06-28 17:21:46 -07:00
Oliver Gugger
886a8f41db
psbt: make Taproot PSBT finalizable 2022-05-02 16:25:17 +02:00
Oliver Gugger
0572702cec
psbt: add valid and invalid PSBTs for new types 2022-05-02 16:25:16 +02:00
Oliver Gugger
5cf346f14f
psbt: add (de-)serialization for new types 2022-05-02 16:25:15 +02:00
Oliver Gugger
db6cb69d84
psbt: add new input/output types and structs 2022-05-02 16:25:13 +02:00
Oliver Gugger
e6367b26b7
psbt: remove invalid type from typo 2022-05-02 16:25:12 +02:00
Oliver Gugger
a764afd44e
psbt: rename receiver to match rest of code 2022-05-02 16:25:11 +02:00
Oliver Gugger
a336854e27
psbt: fix typo, remove TODO 2022-05-02 16:25:09 +02:00
Oliver Gugger
eb2eeaf848
psbt: always use non witness serialization format
BIP-0174 states that the transaction must be in the old serialization
format (without witnesses).
2022-04-13 14:13:47 +02:00
Oliver Gugger
56b048867b
psbt: allow empty bip32 derivation path
BIP-0174 defines the derivation path being encoded as
  "<32-bit uint> <32-bit uint>*"
with the asterisk meaning 0 to n times. Which in turn means that an
empty path is valid, only the key fingerprint is mandatory.
2022-03-28 10:14:43 +02:00
Olaoluwa Osuntokun
c203b940f3
build: update to btcec/v2.1.3 and chaincfg/chainhash v1.0.1
In this commit, we update the top level module to use the newly tagged
sub-modules. Once we remove the circular dependant in these sub-modules,
then we'll no longer have to do things like this.
2022-03-15 18:48:50 -07:00
Olaoluwa Osuntokun
30d58b98a1
build: add temporary replace directives for btcec+chainhash
This PR includes some changes to them, so we'll need to use a temporary
replace directives to ensure the build passes.
2022-03-15 18:23:47 -07:00
Olaoluwa Osuntokun
6fc4199ee4
txscript: add new RawTxInTapscriptSignature to generate tapsript sigs
In this commit, we add a new function `RawTxInTapscriptSignature` that
will be used to generate signatures in the _tapscript_ context. Note
that this differs from top-level taproot as a distinct sighash is used,
and we _always_ accept a root hash to perform the proper tweak.
2022-03-15 18:23:08 -07:00
Olaoluwa Osuntokun
3baa09f33e
build: update to btcec/v2.1.1 and chaincfg/chainhash/v1.00 2022-03-09 18:54:03 -08:00
Oliver Gugger
999514c1fe
mod: add TODOs for removing local replaces 2022-03-09 11:58:43 +01:00
Oliver Gugger
46f5eec021
mod: bump btcec/v2 module version 2022-03-09 11:58:43 +01:00
Oliver Gugger
56dfa0f7e2
mod: add temporary replace 2022-03-09 11:58:42 +01:00
Oliver Gugger
4ad74cd4c2
mod: use chaincfg/chainhash module 2022-03-09 11:58:39 +01:00
Anup Chenthamarakshan
87e3d7e278 Replace github.com/btcsuite/goleveldb with github.com/syndtr/goleveldb 2022-03-08 10:07:52 -08:00
Olaoluwa Osuntokun
7572beb481
build: retract bogus tags from btcd fork
Fixes https://github.com/btcsuite/btcd/issues/1791.
2022-02-04 15:54:43 -08:00
Olaoluwa Osuntokun
0847f7a476
build: update to btcec v2.1.0
This was the version tagged that created the new `ecdsa` and `schnorr`
packages. Updating these pinned version lets importers properly use
these packages and build. Things build as is since we use replace
directive to point to the latest version _in the repo_ when we build.
2022-02-01 12:52:14 -08:00
Olaoluwa Osuntokun
0bbc831040
build: run go mod tidy to refresh go.sum for btcutil 2022-01-31 14:25:52 -08:00
Olaoluwa Osuntokun
d6d38ad4ae
btcec/v2/schnorr: add initial BIP-340 schnorr sig implementation
In this commit, we add an initial implementation of BIP-340. Mirroring
the recently added `ecsda` package, we create a new `schnorr` package
with a unique `Signature` type and `ParsePubkey` function. The new
`Signature` type implements the fixed-sized 64-byte signatures, and the
`ParsePubkey` method only accepts pubkeys that are 32-bytes in length,
with an implicit sign byte.

The signing implementation by default, deviates from BIP-340 as it opts
to use rfc6979 deterministic signatures by default, which means callers
don't need to always pass in their own `auxNonce` randomness. A set of
functional arguments allows callers to pass in their own value, which is
the way all the included test vectors function.

The other optional functional argument added is the `FastSign` option
that allows callers to skip the final step of verifying each signature
they generate.
2022-01-31 14:25:47 -08:00
Olaoluwa Osuntokun
eb61742c5d
btcec/v2: create new ecdsa package
In this commit, we create a new package to house the ECDSA-specific
logic in the new `btcec/v2` pacakge. Thsi c hange is meant to mirror the
structure of the `dcrec` package, as we'll soon slot in our own custom
BIP-340 implementation.
2022-01-31 14:25:39 -08:00
Olaoluwa Osuntokun
eee3c3b337
multi: switch project over to using btcec/v2 2022-01-26 16:10:17 -08:00
Olaoluwa Osuntokun
161863e7fc
btcutil: update modules to replace to top-level btcd repo
Now that the new `btcutil/v1.0.0` tag has been pushed, we update the new
internal modules to point to the top-level `btcd` repo via replace
directives.
2022-01-11 14:21:39 -08:00
Olaoluwa Osuntokun
caac0f821a
multi: update btcutil imports to point to new sub-module
In this commit, we update all the btcutil imports to point to the new
sub-module.

In the same commit, we also modify the recently added `btcutil/go.mod`
file as we need to continue pointing to the _old_ version of btcd, until
we merge this PR and push a new tag.
2022-01-10 18:44:58 -08:00
Olaoluwa Osuntokun
5cd3533e2b
btcutil: move btcutil into new sub-module
In this commit, we move `btcutil` as well as its sub-module, the `psbt`
package into the `btcd` repo itself.
2022-01-10 18:44:56 -08:00