Closed louisinger closed 2 years ago
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.
Don't think this is in the scope of the PR. We should open a dedicated ticket and discuss it there.
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
@altafan @tiero please review