WietseWind / xrpl-accountlib

XRPL Account helper: generation, derivation and signing (family seed, mnemonic, passphrase)
MIT License
27 stars 12 forks source link

Option to chain signing. #309

Closed shortthefomo closed 2 years ago

shortthefomo commented 2 years ago

I would like to pass the transaction to be signed between contracts.

something like

const Tx = {...}

let partially_signed = lib.sign(Tx, account1)
// here at this  point can pass this partially signed tx to the next contract
partially_signed  = lib.sign(partially_signed, account2)
// here at this  point can pass this partially signed tx to the next contract again..
partially_signed  = lib.sign(partially_signed, account3)
// then once my quorum weight is over the requirement I can then submit.

basically the partially signed tx is passed between contracts. this is not security issue like passing private keys between contracts. then once enough contracts have signed and quorum weight is sufficient I can then pass it to the xrpl-client and submit it.

I've been going over all the snippets I can find here, possibly I just missed how todo this here?

WietseWind commented 2 years ago

A sample can be found here: https://github.com/WietseWind/xrpl-accountlib/blob/master/samples/multisign.js

You can sign with an array of signed transactions, the outcome is the combined transaction. Which can then be combined again or submitted directly.