Skip to content

Rework transaction input/output types#3055

Closed
sstone wants to merge 2 commits intotaproot-helpersfrom
taproot-helpers-rework
Closed

Rework transaction input/output types#3055
sstone wants to merge 2 commits intotaproot-helpersfrom
taproot-helpers-rework

Conversation

@sstone
Copy link
Member

@sstone sstone commented Apr 3, 2025

We define:

  • a new output type with subtypes for segwit and taproot outputs
  • a new input type, that includes one of these output types and specifies how to spend it

We define:
- a new output type with subtypes for segwit and taproot outputs
- a new input type, that includes one of these output types and specifies how to spend it
@sstone sstone requested a review from t-bast April 3, 2025 13:56
@t-bast
Copy link
Member

t-bast commented Apr 4, 2025

I don't think that is sufficient: this doesn't let you get rid of the case _ => throw in every addSigs function. We can express exactly what kind of redeem paths are possible for each transaction type: it's a bit inelegant because Scala 2 does not support union types (which Scala 3 supports) but it works and is IMO better than what is done in this PR.

I've made this refactoring in #3056: it took me a while to iterate until I had something that I think is flexible enough and future-proof. I think it should be quite simple to rebase the taproot-helpers function on top of this refactoring and would provide a better architecture, let me know what you think!

@t-bast
Copy link
Member

t-bast commented May 7, 2025

I think we should be able to close this in favor of PRs on top of #3074 or #3075?

@sstone
Copy link
Member Author

sstone commented May 7, 2025

Closed in favour of #3075

@sstone sstone closed this May 7, 2025
@sstone sstone deleted the taproot-helpers-rework branch May 7, 2025 15:20
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