Skip to content

p2sh and p2tr for pset#15

Draft
topologoanatom wants to merge 2 commits intodevelopmentfrom
script-types
Draft

p2sh and p2tr for pset#15
topologoanatom wants to merge 2 commits intodevelopmentfrom
script-types

Conversation

@topologoanatom
Copy link
Collaborator

Changes

Add P2SH and P2TR transactions to service

@topologoanatom topologoanatom self-assigned this Mar 18, 2026
@ivanlele ivanlele self-requested a review March 19, 2026 09:14
})
}

fn sign_p2wsh(
Copy link
Collaborator

Choose a reason for hiding this comment

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

sign_p2wsh and sign_p2sh are almost identical. We can merge them and only apply different logic where required by the type.

.with_state(signer_state)
}

pub enum SpendType {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can figure out this by looking at Script.
Script::is_v0_p2wsh()
Script::is_p2sh()
Script::is_v1_p2tr()

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a parameter to the demo script that specifies the redeem script type. Run them for all 3

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.

2 participants