-
Notifications
You must be signed in to change notification settings - Fork 620
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
Make PublicKey API consistent #554
Comments
It is not expensive at all, it is basically a memcpy for the uncompressed serialization and a check of one bit for the compressed serialization. What is your proposed function signature for a |
Right, I see: the length of byte array will be different (depending on the key compression) and we can't have two functions since bitcoin key must force compressed/uncompressed state... But this is really so frustrating and confusing all the time... Now, when we have a dedicated xcoord-only public key, may be we need to transform In general it seems really inconvenient that we have a lot of places where we can't accept uncompressed keys (everything segwit-related) and need to return |
Definitely agree, it would be nice if we could somehow enforce this at the type level. |
Had a private IRC chat with @sgeisler and at the end decided to publish it to GitHub: 20:56 sgeisler: Also: do we actually know if ECDSA and schnorr mixed usage is insecure? I was under the impression that we simply son't know … |
It's not clear to me at all why we'd have to "rewrite 80% of rust-bitcoin". We just need to
Yes rust-miniscript will require more invasive changes. Probably This whole situation is way simpler than the uncompressed/compressed/hybrid situation because xonly keys can be used if and only if you are in a Taproot context; they have a fixed length; there are no kinds of x-only pubkeys which have no corresponding private key; etc etc. |
Replaced with #588 |
at least expose
serialize
method additionally towrite_into
.Original discussion: rust-bitcoin/rust-miniscript#225 (comment)
Maybe we can go even further and rename confusing
serialize
method in rust-secp256k1 intoto_bytes
method (I assume it is computationally expensive since it calls to C FFI working with internal public key representation).The text was updated successfully, but these errors were encountered: