Commit graph

34787 commits

Author SHA1 Message Date
Pablo Greco
ed31d2215f
Merge pull request #1165 from achow101/explicit-pset-fields-tests
pset: Tests and bug fixes for input explicit value and asset fields
2022-09-06 20:01:50 -03:00
Andrew Chow
66290e60cf tests: Tests for pset input explicit value, asset, and proofs 2022-09-06 16:26:49 -04:00
Andrew Chow
2bf627e282 psbt: Fix check for missing asset and its proof 2022-09-06 15:57:21 -04:00
Andrew Chow
6e6a92209c psbt: Store m_asset_proof for PSBT_IN_ELEMENTS_ASSET_PROOF 2022-09-06 15:56:57 -04:00
Andrew Chow
547b3e30ca psbt: Check subkey_len not key.size() 2022-09-06 15:56:39 -04:00
James Dorfman
457a5645fe
Merge pull request #869 from stevenroose/win-installer
Fix Bitcoin name usage in Windows installer
2022-09-06 15:50:12 -04:00
Pablo Greco
b4935a51c0
Merge pull request #1157 from achow101/explicit-pset-fields
pset: Add input explicit value, assets, and proofs, and issuance blinding flag
2022-09-06 16:00:45 -03:00
Andrew Chow
9ecbf38050 pset: Respect issuance needs blinded flag 2022-09-06 11:41:02 -04:00
Andrew Chow
cf870ed8d0 rpc: Implement decodepsbt for issuance needs blinded flag 2022-09-06 11:41:02 -04:00
Andrew Chow
9599661475 pset: Implement de/ser of issuance needs blinded flag 2022-09-06 11:41:02 -04:00
Andrew Chow
6291af43f9 doc: Specify flag for blinding issuances 2022-09-06 11:38:03 -04:00
Andrew Chow
4bacc852e9 rpc: Add input explicit value, asset, and proofs to decodepsbt 2022-09-06 11:38:01 -04:00
Andrew Chow
be602495f9 pset: Implement VerifyBlindProofs for PSBTInput 2022-09-06 11:37:14 -04:00
Andrew Chow
59658ece6d pset: Implement de/ser of input explicit value, assets, and proofs 2022-09-06 11:32:41 -04:00
Andrew Chow
172a959c7a doc: Specify input explicit values and assets and their proofs 2022-09-06 11:32:35 -04:00
Steven Roose
da236e8ad9
Merge ElementsProject/elements#1160: Fix createblindedaddress help message
fb5132b7bb Fix createblindedaddress help message (Andrea Bonel)

Pull request description:

ACKs for top commit:
  delta1:
    ACK fb5132b
  stevenroose:
    utACK fb5132b7bb

