Skip to content

Web3 dApp Browser

BlockVault includes a built-in Web3 dApp browser that allows users to interact with decentralized applications directly. The browser injects wallet providers so dApps recognize BlockVault as if it were MetaMask (EVM), Phantom (Solana), or Keplr (Cosmos).


Supported Ecosystems

EcosystemInjected asGlobal object
EVM (Ethereum, Polygon, BSC, Base, Arbitrum, Optimism)MetaMask-compatiblewindow.ethereum
SolanaPhantom-compatiblewindow.solana / window.phantom.solana
Cosmos (dYdX, Osmosis, Noble)Keplr-compatiblewindow.keplr / window.cosmos

Architecture

The browser uses a 5-layer injection stack that runs inside an InAppBrowser WebView:

Layer 5: BlockVault Globals (integrity token, referral)
Layer 4: Wallet Standard Announcer (Solana discovery)
Layer 3: Chain Providers (EvmProvider, SolanaProvider, CosmosProvider)
Layer 2: BaseProvider (EventEmitter, guards, shared utilities)
Layer 1: MessageBridge (window.__bvBridge — unified communication)

InAppBrowser WebView (postMessage / executeScript)

Native App (useWeb3Browser → RpcHandler → Blockchain Services)

All layers are compiled into a single IIFE and injected at document start — before any dApp scripts load.


Request Flow

When a dApp calls window.ethereum.request(), the following happens:

1. dApp calls window.ethereum.request({ method, params })
2. EvmProvider sends via __bvBridge.send('evm', method, params)
3. MessageBridge creates a Promise with a unique request ID
4. postMessage sends the request to the native app
5. useWeb3Browser receives the message
6. RpcHandler validates the method and parameters
7. If approval required → show confirmation modal to the user
8. User approves → RpcHandler executes the action
9. Result is sent back to the WebView via executeScript
10. The Promise resolves and the dApp receives the result

Supported RPC Methods

Connection

MethodDescription
eth_requestAccountsConnect wallet to dApp
eth_accountsGet connected addresses
connect (Solana)Connect Solana wallet
cosmos_enableConnect Keplr-compatible wallet

Transactions

MethodDescription
eth_sendTransactionSend an EVM transaction
signTransaction (Solana)Sign a Solana transaction
signAndSendTransaction (Solana)Sign and broadcast a Solana transaction
signAllTransactions (Solana)Batch sign multiple Solana transactions
cosmos_signAminoSign a Cosmos Amino transaction
cosmos_signDirectSign a Cosmos Direct (Protobuf) transaction

Message Signing

MethodDescription
personal_signEIP-191 message signing
eth_signTypedData_v3 / v4EIP-712 typed data signing
signMessage (Solana)Solana message signing
cosmos_signArbitraryADR-036 arbitrary signing

Chain Management

MethodDescription
wallet_switchEthereumChainSwitch the active EVM chain
wallet_addEthereumChainAdd a custom chain
wallet_watchAssetAdd a token to the wallet
eth_chainId / net_versionQuery current chain ID
cosmos_switchChainSwitch Cosmos chain

Read-Only Queries

eth_call, eth_estimateGas, eth_getBalance, eth_getTransactionCount, eth_gasPrice, eth_maxPriorityFeePerGas, eth_feeHistory, eth_blockNumber, eth_getCode, eth_getLogs, eth_getTransactionByHash, eth_getTransactionReceipt, eth_getBlockByNumber


Approval Modals

Operations that affect user funds require explicit approval:

Transaction Approval

When a dApp requests eth_sendTransaction, BlockVault shows a confirmation modal with:

  • Recipient address and contract interaction detection
  • Transaction amount in native currency and USD
  • Gas fee estimation with adjustable speed (Slow / Normal / Fast)
  • High-value transaction warnings

Message Signing

For personal_sign or eth_signTypedData, the user sees the raw message or typed data structure before approving.

Connection Request

On first connection, the dApp must be explicitly approved by the user. Connected sites are persisted so returning to a dApp does not require re-approval.


Timeouts

Operation typeTimeout
Signing methods (eth_sendTransaction, personal_sign, etc.)5 minutes
Read-only methods (eth_gasPrice, eth_call, etc.)30 seconds

Error Codes

BlockVault follows the EIP-1474 standard error codes:

CodeMeaning
4001User rejected the request
4100Unauthorized (not connected)
4200Unsupported method
4900Disconnected
4901Chain disconnected
4902Unrecognized chain ID

EIP-6963 Multi-Wallet Discovery

On EVM chains, BlockVault announces itself via the EIP-6963 standard so dApps can detect it alongside other wallets:

json
{
  "uuid": "app.blockvault.wallet",
  "name": "BlockVault",
  "rdns": "app.blockvault.wallet",
  "icon": "data:image/svg+xml;base64,..."
}

On Solana, the Wallet Standard registration is used for multi-wallet discovery.


Provider Properties

EVM

window.ethereum.isBlockVault = true
window.ethereum.isMetaMask = true       // Compatibility flag
window.ethereum.chainId = "0x1"         // Hex chain ID
window.ethereum.selectedAddress = "0x..."

Solana

window.solana.isBlockVault = true
window.solana.isPhantom = true          // Compatibility flag
window.solana.isConnected = true/false
window.solana.publicKey.toBase58()      // Base58 address

Cosmos

window.keplr.isBlockVault = true
window.keplr.enable(chainId)
window.keplr.getKey(chainId)            // Returns { bech32Address, pubKey, ... }
window.keplr.getOfflineSigner(chainId)  // For transaction signing

BlockVault Documentation