Skip to content

feat: Offline multi node signing support #1378

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

Merged
merged 11 commits into from
May 27, 2025
Merged

feat: Offline multi node signing support #1378

merged 11 commits into from
May 27, 2025

Conversation

0xivanov
Copy link
Contributor

@0xivanov 0xivanov commented May 14, 2025

Description:
The SDK currently does not support the use case of multiple signatures for multiple nodes when signing is done offline. Transaction.sign(key) works for multi node, multi sig but not offline. PrivateKey.signTransaction(transaction) supports offline multi sig, but not multi node.
This PR adds 2 new functions:

  1. GetSignableBodyBytes: returns a list of SignableBody objects for each signed transaction in the transaction list.
  2. AddSignatureV2: adds a signature to the transaction for a specific transaction id and node id.
    This is useful for signing chuncked transactions like FileAppendTransaction, since they can have multiple transaction ids.

Proposal reference https://github.com/hiero-ledger/sdk-collaboration-hub/blob/main/proposals/manual-signature-hsm-design-proposal.md

Related issue(s):

Fixes #1050 #1381

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@0xivanov 0xivanov self-assigned this May 14, 2025
@0xivanov 0xivanov added the enhancement New feature or request label May 14, 2025
@lfdt-bot
Copy link

lfdt-bot commented May 14, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@0xivanov 0xivanov changed the title feat: HSM support feat: Offline multi node signing support May 14, 2025
Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 84.70588% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/transaction.go 86.36% 6 Missing and 3 partials ⚠️
sdk/transaction_id.go 77.77% 3 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
sdk/crypto.go 72.75% <100.00%> (+0.04%) ⬆️
sdk/transaction_id.go 58.08% <77.77%> (+2.37%) ⬆️
sdk/transaction.go 69.26% <86.36%> (+0.81%) ⬆️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

0xivanov added 5 commits May 19, 2025 16:12
@0xivanov 0xivanov marked this pull request as ready for review May 20, 2025 12:56
@0xivanov 0xivanov requested review from a team as code owners May 20, 2025 12:56
@0xivanov 0xivanov requested a review from gsstoykov May 20, 2025 12:56
Signed-off-by: Ivan Ivanov <[email protected]>
0xivanov added 2 commits May 27, 2025 08:58
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
@0xivanov 0xivanov merged commit f1941d4 into main May 27, 2025
14 of 15 checks passed
@0xivanov 0xivanov deleted the HSM-signing branch May 27, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi node, multi signature offline signing support
4 participants