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

stdscript: Add script to address conversion. #2807

Merged
merged 5 commits into from
Nov 18, 2021

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Nov 15, 2021

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

It also adds direct data extraction functions for the following version 0 script types in separate commits to ease the review process:

  • pay-to-pubkey-ed25519
  • pay-to-pubkey-schnorr-secp256k1
  • pay-to-pubkey-hash-ed25519
  • pay-to-pubkey-hash-schnorr-secp256k1

@davecgh davecgh added this to the 1.7.0 milestone Nov 15, 2021
@davecgh davecgh force-pushed the stdscript_script_to_addr_conversion branch from e48bb46 to f9b2037 Compare November 15, 2021 07:09
@davecgh davecgh force-pushed the stdscript_script_to_addr_conversion branch 2 times, most recently from 8cf694a to 0eab9cb Compare November 16, 2021 03:24
@davecgh davecgh force-pushed the stdscript_script_to_addr_conversion branch 2 times, most recently from 0d08d3e to 272632d Compare November 17, 2021 00:30
@davecgh davecgh force-pushed the stdscript_script_to_addr_conversion branch from 272632d to 752659a Compare November 18, 2021 18:08
@davecgh davecgh force-pushed the stdscript_script_to_addr_conversion branch from 752659a to c7ff884 Compare November 18, 2021 18:21
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 davecgh force-pushed the stdscript_script_to_addr_conversion branch from c7ff884 to 165730f Compare November 18, 2021 18:24
@davecgh davecgh merged commit 165730f into decred:master Nov 18, 2021
@davecgh davecgh deleted the stdscript_script_to_addr_conversion branch November 18, 2021 18:29
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.

5 participants