-
Notifications
You must be signed in to change notification settings - Fork 50
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 segwit API #120
Add segwit API #120
Conversation
4a50ff2
to
db7144e
Compare
3c7e229
to
d45699f
Compare
Hey @apoelstra check this out, its so-hot-right-now :) |
Nice! d45699f looks pretty good. I have some nits about the comments, mainly. Think this can be undrafted. |
Cool, I'll go over it again today (after I fix the uppercase QR code thing) and undraft. Want to put this in before the alpha release? |
Yeah, let's get it in before alpha. We're pretty close. |
d45699f
to
004261a
Compare
004261a
to
047a29e
Compare
Add a segwit API with the aim that "typical" modern bitcoin usage is easy and correct.
047a29e
to
6c1379b
Compare
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.
ACK 6c1379b
Thanks for the review @clarkmoody! |
d79984d
to
bcc8506
Compare
src/segwit.rs
Outdated
encode(hrp, segwit::VERSION_0, witness_program) | ||
} | ||
|
||
/// Encodes a segwit version 1 address. | ||
#[cfg(feature = "alloc")] | ||
pub fn encode_v1(hrp: &Hrp, witness_program: &[u8]) -> Result<String, EncodeError> { | ||
encode(hrp, segwit::VERSION_1, witness_program) |
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.
No need for segwit::
scoping here.
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.
I umm'ed and ahhh'ed about that line, whether the "segwit" added anything, will remove.
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.
ACK bcc8506
Add two field element consts for segwit version 0 an version 1. This makes reading the code much easier since one does not have to remember p ad q.
bcc8506
to
024ed01
Compare
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.
ACK 024ed01
Add a
segwit
API with the aim that "typical" modern bitcoin usage is easy and correct.Done in a separate module so as not to impact the main crate API.