coral-xyz / backpack

🎒 Next level crypto wallet
https://backpack.app
GNU General Public License v3.0
1.38k stars 824 forks source link

Add ability to deserialized partially signed transactions #1258

Open hkirat opened 2 years ago

hkirat commented 2 years ago

We'll probably have to re-write a custom deserializer similar to - https://github.com/solana-labs/solana-web3.js/blob/dee241d7211a5e592d4bcccd23e8a3399087af7b/src/transaction/versioned.ts#L78

To explain the problem better - All of our transaction messages (sign, sendAndConfirm...) send transactions to the background after serialising it to a string. On the other side (in the service worker), we try to deserialize this transaction string back to a VersionedTransaction. Unfortunately deserializing only works if either everyone has signed the transaction or no one has (ref https://github.com/solana-labs/solana-web3.js/blob/dee241d7211a5e592d4bcccd23e8a3399087af7b/src/transaction/versioned.ts#L27 )

armaniferrante commented 2 years ago

Idea: We could deserialize it with no signatures and then add the partial signatures one by one?

armaniferrante commented 1 year ago

p3. Let me know if you disagree @hkirat.