Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: Update Signing Message for Funding Lock and Commitment Lock (with Pending HTLC) #17

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jjyr
Copy link

@jjyr jjyr commented Mar 7, 2025

This PR update the signing message of funding lock and commitment lock(with pending htlc).

In the original code, the signing message was tx_hash. This approach faces challenges during script upgrades because the cell_dep field in the transaction became invalid, which causes the entire transaction invalid.

To resolve this, we introduce a new signing message format that excludes cell_dep and other fields, ensuring compatible across script cell upgrades. The new message computed as follows:

  1. Hashing Inputs: iterate all inputs and hash the outpoint (32 bytes each).
  2. Hashing Outputs: For each output, hash:
    1. cell output (molecule serialized cell output structure),
    2. data len (4 bytes, length of the output data, little endian encoding),
    3. data (the actual output data).

The resulting hash is the signing message.

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