Tree-SHA512: dd60dac485815b8e02a6dd239862fdc079ad53a7079b75ded3fbd1552a88514b0e5168749d2ad186b589ebbe9d73a1d490f263978bbc67b516ec461e191ef139
2022-09-06 16:06:11 +02:00
Pablo Greco
3e646d4888
Merge pull request #1159 from ElementsProject/elements-tx-format-fix-typo
docs: fix typo in elements-tx-format.md
2022-09-05 16:58:10 -03:00
Andrea Bonel
fb5132b7bb Fix createblindedaddress help message 2022-09-05 11:35:19 -03:00
James Dorfman
6c55d1d53f docs: fix typo in elements-tx-format.md and remove trailing whitespace 2022-09-02 11:26:29 -04:00
James Dorfman
03b646930f
Merge pull request #1154 from andreabonel/master-fix_issue_1151
Elements-qt: Correctly display the amount in the sender's wallet after using Send button
2022-09-01 13:26:40 -04:00
James Dorfman
872478b1be
docs: describe elements transaction serialization format (#1148) 2022-09-01 13:24:11 -04:00
Andrea Bonel
60b913e341 Elements-qt: Correctly display the amount in the sender's wallet after using Send button 2022-08-31 19:12:50 -03:00
Pablo Greco
53da86e398
Merge pull request #1150 from allenpiscitello/pset-issuance-unblinded
Changing PSET to not blind asset issuances by default.
2022-08-24 22:20:42 -03:00
Allen Piscitello
dd2d758bc6 fixed minor issues found in review 2022-08-24 16:31:42 -05:00
Allen Piscitello
2da7d75ee9 removing test that fails due to blinded issuances, which results in incorrect reissuance token ids 2022-08-24 13:36:08 -05:00
Allen Piscitello
420de43c1c removing code to blind issuances. PSET should be modified to include an option to blind or unblind issuances, defaulting to unblind. 2022-08-24 09:42:29 -05:00
Pablo Greco
0be72f4c39
Merge pull request #1146 from andreabonel/master_issue_1144
Elements-qt: Fix arrows to increase/decrease Amount
2022-08-18 13:59:45 -03:00
Pablo Greco
debf46b89e
Merge pull request #1145 from allenpiscitello/pset-fixes
Fixing issuance cases and half blinded cases in PSET
2022-08-18 13:40:04 -03:00
Allen Piscitello
5954b10a1a Fixing issuance cases and half blinded cases in PSET 2022-08-18 11:20:02 -05:00
Andrea Bonel
38e9490de5 Elements-qt: Fix arrows to increase/decrease Amount 2022-08-18 13:16:37 -03:00
Pablo Greco
fa809aff5e
Merge pull request #1141 from ElementsProject/roconnor-blockstream-patch-1
Fix tapscript comment
2022-08-12 13:01:41 -03:00
roconnor-blockstream
707cf20b12
Fix tapscript comment
In elements tapscript is verison 0xc4
2022-08-12 11:56:15 -04:00
Andrew Poelstra
6422e50652
Merge ElementsProject/elements#1140: Fix Icon position in dmg
7fb99ff33f Fix Icon position in dmg (Pablo Greco)

Pull request description:

  Mac installer is showing the elements icon in a bad position
  ![image](https://user-images.githubusercontent.com/12950210/184251990-2496a5fc-de3a-450f-88d7-bce4188224f2.png)

  This small fix puts it back where it should be
  ![image](https://user-images.githubusercontent.com/12950210/184252039-0455a9ce-39f8-44cf-8d78-e8b1669e15e3.png)

ACKs for top commit:
  apoelstra:
    utACK 7fb99ff33f. Confirmed that it only touches Mac stuff.

Tree-SHA512: cbe3cd3ae4b5d461dc7f993ca0ea11f6ff1759a616d4d96d3a7ca9eda59cd2dc8e6664f2708d168bc9d84a8158adef73d0c995d6a8d40fd31311e4591f6747fd
2022-08-12 15:52:39 +00:00
Pablo Greco
7fb99ff33f Fix Icon position in dmg 2022-08-11 21:29:05 +00:00
Pablo Sebastian Greco
6132c01d60
Merge pull request #1121 from jgriffiths/pset_updates
PSET: Various fixes
2022-08-09 16:16:02 -03:00
Pablo Sebastian Greco
1efefc3914
Merge pull request #1131 from sanket1729/udpate_dump_blind_key
Allow dumpblinding key to accept non-CT address
2022-08-09 16:14:57 -03:00
Jon Griffiths
3be6e80f90
PSET: handle missing/NULL issuance assets when blinding 2022-08-09 09:36:02 +12:00
Jon Griffiths
e319fe0a9a
PSET: Add a parsepsbt RPC command to parse and dump a given PSBT
I found this useful for for creating test cases and checking validity.
In the event that alternative implementations do not aim for exact
serilization compatibility, this RPC can be used to validate and
re-serialize their output for testing.
2022-08-09 09:36:02 +12:00
Jon Griffiths
1462492553
PSET: Use the current serialization format in PSET tests
This allows these test cases to be re-used by alternate implementations
for round-trip serialization testing.
2022-08-09 09:36:02 +12:00
Jon Griffiths
e8e2bd1e61
PSET: Handle unknown global PSET extension fields
This makes global handling forwards-compatible when new fields are
added, and un-breaks any PSET implementations that serialize
PSBT_ELEMENTS_GLOBAL_TX_MODIFIABLE (which Elements does not yet
implement).
2022-08-09 09:36:02 +12:00
Jon Griffiths
9eeadc83da
PSET: Write input fields in their definition order
As for outputs. ISSUANCE_VALUE_COMMITMENT and ISSUANCE_VALUE were
misordered.
2022-08-09 09:36:02 +12:00
Jon Griffiths
4f71f62b43
PSET: Write output fields in their definition order
ASSET_COMMITMENT and ASSET were in the wrong order, which prevents
simply iterating the constants in simple parsers/writers.
2022-08-09 09:36:02 +12:00
Jon Griffiths
6e01e5dc82
PSET: Put PSBT_OUT_AMOUNT back in the same position as in PSBT
While the order of fields is not explicit in the PSBT/PSET specifications,
third parties need to be able to support both with a single implementation.
Keeping the PSBT fields in the same order makes this significantly
easier.
2022-08-09 09:36:02 +12:00
Jon Griffiths
5831e6b165
PSET: Serialize PSBT_ELEMENTS_GLOBAL_SCALAR according to spec
Note the re-parsing of the correct serialization is covered by the existing
PSBT tests which process PSBTs containing scalars.
2022-08-09 09:36:01 +12:00
Jon Griffiths
46c49c09b6
PSET: Allow reading of correctly serialized empty vectors
A single 0x00 byte indicates a zero length field; we must skip parsing
that field otherwise the length will be expected to be read again for
the vector that is passed in to revieve the value.

This allows PSBT_ELEMENTS_GLOBAL_SCALAR to be parsed when it is
serialized according to the spec, i.e. both of the following cases
will correctly parse to the same representation:

$cli decodepsbt 'cHNldP8B+wQCAAAAAQIEAgAAAAEEAQABBQEAJ/wEcHNldAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fIAEAAA=='

and

$cli decodepsbt 'cHNldP8B+wQCAAAAAQIEAgAAAAEEAQABBQEAJ/wEcHNldAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fIAAA'

PSBT_ELEMENTS_GLOBAL_SCALAR is the only PSBT/PSET field that contains
key data but no value data and so is the only field that currently hits
this special case.
2022-08-09 09:35:54 +12:00
Glenn Willen
426679e48c
Merge pull request #1134 from sanket1729/crash_partial_blind
Check the value assertion only on valid amounts
2022-08-08 13:16:22 -07:00
sanket1729
53a75ebbae Check the value assetion only on valid amounts
This causes crash on elements wallet when dealing with transactions that
have explicit values and confidential assets. This creates a somewhat
serious DoS attack as the sender can cause the reciever's wallet to
crash by partially blinding the change output. To make matters worse,
the wallet initially accepts the transaction, but fails while spending
the output.

This is likely caused by a combination of two bugs:
1) The wallet's current behaviour stores the complete transaction of interest
in CWalletTx instead of just Outpoints. Only that the spend time do we
iterate over all outputs, try to unblind them and check which are
isMine. When calling wtx.GetOutputValueOut() or similar calls, we hit this assertion.

While the current behaviour is okay, I think the correct way is move
the IsMine == ISMINE_NO at the start of the loop. We should not do be
any checks on outputs that are not ours. This is used in multiple
places at different parts of the codebase for different RPCs.

2) When dealing with partially blinded trasactions, ComputeBlindingData
correctly sets value = -1, and the cache byte to 1. When getting the
data again with GetBlindingData for explicit value and confidential
asset, we load the precomputed data with value = -1 and assert the
loaded value be the explicit value in the transaction. This is only true
for explicit value and explicit asset.

The changed assertion checks that written value should be same as the
explicit value that was written only when the amounts are valid
2022-08-08 03:28:51 -07:00
Glenn Willen
1be529a11b
Merge pull request #1130 from psgreco/master-qtfixtitle
QT: fix title in custom chains
2022-08-03 12:05:51 -07:00
sanket1729
a142232384 Allow dumpblinding key to accept non-CT address
This facilitates the following workflow:
1) Obtain an updated psbt with in_witness_utxo and in_utxo_rangeproof
2) Get the blinding key from the input utxo address obtained from input
script pubkey without revealing master blinding key
3) Rewind the proof to obtain blinding factors and implement stateless
blinding
2022-08-02 13:29:05 -07:00
Pablo Greco
088c24c16a QT: fix title in custom chains 2022-08-01 21:32:00 -03:00