In order to use the latest changes of btcsuite/btcd (including taproot PRs + schnorr support), go mod is pointing the latest commit hash. It seems to me that taproot changes has not been released yet (Am I wrong ?).
btcutils packages are now included in btcd, that's why some imports have been modified
2. Elements taproot
taproot package extends the btcd/txscript/taproot file and reuses the same unit test file taproot_test.go. Lot of copy-paste there, the logic is the same on Elements. The major change is about BIP-341 hash tags (suffixed by "/elements" on Liquid).
payment pkg implements several new functions in order to support P2TR payments (unconfidential/confidential).
blech32 supports segwit v1 encoding (bech32m) + BONUS: add unit tests from liquidjs-lib
transaction pkg implements HashForWitnessV1.
some changes in address pkg (getScriptType, toOutputScript etc...).
e2e nigiri testing for taproot (keypath & tapscript).
add the new elements tapscript opcodes constants.
About new opcodes: It is quite possible to use the new opcodes now. However, for better introspection support, I think we should extend the scriptBuilder from txscript with some elements-specific functions like AddAssetHash or AddIndex etc.
This PR adds Taproot/Tapscript support for elements, greatly inspired by the work already done on btcd: https://github.com/btcsuite/btcd/pull/1787
1. bump btcd to latest, drop btcutils
btcsuite/btcd
(including taproot PRs + schnorr support), go mod is pointing the latest commit hash. It seems to me that taproot changes has not been released yet (Am I wrong ?).2. Elements taproot
taproot
package extends thebtcd/txscript/taproot
file and reuses the same unit test filetaproot_test.go
. Lot of copy-paste there, the logic is the same on Elements. The major change is about BIP-341 hash tags (suffixed by "/elements" on Liquid).payment
pkg implements several new functions in order to support P2TR payments (unconfidential/confidential).blech32
supports segwit v1 encoding (bech32m) + BONUS: add unit tests from liquidjs-libtransaction
pkg implementsHashForWitnessV1
.address
pkg (getScriptType, toOutputScript etc...).it closes #172
duplicate of #195
@altafan @tiero please review