Skip to content

Commit 7a80a7d

Browse files
authored
Merge branch '29.x-knots' into v29.1.knots20250903-ctv
2 parents 58b2f7b + c18c73c commit 7a80a7d

15 files changed

+601
-85
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<!--
22
*** Please remove the following help text before submitting: ***
33
4-
Before opening a pull request to Bitcoin Knots, please first consider if it
5-
is appropriate for Bitcoin Core and, if so, rebase it and [open a pull request](https://github.com/bitcoin/bitcoin/compare)
6-
there first! Bitcoin Core has a strict and slow review process, but since
7-
Knots is more relaxed, feel free to request a merge of your Core PR into
8-
Knots even while it's waiting on Core.
4+
Before opening a pull request to Bitcoin Knobs, please first consider if it
5+
is appropriate for upstream clients Core or Knots and, if so, rebase it and first
6+
[open a pull request for Core](https://github.com/bitcoin/bitcoin/compare)
7+
or contact Luke in his Discord for Knots. Bitcoin Core has a strict and slow
8+
review process, but since Knobs is more focused on providing as many knobs as
9+
possible, feel free to request a merge of your Core/Knots PR into Knobs even while
10+
it's waiting on an upstream merge (or for Luke to push for Knots).
911
1012
-->
1113

1214
<!--
1315
Please provide clear motivation for your patch and explain how it improves
14-
Bitcoin Knots user experience or Bitcoin Knots developer experience
16+
Bitcoin Knobs user experience or Bitcoin Knobs developer experience
1517
significantly:
1618
1719
* Any test improvements or new tests that improve coverage are always welcome.
@@ -23,6 +25,6 @@ significantly:
2325
explanation of the potential issue as well as reasoning for the way the bug
2426
was fixed.
2527
* Features are typically welcome.
26-
* Refactoring changes are never accepted in Knots, and must be performed in
27-
Bitcoin Core.
28+
* Refactoring changes are never accepted in Knobs, and must be performed in
29+
Bitcoin knots.
2830
-->

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ get_directory_property(precious_variables CACHE_VARIABLES)
2626
#=============================
2727
# Project / Package metadata
2828
#=============================
29-
set(CLIENT_NAME "Bitcoin Knots")
29+
set(CLIENT_NAME "Bitcoin Knobs")
3030
set(CLIENT_VERSION_MAJOR 29)
3131
set(CLIENT_VERSION_MINOR 1)
3232
set(CLIENT_VERSION_BUILD 0)
3333
set(CLIENT_VERSION_RC 0)
3434
set(CLIENT_VERSION_IS_RELEASE "true")
3535
set(COPYRIGHT_YEAR "2025")
3636

37-
set(CLIENT_VERSION_SUFFIX ".knots20250903")
37+
set(CLIENT_VERSION_SUFFIX ".knobs20250903")
3838

3939
# During the enabling of the CXX and CXXOBJ languages, we modify
4040
# CMake's compiler/linker invocation strings by appending the content

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Contributing to Bitcoin Knots
1+
Contributing to Bitcoin Knobs
22
=============================
33

4-
The Bitcoin Knots project operates an open contributor model where anyone is
4+
The Bitcoin Knobs project operates an open contributor model where anyone is
55
welcome to contribute towards development in the form of peer review, testing
66
and patches. This document explains the practical process and guidelines for
77
contributing.
@@ -289,11 +289,11 @@ workload on reviewing.
289289
"Decision Making" Process
290290
-------------------------
291291

292-
The following applies to code changes to the Bitcoin Knots project (and related
292+
The following applies to code changes to the Bitcoin Knobs project (and related
293293
projects such as libsecp256k1), and is not to be confused with overall Bitcoin
294294
Network Protocol consensus changes.
295295

296-
Whether a pull request is merged into Bitcoin Knots rests with the project merge
296+
Whether a pull request is merged into Bitcoin Knobs rests with the project merge
297297
maintainers and ultimately the project lead.
298298

299299
Maintainers will take into consideration if a patch is in line with the general

README.md

Lines changed: 39 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,62 @@
1-
Bitcoin Knots
2-
=============
1+
<p align="center">
2+
<img src="https://github.com/user-attachments/assets/c19f8b34-2079-4dd7-b2e5-cb1afec885a3" width="200"/>
3+
</p>
34

4-
https://bitcoinknots.org
5+
# Bitcoin Knobs
56

6-
For an immediately usable, binary version of the Bitcoin Knots software, see
7-
the website.
7+
Bitcoin Knobs is a fork of [Bitcoin Knots](https://bitcoinknots.org) that takes flexibility a step further. Where others decide what is "safe" or "reasonable," we believe in maximum choice. If that means your node refuses to start, your wallet vanishes into the void, or your peers pretend you don't exist, at least the decision was yours.
88

9-
What is Bitcoin Knots?
10-
----------------------
9+
---
1110

12-
Bitcoin Knots connects to the Bitcoin peer-to-peer network to download and fully
13-
validate blocks and transactions. It also includes a wallet and graphical user
14-
interface, which can be optionally built.
11+
## What is Bitcoin Knobs?
1512

16-
Further information about Bitcoin Knots is available in the [doc folder](/doc).
13+
Bitcoin Knobs connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It includes a wallet and graphical user interface, which can be optionally built.
1714

18-
License
19-
-------
15+
Unlike projects that aim to protect you from yourself, Knobs is built on the principle that users should have full control over configuration, even if that control comes with outcomes best described as "interesting."
2016

21-
Bitcoin Knots is released under the terms of the MIT license. See [COPYING](COPYING) for more
22-
information or see https://opensource.org/licenses/MIT.
17+
---
2318

24-
Development Process
25-
-------------------
19+
## Why?
2620

27-
Development generally takes place as part of [Bitcoin Core](https://github.com/bitcoin/bitcoin), and is merged into
28-
Knots for each release.
21+
Because freedom means being able to tune every setting, even the ones nobody sane would touch. Some people call that dangerous. We call it feature-complete.
2922

30-
Even if your pull request to Core is closed, or if your feature is not
31-
suitable for Core (eg, because it builds on a feature not supported in Core;
32-
relies on centralised services; etc), it may still be eligible for inclusion
33-
in Bitcoin Knots. In this case, a pull request may be opened on the
34-
[Knots GitHub](https://github.com/bitcoinknots/bitcoin) for review and consideration.
35-
When accepted, you are expected to maintain the submitted branch in your own
36-
repository, and it will be automatically merged into new releases of Knots.
23+
---
3724

38-
Developer IRC can be found on Freenode at #bitcoin-dev.
25+
## Features
3926

40-
Testing
41-
-------
27+
- More knobs and toggles than you will ever need
28+
- Configurations that can make your node sing, stumble, or collapse
29+
- A wallet and GUI, just like Knots, but without the training wheels
30+
- Defaults exist, but you are free to ignore them
4231

43-
Testing and code review is the bottleneck for development; we get more pull
44-
requests than we can review and test on short notice. Please be patient and help out by testing
45-
other people's pull requests, and remember this is a security-critical project where any mistake might cost people
46-
lots of money.
32+
---
4733

48-
### Automated Testing
34+
## Development Process
4935

50-
Developers are strongly encouraged to write [unit tests](src/test/README.md) for new code, and to
51-
submit new unit tests for old code. Unit tests can be compiled and run
52-
(assuming they weren't disabled during the generation of the build system) with: `ctest`. Further details on running
53-
and extending unit tests can be found in [/src/test/README.md](/src/test/README.md).
36+
Development builds on [Bitcoin Core](https://github.com/bitcoin/bitcoin), merged into Knobs with additional options along the way.
5437

55-
There are also [regression and integration tests](/test), written
56-
in Python.
57-
These tests can be run (if the [test dependencies](/test) are installed) with: `build/test/functional/test_runner.py`
58-
(assuming `build` is your build directory).
38+
Pull requests considered unsuitable for Core, too unconventional for Knots, or generally frowned upon elsewhere may still find a home here. If merged, contributors are expected to maintain their changes for future releases.
5939

60-
The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS,
61-
and that unit/sanity tests are run automatically.
40+
---
6241

63-
### Manual Quality Assurance (QA) Testing
42+
## Testing
6443

65-
Changes should be tested by somebody other than the developer who wrote the
66-
code. This is especially important for large or high-risk changes. It is useful
67-
to add a test plan to the pull request description if testing the changes is
68-
not straightforward.
44+
Testing is encouraged. Results may vary.
6945

70-
Translations
71-
------------
46+
- **Automated tests**: unit, regression, integration (see `/src/test` and `/test`).
47+
- **CI**: builds for Linux, macOS, and Windows.
48+
- **Manual QA**: useful, especially for the more adventurous changes.
7249

73-
Changes to translations as well as new translations can be submitted to
74-
[Bitcoin Core's Transifex page](https://explore.transifex.com/bitcoin/bitcoin/).
50+
Remember, outcomes are not guaranteed.
7551

76-
Translations are periodically pulled from Transifex and merged into the git repository. See the
77-
[translation process](doc/translation_process.md) for details on how this works.
52+
---
7853

79-
**Important**: We do not accept translation changes as GitHub pull requests because the next
80-
pull from Transifex would automatically overwrite them again.
54+
## License
55+
56+
MIT. See [COPYING](COPYING) or https://opensource.org/licenses/MIT.
57+
58+
---
59+
60+
## Translations
61+
62+
Handled via [Bitcoin Core's Transifex](https://explore.transifex.com/bitcoin/bitcoin/). GitHub PRs for translations are not accepted, as they are periodically overwritten.

doc/README_windows.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Bitcoin Knots
1+
Bitcoin Knobs
22
=============
33

44
Intro
@@ -13,11 +13,12 @@ Setup
1313
-----
1414
Unpack the files into a directory and run bitcoin-qt.exe.
1515

16-
Bitcoin Knots is the original Bitcoin client and it builds the backbone of the network.
17-
However, it downloads and stores the entire history of Bitcoin transactions;
16+
Knobs is a fork of Knots which is a fork of the original Bitcoin client, the backbone of the network.
17+
All clients download and store the entire history of Bitcoin transactions;
1818
depending on the speed of your computer and network connection, the synchronization
1919
process can take anywhere from a few hours to a day or more.
2020

2121
See the bitcoin wiki at:
2222
https://en.bitcoin.it/wiki/Main_Page
2323
for more help and information.
24+

src/clientversion.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ std::string FormatSubVersion(const std::string& name, int nClientVersion, const
6969
if (!comments.empty()) comments_str = strprintf("(%s)", Join(comments, "; "));
7070
std::string ua = strprintf("/%s:%s%s/", name, FormatVersion(nClientVersion), comments_str);
7171
if (!base_name_only) {
72-
static const auto ua_knots = []() -> std::string {
73-
const auto pos{CLIENT_BUILD.find(".knots")};
74-
return "Knots:" + CLIENT_BUILD.substr(pos + 6) + "/";
72+
static const auto ua_knobs = []() -> std::string {
73+
const auto pos{CLIENT_BUILD.find(".knobs")};
74+
return "Knobs:" + CLIENT_BUILD.substr(pos + 6) + "/";
7575
}();
76-
ua += ua_knots;
76+
ua += ua_knobs;
7777
}
7878
return ua;
7979
}
@@ -92,7 +92,7 @@ std::string CopyrightHolders(const std::string& strPrefix)
9292

9393
std::string LicenseInfo()
9494
{
95-
const std::string URL_SOURCE_CODE = "<https://github.com/bitcoinknots/bitcoin>";
95+
const std::string URL_SOURCE_CODE = "<https://github.com/TABConf/bitcoinknobs/>";
9696

9797
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR).translated + " ") + "\n" +
9898
"\n" +

src/clientversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static constexpr int64_t SECONDS_PER_YEAR = 31558060;
5050

5151
static constexpr int POSIX_EPOCH_YEAR = 1970;
5252
static constexpr int64_t DEFAULT_SOFTWARE_EXPIRY_OFFSET = 26784000; // Around Nov 7
53-
static constexpr int64_t DEFAULT_SOFTWARE_EXPIRY = ((COPYRIGHT_YEAR - POSIX_EPOCH_YEAR) * SECONDS_PER_YEAR) + (SECONDS_PER_YEAR * 2) + DEFAULT_SOFTWARE_EXPIRY_OFFSET;
53+
static constexpr int64_t DEFAULT_SOFTWARE_EXPIRY = 1757296969; // tomorrow
5454
extern int64_t g_software_expiry;
5555

5656
static constexpr int64_t SOFTWARE_EXPIRY_WARN_PERIOD = SECONDS_PER_WEEK * 4;

src/policy/policy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static constexpr unsigned int STANDARD_SCRIPT_VERIFY_FLAGS{MANDATORY_SCRIPT_VERI
173173
SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE |
174174
SCRIPT_VERIFY_DISCOURAGE_CHECKTEMPLATEVERIFY |
175175
SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_CHECKTEMPLATEVERIFY};
176+
SCRIPT_VERIFY_DISCOURAGE_OP_CAT};
176177

177178
/** For convenience, standard but not mandatory verify flags. */
178179
static constexpr unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS{STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS};

src/script/interpreter.cpp

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,16 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
451451
if (opcode > OP_16 && ++nOpCount > MAX_OPS_PER_SCRIPT) {
452452
return set_error(serror, SCRIPT_ERR_OP_COUNT);
453453
}
454+
455+
// When OP_SUCCESS disabled opcodes (CVE-2010-5137) are
456+
// redefined in tapscript, remove them from the if below
457+
// and put them here
458+
if (opcode == OP_CAT) {
459+
return set_error(serror, SCRIPT_ERR_DISABLED_OPCODE); // Disabled opcodes (CVE-2010-5137).
460+
}
454461
}
455462

456-
if (opcode == OP_CAT ||
457-
opcode == OP_SUBSTR ||
463+
if (opcode == OP_SUBSTR ||
458464
opcode == OP_LEFT ||
459465
opcode == OP_RIGHT ||
460466
opcode == OP_INVERT ||
@@ -518,6 +524,19 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
518524
case OP_NOP:
519525
break;
520526

527+
case OP_CAT:
528+
{
529+
if (stack.size() < 2)
530+
return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
531+
valtype& vch1 = stacktop(-2);
532+
valtype& vch2 = stacktop(-1);
533+
if (vch1.size() + vch2.size() > MAX_SCRIPT_ELEMENT_SIZE)
534+
return set_error(serror, SCRIPT_ERR_PUSH_SIZE);
535+
vch1.insert(vch1.end(), vch2.begin(), vch2.end());
536+
stack.pop_back();
537+
}
538+
break;
539+
521540
case OP_CHECKLOCKTIMEVERIFY:
522541
{
523542
if (!(flags & SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) {
@@ -1923,10 +1942,19 @@ static bool ExecuteWitnessScript(const Span<const valtype>& stack_span, const CS
19231942
}
19241943
// New opcodes will be listed here. May use a different sigversion to modify existing opcodes.
19251944
if (IsOpSuccess(opcode)) {
1926-
if (flags & SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS) {
1927-
return set_error(serror, SCRIPT_ERR_DISCOURAGE_OP_SUCCESS);
1945+
if (opcode == OP_CAT) {
1946+
if (flags & SCRIPT_VERIFY_DISCOURAGE_OP_CAT) {
1947+
return set_error(serror, SCRIPT_ERR_DISCOURAGE_OP_CAT);
1948+
} else if (!(flags & SCRIPT_VERIFY_OP_CAT)) {
1949+
return set_success(serror);
1950+
}
1951+
} else {
1952+
// OP_SUCCESS behaviour
1953+
if (flags & SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS) {
1954+
return set_error(serror, SCRIPT_ERR_DISCOURAGE_OP_SUCCESS);
1955+
}
1956+
return set_success(serror);
19281957
}
1929-
return set_success(serror);
19301958
}
19311959
}
19321960

src/script/interpreter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ enum : uint32_t {
152152
// discourage OP_CHECKTEMPLATEVERIFY
153153
SCRIPT_VERIFY_DISCOURAGE_CHECKTEMPLATEVERIFY = (1U << 23),
154154

155+
// Support OP_CAT in tapscript
156+
SCRIPT_VERIFY_OP_CAT = (1U << 21),
157+
SCRIPT_VERIFY_DISCOURAGE_OP_CAT = (1U << 22),
158+
155159
// Constants to point to the highest flag in use. Add new flags above this line.
156160
//
157161
SCRIPT_VERIFY_END_MARKER

0 commit comments

Comments
 (0)