hedera-sdk-java icon indicating copy to clipboard operation
hedera-sdk-java copied to clipboard

Multi node, multi signature offline signing support

Open jbair06 opened this issue 1 year ago • 1 comments

Problem

Issue is copied from JS SDK, please review the conversation: https://github.com/hashgraph/hedera-sdk-js/issues/2481

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.

Solution

A new object and a couple new methods can solve this situation.

  • Signature/SignatureDictionary - this object can mimic transaction in that it would have sub-signatures, each signature would be tied to a node account id. Or this object could just be a simple { [key: string]: string } dictionary.
  • PrivateKey.sign(transaction) - this function would create the signature object. Goes through all the sub transactions and creates a signature for each.
  • Transaction.addSignature(PublicKey, signature/signatureDictionary) - this function would add each signature in the dictionary to the matching sub-transaction, based on node account id.

Alternatives

No response

jbair06 avatar Sep 03 '24 23:09 jbair06

may I work on this issue @0xivanov

b-l-u-e avatar Apr 25 '25 21:04 b-l-u-e