-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Brave Wallet
Brave Wallet was created as part of the Brave browser in order to bring cryptocurrency and web 3 access to Brave's users.
Users can access the Brave Wallet by navigating to brave://wallet or from the wallet icon at the top of the browser.
The Brave wallet will be home to a user's local cryptocurrency wallet, Brave Rewards wallet, credit cards, and other exchanges that we support oauth’ing to.
The window.ethereum
object is provided by Brave's wallet to web pages. You can read about it here: https://github.com/brave/brave-browser/wiki/Ethereum-Provider-API
Brave Wallet settings can be accessed from: brave://settings/wallet
The default wallet setting can be set to one of the following values:
-
Brave Wallet (Prefer extensions)
: This is the default setting. With this setting,window.ethereum
is exposed by Brave Wallet; however, extensions such as MetaMask are still allowed to overwritewindow.ethereum
. -
Brave Wallet
: With this settingwindow.ethereum
is exposed by Brave Wallet and extensions do not have access to overwritewindow.ethereum
. -
Crypto Wallets (Deprecated)
: This setting only shows up for existing users that have used Crypto Wallets in the past. Crypto Wallets was Brave's old cryptocurrency wallet and it was a MetaMask fork. If this setting is selected, navigating to brave://wallet will load Crypto Wallets instead of Brave Wallet. New users can access this setting only if they have brave://flags/#ethereum_remote-client_new-installs set to true manually. -
None
: With this setting users can still navigate to brave://wallet, however nowindow.ethereum
object is exposed.
The default base currency allows you to select which currency you'd like to display asset prices in. The default is USD.
The default base cryptocurrency allows you to select which cryptocurrency you'd like to display asset prices in. The default is BTC.
This controls wether there is a wallet icon at the top of your browser or not on Desktop. If there is no icon and there are Dapp requests, they will popup from the hamburger menu.
The number of minutes to wait until the Brave Wallet is automatically locked. The default is 5 minutes.
EVM compatible networks can be added here: brave://settings/wallet/networks You can visit https://chainlist.org/ for a list of supported chains.
This allows you to reset all of your wallet state back to the original default. Ensure you have a backup of your seed phrase and imported keys before using this option.
Permissions in Brave Wallet are managed by content settings. They can be modified for which sites have access to your addresses here: brave://settings/content/ethereum
If a Dapp has previously requested access to a page and was given permission, then it will show up in this page as well.
Bitcoin and Ethereum generate addresses in different ways, but they share the same key derivation implementations as BIP-32 compatible wallets.
The Brave wallet implements BIP-32 (HD wallet), BIP-39 (Mnemonic keywords), BIP-43 (Multipurpose HD wallet structure), and BIP-44 (Multicurrency and multi account wallets).
The mnemonic words are encrypted with AES-GCM symmetric encryption and stored in preferences with the user passphrase.
Which account paths are created / derived are stored in preferences as well. We will support discovery of them when restoring too via https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account-discovery
Bitcoin and Ethereum use an elliptic curve named secp256k1. We use Boring SSL in Brave, but that library does not support secp256k1. Instead we use libsecp256k1
from Bitcoin Core.
On Ethereum, both externally-owned accounts and contract accounts are 40-character hex encoded strings with a “0x” prefix. 0x + the last 20 bytes of the keccak
hash of the public key.
For testing: http://bip32.org/
Bitcoin addresses are encoded using bech32
base 58 encoding (base-58 encoding also from https://github.com/bitcoin/bitcoin).
https://en.bitcoin.it/wiki/BIP_0173#Segwit_address_format https://en.bitcoin.it/wiki/Segregated_Witness