Skip to content

feat: add slip 44 identifiers - #39234

Closed
salimtb wants to merge 8 commits into
mainfrom
feat/add-slip-44-identifiers
Closed

salimtb wants to merge 8 commits into
mainfrom
feat/add-slip-44-identifiers

Conversation

@salimtb

@salimtb salimtb commented Jan 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Screen.Recording.2026-01-13.at.15.32.37.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@socket-security

socket-security Bot commented Jan 14, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​network-enablement-controller@​3.1.0 ⏵ 4.0.0-preview-f075c1f100 +2100100100 +5100

View full report

@socket-security

socket-security Bot commented Jan 14, 2026 •

Copy link
Copy Markdown

Caution

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Block Medium
Network access: npm @metamask/multichain-network-controller in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: ? → npm/@metamask/network-enablement-controller@4.0.0-preview-f075c1f → npm/@metamask/multichain-network-controller@3.0.1

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/multichain-network-controller@3.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Ignoring alerts on:

  • @metamask/gas-fee-controller@26.0.1

View full report

@salimtb

salimtb commented Jan 14, 2026

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/@metamask/gas-fee-controller@26.0.1

This is a MetaMask-owned package (@metamask/gas-fee-controller). Network access via fetch is expected behavior - the controller needs to fetch gas fee estimates from external APIs (like gas price oracles) to provide accurate gas pricing to users.

@metamaskbotv2

metamaskbotv2 Bot commented Jan 14, 2026

Copy link
Copy Markdown
Contributor
Builds ready [bafa023]
📊 Page Load Benchmark Results

Current Commit: bafa023 | Date: 1/14/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±71ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 737ms (±69ms) 🟢 | historical mean value: 720ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 71ms 1.01s 1.34s 1.27s 1.34s
domContentLoaded 737ms 69ms 698ms 1.00s 945ms 1.00s
firstPaint 77ms 12ms 60ms 176ms 88ms 176ms
firstContentfulPaint 77ms 12ms 60ms 176ms 88ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 23.23 KiB (0.46%)
  • ui: 27 Bytes (0%)
  • common: 151 Bytes (0%)

@metamaskbotv2

metamaskbotv2 Bot commented Jan 14, 2026

Copy link
Copy Markdown
Contributor
Builds ready [464b89d]
📊 Page Load Benchmark Results

Current Commit: 464b89d | Date: 1/14/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±69ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 735ms (±66ms) 🟢 | historical mean value: 720ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±15ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 69ms 1.01s 1.35s 1.26s 1.35s
domContentLoaded 735ms 66ms 700ms 1.02s 935ms 1.02s
firstPaint 77ms 15ms 60ms 208ms 88ms 208ms
firstContentfulPaint 77ms 15ms 60ms 208ms 88ms 208ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 70.9 KiB (1.41%)
  • ui: 26 Bytes (0%)
  • common: 150 Bytes (0%)

@salimtb

salimtb commented Jan 14, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-policies

@metamaskbot

Copy link
Copy Markdown
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbotv2

metamaskbotv2 Bot commented Jan 14, 2026 •

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

🕵️ @MetaMask/extension-privacy-reviewers (1 files, +1 -0)
  • 📁 test/
    • 📁 e2e/
      • 📁 tests/
        • 📁 settings/
          • 📄 state-logs.json +1 -0

📜 @MetaMask/policy-reviewers (5 files, +179 -5)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +43 -1
      • 📁 experimental/
        • 📄 policy.json +43 -1
      • 📁 flask/
        • 📄 policy.json +43 -1
      • 📁 main/
        • 📄 policy.json +43 -1
    • 📁 webpack/
      • 📁 mv2/
        • 📄 policy.json +7 -1

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.


🧪 @MetaMask/qa (1 files, +1 -0)
  • 📁 test/
    • 📁 e2e/
      • 📁 tests/
        • 📁 settings/
          • 📄 state-logs.json +1 -0

🔄 @MetaMask/swaps-engineers (1 files, +1 -0)
  • 📁 test/
    • 📁 data/
      • 📁 bridge/
        • 📄 mock-bridge-store.ts +1 -0

@metamaskbotv2

metamaskbotv2 Bot commented Jan 14, 2026

Copy link
Copy Markdown
Contributor
Builds ready [914ca1c]
UI Startup Metrics (1268 ± 122 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1268999155512213441490
load--1064810131311411381280
domContentLoaded--1056805130711411271272
domInteractive--2514104202081
firstPaint--202581111213188898
backgroundConnect--20517226316215231
firstReactRender--1593451626
getState--351977114158
initialActions--104112
loadScripts--85963710981119301065
setupStore--1273851324
numNetworkReqs--181188191173
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--------
load--------
domContentLoaded--------
domInteractive--------
firstPaint--------
backgroundConnect--------
firstReactRender--------
getState--------
initialActions--------
loadScripts--------
setupStore--------
numNetworkReqs--------
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--816674119287851990
load--65558495371668803
domContentLoaded--65058094771664797
domInteractive--2615105202288
firstPaint--1046039154118216
backgroundConnect--2861383035102
firstReactRender--16113941823
getState--331575134458
initialActions--104113
loadScripts--64657793769661788
setupStore--1474381537
numNetworkReqs--181179171167
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1355994210627415751908
load--674591118395680894
domContentLoaded--665585117795664888
domInteractive--36162553532122
firstPaint--1346349478189262
backgroundConnect--107864520223590
firstReactRender--22163542430
getState--15013221414157171
initialActions--102011
loadScripts--662583116893661880
setupStore--1694781738
numNetworkReqs--973422647138205
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14241104203719915121877
load--1133944169914012001353
domContentLoaded--1132944169914012001353
domInteractive--70332504489162
firstPaint--------
backgroundConnect--58201804578160
firstReactRender--1495061323
getState--146150181229
initialActions--103122
loadScripts--1097932162212011661253
setupStore--13491111243
numNetworkReqs--19980191375
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--25361949549858226074180
load--12191039205218212181627
domContentLoaded--12181038205218212171626
domInteractive--12234500103117432
firstPaint--------
backgroundConnect--1093351987129271
firstReactRender--24157592635
getState--303761126254464875
initialActions--3169723
loadScripts--11741009189716111691567
setupStore--14014777187153657
numNetworkReqs--60302265246203
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16231256218220118001931
load--13481110191113714221579
domContentLoaded--13481110191113714221578
domInteractive--942923346130191
firstPaint--------
backgroundConnect--67212394790178
firstReactRender--15116251622
getState--218240321668
initialActions--105122
loadScripts--13071097179111913781524
setupStore--2442334117118
numNetworkReqs--20983201577
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29082014508881528344706
load--16331207324757817203057
domContentLoaded--16331206324757817203056
domInteractive--11632638120107462
firstPaint--------
backgroundConnect--1993113263091461161
firstReactRender--2415110112632
getState--297691051256448859
initialActions--207123
loadScripts--15021159304142916712704
setupStore--12011704160114549
numNetworkReqs--59291903975149
19--------
📊 Page Load Benchmark Results

Current Commit: 914ca1c | Date: 1/14/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±35ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 720ms (±33ms) 🟢 | historical mean value: 715ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 35ms 1.01s 1.30s 1.06s 1.30s
domContentLoaded 720ms 33ms 700ms 969ms 742ms 969ms
firstPaint 77ms 12ms 60ms 184ms 88ms 184ms
firstContentfulPaint 77ms 12ms 60ms 184ms 88ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 70.9 KiB (1.41%)
  • ui: 26 Bytes (0%)
  • common: 150 Bytes (0%)

github-merge-queue Bot pushed a commit to MetaMask/core that referenced this pull request Jan 14, 2026
)

## Explanation

### Current State
The `NetworkEnablementController` tracks which networks are
enabled/disabled but lacks information about the native asset identifier
for each chain. This information is needed to properly identify native
assets across different blockchain networks using a standardized format.

Extension UI PR:
MetaMask/metamask-extension#39234


### Solution
This PR adds a new state property `nativeAssetIdentifiers` to the
`NetworkEnablementController` that maps CAIP-2 chain IDs to CAIP-19-like
native asset identifiers.

For example:
- `eip155:1` → `eip155:1/slip44:60` (Ethereum uses ETH, SLIP-44 coin
type 60)
- `eip155:56` → `eip155:56/slip44:714` (BSC uses BNB, SLIP-44 coin type
714)
- `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` →
`solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501`

### Implementation Details
1. **New `Slip44Service`**: A service that wraps the `@metamask/slip44`
package to look up SLIP-44 coin types by symbol (e.g., `ETH` → `60`,
`BTC` → `0`).

2. **State Updates**: The `nativeAssetIdentifiers` state is
automatically updated when:
   - A network is added (`NetworkController:networkAdded`)
   - A network is removed (`NetworkController:networkRemoved`)
- A network's native currency symbol is changed
(`NetworkController:stateChange`)

3. **Default State**: Popular networks are pre-populated with their
correct native asset identifiers based on their native currency symbols.

4. **Graceful Handling**: If a symbol has no SLIP-44 mapping, the entry
is removed from the state rather than storing an invalid identifier.

### Dependency Addition
Added `@metamask/slip44` package to dynamically look up SLIP-44 coin
types instead of hardcoding them, ensuring accuracy and maintainability.

## References

- [SLIP-44
Standard](https://github.com/satoshilabs/slips/blob/master/slip-0044.md)
- [CAIP-2 Chain ID
Specification](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-2.md)
- [CAIP-19 Asset Identifier
Specification](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-19.md)
- [@metamask/slip44 npm
package](https://www.npmjs.com/package/@metamask/slip44)

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduces native asset tracking and supporting utilities.
> 
> - Adds `nativeAssetIdentifiers` mapping (CAIP-2 ->
`.../slip44:<coinType>`) to `NetworkEnablementController` state and
metadata
> - New `Slip44Service` (uses `@metamask/slip44` and chainid.network) to
resolve coin types by symbol/chainId; exports helpers
> - Makes `init()` async and populates EVM identifiers; new
`initNativeAssetIdentifiers(networks)` API for bulk initialization
> - Updates network lifecycle: on add (async) computes and stores
identifier; on remove deletes identifier
> - Extends public exports (types, service) and adds `@metamask/slip44`
dependency
> - Updates/extends tests for controller, selectors, utils, and new
service
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f8cdcfc. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@salimtb salimtb closed this Feb 22, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 22, 2026

This branch was previously deployed

1 inactive deployment
pr-comment — 914ca1c4 Deployed Jan 14, 2026 by salimtb via Publish prerelease / Publish prerelease #112748
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants