Skip to content

feat: support delegated MPC with dev single-change behavior - #99

Draft
bandrivskiy wants to merge 5 commits into
devfrom
feat/dfns-embedded
Draft

bandrivskiy wants to merge 5 commits into
devfrom
feat/dfns-embedded

Conversation

@bandrivskiy

@bandrivskiy bandrivskiy commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Support RGB transfers with delegated Dfns wallets

Summary

Enable the delegated Dfns flow to fund Internal once, prepare External RGB UTXOs, receive through blind invoices and send repeatedly from RGB change. Bitcoin keys remain with the provider; delegated authorization is handled outside the library.

Changes

  • Reuse the active SQLite transaction during MPC address registration, balance queries and transaction preparation to avoid nested-connection hangs.
  • Complete create_utxos_begin / create_utxos_end for provider addresses: protect RGB and reserved inputs, register the resulting External outputs and preserve spent state when completion is repeated.
  • Persist complete RGB send input reservations across restarts, including fee inputs when the original PSBT file is missing. Expose pending BTC transaction listing and cancellation for MPC callers.
  • Track and select RGB allocations on Internal change so subsequent sends can spend them. Exclude RGB-bearing and reserved UTXOs from ordinary BTC funding.
  • Skip recipient updates for unrelated contracts carried forward by a transfer, and encode BFA fungible amounts correctly in receive invoices.

Compatibility

Preserve the existing MPC policy of one Internal change output carrying BTC and any RGB remainder, along with the six colored/vanilla BTC balance fields. Internal outputs carrying RGB remain protected from ordinary BTC spending.

Add the mpc_prepared_inputs database migration for durable send reservations. Legacy prepared transfers still require their original matching PSBT when no complete reservation exists. Keep wallet state and operation records across restarts.

The existing DfnsProvider and MPC PSBT utilities are unchanged. Shared wallet changes cover transaction plumbing, reservation filtering, transfer finalization and the BFA invoice correction. See the flow and validation notes.

@bandrivskiy bandrivskiy changed the title Support durable two-role Taproot RGB wallets feat: support delegated MPC with dev single-change behavior Sep 24, 2026
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.

1 participant