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

chore: should we remove unused SignerError variants ? #1484

Open
Tracked by #1619
oleonardolima opened this issue Jun 21, 2024 · 7 comments
Open
Tracked by #1619

chore: should we remove unused SignerError variants ? #1484

oleonardolima opened this issue Jun 21, 2024 · 7 comments
Labels
api A breaking API change module-wallet new feature New feature or request
Milestone

Comments

@oleonardolima
Copy link
Contributor

oleonardolima commented Jun 21, 2024

Describe the enhancement

As noticed in #1448 and #1424 there are some unused error variants on SignerError

Use case

Do we need such variants, e.g sighash::TaprootError, transaction::TxInputsIndexError, or should it be merged with InputIndexOutOfRange (for example) ?

Additional context

Issue meant for related discussion.

@oleonardolima oleonardolima added the new feature New feature or request label Jun 21, 2024
@ValuedMammal
Copy link
Contributor

Do you want to make this into a super issue to figure out further improvements to the signer module as a whole?

@oleonardolima
Copy link
Contributor Author

oleonardolima commented Jun 22, 2024

Do you want to make this into a super issue to figure out further improvements to the signer module as a whole?

That could work, I don't see a problem doing it that way.

You mean also considering Steve's comments?

@notmandatory notmandatory added this to BDK Jun 23, 2024
@notmandatory notmandatory moved this to Discussion in BDK Jun 23, 2024
@notmandatory notmandatory added this to the 1.0.0-alpha milestone Jun 23, 2024
@notmandatory notmandatory added module-wallet api A breaking API change labels Jun 23, 2024
@LLFourn
Copy link
Contributor

LLFourn commented Jun 24, 2024

Do you want to make this into a super issue to figure out further improvements to the signer module as a whole?

The end goal is to remove the Signer trait and to remove Signers from wallet in favor of a library that helps you sign PSBTs with whatever key material you have. I think we'll tackle this during transaction building which comes in v2.

@nondiremanuel nondiremanuel modified the milestones: 1.0.0-alpha, 1.0.0-beta Jun 25, 2024
@ValuedMammal
Copy link
Contributor

Playing with the idea of removing signers from the Wallet structure, I naively imagined simply adding a signer parameter to the Wallet::sign method thinking the user could construct their own SignersContainer just before signing. I realized that the wallet signers are used in create_tx in order to extract_policy which itself is somewhat of a rabbit hole, although it's curious that extracting a policy seems to works fine even when the wallet has no signers.. so maybe there's a way to disentangle that logic. Anyway I see this issue being related to the policy vs plan discussion, which in turn implies a tx-builder redesign. Still brainstorming ways to divide the problem into chunks we can easily tackle.

Regarding the proposal to remove the TransactionSigner trait, I think that would also simplify the whole concept of SignersContainer. Maybe we keep a sign method on Wallet that takes in a keymap or similar and internally calls Psbt::sign.

@notmandatory
Copy link
Member

Ok to remove this from 1.0.0-beta milestone? Based on above it sounds like this should likely be fixed in a 2.0 release when signer is removed from wallet.

@oleonardolima
Copy link
Contributor Author

Ok to remove this from 1.0.0-beta milestone? Based on above it sounds like this should likely be fixed in a 2.0 release when signer is removed from wallet.

Yes, as Lloyd and Mammal mentioned above it'll probably rely on TxBuilder redesign, which is already intended for v2 (please correct me if I'm wrong). Also, do we already have an issue for that?

@ValuedMammal
Copy link
Contributor

Ok to remove this from 1.0.0-beta milestone? Based on above it sounds like this should likely be fixed in a 2.0 release when signer is removed from wallet.

Yes, as Lloyd and Mammal mentioned above it'll probably rely on TxBuilder redesign, which is already intended for v2 (please correct me if I'm wrong). Also, do we already have an issue for that?

These are some tx-builder issues that I'm aware of #899 #988

@notmandatory notmandatory removed this from the 1.0.0-beta milestone Sep 26, 2024
@notmandatory notmandatory added this to the 2.0.0 milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api A breaking API change module-wallet new feature New feature or request
Projects
Status: Discussion
Development

No branches or pull requests

5 participants