-
Notifications
You must be signed in to change notification settings - Fork 39
Use forfeit pubkey in batch out sweep closure and checkpoint tapscript #732
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughRewires forfeit vs signer key usage across core, builder, wallet, tests and bumps github.com/arkade-os/go-sdk version in two go.mod files; key retrieval and signing now use wallet/GetForfeitPubkey and forfeit private key in LP mode where applicable. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Core as Core Service
participant Builder as Tx Builder
participant Wallet as Wallet
participant Chain as Bitcoin Network
Note over Core,Builder: Finalization and sweep now use forfeit key paths
Core->>Builder: BuildCommitmentTx(forfeitPubkey, ...)
Builder-->>Core: PSBT (commitment)
Core->>Builder: BuildSweepTx(PSBT)
Builder->>Wallet: GetForfeitPubkey()
Wallet-->>Builder: forfeitPubkey
Builder->>Wallet: SignTransactionTapscript(PSBT, forfeit context)
Wallet-->>Builder: Signed PSBT
Builder-->>Core: Sweep TX
Core->>Wallet: SignTransaction(PSBT, mode)
alt SignModeLiquidityProvider
Wallet->>Wallet: signingKey = keyMgr.forfeitPrvkey
else other modes
Wallet->>Wallet: signingKey = SignerKey
end
Wallet-->>Core: Signed PSBT
Core->>Chain: Broadcast TX
Chain-->>Core: TXID / result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🧬 Code graph analysis (1)test/e2e/utils_test.go (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK but would be good to have e2e test where we explictly verify this is correct in all locations during operation
This makes sure that when any output is swept onchain, funds go back to the liquidity provider and not to the signer, which is an entity that is not expected to own onchain funds; rather, it just cosigns vtxos.
Summary by CodeRabbit
Bug Fixes
Refactor
Chores