heyy @nerses
Bako wallets are built using predicates, which — despite working similarly to traditional EOAs — have one important limitation: predicates cannot sign messages.
In transactions sent by predicates, the signature is actually provided by a standard EOA, which is part of the predicate’s internal rules.
- Predicates → cannot sign messages.
- EOAs → can sign messages.
If your goal is to recognize and validate a signature made by a predicate, it might be possible, but it’s a complex process — especially if you want to obtain this directly within Sway.
To better understand how Bako wallets work, I recommend reading the BakoSafe proposal:
Revolutionizing Multisig: A Fully Non-Custodial Solution Powered by Fuel Network
An Alternative Approach
One possible approach to work around this limitation could be:
- Deploy a contract that mints an intention token, serving as proof that the vault (predicate) agrees with a given message.
- The token ID could be derived as:
sha256(contract_id, sha256(message+vault_address))
- This token would act as evidence that the message was validated according to the vault’s rules.
- To verify this intention in a future transaction, you would simply include this token as one of the transaction’s inputs.
Within Sway, you could validate that:
- The token was indeed minted by a specific contract.
- The hash of the message matches the hash stored within the token.
- This way, you’d have an indirect mechanism for predicates to “sign” messages, ensuring the message was approved by the vault’s logic.
If you have any questions, I’ll be happy to help