Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taproot support #198

Merged
merged 38 commits into from
Jun 15, 2022
Merged

Taproot support #198

merged 38 commits into from
Jun 15, 2022

Conversation

louisinger
Copy link
Collaborator

This PR adds Taproot/Tapscript support for elements, greatly inspired by the work already done on btcd: btcsuite/btcd#1787

1. bump btcd to latest, drop btcutils

  • 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.

it closes #172

duplicate of #195

@altafan @tiero please review

@louisinger louisinger mentioned this pull request Jun 10, 2022
@louisinger
Copy link
Collaborator Author

CI is passing locally, will add the PR changes + psetv2 taproot support to #189

@louisinger louisinger closed this Jun 14, 2022
@tiero tiero reopened this Jun 15, 2022
@tiero tiero merged commit 64080b6 into vulpemventures:master Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Taproot & Tapscript
2 participants