The TrustVault Metamask Snap operating in Enhanced Mode enables use of the TrustVault-managed nonce, enabling the following features:
- Transaction Queueing: multiple transactions can be queued up in TrustVault for signing in one go.
- Multiple team members can interact with the same (TrustVault) accounts in Metamask, even across different computers and chrome profiles.
How to Enable Enhanced Mode
Using the Snap in Enhanced mode requires enabling the TrustVault RPC Proxy:
- Navigate to TrustVault Web Snap Page
- Click “Toggle Snap Mode”
- Select “Enhanced”
- Click “Add Network”
- Fill in details about the network you wish to use. ChainList is a useful resource for chain and rpc information.
- Click “Add RPC”
What is the TrustVault RPC Proxy and why is it necessary?
Metamask by default is designed to sign transactions as soon as you approve them. It is architected to create transactions one-by-one in the following sequence:
Create Tx -> Approve Tx -> Keyring Signs Tx -> Submit Tx to Chain
However, when your keys are managed by an external system like TrustVault, the Signing step can take some time as the transaction makes its way through approvals and compliance controls, depending on your configuration. During this time the creation of the next transaction is blocked, which is not optimal for teams who need high agility and need to be able to create several transactions at a time for signing in TrustVault.
Snaps have a very specific API to follow, and unfortunately this API does not give Snaps the ability to change how Metamask handles its transaction flow in this way.
Instead, the TrustVault Snap changes this behaviour by managing Metamask’s view of transactions via its RPC communications. The RPC proxy is a light RPC layer between Metamask and your chosen RPC URL, that intercepts specific RPC calls to make Metamask view a transaction as Confirmed, unblocking creation of the next one.
The RPC proxy also supplies the TrustVault-managed nonce to Metamask for transaction queueing. This allows Metamask to get the correct nonce whilst multiple transactions are pending in TrustVault and not yet on chain (the usual source of the nonce).
What happens if I accidentally change Network away from the RPC Proxy?
This might be quite a common occurrence as many dapps offer to change the network / set the RPC URL.
The Snap will detect an RPC change and alert you to reconfigure it back to the Proxy RPC, or switch off enhanced mode, both of which can be done on the TrustVault Web Snap Page.
Metamask and the Snap will continue to work as normal - just without the enhanced features until the RPC Proxy is set up again.
How do I change Network / Chain ID / RPC URL?
Visit the TrustVault Web Snap Page and click “Add Network” and fill in the details of the network you wish to use. Metamask will be updated to use your new settings.
Would Metamask show “Confirmed” even though the transaction is pending in TrustVault and not yet on chain?
Yes. To get the status of a transaction you can check on the TrustVault Web Transactions Page.
When you select the transaction and click “View on Block Explorer” in Metamask, the Snap will redirect you to the transaction in TrustVault. This is because the transaction might not exist yet on chain, so a block explorer would not be able to find it.
See Also
TrustVault x MetaMask Snap User Guide for more TrustVault Snap information and setup instructions.