Skip to content

feat: SamRock Protocol support for BTCPay Server#2005

Open
RenAndKiwi wants to merge 4 commits into
SatoshiPortal:developfrom
RenAndKiwi:feature/samrock-protocol
Open

feat: SamRock Protocol support for BTCPay Server#2005
RenAndKiwi wants to merge 4 commits into
SatoshiPortal:developfrom
RenAndKiwi:feature/samrock-protocol

Conversation

@RenAndKiwi
Copy link
Copy Markdown

Summary

  • Add SamRock Protocol integration allowing BTCPay Server to generate payment addresses from the user's Bull Bitcoin wallet descriptor
  • Accept both BTCPay Server (btc-chain, liquid-chain, btc-ln) and Aqua (btc, lbtc, btcln) URL formats
  • Add SamRock entry in Settings screen
  • Add paste input alongside QR scanner for URL entry

Test plan

  • Tested with live BTCPay Server at btcpay.bitcoinbutlers.com
  • Verified invoice payment address matches Bull Bitcoin wallet receive address
  • All 16 unit tests pass

RenAndKiwi and others added 4 commits April 3, 2026 10:51
Implement SamRock Protocol to enable one-scan merchant setup between
Bull Bitcoin wallet and BTCPay Server. Scanning a SamRock QR code
from BTCPay extracts the wallet's public descriptors (BTC, Liquid,
Lightning/Boltz) and POSTs them to configure the store.

Feature structure (clean architecture):
- Domain: entities, repository contract, usecase
- Data: HTTP datasource (HTTPS-only), repository impl
- Presentation: Cubit with freezed state management
- UI: QR scanner, confirmation screen, success/error views
- Tests: 18 unit tests for URL parsing and payload construction

Security: only public descriptors shared, HTTPS enforced,
user confirmation required before POST, server URL displayed.

Requires: SamRock Protocol plugin on BTCPay Server, Boltz plugin
for Lightning support.

Closes: Bull Bitcoin SamRock integration (roadmap item)
BTCPay Server sends btc-chain/liquid-chain/btc-ln in setup URLs,
while Aqua uses btc/lbtc/btcln. Accept both formats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SamRock link in Settings screen
- Add PasteInput widget to QR scanner view for URL pasting
@BullishNode
Copy link
Copy Markdown
Contributor

The samrock protocol normally specifies to create a seperate Liquid Wallet other than the main one (in our case the instant payment wallet). This should be considered as part of our multi-wallet feature.

@RenAndKiwi
Copy link
Copy Markdown
Author

Thanks for the feedback @BullishNode.

We looked into creating a separate Liquid wallet for SamRock. The issue is that lwk.Descriptor.newConfidential() only takes mnemonic + network — it always derives account index 0 (m/84'/1776'/0'). There's no way to create a second Liquid wallet at account index 1 through the current LWK API.

Two options we see:

  1. Derive a confidential descriptor at account index 1 outside LWK (manual BIP32 + SLIP77 blinding key derivation), then import it as a watch-only wallet via createPublicWallet. Label it "BTCPay - {serverHost}".

  2. Wait for multi-wallet support — if you already have a pattern planned for creating purpose-specific Liquid wallets with custom account indices, we'd rather align with that.

Does LWK support account index selection that we're missing, or do you have a preferred approach in the multi-wallet roadmap?

@BullishNode
Copy link
Copy Markdown
Contributor

We have a specific approach for multiwallet roadmap we are working on, we will keep you posted. Thanks for the PR! Let's consider that multiwallet feature is a prerequisite for Samrock

@kiwihodl
Copy link
Copy Markdown

@BullishNode should we close this now as this (rockstardev/SamRockProtocol#10) got added and merged?

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.

3 participants