Solana: Can't bundle AfterSignature and ApplySignature instructions in single transaction

Created on 17 Oct 2018  ·  9Comments  ·  Source: solana-labs/solana

Problem:
Can't currently implement multisig in a single transaction.

Proposed solution:
Change Transaction's signature: Signature to signatures: Vec<Signature>. Sigverify should use the first signatures.len() of account_keys for the respective pubkeys.

TODO: Decide if the signed data should be the same for all signatures, or if all signatures after the first simply sign the first signature. I don't have a strong opinion, but signing the first signature is what Budget's ApplySignature currently expected.

TODO: Does that rule about the first signatures.len() keys being signed create any problems? Does it alleviate the need for an instruction to specify signed_account_keys?

Most helpful comment

Regarding the first TODO, we're leaning toward signing the same data in every signature and not signing the first signature (or any sort of stacking). That way all signatures can be generated concurrently.

All 9 comments

@aeyakovenko, @mvines, comments on the TODOs?

@sakridge, once we have the details pinned down, would you mind making the change to sigverify for us?

@garious that works! Since instruction accounts are just offsets you can mix and match whichever you want.

@sakridge can you generalize the interface to the gpu to take a blob of data and arrays of sigs and key and data offsets into the blob?

We might need to “type” the signatures eventually. BLS signatures combine the data into one sig to save space

Regarding the second TODO, I think we only need to add a signed field to KeyedAccount.

Regarding the first TODO, we're leaning toward signing the same data in every signature and not signing the first signature (or any sort of stacking). That way all signatures can be generated concurrently.

Assigning to @sakridge as it seems like generalizing the sigverify interface is the next step here.

@sakridge - is this something doable this week, or should we punt this issue from v0.10?

@mvines it should be doable, let me prioritize this work.

@sakridge, how's this one looking? Can we plan for it coming in sooner than later or is back on the back burner?

@garious @mvines Should the keys argument to Transaction::new_with_instructions be a slice of Keypair then? keys: &[Keypair] and then it signs with all those keys in the slice?

@sakridge, yes, exactly

Was this page helpful?
0 / 5 - 0 ratings