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

Unisat tweaked signer improvement #200

Open
jrwbabylonlab opened this issue Jan 17, 2025 · 0 comments
Open

Unisat tweaked signer improvement #200

jrwbabylonlab opened this issue Jan 17, 2025 · 0 comments

Comments

@jrwbabylonlab
Copy link
Collaborator

Refer to this discussion.

We had a discussion with UniSat about this complex implementation. In general, the tweaked signer should not be used when performing staking transactions because we use the base public key in the timelock script. To unlock the script, the same public key must be used for both signing and verification; otherwise, the transaction will fail on the BTC side.

The current implementation in the PR is correct, as it includes a condition to check if the address is the same as the wallet address before using the tweaked signer. However, this logic should not really reside within the wallet provider. One of the key rules for our provider is that it should function as an “interface exchange,” meaning it should contain minimal business logic.

Here’s what needs to be done or followed up on in this ticket:
1. Follow up with UniSat to see if they can move this logic into their own codebase and expose a parameter for us to use.
2. If the answer is no, add a unit test for this complex method.
3. Add detailed comments explaining each line of the method, as this logic is extremely important.

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

No branches or pull requests

1 participant