Skip to content

[feat] Add PSBT Support to Avian Core. #216

@cdonnachie

Description

@cdonnachie

Feature Request

Describe the Feature Request
Introduce comprehensive BIP 174 Partially Signed Bitcoin Transaction (PSBT) support in Avian Core so hardware wallets, multisig coordinators, and offline signers can interoperate reliably with AVN. Today Avian lacks full PSBT creation, updating, signing, analysis, and GUI inspection, making workflows like watch-only wallets + external signers impossible.

Describe Preferred Solution

  1. Core/Serialization: Port or implement PartiallySignedTransaction structures, serialization/deserialization (magic bytes, key-value maps), and helper methods (AddInput/AddOutput, Merge, Finalize, Analyze) aligned with BIP 174. Ensure Avian-specific transaction flags (assets, scripts) are preserved.
  2. Wallet/RPC: Expose PSBT creator/updater RPCs (createpsbt, walletcreatefundedpsbt, converttopsbt, utxoupdatepsbt, walletprocesspsbt, combine/joinpsbt, analyzepsbt, finalizepsbt). Wallet code should fill UTXO data, HD paths, and produce ready-to-sign PSBTs; RPC inputs/outputs should accept native JSON arrays/objects.
  3. GUI: Add PSBT dialogs in Qt (creator, analyzer, signer) so non-CLI users can load/save PSBT files, inspect inputs/outputs, and copy/paste base64.
  4. Interop/Testing: Include round-trip unit and functional tests covering PSBT creation, funding, signing, and finalization (both AVN and asset transactions). Document workflows in doc/psbt.md.
  5. Future-proofing: Provide hooks for proprietary Avian extensions (asset metadata, verifier strings) without breaking BIP 174 compliance.

Describe Alternatives

  • Keep relying on raw transaction hex and manual signing (limits hardware wallet support, error-prone).
  • Implement only a subset (e.g., creator without updater/signer), but that still blocks multisig/hardware flows and doesn’t align with upstream best practices.

Related Code
Key touch points: src/psbt.h/.cpp (PSBT structs), wallet helpers (src/wallet/psbtwallet.cpp), RPC layer (src/rpc/psbt.cpp), Qt dialogs (src/qt/), and docs/tests (doc/psbt.md, test/psbt_tests.cpp, functional tests under test/functional/).

Additional Context

  • BIP 174 spec: https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
  • Upstream Bitcoin Core provides reference behavior for all RPCs/UI elements; Avian should mirror that while adding asset-specific extensions.
  • This feature unlocks safer signing with hardware wallets, watch-only wallets, air-gapped workflows, and lays groundwork for advanced asset support later.

Metadata

Metadata

Assignees

Labels

backportBitcoin BackportsenhancementNew feature or requestuiUI feature or change

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions