-
Notifications
You must be signed in to change notification settings - Fork 622
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
Create ecdsa::LegacySignature
and ecdsa::SegwitV0Signature
#1989
base: master
Are you sure you want to change the base?
Conversation
e1dde68
to
59fa30b
Compare
Note that this PR just duplicates the |
Not sure now if this is going in the right direction. |
I think this is going in the right direction. The main difficulty as always is that PSBT (the protocol) commingles these types so we'll need a PSBT-specific enum. Eventually the legacy signature will use legacy keys and segwit signatures will use (compressed only) secp keys, which should also simplify our public key story. |
One observation I have is that these signature types seem to line up with the scriptpubkey/witness/txout-type table that you mentiend in #2084 I wonder if we want to try to create some "output type" trait which uses associated types and constants to capture the workflow here. And we could maybe allow upcasting/downcasting to a "generic" version of the output type and its associated types, for applications like PSBT where things are just byte-serialized. |
Man, I like that idea. |
59fa30b
to
3baa55b
Compare
On ice until next release. |
Create a subdirectory `crytpo/ecdsa` and move `ecdsa.rs` to `ecdsa/mod.rs`. Done in preparation for further improvements to the `ecdsa` module. No other changes.
Move the error code out of the `ecdsa/mod.rs` file and into a private `error` submodule. Add public re-export so this not a breaking change. Code move only plus import/export changes to build cleanly. No other changes.
Create a subdirectory `crytpo/sighash` and move `sighash.rs` to `sighash/mod.rs`. Done in preparation for further improvements to the `sighash` module. No other changes.
Move the error code out of the `sighash/mod.rs` file and into a private `error` submodule. Add public re-export so this not a breaking change. Code move only plus import/export changes to build cleanly. No other changes.
Move the two sighash types (`TapSighashType` and `EcdsaSighashType`) to a `sighash_type` submodule. While we are at it lay the code out with impl blocks below the type definitions as is customary. Code move, re-order, and fix import/export paths only. No other changes.
Add two types - `ecdsa::legacy::Signature` - `ecdsa::segwit_v0::Signature`. Both are just thin wrappers around `ecdsa::Signature`. Do not use the new types anywhere.
3baa55b
to
e4a02aa
Compare
Started in #2154 |
Mad, github is not Linux, I can un-delete things :) |
Draft because on top of #2152, this PR is only the last patch.
This is a re-spin of #1606 since the sighash types were split already since then.
In an effort to further spit up the ECDSA type into legacy and segwit v0 add two new sig types. Currently unused, as it is this does not buy us much but if we would like to re-design our keys with legacy/segwit in mind then this will be needed.