Skip to content

Wallet Hierarchical Script Support #201

@Andre-Diamond

Description

@Andre-Diamond

Multisig Wallet Hierarchical Script Support

Context

We currently build wallets via src/utils/common.ts and use the results across API routes, hooks, and UI. There are three wallet types:

  • Legacy: payment keys only
  • SDK: built using MultisigWallet
  • Summon: uses rawImportBodies.multisig payloads (payment and optional stake scripts)

Summon wallets can include hierarchical native scripts (for example, all wrapping a single atLeast), and may or may not include staking capabilities. We need to correctly parse these scripts, derive addresses, and expose capabilities so all dependent code behaves correctly.

Example imported payment native script (decoded):

{
  "type": "all",
  "scripts": [
    {
      "type": "atLeast",
      "required": 2,
      "scripts": [
        {
          "type": "sig",
          "keyHash": "b8b7d...dfde7"
        },
        {
          "type": "sig",
          "keyHash": "f4755...1faa1"
        },
        {
          "type": "sig",
          "keyHash": "59d8f...60762"
        }
      ]
    }
  ]
}

Desired Behavior

  • Summon wallets should be usable wherever addresses, scripts, or capability detection are required.
  • Hierarchical native scripts should be parsed to extract the effective signing rule and key hashes.
  • Feature flags should be derived from the actual scripts:
    • Payment script always required
    • Staking only when a valid stake script is provided or a stake credential hash is derived
  • UI and API should not assume MultisigWallet exists for Summon wallets.

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions