Skip to content

Conversation

@tee8z
Copy link
Contributor

@tee8z tee8z commented Jan 10, 2026

I added this interface into the project so I can hook it up with the keymeld project I've been working on. Since keymeld is a centralizing force, I am trying to communicate this is not the preferred approach. This api, of exposing the data to be signed, makes it easier to use this project with an HSM as well. If you hate this idea and don't want to merge this into main I completed understand and will maintain this change on a fork.

Summary

This PR adds an external signing API that allows users to integrate DLC signing with external systems like HSMs, secure enclaves, or signing services (e.g., keymeld).

Changes

  • src/signing.rs: New module with SigningData struct containing:

    • Outcome transaction sighashes (for both attestation and expiry outcomes)
    • Adaptor points for attestation outcomes (derived from oracle locking points)
    • Split transaction sighashes for each win condition
    • Aggregate public keys for both funding and split transactions
  • src/lib.rs: Exports the new signing module and integrates SigningData generation into the existing API

  • src/regtest.rs: Added comprehensive tests for the external signing workflow

Use Cases

This API is useful when you need to:

  • Sign DLC transactions using an external HSM or secure enclave
  • Use a custom MuSig2 implementation
  • Batch multiple DLC signatures into a single signing session

Design Notes

  • For most use cases, the existing SigningSession state machine remains the preferred approach
  • The new API provides all necessary sighashes and metadata for external signers

@conduition
Copy link
Owner

Thank you for this pull, I think this is a great idea. I've got some catch-up to do from the holidays but I'll try to review this once I have some time. At a glance, your approach looks straightforward and I can't foresee any big changes, but i'll take a closer look soon 👍

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.

2 participants