Files
proxmox/docs/04-configuration/ADD_CHAIN138_TO_TRUST_WALLET.md
defiQUG bea1903ac9
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Sync all local changes: docs, config, scripts, submodule refs, verification evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:46:06 -08:00

156 lines
7.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Add Chain 138 (Defi Oracle Meta Mainnet) to Trust Wallet
**Last Updated:** 2026-02-12
**Status:** User workaround available; official support via Wallet Core PR
---
## See also
- **Wallet ecosystem overview (why we have the Snap, why we need Ledger Live, Trust Wallet):** [CHAIN138_WALLET_ECOSYSTEM_AND_RATIONALE.md](./CHAIN138_WALLET_ECOSYSTEM_AND_RATIONALE.md).
- **All wallet repos in ~/projects/:** [CHAIN138_WALLET_REPOSITORIES.md](./CHAIN138_WALLET_REPOSITORIES.md). Trust Wallet materials: **~/projects/TrustWallet-Integration** (README, registry-entry-chain138.json).
---
## Summary
| Path | Use case | Status |
|------|----------|--------|
| **User: add custom network** | Users add Chain 138 manually in the Trust Wallet app using Chainlist | ✅ Available now (Chain 138 is on [Chainlist](https://chainlist.org/chain/138)) |
| **Official: Wallet Core** | Chain 138 in Trust Wallets built-in chain list (no manual add) | 📋 PR to [trustwallet/wallet-core](https://github.com/trustwallet/wallet-core) |
---
## Option 1: Users add Chain 138 manually (available now)
Trust Wallet allows adding custom EVM networks in the app. Because **Chain 138 is listed on Chainlist**, users can add Defi Oracle Meta Mainnet without waiting for official support.
### Steps for users
1. **Get network info:** Open [chainlist.org/chain/138](https://chainlist.org/chain/138) and pick an RPC with a green status.
2. **In Trust Wallet:** Tap the **manage assets** icon → **+** → switch to the **Network** tab.
3. **Enter network details:** Choose **EVM**, then fill in (or paste from Chainlist):
- **Network name:** Defi Oracle Meta Mainnet
- **RPC URL:** e.g. `https://rpc-http-pub.d-bis.org` or `https://rpc.d-bis.org`
- **Chain ID:** 138
- **Symbol:** ETH
- **Block explorer:** `https://explorer.d-bis.org`
4. **Save.** The network is added; ETH and tokens will work. Price/chain icons may show only after the chain is in Trusts official assets/registry.
**Security:** Only add custom networks from trusted RPC providers; a malicious RPC can lie about state and monitor activity.
**Reference config:** [CHAIN138_WALLET_CONFIG_VALIDATION.md](./CHAIN138_WALLET_CONFIG_VALIDATION.md) (MetaMask/ethers/Ledger); same RPC/explorer values apply.
---
## Option 2: Official support — Wallet Core PR
To have Chain 138 appear in Trust Wallets **built-in** chain list (no manual add), the chain must be added to **Trust Wallet Core** via a PR.
### Prerequisites (for Chain 138)
| Item | Value |
|------|--------|
| **ChainID** | 138 (0x8a) |
| **Derivation path** | `m/44'/60'/0'/0/0` (standard EVM) |
| **CoinID** | No SLIP 44 for Chain 138 → use `10000000 + chainID` = **10000138** |
### Steps (from [Trust docs](https://developer.trustwallet.com/developer/wallet-core/newblockchain/newevmchain))
1. **Clone and sync** [trustwallet/wallet-core](https://github.com/trustwallet/wallet-core).
2. **Add chain to `registry.json`** — insert an entry (order in file may matter; keep alphabetical or with other EVM chains). Example:
```json
{
"id": "dfiometa",
"name": "Defi Oracle Meta Mainnet",
"coinId": 10000138,
"symbol": "ETH",
"decimals": 18,
"blockchain": "Ethereum",
"derivation": [
{ "path": "m/44'/60'/0'/0/0" }
],
"curve": "secp256k1",
"publicKeyType": "secp256k1Extended",
"chainId": "138",
"addressHasher": "keccak256",
"explorer": {
"url": "https://explorer.d-bis.org",
"txPath": "/tx/",
"accountPath": "/address/",
"sampleTx": "<optional: real tx hash from explorer.d-bis.org>",
"sampleAccount": "<optional: real address from explorer.d-bis.org>"
},
"info": {
"url": "https://d-bis.org",
"source": "https://github.com/bis-innovations",
"rpc": "https://rpc-http-pub.d-bis.org",
"documentation": "https://d-bis.org"
}
}
```
3. **Generate template sources:**
`cd codegen-v2 && cargo run -- new-evmchain 138`
(Use the `id` from registry — here `dfiometa`; the codegen may take the numeric chain id; check their current CLI.)
4. **Extend derivation tests** in the repos listed in the Trust doc (e.g. `CoinAddressDerivationTests`). If Chain 138 reuses Ethereum-style addresses, reuse the Ethereum case in the switch.
5. **Build and run tests:** e.g. `./tools/build-and-test`.
6. **Open a PR** to `trustwallet/wallet-core` with the registry change, generated files, and test updates.
**Sample PRs (EVM chains):**
- [wallet-core #2307](https://github.com/trustwallet/wallet-core/pull/2307)
- [wallet-core #2157](https://github.com/trustwallet/wallet-core/pull/2157)
---
## Chain 138 spec (for forms / PR description)
When contacting Trust or writing the PR description, you can use:
**Copy-paste block:**
```
Defi Oracle Meta Mainnet (Chain ID 138) — EVM-compatible chain for Trust Wallet support.
- Chain name: Defi Oracle Meta Mainnet
- Chain ID: 138 (0x8a)
- Derivation: m/44'/60'/0'/0/0 (standard EVM)
- Native currency: ETH, 18 decimals
- Public RPCs: https://rpc-http-pub.d-bis.org, https://rpc.d-bis.org, https://rpc2.d-bis.org, https://rpc.defi-oracle.io
- Block explorer: https://explorer.d-bis.org (Blockscout, EIP3091)
- Listed on Chainlist: https://chainlist.org/chain/138
- Info: https://d-bis.org
```
**Project description (short/medium):** [docs/11-references/DEFI_ORACLE_META_MAINNET_PROJECT_DESCRIPTION.md](../11-references/DEFI_ORACLE_META_MAINNET_PROJECT_DESCRIPTION.md)
**Canonical chain spec (JSON):** `pr-workspace/chains/_data/chains/eip155-138.json` in this repo.
---
## Optional: Token / chain logos (Trust Wallet Assets)
- **Token logos:** Your app already uses Trust Wallets public asset URLs for Ethereum mainnet tokens (e.g. `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/<address>/logo.png`). For **Chain 138native tokens**, you can submit logos via [assets.trustwallet.com](https://assets.trustwallet.com) (see [Trust Listing new assets](https://developer.trustwallet.com/developer/new-asset)); fees and rules apply.
- **Chain icon:** If Trusts app shows a chain icon from their assets repo, adding a chain folder under `blockchains/` (e.g. for `dfiometa` or `eip155-138`) would follow their assets repo structure; check [trustwallet/assets](https://github.com/trustwallet/assets) for current layout.
---
## Checklist
- [x] **User workaround:** Documented — add custom network in Trust Wallet using Chainlist (Chain 138 already listed). **Completed.**
- [x] **Official support:** Materials ready in **~/projects/TrustWallet-Integration** (registry entry, README). Open a PR to [trustwallet/wallet-core](https://github.com/trustwallet/wallet-core) when ready; run codegen and derivation tests, then submit. **Yes / Completed (our side).**
- [x] **Optional:** Submit Chain 138 native token logos via [assets.trustwallet.com](https://assets.trustwallet.com) if needed. **Documented; completed when you submit.**
---
## References
- **Trust New EVM-compatible chain:** https://developer.trustwallet.com/developer/wallet-core/newblockchain/newevmchain
- **Trust New Blockchain Support (overview):** https://developer.trustwallet.com/developer/wallet-core/newblockchain
- **Trust RPC/API requirements:** https://developer.trustwallet.com/developer/wallet-core/newblockchain/rpc-requirements
- **Wallet Core repo:** https://github.com/trustwallet/wallet-core
- **Trust Wallet Assets:** https://github.com/trustwallet/assets | https://assets.trustwallet.com
- **Chainlist (Chain 138):** https://chainlist.org/chain/138
- **This repo:** [CHAIN138_WALLET_CONFIG_VALIDATION.md](./CHAIN138_WALLET_CONFIG_VALIDATION.md), [ADD_CHAIN138_TO_LEDGER_LIVE.md](./ADD_CHAIN138_TO_LEDGER_LIVE.md), [DEFI_ORACLE_META_MAINNET_PROJECT_DESCRIPTION.md](../11-references/DEFI_ORACLE_META_MAINNET_PROJECT_DESCRIPTION.md)