Commit graph

29954 commits

Author SHA1 Message Date
Andrew Chow
23f644206b Update SignPSBTInput for PSBTv2 2021-06-22 13:54:50 -04:00
Andrew Chow
d8dba3333b Add PSBTInput::GetOutPoint
Helper for getting the PSBTInput COutPoint
2021-06-22 13:54:50 -04:00
Andrew Chow
4ff2593280 Implement PSBTv2 field merging 2021-06-22 13:54:50 -04:00
Andrew Chow
cd5515a266 Change PSBT::AddOutput to take just PSBTOutput 2021-06-22 13:54:50 -04:00
Andrew Chow
90cd7ec5d5 Change PSBT::AddInput to take just PSBTInput 2021-06-22 13:54:50 -04:00
Andrew Chow
bd1a57bd80 Add PSBT::GetUniqueID
The unique ID for PSBTv2 is different from v0. Use this function to get
the ID without requiring the caller to know the version number.
2021-06-22 13:54:50 -04:00
Andrew Chow
32bdf2d97e Add PSBT::GetUnsignedTx
A helper function for getting the unsigned transaction regardless of
psbt version.
2021-06-22 13:54:50 -04:00
Andrew Chow
10bf24726b Add PSBT::ComputeLockTime()
Function to compute the lock time for the transaction
2021-06-22 13:54:50 -04:00
Andrew Chow
3c647b7a54 Replace PSBT::GetInputUTXO with PSBTInput::GetUTXO
Now that PSBTInput's track their own prevouts, there's no need for a
PSBT global function to fetch input specific data.
2021-06-22 13:54:50 -04:00
Andrew Chow
4b805fd4b5 Convert PSBTv0 unsigned tx to PSBTv2 fields
This is just a convenience and doesn't effect serialization.
2021-06-22 13:54:50 -04:00
Andrew Chow
32234dfa68 Call CacheUnsignedTxPieces in PSBT constructor 2021-06-22 13:54:50 -04:00
Andrew Chow
c32950e02b Add PSBT::CacheUnsignedTxPieces
Fetches the PSBTv2 fields from PSBTv0's global unsigned tx. This allows
us to pretend everything internally is a PSBTv2 and makes things easier
to work with.
2021-06-22 13:54:50 -04:00
Andrew Chow
457b6bd44b Enforce PSBT version constraints
With PSBTv2, some fields are not allowed in PSBTv2, and some are
required. Enforce those.
2021-06-22 13:54:50 -04:00
Andrew Chow
2042765520 Have PSBTInput and PSBTOutput know the PSBT's version 2021-06-22 13:54:50 -04:00
Andrew Chow
8c624438ca Change PSBT unknown fields test to use higher numbers
Previously these tests were using 0x0f as the field number. Changed to
use 0xf0 instead as it is unlikely we will hit that anytime soon.
2021-06-22 13:54:50 -04:00
Andrew Chow
dd792cea62 Implement PSBTv2 fields de/ser 2021-06-22 13:54:50 -04:00
Andrew Chow
ec03f83d5f Define psbtv2 field numbers 2021-06-22 13:54:50 -04:00
Andrew Chow
20e8dff880 Merge global xpubs in joinpsbts and combinepsbts 2021-06-22 13:54:50 -04:00
Andrew Chow
bc2651d200 Add global xpub test vectors from BIP 2021-06-22 13:54:50 -04:00
Andrew Chow
7fd50b2795 Add global_xpubs to decodepsbt 2021-06-22 13:54:50 -04:00
Andrew Chow
2c54175f0f Implement serializations for PSBT_GLOBAL_XPUB 2021-06-22 13:54:50 -04:00
Andrew Chow
5b5c5efbbb Implement operator< for KeyOriginInfo and CExtPubKey 2021-06-22 13:54:50 -04:00
Andrew Chow
4eabba9be7 Separate individual HD Keypath serialization into separate functions 2021-06-22 13:54:50 -04:00
Andrew Chow
cb9c553429 Store version bytes and be able to serialize them in CExtPubKey
CExtPubKey does not store the version bytes for the extended public key.
We store these so that a CExtPubKey can be serialized and deserialized with
the same version bytes.
2021-06-22 13:54:50 -04:00
Andrew Chow
fad29bafd3 moveonly: Move (Un)Serialize(To/From)Vector, (De)SerializeHDKeypaths to psbt module
SerializeToVector, UnserializeFromVector, DeserializeHDKeypaths, and SerializeHDKeypaths
were in sign.h where PSBT was originally implemented. Since all of the PSBT serialization
has moved to its own file, these functions should follow.
2021-06-22 13:54:50 -04:00
MarcoFalke
0896d0a278 util: Properly handle -noincludeconf on command line
This bug was introduced in commit
fad0867d6a.

Unit test
Co-Authored-By: Russell Yanofsky <russ@yanofsky.org>
2021-06-21 14:08:34 +00:00
MarcoFalke
5f18d337d4 Cleanup -includeconf error message
Remove the erroneous trailing newline '\n'. Also, print only the first
value to remove needless redundancy in the error message.
2021-06-19 02:40:20 +00:00
MarcoFalke
99b86594df Fix crash when parsing command line with -noincludeconf=0 2021-06-19 02:39:07 +00:00
Andrew Poelstra
c98902bd1b fuzz: add missing ECCVerifyHandle to base_encode_decode
Backport of https://github.com/bitcoin/bitcoin/pull/22279
2021-06-18 23:29:10 +00:00
Andrew Chow
31a7e0a744 Test for proprietary field 2021-06-03 15:44:20 -04:00
Andrew Chow
5bb930e0b4 Output proprietary type info in decodepsbt 2021-06-03 15:44:20 -04:00
Andrew Chow
575fec01b2 Implement PSBT proprietary type 2021-06-03 15:44:20 -04:00
Andrew Chow
25c13ad3b8 Output psbt version in decodepsbt 2021-06-03 15:44:20 -04:00
Andrew Chow
ad2b2d7c58 Add GetVersion helper to PSBT 2021-06-03 15:44:19 -04:00
Andrew Chow
50c281fc12 Implement PSBT versions 2021-06-03 15:44:19 -04:00
Andrew Chow
e882a3a32d Types are compact size uints 2021-06-03 15:44:19 -04:00
Andrew Chow
fdf71def4c Remove PSET and disable PSBT/PSET things for now
Reset back to Bitcoin PSBT and disable PSBT/PSET handling in wallet and
rpc.

This is just a reset to allow for PSBTv2 change and then a new and
improved PSET.
2021-06-03 15:44:19 -04:00
Steven Roose
eda3fbe212
Merge ElementsProject/elements#1001: Adds an -fno-stack-check compile time flag to OSX local builds
43657b5aaa Adds an -fno-stack-check compile time flag to OSX local builds (Mike Slominsk)

Pull request description:

  As a workaround for several elements issues on OSX 10.15 and later, this PR adds the `-fno-stack-check` flag to local (non-cross compile) OSX builds.

  Background: There seems to be a general issue with OSX (version >= 10.15) builds and clang's default use of `-fstack-check` which seems to be buggy enough to cause issues with multiple projects.

  closes #987 #998
  Also related to #782

Top commit has no ACKs.

Tree-SHA512: b8ecf10771da235878d10a59cddf22be9e587c2c6b278a62ea777d547b1a37abfbec4945842df2b581407e81dafcfc3df1d86e27f861a03322cb188917a5e940
2021-06-02 18:16:55 +01:00
Mike Slominsk
43657b5aaa Adds an -fno-stack-check compile time flag to OSX local builds 2021-05-18 15:15:38 -07:00
Steven Roose
3172615d2c
Merge ElementsProject/elements#986: Undo default signalling behavior for dynafed unless enabled
b7a116d910 Undo default signalling behavior for dynafed unless enabled (Steven Roose)

Pull request description:

  This adds an explicit argument to enable dynafed signalling that is not active by default.

ACKs for top commit:
  gwillen:
    That looks great, utACK b7a116d.

Tree-SHA512: bf13ff2b0a8b2cb1d5570ef8f5c423c3b112249d08407791fdca9a86ab7759dd37aa28edce14b5c8600bf22f100472515bed465243253fefd3f51ce9782e9210
2021-05-10 12:05:59 +02:00
Steven Roose
b7a116d910
Undo default signalling behavior for dynafed unless enabled 2021-05-07 13:46:55 +02:00
Steven Roose
108e1ba7bb
Merge ElementsProject/elements#984: Address problems raised in #935 (0.21 rebase)
f2a0050f31 primitives: do not de/serialize asset issuance in bitcoin mode (Andrew Poelstra)
9c1de4d85f ci: give more memory to a couple Cirrus jobs (Andrew Poelstra)
40c09f637c rpc: fix error message accidentally changed in 5e62edc (Andrew Poelstra)
adbd9f163a qt: fix PSBT/PSET change from 4839db857d (Andrew Poelstra)
057237bd02 qt: fix double-scoping of enum introduced in c3b6bbb (Andrew Poelstra)
5819f25975 bitcoin-tx: add ASSET to the help text of some option (Andrew Poelstra)
1f3cfb451a chainparamsbase: fix bool-vs-enum mistake in 9c3480fea9 (Andrew Poelstra)
2573747447 fix test code duplication from 3a0de44d90 (Andrew Poelstra)
0045cafd75 rpc/mining: restore code erroneously dropped in 0e2c963dbf (Andrew Poelstra)
39112e1eaa correct copy/paste error in error message (Andrew Poelstra)

Pull request description:

ACKs for top commit:
  stevenroose:
    utACK f2a0050

Tree-SHA512: 5ce831ef24e51e76b93cd4d8e345a382dbd716e38c99565a7c2f25b5eeb8bac1e36c623491c5763ceb7b47444024b5821a878942df150bb01b33eeae33f292b1
2021-05-06 15:33:55 +01:00
Steven Roose
4db1799620
Merge ElementsProject/elements#951: Spec for PSET
8e19dfa35b Specify PSET (Andrew Chow)

Pull request description:

  Adds the document specifying the new PSET format that #900 implements.

  Pulled out of #900

Top commit has no ACKs.

Tree-SHA512: 892d27a5735fc581b0963b3e230cc028c08f7750a55c8b4030f9f909dee89910348fdc565739c6ec73ce206b7cfd08d3614ccaf884d5abc43a7470f36368ca43
2021-05-06 15:28:58 +01:00
Steven Roose
46fdd2795c
Merge ElementsProject/elements#982: Add liquidv1test chainparams.
b47c279ee1 Fix compilation errors after rebase onto master (Glenn Willen)
6d19c44bd0 Add liquidv1test chainparams. (Glenn Willen)
a8704b270d Fix description of -chain parameter (Glenn Willen)
188283eecb Change stray uses of global gArgs to args in CCustomParams (Glenn Willen)

Pull request description:

  Add the `liquidv1test` chain, which is meant to more closely track the `liquidv1` chain for realistic testing in CI and on test networks (vs `elementsregtest`, a "custom chain" which has diverged a bit more than I'm comfortable with.)

  I also fixed a few stray things that looked like minor mistakes to me (uses of the global `gArgs` instead of the parameter `args`, and the `-chain` help text not mentioning `liquidv1` as the default.)

Top commit has no ACKs.

Tree-SHA512: 0009740b6811af4b52c771e4559a4e941aec188e9994809b28642b5bd74f6e10fc0053c6246f89a7d8224269305308b7ffae082c93ac61355c305bdb326daeca
2021-04-30 13:42:07 +01:00
Glenn Willen
b47c279ee1 Fix compilation errors after rebase onto master 2021-04-29 15:00:54 -07:00
Andrew Poelstra
f2a0050f31 primitives: do not de/serialize asset issuance in bitcoin mode
Fixes a fuzztest failure related to `g_con_elementsmode`.
2021-04-28 22:33:34 +00:00
Andrew Poelstra
9c1de4d85f ci: give more memory to a couple Cirrus jobs 2021-04-28 22:33:24 +00:00
Andrew Chow
8e19dfa35b Specify PSET 2021-04-20 18:08:17 -04:00
Andrew Poelstra
40c09f637c rpc: fix error message accidentally changed in 5e62edc 2021-04-15 18:06:52 +00:00
Andrew Poelstra
adbd9f163a qt: fix PSBT/PSET change from 4839db857d 2021-04-15 18:04:01 +00:00