8000 [WIP] Expand on #183: Extract network and compressedness from key types by stevenroose · Pull Request #194 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[WIP] Expand on #183: Extract network and compressedness from key types #194

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

Closed
wants to merge 8 commits into from

Conversation

stevenroose
Copy link
Collaborator

This is an attempt to alter #183 to take the network and compressedness properties out of the key types. This effectively creates Bitcoin-util wrappers around the secp256k1 types, which I think is fine.

It defers the network/compressedness decision all the way until an address is actually created and where it has any influence.

dongcarl and others added 4 commits November 15, 2018 13:28
- Rename privkey::PrivKey to privkey::PrivateKey
- Remove unnecessary methods for privkey::PrivateKey
- Modify tests to work with above changes
- Move util::privkey to util::key
- Add PublicKey struct to util::key
- Implement de/serialization methods for util::key::PublicKey
- Switch util::address::Payload::Pubkey variant to wrap
  util::key::PublicKey
- Switch util::address::Address::p*k* constructors to use
  util::key::PublicKey
- Fix tests for aforementioned switch
- Add convenience methods for util::key::PublicKey to
  util::key::PrivateKey conversion
- Switch BIP143 tests to use util::key::PublicKey
Because p2pk addresses are just not a thing.
@dongcarl
Copy link
Member

I'm not sure why compressedness is in a PublicKey and not in a PrivateKey.

@stevenroose
Copy link
Collaborator Author

Yeah I gave up messing with this yesterday 😅 I guess if you just take network out of PrivateKey, you're where I would end up. Closing this.

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.

2 participants
0