decred.org/dcrdex@v1.0.5/docs/wiki/Ethereum.md (about) 1 # Ethereum 2 3 ## Wallet Overview 4 5 The Ethereum wallet in Bison Wallet is similar to the "native" wallets for BTC 6 and DCR, but requires some manual configuration. 7 8 Like the other native wallets, the private keys (and accounts) are derived from 9 the DEX "application seed", so that reinitializing the DEX app from seed will 10 restore the same Ethereum wallet and any ERC20 wallets. The keys are maintained 11 exclusively by the application process, and all transaction signing is handled 12 by the application. 13 14 Unlike the other native wallets, the Ethereum wallet uses "RPC providers" 15 specified by the user. This is the wallet's gateway to the Ethereum network. 16 Casual ETH users may be familiar with Infura, as an example, since this is the 17 default provider for the common MetaMask wallet. When creating your Ethereum 18 wallet in the DEX application, you will need to specify the full path to an 19 Ethereum RPC provider, i.e. an RPC endpoint. See the [RPC Provider 20 List](#rpc-provider-list-partial) below for suggestions. 21 22 ## Wallet Setup 23 24 From the "Wallets" page of the DEX application, you select Ethereum from the 25 left menu, which will show you your ETH balance if you already have a 26 wallet, or you will see a "Create a Ethereum Wallet" button: 27 28 <img src="images/eth-create-wallet.png" width="320"> 29 30 When you click the button, you will be able to specify one or more RPC provider 31 endpoints. You can provide a single endpoint, but it is recommended to specify 32 more than one for redundancy. Click the "+" icon at the right to add additional 33 providers. 34 35 <img src="images/eth-wallet-settings.png" width="320"> 36 37 The types of endpoints that are supported are: 38 39 - (**Recommended**) WebSocket (ws:// or wss:///). These use a persistent 40 connection, which is efficient and supports new block subscriptions to reduce 41 provider utilization and bandwidth. 42 - HTTP (http:// or https://). These are less efficient and do not support new 43 block subscriptions, so the client frequently polls for new blocks. 44 - IPC. These are typically a special file on your local machine. You must be 45 running a local node to use this, and the IPC file permissions must be set to 46 allow the DEX app to use it. However, typically even a full node will expose a 47 WebSocket interface. 48 49 ## RPC Provider Suggestions 50 51 Consider the following tips when configuring your Ethereum wallet: 52 53 - Use **multiple providers**, even if one of them is your own full node. This 54 provides redundancy. Often a provider will fall behind or even stall, so 55 use of multiple providers adds robustness to your wallet. 56 57 - Get a personal RPC endpoint, with your own **private API key**. Many providers 58 will allow you to create a personal endpoint that includes an API "key" that 59 is assigned just to you. 60 61 This is important since all providers have request rate limits, which may be 62 exhausted quickly with a generic RPC endpoint (e.g. 63 <https://rpc.ankr.com/eth>) that enforce rate limiting based on the source IP 64 address. This is particularly important if you use a VPN or other proxy where 65 you share an outbound IP address with many other people. 66 67 Further, taking the time to get an endpoint with your personal API key often 68 gives you access to a "dashboard" with the provider so you can monitor your 69 API requests. 70 71 - Use **WebSockets** (wss:// URL scheme) when using a third-party RPC provider. 72 It is much more efficient than HTTP, the wallet will become aware of new 73 blocks sooner, and it will consume less of your quota with the provider. The 74 application may attempt a WebSocket connection even when given an HTTP 75 endpoint, but it is best to specify it explicitly if it is known. 76 77 - Use a private full node for one of your endpoints, if you are able. 78 79 - Even if you use a private full node, use backup RPC providers! Running an 80 Ethereum node is difficult. You will experience downtime when you least expect 81 it. 82 83 ## RPC Provider List (partial) 84 85 Some common Ethereum RPC providers are listed at <https://ethereumnodes.com/>. 86 87 A handful that we have tested: 88 89 - [NodeReal](https://dashboard.nodereal.io/) - personal API key, wss 90 - [Alchemy](https://www.alchemy.com/overviews/private-rpc-endpoint) - personal API key 91 - [LlamaNodes](https://llamanodes.com/) - personal API key, wss, web3 sign-in, no testnet 92 - [Rivet](https://rivet.cloud/) - personal API key, wss, web3 sign-in 93 - [Blast](https://blastapi.io/login?app=consumer) - personal API key, wss, web3 sign-in 94 - [OmniaTech](https://app.omniatech.io/dashboard/generate-endpoints) - personal API key, wss, web3 sign-in 95 - [Ankr](https://www.ankr.com/rpc/) - generic endpoint, often behind a few blocks, possibly http-only 96 - [Publicnode](https://ethereum.publicnode.com/) - generic endpoint, possibly http-only 97 98 [Infura](https://docs.infura.io/infura/reference/network-endpoints) is also 99 extremely reliable and common, but their data sharing and retention policy has 100 been under fire recently. Decide for yourself. 101 102 The Flashbots Protect RPC service is **not recommended** for the DEX wallet 103 since the public mempool is only used in certain circumstances, which is not 104 helpful for the DEX wallet. Further, Flashbots will abandon transactions that 105 are not mined within 6 minutes, and while it is expected that transactions will 106 be mined more promptly, this is not desirable. 107 108 Some providers allow you to sign in with a web3 wallet (e.g. MetaMask) to create 109 a personal API key and access a dashboard. This may be preferable to creating an 110 account with an email address. 111 112 ## Wallet Recovery 113 114 The wallet's account and private keys are derived from the DEX "application 115 seed". This means that reinitializing the DEX application from this seed will 116 restore the same Ethereum wallet and any ERC20 wallets. 117 118 **WARNING: You should never interact with the Ethereum account outside of the 119 DEX application!** 120 121 **Do NOT** simultaneously use the account from multiple wallet programs, 122 including multiple installations of the DEX application with the same seed. Any 123 interaction other than simply viewing the balance while the DEX app is running 124 or there are active orders can interfere with trades and can lead to lost funds. 125 Such interactions include sending funds, cancelling or "speeding up" 126 transactions, or any other interaction that consumes gas or creates a new 127 transaction. 128 129 However, it is possible to export the account's private key for recovery outside 130 of the DEX application. Only in emergency recovery situations should you import 131 the private key into another wallet. Again, do not use the wallet outside of the 132 DEX application. If you feel you need to use the backup private key, or are 133 unable to reinitialize the DEX application with the same seed, please first seek 134 guidance in the [Decred chat](https://matrix.to/#/#dex:decred.org).