-
Notifications
You must be signed in to change notification settings - Fork 645
Add CBech32Data #154
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
Add CBech32Data #154
Conversation
|
Looks like a good start! We should think how we can present a decent API for this, along the lines of the existing |
| BASE58_PREFIXES = {'PUBKEY_ADDR':111, | ||
| 'SCRIPT_ADDR':196, | ||
| 'SECRET_KEY' :239} | ||
| BECH32_HRP = 'tb' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be bcrt for regtest
|
Yo @petertodd, can you make @dgpv or @Simplexum co-maintainer of this library? |
|
Not applicable, as explained in Simplexum#17 (comment) - I am not willing to maintain original library, only our derivative library, that have reduced scope. |
1547251 Bitcoin's default Regtest bech32 HRP is 'bcrt' not 'tb' (John Villar) e8d2037 Add tests (genme) 542ac35 Add python2 support to CBech32BitcoinAddress (genme) e872989 add str() tests for P2WPKHBitcoinAddress and P2WSHBitcoinAddress (Dmitry Petukhov) 7c2b4e1 add Bech32-encoded address support (Dmitry Petukhov) 737380e Add python2 support to bech32 (Martino Salvetti) 01083b7 Add BECH32_HRP in network parameters (Martino Salvetti) dfaa0c2 Add Bech32 encoding/decoding; add CBech32Data (Martino Salvetti) Pull request description: Add Bech32-encoded address support This is based on #154 Introduce CBase58Address and CBech32Address make CBitcoinAddress a wrapper that returns CBase58Address or CBech32Address depending on input data introduce to_redeemScript() method, because for P2WPKHBitcoinAddress redeem script is not the same as scriptPubKey. unfortunately, for P2WSHBitcoinAddress to_redeemScript() cannot be implemented, as we need all pubkeys for that, and not only the hash. Top commit has no ACKs. Tree-SHA512: c2ea9a690c5f1a3d4f6f5d043396e8265adcfa0dc582daafb122a3f56e7eda2656051a07c294ea377034a221d83cb7864bc57265be0d02903f002412d86e384c
|
This was merged via #189 |
The CBech32Data class implements an interface similar to CBase58Data, it encapsulates the python reference implementation of bech32 addresses.