MetaMask / MetaMask/metamask-extension

[Bug]: MetaMask Incorrectly Blocks Valid Transactions to Own EOA

Open
#32,495 18 comments 7 reactions 0 assignees View on GitHub
Batch-Transactions-(5792-+-7702) external-contributor INVALID-ISSUE-TEMPLATE Sev2-normal team-confirmations type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

**Describe the bug**

MetaMask incorrectly blocks transactions that send data to the same address as the sender with the error "External transactions to internal accounts cannot include data". This validation is overly restrictive and prevents legitimate use cases such as inscriptions and other valid on-chain operations.

**Expected behavior**

The transaction should be processed normally, allowing users to send data to their own address. This is a valid Ethereum operation that has legitimate use cases including:
- Inscriptions (e.g., [ethscriptions](https://docs.ethscriptions.com/))
- Input Data Messages (IDM) (e.g., [etherscan messaging](https://etherscan.io/idm))
- Other on-chain operations that require sending data to self

**Steps to reproduce**

1. Use MetaMask version 12.15.0 or later
2. Attempt to send a transaction with the following parameters:
```typescript
{
to: ownAddress, // Same as the from address
data: someData, // Any hex encoded data
value: 0
}
```

**Error messages or log output**

```shell

{
"code": -32602,
"message": "External transactions to internal accounts cannot include data",
"stack": "{\n \"code\": -32602,\n \"message\": \"External transactions to internal accounts cannot include data\",\n \"stack\": \"Error: External transactions to internal accounts cannot include data\\n at new o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:1:780)\\n at i (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:1:3871)\\n at Object.invalidParams (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:1:4377)\\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:5:1047205\\n at He.addTransaction (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:5:893020)\\n at async chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-1.js:1:265367\"\n}\n at new o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:1:780)\n at i (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:1:3871)\n at Object.invalidParams (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:1:4377)\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:5:1047205\n at He.addTransaction (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-4.js:5:893020)\n at async chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-1.js:1:265367"
}

TransactionExecutionError: Invalid parameters were provided to the RPC method.
Double check you have provided the correct parameters.

Request Arguments:
chain: Sepolia (id: 11155111)
from: 0xf1Aa941d56041d47a9a18e99609A047707Fe96c7
to: 0xf1Aa941d56041d47a9a18e99609A047707Fe96c7
value: 0 ETH
data: 0x646174613a6d6573736167652f766e642e7469632b6a736f6e2c7b22746f706963223a22307839326236353233656463363439616432376334373438333661323966366437366330376338376237363935623935343330643563666465383863323966303138222c22636f6e74656e74223a2254657374696e6720696e736372697074696f6e20636f6d6d656e74222c2276657273696f6e223a22307830222c22656e636f64696e67223a2275746638227d
gas: 28466
gasPrice: 12.496770907 gwei
nonce: 1087

Details: External transactions to internal accounts cannot include data
Version: viem@2.28.0
at getTransactionError (getTransactionError.js:13:10)
at sendTransaction.js:205:11
at Generator.throw ()
at rejected (chunk-ZYQGWDEM.js:92:29)
at _ZoneDelegate.invoke (zone.js:339:158)
at Object.onInvoke (core.mjs:6368:25)
at _ZoneDelegate.invoke (zone.js:339:46)
at ZoneImpl.run (zone.js:110:35)
at zone.js:2428:30
at _ZoneDelegate.invokeTask (zone.js:364:171)Caused by: InvalidParamsRpcError: Invalid parameters were provided to the RPC method.
Double check you have provided the correct parameters.

Details: External transactions to internal accounts cannot include data
Version: viem@2.28.0
at buildRequest.js:49:19
at Generator.throw ()
at rejected (chunk-ZYQGWDEM.js:92:29)
at _ZoneDelegate.invoke (zone.js:339:158)
at Object.onInvoke (core.mjs:6368:25)
at _ZoneDelegate.invoke (zone.js:339:46)
at ZoneImpl.run (zone.js:110:35)
at zone.js:2428:30
at _ZoneDelegate.invokeTask (zone.js:364:171)
at core.mjs:6037:49
```

**Detection stage**

In production (default)

**Version**

12.15.0+

**Build type**

None

**Browser**

Chrome

**Operating system**

MacOS

**Additional context**

## Technical Details
- MetaMask Version: 12.15.0+
- Network: Any Ethereum network
- Error occurs in the transaction validation layer before the transaction reaches the network
- The error occurs regardless of transaction type

## Impact
This bug prevents users from performing legitimate on-chain operations that require sending data to their own address. This affects:
- Users trying to create inscriptions
- Developers implementing self-referential contract operations
- Any application that requires sending data to the same address
- Projects using ethscriptions or similar technologies

## Additional Context
- The error is coming from MetaMask's base transaction validation logic
- This validation is preventing valid use cases
- Other wallets (like Rainbow, Rabby, etc.) allow these transactions without issues
- This is a valid Ethereum operation that should be allowed

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the transaction on Sepolia with MetaMask 12.15.0+ using an EOA as both from and to and non-empty data. Trace the transaction validation layer that emits "External transactions to internal accounts cannot include data"; done means valid self-directed data transactions are accepted and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.