Skip to content

Support composing large modules across multiple transactions (multisig + Taproot) #485

Description

@ltardivo

Problem

When using the multisig module type specifier, the entire module must fit inside a single transaction. This creates a hard size limit that is significantly lower than what is practical for many real-world modules.

Even on chains that support Taproot (where we currently have a tested limit of roughly ~400 KB), very large modules can still become problematic. On older chains that only support classic multisig, the limit is much more restrictive (arround 12K to 18K).

As a result, any module that exceeds the per-transaction size limit cannot be deployed today, even if the logic itself is perfectly valid.

Desired Solution

We need a clean way to split a large module into multiple smaller modules, deploy each of them in separate transactions, and then compose / load them together so that they behave as a single logical module at runtime.

The solution should:

  • Work with the existing multisig module type
  • Also work cleanly with Taproot modules (for future-proofing and for chains that support larger scripts)
  • Allow developers to declare dependencies between the split modules
  • Make the composition transparent to the rest of the application code as much as possible
  • Be supported natively by the Bitcoin Computer library (rather than requiring ad-hoc workarounds in every application)

See here for an example: https://docs.bitcoincomputer.io/tutorial/#module-system

Goals / Acceptance Criteria

  • Provide a clear API or convention for splitting a large module into multiple deployable pieces
  • Support loading and composing those pieces so they act as one module
  • Document the pattern (including an example)
  • Include integration test for large modules. Ensure the approach works for both multisig and Taproot module types
  • Keep the developer experience as simple as possible

Metadata

Metadata

Assignees

No one assigned

    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