feat: capture bond registration BTC/sBTC lockup data#2579
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
@stacks/codecregister-for-bondevent now carries BTC/sBTC lockup provenance (btc_lockup), describing how a participant locked the BTC backing their bond registration — either a proven Bitcoin L1 lockup (with a list of proven outputs) or an sBTC ("l2") lockup. This PR captures that data end-to-end and exposes it through the bond registration endpoints.Motivation: the codec upgrade added
btc_lockupto the register-for-bond event; without ingesting it we lose the lockup type and the proven L1 outputs.What changed:
btc_lockupon the register-for-bond event.bond_registrations):btc_lockup_type(asmallintbacked by the newDbBondLockupTypeenum —L1 = 0,L2 = 1, mirroringDbTxTypeId/DbPrincipalBondPositionStatus) andbtc_lockup_txs(jsonb, the proven L1 outputs;nullfor sBTC).is_l1_lockcolumn (fully encoded bybtc_lockup_type).bond_registrationsrow whose canonical flag is already flipped during reorgs.GET /staking/bonds/:index/registrations(list) returns a lightweight summary (signer,staker,type,balances) — no per-lockup transaction details.GET /staking/bonds/:index/registrations/:principal(detail) returns the full registration as a union: anl1_lockupvariant (transactions: [{ tx_id, output_index }]) or anl2_lockupvariant (tx_id).Impact on app developers: the registration list response is now a summary (lockup
typeonly); the per-principal endpoint carries the lockup details.is_l1_lockis replaced bybtc_lockup.type/ thetypefield.Type of Change
Does this introduce a breaking change?
This targets the unreleased
pox5branch. Within that line it reshapes the bond registration responses (summary vs detail) and removesis_l1_lockin favor ofbtc_lockup.type.Are documentation updates required?
Testing information
tests/api/pox5/bonds.test.tssuite (block ingestion viaTestBlockBuilder→ API assertions).pg-write-store),bond_registrationsschema/migration, bond registration read methods + serializers + API schemas.npm run test:api:pox5(bonds suite: 17/17 passing).btc_lockup_txsjsonb column is returned as a string by the pg driver and is parsed on read; the list endpoint must still select the cursor columns for pagination.Checklist
npm run testpasses (pox5 api suite)🤖 Generated with Claude Code