Skip to content
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

Introduce PsbtSigHashType #779

Merged
merged 2 commits into from Jan 14, 2022

Conversation

sanket1729
Copy link
Member

@sanket1729 sanket1729 commented Jan 13, 2022

We cannot really use Psbt for taproot because the sighash type is currently EcdsaSigHashType. We could introduce an enum with two options but then deser is not really clear, so I chose the approach in the current PR. Feedback or other ways to do this welcome :)

This is NOT related to #776

@sanket1729 sanket1729 mentioned this pull request Jan 13, 2022
20 tasks
@sanket1729 sanket1729 added this to the 0.28.0 milestone Jan 13, 2022
Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor suggestions :)

src/util/psbt/map/input.rs Outdated Show resolved Hide resolved
src/util/psbt/map/input.rs Outdated Show resolved Hide resolved
src/util/psbt/map/input.rs Outdated Show resolved Hide resolved
We do not want to imports from within the lib and external of lib in the
same line
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK ebdeed0

I was a little hesitant about this PR, but I think it makes sense. The type of the sighash in PSBT is little more than a bytestring, and I think this is the right way to represent it in rust-bitcoin.

@dr-orlovsky dr-orlovsky added this to In progress in PSBT via automation Jan 14, 2022
@dr-orlovsky dr-orlovsky added this to In review in Taproot Jan 14, 2022
Taproot automation moved this from In review to Ready for merge Jan 14, 2022
Copy link
Collaborator

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK ebdeed0

Do not want to bikeshedd about method names, just left a note which can be applied only if there will be re-base or other updates

}

/// Obtains the inner sighash byte from this [`PsbtSigHashType`].
pub fn inner(self) -> u32 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: probably as_u32 will be better, because it is not clear what is the inner type for PSBT sighashes. Also inner is quite uncommon, usually it is as_inner or into_inner.

Also as_u32 will match methods in EcdsaSigHashType

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it for some of the follow-up PRs

PSBT automation moved this from In progress to Ready for merge Jan 14, 2022
@dr-orlovsky dr-orlovsky merged commit a2da9f5 into rust-bitcoin:master Jan 14, 2022
Taproot automation moved this from Ready for merge to Done Jan 14, 2022
PSBT automation moved this from Ready for merge to Done Jan 14, 2022
@dr-orlovsky
Copy link
Collaborator

Ok, I was the second reviewer, so I tested it on my machine with a test build script on each of the commits and merged.

sander2 added a commit to sander2/polkabtc-clients that referenced this pull request Oct 6, 2022
sander2 added a commit to sander2/polkabtc-clients that referenced this pull request Oct 6, 2022
sander2 added a commit to sander2/polkabtc-clients that referenced this pull request Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
PSBT
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants