0

I was reading about offline transactions.

Say I have an app that allows users to transfer SOL offline. What if a user makes a send sol tx and signs it offline?

What if he chooses to not broadcast his transaction and instead chooses to open his account in another wallet? I am assuming that his balance will be restored from the previous state in which he was online.

What if in this new wallet, he spends the funds and then broadcasts the offline tx after this?

Is there a way I can mitigate this? on-chain?

1 Answer 1

2

The transaction is not known to the network until it's broadcasted to the network. So, the sequence of the signature signing is irrelevant. What matters is when the transaction was broadcasted.

If an offline transaction is broadcasted, assuming its blockhash is still valid, after another transaction, it will be considered to have happened after the newer transaction.

The transaction which is broadcasted first will change the state first and if there are no more SOL to spend for the offline transaction which is broadcasted later, it will fail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.