Commit graph

77 commits

Author SHA1 Message Date
ivanlele
cd6ec40d0f
Merge 2aff9a36c3 into merged_master (Bitcoin PR bitcoin/bitcoin#30352) 2026-03-11 09:41:57 +00:00
Byron Hambly
1c37230da9
Merge 514268170b into merged_master (Bitcoin PR bitcoin/bitcoin#29133) 2025-11-18 13:27:06 +02:00
Byron Hambly
43e88ba24e
Merge cc7aee39b9 into merged_master (Elements PR #1492) 2025-11-05 10:12:43 +02:00
Tom Trevethan
a8bd002ae3
fix dest error messages and test
(cherry picked from commit d2cc317cdb1b5bb1c491954cee4202c8ad44e1ad)
2025-10-09 10:07:46 +02:00
Tom Trevethan
9f1cc945b6
Fix: address error messages and test (#1486)
* fix address error messages and test

* newline

---------

Co-authored-by: Tom Trevethan <ttrevethan@blockstream.com>
2025-08-25 15:05:57 +02:00
Byron Hambly
34f8d7a3c4
Merge 53313c49d6 into merged_master (Bitcoin PR bitcoin/bitcoin#28246) 2025-08-01 12:40:43 +02:00
Byron Hambly
61847fc900 Merge 1e9d367d0d into merged_master (Bitcoin PR bitcoin/bitcoin#28423) 2025-07-21 14:48:23 +02:00
Byron Hambly
6c55760a2d Merge 7ef2d4ee4d into merged_master (Bitcoin PR bitcoin/bitcoin#28244) 2025-07-04 17:24:18 +02:00
Byron Hambly
5348a20579 Merge 9d098af5a9 into merged_master (Bitcoin PR bitcoin/bitcoin#27747) 2025-06-23 15:13:31 +02:00
Byron Hambly
c1b97b12ec Merge a13f3746dc into merged_master (Bitcoin PR bitcoin/bitcoin#27727) 2025-06-23 14:45:00 +02:00
Byron Hambly
d69d8c5c42 Merge 73a9892bce into merged_master (Bitcoin PR bitcoin/bitcoin#26514) 2025-04-10 07:55:52 +02:00
Greg Sanders
455fca86cf policy: Add OP_1 <0x4e73> as a standard output type
These outputs are called anchors, and allow
key-less anchor spends which are vsize-minimized
versus keyed anchors which require larger outputs
when creating and inputs when spending.
2024-07-30 14:06:58 -04:00
MarcoFalke
fa96d93711
refactor: Allow std::span construction from CKey 2024-01-16 15:29:18 +01:00
fanquake
53313c49d6
Merge bitcoin/bitcoin#28246: wallet: Use CTxDestination in CRecipient instead of just scriptPubKey
ad0c469d98 wallet: Use CTxDestination in CRecipient rather than scriptPubKey (Andrew Chow)
07d3bdf4eb Add PubKeyDestination for P2PK scripts (Andrew Chow)
1a98a51c66 Allow CNoDestination to represent a raw script (Andrew Chow)
8dd067088d Make WitnessUnknown members private (Andrew Chow)

Pull request description:

  For silent payments, we want to provide a `SilentPaymentsDestination` to be used as the recipient, which requires `CRecipient` to use something other than just the `scriptPubKey` as we cannot know the output script for a silent payment prior to transaction creation. `CTxDestination` seems like the obvious place to add a `SilentPaymentsDestination` as it is our internal representation of an address.

  In order to still allow paying to arbitrary scriptPubKeys (e.g. for data carrier outputs, or the user hand crafted a raw transaction that they have given to `fundrawtransaction`), `CNoDestination` is changed to contain raw scripts.

  Additionally, P2PK scripts are now interpreted as a new `PubKeyDestination` rather than `PKHash`. This results in some things that would have given an address for P2PK scripts to no longer do so. This is arguably more correct.

  `ExtractDestination`'s behavior is slightly changed for the above. It now returns `true` for those destinations that have addresses, so P2PK scripts now result in `false`. Even though it returns false for `CNoDestination`, the script will now be included in that `CNoDestination`.

  Builds on #28244

ACKs for top commit:
  josibake:
    ACK https://github.com/bitcoin/bitcoin/pull/28246/commits/ad0c469d98c51931b98b7fd937c6ac3eeaed024e

Tree-SHA512: ef3f8f3c7284779d9806c77c85b21caf910a79a1f7e7f1b51abcc0d7e074f14e00abf30f625a13075e41d94dad6202c10ddff462c0ee74c2ca4aab585b145a52
2023-09-19 16:48:43 +00:00
TheCharlatan
f0d1d8b35c
[refactor] Add missing includes for next commit 2023-09-12 22:51:42 +02:00
Andrew Chow
07d3bdf4eb Add PubKeyDestination for P2PK scripts
P2PK scripts are not PKHash destinations, they should have their own
type.

This also results in no longer showing a p2pkh address for p2pk outputs.
However for backwards compatibility, ListCoinst will still do this
conversion.
2023-09-12 12:14:31 -04:00
Andrew Chow
8dd067088d Make WitnessUnknown members private
Make sure that nothing else can change WitnessUnknown's data members by
making them private. Also change the program to use a vector rather than
C-style array.
2023-09-12 12:14:31 -04:00
Andrew Chow
91d924ede1 Rename script/standard.{cpp/h} to script/solver.{cpp/h}
Since script/standard only contains things that are used by the Solver
and its callers, rename the files to script/solver.
2023-08-14 17:39:49 -04:00
Andrew Chow
bacdb2e208 Clean up script/standard.{h/cpp} includes 2023-08-14 17:38:27 -04:00
Andrew Chow
f3c9078b4c Clean up things that include script/standard.h
Remove standard.h from files that don't use anything in it, and include
it in files that do.
2023-08-14 17:38:27 -04:00
Byron Hambly
47626b5a64 Merge 623745ca74 into merged_master (Bitcoin PR bitcoin/bitcoin#23912) 2023-06-14 15:44:11 +00:00
Byron Hambly
a120b7925d Merge 22feb7fee9 into merged_master (Bitcoin PR bitcoin/bitcoin#23577) 2023-06-02 08:34:54 +00:00
Byron Hambly
eee64b5289 Merge 95d19f8c1a into merged_master (Bitcoin PR bitcoin/bitcoin#16807)
I did not do a great job with this merge, and it could use some
improvement. Commented out some of the assertions in
rpc_invalid_address_message.py
2023-05-30 15:27:30 +00:00
Reese Russell
3d0a5c37e9 use 'byte'/'bytes' for bech32(m) validation error
changed from std::string -> std::string_view

applied snake case to byteStr -> byte_str
2023-05-25 06:30:10 +00:00
MarcoFalke
eeee55f928
rpc: Fix invalid bech32 handling 2023-05-23 15:10:00 +02:00
Aurèle Oulès
962a0930e6
Improve address decoding errors 2023-01-17 18:31:51 +01:00
Glenn Willen
6b4228e3a5 Preserve blinding key when parsing taproot address. 2022-10-11 15:30:04 -07:00
Hennadii Stepanov
f47dda2c58
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
* 2020: fa0074e2d8
* 2019: aaaaad6ac9
2021-12-30 19:36:57 +02:00
Samuel Dobson
a4fe70171b Make Bech32 LocateErrors return error list rather than using out-arg 2021-12-06 14:17:41 +13:00
Samuel Dobson
bb4d3e9b97 Address review comments for Bech32 error validation 2021-11-23 15:48:59 +13:00
Samuel Dobson
b62b67e06c Add Bech32 error location function 2021-10-12 12:03:14 +13:00
Samuel Dobson
0b06e720c0 More detailed error checking for base58 addresses 2021-10-12 12:03:14 +13:00
Andrew Poelstra
ba3d786a61 Merge 64194498cf into merged_master (Elements PR ElementsProject/elements#1025)
Another annoying one to deal with because it includes partial
backports. In future let's really try to stay up to date with
Core.
2021-09-05 15:42:08 +00:00
Andrew Poelstra
c01e09e8c3 blech32: add blech32m format and use it to decode witness v1+ addresses 2021-08-18 15:54:20 +00:00
Pieter Wuille
b3df66f82e Use Bech32m encoding for v1+ segwit addresses
This also includes updates to the Python test framework implementation,
test vectors, and release notes.

https://github.com/bitcoin/bitcoin/pull/20861 (3/5)
2021-08-17 22:32:47 +00:00
Pieter Wuille
b1d1d94e01 Implement Bech32m encoding/decoding
https://github.com/bitcoin/bitcoin/pull/20861 (1/5)
2021-08-17 22:32:47 +00:00
Bezdrighin
c607835bad Better error messages for invalid addresses
This commit addresses #20809.

We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.

https://github.com/bitcoin/bitcoin/pull/20832 (1/1)

ELEMENTS: Merge conflicts resolved based on d6c85c5620 (from 22.0 rebase)
2021-08-17 22:32:47 +00:00
Andrew Poelstra
e4746d6297 Merge 914c0cad97 into merged_master (Bitcoin PR bitcoin/bitcoin#22399)
This PR adds a fuzz test ensuring that all the different destination types
round-trip to strings (an important test given that Satoshi managed to mess
this up, having two different address types encode the same way..)

Anyway we fail this test, since both CNoDestination and NullData encode as
empty strings, and then this "decodes" as CNoDestination (and returns an
error, but the fuzztest doesn't check that). To make the fuzzer pass, I
changed NullData to encode and decode as "null".

I think this actually adds some functionality, letting you use "null" as
an "address" for sendtoaddress and createrawtransaction, thus burning the
coins and fixing #1011...but this was not my intent and we probably want
to think a bit more carefully before deliberately supporting this.
2021-07-31 00:58:01 +00:00
Andrew Poelstra
3ffb9aa14f Merge c7dd9ff71b into merged_master (Bitcoin PR bitcoin/bitcoin#22051)
Does the bare minimum to introduce Taproot wallet support with CT; just
adds a CPubKey blinding_pubkey to the taproot destination variant and
updates some visitors.

In future when we define blech32 we will need to make sure we are using
that encoding and using the pubkey.
2021-07-21 23:15:57 +00:00
Andrew Poelstra
d44ce3a73f Merge 8ec881d3b6 into merged_master (Bitcoin PR #20861) 2021-06-27 19:12:42 +00:00
Andrew Poelstra
d6c85c5620 Merge 4b15ffe991 into merged_master (Bitcoin PR #20832) 2021-06-18 20:35:42 +00:00
Andrew Poelstra
acf709b3ab Merge bd6af53e1f into merged_master (Bitcoin PR #20480)
what a trainwreck of a programming language..
2021-06-17 15:15:29 +00:00
Pieter Wuille
a4bf84039c Separate WitnessV1Taproot variant in CTxDestination 2021-05-24 12:14:16 -07:00
Pieter Wuille
fe5e495c31 Use Bech32m encoding for v1+ segwit addresses
This also includes updates to the Python test framework implementation,
test vectors, and release notes.
2021-03-16 10:48:36 -07:00
Pieter Wuille
da2bb6976d Implement Bech32m encoding/decoding 2021-03-15 17:26:35 -07:00
Bezdrighin
8f0b64fb51 Better error messages for invalid addresses
This commit addresses #20809.

We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.
2021-01-24 02:44:53 +01:00
MarcoFalke
faa8f68943
Replace boost::variant with std::variant 2021-01-05 10:10:50 +01:00
Andrew Poelstra
fa10c4dfe5 Merge bd331bd745 into merged_master (Bitcoin PR #17938)
Also re-`static`'d a method in src/script/standard.cpp which we had made globally
visible for some historical reason, but which I noticed diffing that file against
upstream.
2020-11-26 01:09:10 +00:00
Andrew Poelstra
009bc2fdfb Merge 99813a9745 into merged_master (Bitcoin PR #17829) 2020-11-14 16:52:02 +00:00
Andrew Poelstra
c1ac820649 Merge 3914e877c4 into merged_master (Bitcoin PR #17511) 2020-11-14 16:51:57 +00:00