Parent epic: #1633
Summary
Generalize PeginManager.preparePegin to accept multiple vault providers in one call. Today it accepts vaultProviderBtcPubkey: string (singular); needs to accept an array of providers and produce per-provider HTLC outputs while keeping the shared Pre-PegIn structure intact.
This is the foundation for the entire batch-vault-creation initiative — every other ticket in #1633 depends on this landing.
Scope
- Extend
PreparePeginParams with vaultProviders: { address: string; btcPubkey: string }[] (deprecate the singular field; keep a single-element-array shim for one release).
- Update
preparePegin() to loop sizing + commitment construction per provider while keeping the shared Pre-PegIn output structure intact.
- Return:
{ perProvider: { provider: Address; transaction: PreparePeginTransaction }[] }.
- Per CLAUDE.md §4: vault-secret derivation is per-vault, so each provider's vault gets its own root derivation. Add a two-vault test across distinct providers with overlapping funding inputs (mandatory per §4).
Files
packages/babylon-ts-sdk/src/tbv/core/managers/PeginManager.ts
packages/babylon-ts-sdk/src/tbv/core/primitives/psbt/pegin.ts (only if build helpers need adjusting)
Acceptance
- Unit test: single-provider call produces output byte-identical to the current single-provider flow.
- Unit test: two providers with overlapping funding inputs produce distinct vault roots (CLAUDE.md §4 two-vault test requirement).
- All existing pegin tests pass unchanged.
- Golden vectors in this repo and
btc-vault re-verified.
Dependencies
None — this is foundational.
Parent epic: #1633
Summary
Generalize
PeginManager.preparePeginto accept multiple vault providers in one call. Today it acceptsvaultProviderBtcPubkey: string(singular); needs to accept an array of providers and produce per-provider HTLC outputs while keeping the shared Pre-PegIn structure intact.This is the foundation for the entire batch-vault-creation initiative — every other ticket in #1633 depends on this landing.
Scope
PreparePeginParamswithvaultProviders: { address: string; btcPubkey: string }[](deprecate the singular field; keep a single-element-array shim for one release).preparePegin()to loop sizing + commitment construction per provider while keeping the shared Pre-PegIn output structure intact.{ perProvider: { provider: Address; transaction: PreparePeginTransaction }[] }.Files
packages/babylon-ts-sdk/src/tbv/core/managers/PeginManager.tspackages/babylon-ts-sdk/src/tbv/core/primitives/psbt/pegin.ts(only if build helpers need adjusting)Acceptance
btc-vaultre-verified.Dependencies
None — this is foundational.