Note:
This is an issue with the Blocto wallet backend on Flow.
I posted this issue here as there is no public repository for Blocto wallet backend.
Reproduce
- Go to Flow port and add a new key to your Blocto wallet.
- Send any transaction.
- The transaction will fail with an invalid signature error.
Issue
It appears that Blocto assumes that:
- a blocto wallet has only 3 keys and
- all keys are managed by Blocto
Fix
Instead of using keys.last and assuming the key is managed by Blocto, either
- use
keys[2] (when account was created by Blocto)
- or check if the key at a specific index is a managed by Blocto before signing