-
Notifications
You must be signed in to change notification settings - Fork 291
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
stdscript: Add script to address conversion. #2807
Merged
davecgh
merged 5 commits into
decred:master
from
davecgh:stdscript_script_to_addr_conversion
Nov 18, 2021
Merged
stdscript: Add script to address conversion. #2807
davecgh
merged 5 commits into
decred:master
from
davecgh:stdscript_script_to_addr_conversion
Nov 18, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davecgh
force-pushed
the
stdscript_script_to_addr_conversion
branch
from
November 15, 2021 07:09
e48bb46
to
f9b2037
Compare
dnldd
reviewed
Nov 15, 2021
dnldd
approved these changes
Nov 15, 2021
davecgh
force-pushed
the
stdscript_script_to_addr_conversion
branch
2 times, most recently
from
November 16, 2021 03:24
8cf694a
to
0eab9cb
Compare
matheusd
reviewed
Nov 16, 2021
davecgh
force-pushed
the
stdscript_script_to_addr_conversion
branch
2 times, most recently
from
November 17, 2021 00:30
0d08d3e
to
272632d
Compare
rstaudt2
approved these changes
Nov 17, 2021
davecgh
force-pushed
the
stdscript_script_to_addr_conversion
branch
from
November 18, 2021 18:08
272632d
to
752659a
Compare
matheusd
approved these changes
Nov 18, 2021
chappjc
approved these changes
Nov 18, 2021
davecgh
force-pushed
the
stdscript_script_to_addr_conversion
branch
from
November 18, 2021 18:21
752659a
to
c7ff884
Compare
This adds support for directly extracting the public key from standard version 0 pay-to-pubkey-ed25519 scripts along with full test coverage. Note that this information is also available via extracting the data and signature type from the pay-to-alt-pubkey variant, but it is more convenient to offer it directly.
This adds support for directly extracting the public key from standard version 0 pay-to-pubkey-schnorr-secp256k1 scripts along with full test coverage. Note that this information is also available via extracting the data and signature type from the pay-to-alt-pubkey variant, but it is more convenient to offer it directly.
This adds support for directly extracting the public key hash from standard version 0 pay-to-pubkey-hash-ed25519 scripts along with full test coverage. Note that this information is also available via extracting the data and signature type from the pay-to-alt-pubkey-hash variant, but it is more convenient to offer it directly.
This adds support for directly extracting the public key hash from standard version 0 pay-to-pubkey-hash-schnorr-secp256k1 scripts along with full test coverage. Note that this information is also available via extracting the data and signature type from the pay-to-alt-pubkey-hash variant, but it is more convenient to offer it directly.
As part of the ongoing effort to refactor all code dealing with standard scripts out of txscript, this adds support to stdscript for extracting the addresses from standard recognized forms of public key scripts along with comprehensive tests to ensure proper functionality. Staying consistent with the design of determining script types, the API is designed such that there is an exported function specifically for extracting addresses from version 0 scripts as well as a separate variant that accepts the script version.
davecgh
force-pushed
the
stdscript_script_to_addr_conversion
branch
from
November 18, 2021 18:24
c7ff884
to
165730f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is rebased on #2805.As part of the ongoing effort to refactor all code dealing with standard scripts out of
txscript
, this adds support tostdscript
for extracting the addresses from standard recognized forms of public key scripts along with comprehensive tests to ensure proper functionality.Staying consistent with the design of determining script types, the API is designed such that there is an exported function specifically for extracting addresses from version 0 scripts as well as a separate variant that accepts the script version.
It also adds direct data extraction functions for the following version 0 script types in separate commits to ease the review process: