This is an implementation of the Schnorr/taproot consensus rules proposed by BIPs 340, 341, and 342.
See the list of commits below. No signing or wallet support of any kind is included, as testing is done entirely through the Python test framework.
This is a successor to #17977 (see discussion following this comment), and will have further changes squashed/rebased. The history of this PR can be found in #19997.