Skip to content

Introduce PsbtSigHashType#779

Merged
dr-orlovsky merged 2 commits intorust-bitcoin:masterfrom
sanket1729:psbt_ecdsa_sighash_ty
Jan 14, 2022
Merged

Introduce PsbtSigHashType#779
dr-orlovsky merged 2 commits intorust-bitcoin:masterfrom
sanket1729:psbt_ecdsa_sighash_ty

Conversation

@sanket1729
Copy link
Copy Markdown
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
Copy Markdown
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 :)

We do not want to imports from within the lib and external of lib in the
same line
@sanket1729 sanket1729 force-pushed the psbt_ecdsa_sighash_ty branch from 9aad350 to ebdeed0 Compare January 14, 2022 00:09
Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@dr-orlovsky dr-orlovsky merged commit a2da9f5 into rust-bitcoin:master Jan 14, 2022
@dr-orlovsky
Copy link
Copy Markdown
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
moonman889 added a commit to moonman889/interbtc-clients that referenced this pull request Sep 15, 2025
neon-rider578 added a commit to neon-rider578/interbtc-clients that referenced this pull request Sep 30, 2025
stack-sage7291 added a commit to stack-sage7291/interbtc-clients that referenced this pull request Dec 11, 2025
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.

4 participants