Skip to content

sign_psbt should be told what policy to sign for. #15

@darosior

Description

@darosior

This was reported to me by @bigspider, and i think it makes sense. Copy paste of the report follows.

async fn sign_tx(&self, tx: &mut Psbt) -> Result<(), Error>;

I think you shouldn't abstract the policy in the HWI trait; sign_psbt without specifying what policy you're signing with puts the burden of figuring it out to the library.
But the caller of sign_psbt always knows which policy you're signing with.
if you have multiple inputs with different policies, most likely it's going to be from different signers − so multiple calls to sign_psbt with different policies
sure, one might imagine signing with multiple policies at the same time (if they are all controlled by the same hardware wallet), but I wouldn't bother yet, can generalize in the future

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions