{"eip":107,"title":"safe \"eth_sendTransaction\" authorization via html popup","description":"This draft EIP describes the details of an authorization method that if provided by rpc enabled ethereum nodes would allow regular websites to send transactions (via ethsendTransaction) without the need to enable CORS. Instead, user would be asked to confirm the transaction via an html popup.","authors":["Ronan Sandford (@wighawag)"],"status":"Stagnant","type":"Standards Track","category":"Interface","created":"2016-06-05","repo":"EIPs","label":"EIP-107","officialUrl":"https://eips.ethereum.org/EIPS/eip-107","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-107.md","url":"https://eips.huatuo.xyz/eip-107/","tldr":{"en":"A 2016 proposal for nodes to serve an HTML popup so ordinary websites could request eth_sendTransaction with user confirmation, instead of enabling CORS and trusting the dapp.","ja":"2016 年の提案。ノードが HTML ポップアップを提供し、CORS を有効にして dapp を信頼する代わりに、通常のウェブサイトがユーザーの確認付きで eth_sendTransaction を要求できるようにする。","ko":"2016년 제안. 노드가 HTML 팝업을 제공해, CORS를 켜고 dapp을 신뢰하는 대신 일반 웹사이트가 사용자 확인을 거쳐 eth_sendTransaction을 요청할 수 있게 한다.","zh":"2016 年的一项提案：由节点提供 HTML 弹窗，使普通网站无需启用 CORS 并信任 dapp，就能在用户确认后请求 eth_sendTransaction。"},"tags":["json-rpc","wallet","dapp","authorization","interface"],"explainers":{"en":{"lang":"en","tldr":"A 2016 proposal for nodes to serve an HTML popup so ordinary websites could request eth_sendTransaction with user confirmation, instead of enabling CORS and trusting the dapp.","tags":["json-rpc","wallet","dapp","authorization","interface"],"related":[1102,1193,2255],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-107/","markdown":"## What problem does it solve?\n\nIn 2016, a dapp in a normal browser could only reach your local Ethereum node's RPC if you enabled CORS for its domain. Once you did, the site could call `eth_sendTransaction` from any **unlocked** account with no prompt at all. Users had to either trust the site completely or copy transactions by hand into Mist or the node's console.\n\nEIP-107 proposes a way for websites to use the node safely: read-only calls just work, and every transaction needs an explicit click from the user.\n\n## How it works\n\nThe node serves one self-contained page at `\u003cnode url\u003e/authorization.html`. Because the page comes from the node's own origin, browser same-origin rules protect it. The dapp uses the page in two ways:\n\n1. **Invisible iframe.** The dapp embeds it and sends read-only RPC calls through `window.postMessage`. The iframe refuses any call that needs an unlocked key, so a hidden frame can't trick users into confirming.\n2. **Popup window.** For `eth_sendTransaction`, the dapp opens the same URL in a new window. It shows the sender, recipient, amount and gas cost, and only forwards the call if the user confirms. `eth_sign` is deliberately not allowed, because the popup cannot show its meaning safely.\n\nMessage protocol:\n\n- The frame or window first posts the string `\"ready\"`.\n- The dapp sends `{ id, payload }`, where `payload` is a normal JSON-RPC object.\n- The reply is `{ id, result, error }`, and `error.type === \"cancel\"` means the user rejected.\n- `from`, `gas` and `gasPrice` must be set so the popup can display them.\n\nIf the account is locked and the node exposes the `personal` API, the popup can ask for the password and unlock it briefly (3 seconds in the reference page).\n\n## Sample code\n\nDapp side, sending a transaction through the popup:\n\n```ts\nconst NODE = \"http://localhost:8545\";\nconst popup = window.open(`${NODE}/authorization.html`, \"eth-auth\", \"width=420,height=520\")!;\n\nwindow.addEventListener(\"message\", (ev) =\u003e {\n  if (ev.origin !== NODE) return;\n  if (ev.data === \"ready\") {\n    popup.postMessage({\n      id: 1,\n      payload: {\n        jsonrpc: \"2.0\", id: 1, method: \"eth_sendTransaction\",\n        params: [{ from: \"0x…\", to: \"0x…\", value: \"0x2386f26fc10000\",\n                   gas: \"0x5208\", gasPrice: \"0x4a817c800\" }],\n      },\n    }, NODE);\n  } else if (ev.data.id === 1) {\n    if (ev.data.error?.type === \"cancel\") console.log(\"user rejected\");\n    else console.log(\"tx hash\", ev.data.result);\n  }\n});\n```\n\n## Things to know\n\n- This proposal is **Stagnant** and was never standardized or widely deployed.\n- The ecosystem went a different way. Wallets such as browser extensions inject a provider ([EIP-1193](/eip-1193/)), ask the user to connect accounts ([EIP-1102](/eip-1102/), [EIP-2255](/eip-2255/)), and show their own confirmation screens. Today the node usually never sees the user's keys at all.\n- The design assumes accounts unlocked inside the node, which is now discouraged.\n- It remains a useful historical record of why \"the dapp must never sign without the user\" became a core wallet principle.\n"},"ja":{"lang":"ja","tldr":"2016 年の提案。ノードが HTML ポップアップを提供し、CORS を有効にして dapp を信頼する代わりに、通常のウェブサイトがユーザーの確認付きで eth_sendTransaction を要求できるようにする。","tags":["json-rpc","wallet","dapp","authorization","interface"],"related":[1102,1193,2255],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-107/","markdown":"## 何を解決するのか\n\n2016 年当時、通常のブラウザ上の dapp がローカルの Ethereum ノードの RPC にアクセスするには、そのドメインに対して CORS を有効にする必要がありました。有効にすると、そのサイトは**アンロックされた**任意のアカウントから、確認なしに `eth_sendTransaction` を呼び出せてしまいます。ユーザーはサイトを完全に信頼するか、トランザクションを手作業で Mist やノードのコンソールにコピーするしかありませんでした。\n\nEIP-107 は、ウェブサイトがノードを安全に使う方法を提案します。読み取り専用の呼び出しはそのまま動作し、すべてのトランザクションにはユーザーの明示的なクリックが必要です。\n\n## 仕組み\n\nノードは `\u003cnode url\u003e/authorization.html` で、自己完結した 1 枚のページを提供します。このページはノード自身のオリジンから配信されるため、ブラウザの同一オリジンポリシーで保護されます。dapp はこのページを 2 通りの方法で使います。\n\n1. **非表示の iframe。** dapp がこれを埋め込み、`window.postMessage` を通じて読み取り専用の RPC 呼び出しを送ります。iframe はアンロックされた鍵を必要とする呼び出しを拒否するため、隠しフレームでユーザーを騙して承認させることはできません。\n2. **ポップアップウィンドウ。** `eth_sendTransaction` の場合、dapp は同じ URL を新しいウィンドウで開きます。ウィンドウには送信元、送信先、金額、ガスコストが表示され、ユーザーが確認した場合にのみ呼び出しが転送されます。ポップアップでは `eth_sign` の意味を安全に表示できないため、`eth_sign` は意図的に許可されていません。\n\nメッセージプロトコル:\n\n- フレームまたはウィンドウは、まず文字列 `\"ready\"` を投稿します。\n- dapp は `{ id, payload }` を送ります。`payload` は通常の JSON-RPC オブジェクトです。\n- 返信は `{ id, result, error }` で、`error.type === \"cancel\"` はユーザーが拒否したことを意味します。\n- ポップアップが表示できるよう、`from`、`gas`、`gasPrice` を設定する必要があります。\n\nアカウントがロックされていてノードが `personal` API を公開している場合、ポップアップはパスワードを求めて一時的（リファレンスページでは 3 秒間）にアンロックできます。\n\n## サンプルコード\n\ndapp 側から、ポップアップ経由でトランザクションを送信する例:\n\n```ts\nconst NODE = \"http://localhost:8545\";\nconst popup = window.open(`${NODE}/authorization.html`, \"eth-auth\", \"width=420,height=520\")!;\n\nwindow.addEventListener(\"message\", (ev) =\u003e {\n  if (ev.origin !== NODE) return;\n  if (ev.data === \"ready\") {\n    popup.postMessage({\n      id: 1,\n      payload: {\n        jsonrpc: \"2.0\", id: 1, method: \"eth_sendTransaction\",\n        params: [{ from: \"0x…\", to: \"0x…\", value: \"0x2386f26fc10000\",\n                   gas: \"0x5208\", gasPrice: \"0x4a817c800\" }],\n      },\n    }, NODE);\n  } else if (ev.data.id === 1) {\n    if (ev.data.error?.type === \"cancel\") console.log(\"user rejected\");\n    else console.log(\"tx hash\", ev.data.result);\n  }\n});\n```\n\n## 知っておくべきこと\n\n- この提案は **Stagnant** で、標準化も広い展開もされませんでした。\n- エコシステムは別の道を進みました。ブラウザ拡張などのウォレットがプロバイダーを注入し（[EIP-1193](/eip-1193/)）、ユーザーにアカウントの接続を求め（[EIP-1102](/eip-1102/)、[EIP-2255](/eip-2255/)）、独自の確認画面を表示します。現在では、ノードがユーザーの鍵を目にすることは通常まったくありません。\n- この設計はノード内でアンロックされたアカウントを前提としていますが、現在は推奨されません。\n- 「dapp はユーザーなしで署名してはならない」がウォレットの中核原則になった理由を示す、歴史的な記録として今も有用です。\n"},"ko":{"lang":"ko","tldr":"2016년 제안. 노드가 HTML 팝업을 제공해, CORS를 켜고 dapp을 신뢰하는 대신 일반 웹사이트가 사용자 확인을 거쳐 eth_sendTransaction을 요청할 수 있게 한다.","tags":["json-rpc","wallet","dapp","authorization","interface"],"related":[1102,1193,2255],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-107/","markdown":"## 어떤 문제를 해결하나요?\n\n2016년에는 일반 브라우저의 dapp이 로컬 이더리움 노드의 RPC에 접근하려면 해당 도메인에 CORS를 켜야 했습니다. 켜고 나면 그 사이트는 **잠금 해제된** 어떤 계정에서든 아무 확인 없이 `eth_sendTransaction`을 호출할 수 있었습니다. 사용자는 사이트를 전적으로 신뢰하거나, 트랜잭션을 Mist나 노드 콘솔에 직접 복사해 넣어야 했습니다.\n\nEIP-107은 웹사이트가 노드를 안전하게 사용하는 방법을 제안합니다. 읽기 전용 호출은 그대로 동작하고, 모든 트랜잭션에는 사용자의 명시적인 클릭이 필요합니다.\n\n## 어떻게 동작하나요?\n\n노드는 `\u003cnode url\u003e/authorization.html`에서 독립적으로 동작하는 페이지 하나를 제공합니다. 이 페이지는 노드 자신의 오리진에서 오기 때문에 브라우저의 동일 출처 규칙이 보호합니다. dapp은 이 페이지를 두 가지 방식으로 사용합니다.\n\n1. **보이지 않는 iframe.** dapp이 페이지를 임베드하고 `window.postMessage`로 읽기 전용 RPC 호출을 보냅니다. iframe은 잠금 해제된 키가 필요한 호출을 거부하므로, 숨겨진 프레임이 사용자를 속여 승인하게 만들 수 없습니다.\n2. **팝업 창.** `eth_sendTransaction`의 경우 dapp이 같은 URL을 새 창으로 엽니다. 창에는 보내는 사람, 받는 사람, 금액, 가스 비용이 표시되고, 사용자가 확인한 경우에만 호출을 전달합니다. 팝업이 `eth_sign`의 의미를 안전하게 보여줄 수 없으므로 `eth_sign`은 의도적으로 허용되지 않습니다.\n\n메시지 프로토콜:\n\n- 프레임이나 창이 먼저 문자열 `\"ready\"`를 게시합니다.\n- dapp은 `{ id, payload }`를 보냅니다. `payload`는 일반적인 JSON-RPC 객체입니다.\n- 응답은 `{ id, result, error }`이며, `error.type === \"cancel\"`은 사용자가 거부했다는 뜻입니다.\n- 팝업이 표시할 수 있도록 `from`, `gas`, `gasPrice`를 반드시 설정해야 합니다.\n\n계정이 잠겨 있고 노드가 `personal` API를 노출하는 경우, 팝업은 비밀번호를 물어 잠시(참조 페이지에서는 3초) 잠금을 해제할 수 있습니다.\n\n## 샘플 코드\n\ndapp 쪽에서 팝업을 통해 트랜잭션을 보내는 예:\n\n```ts\nconst NODE = \"http://localhost:8545\";\nconst popup = window.open(`${NODE}/authorization.html`, \"eth-auth\", \"width=420,height=520\")!;\n\nwindow.addEventListener(\"message\", (ev) =\u003e {\n  if (ev.origin !== NODE) return;\n  if (ev.data === \"ready\") {\n    popup.postMessage({\n      id: 1,\n      payload: {\n        jsonrpc: \"2.0\", id: 1, method: \"eth_sendTransaction\",\n        params: [{ from: \"0x…\", to: \"0x…\", value: \"0x2386f26fc10000\",\n                   gas: \"0x5208\", gasPrice: \"0x4a817c800\" }],\n      },\n    }, NODE);\n  } else if (ev.data.id === 1) {\n    if (ev.data.error?.type === \"cancel\") console.log(\"user rejected\");\n    else console.log(\"tx hash\", ev.data.result);\n  }\n});\n```\n\n## 알아둘 점\n\n- 이 제안은 **Stagnant** 상태이며 표준화되거나 널리 배포된 적이 없습니다.\n- 생태계는 다른 길로 갔습니다. 브라우저 확장 같은 지갑이 프로바이더를 주입하고([EIP-1193](/eip-1193/)), 사용자에게 계정 연결을 요청하며([EIP-1102](/eip-1102/), [EIP-2255](/eip-2255/)), 자체 확인 화면을 보여줍니다. 오늘날 노드는 보통 사용자의 키를 전혀 보지 못합니다.\n- 이 설계는 노드 안에서 잠금 해제된 계정을 전제로 하는데, 지금은 권장되지 않습니다.\n- \"dapp은 사용자 없이 절대 서명해서는 안 된다\"가 지갑의 핵심 원칙이 된 이유를 보여주는 역사적 기록으로 여전히 유용합니다.\n"},"zh":{"lang":"zh","tldr":"2016 年的一项提案：由节点提供 HTML 弹窗，使普通网站无需启用 CORS 并信任 dapp，就能在用户确认后请求 eth_sendTransaction。","tags":["json-rpc","wallet","dapp","authorization","interface"],"related":[1102,1193,2255],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-107/","markdown":"## 它解决什么问题？\n\n2016 年时，普通浏览器中的 dapp 只有在你为其域名启用 CORS 后，才能访问本地以太坊节点的 RPC。一旦启用，该网站就可以不经任何提示，从任何**已解锁**的账户调用 `eth_sendTransaction`。用户要么完全信任该网站，要么手动把交易复制到 Mist 或节点控制台中。\n\nEIP-107 提出了一种让网站安全使用节点的方法：只读调用可以直接使用，而每笔交易都需要用户明确点击确认。\n\n## 它如何运作\n\n节点在 `\u003cnode url\u003e/authorization.html` 提供一个自包含的页面。由于该页面来自节点自己的源，浏览器的同源策略会对其提供保护。dapp 以两种方式使用该页面：\n\n1. **不可见的 iframe。** dapp 嵌入该页面，并通过 `window.postMessage` 发送只读 RPC 调用。iframe 会拒绝任何需要已解锁密钥的调用，因此隐藏的框架无法诱骗用户确认。\n2. **弹出窗口。** 对于 `eth_sendTransaction`，dapp 在新窗口中打开同一 URL。窗口会显示发送方、接收方、金额和 gas 费用，只有用户确认后才会转发调用。`eth_sign` 被有意禁止，因为弹窗无法安全地展示其含义。\n\n消息协议：\n\n- 框架或窗口首先发送字符串 `\"ready\"`。\n- dapp 发送 `{ id, payload }`，其中 `payload` 是普通的 JSON-RPC 对象。\n- 回复为 `{ id, result, error }`，`error.type === \"cancel\"` 表示用户拒绝。\n- 必须设置 `from`、`gas` 和 `gasPrice`，以便弹窗显示它们。\n\n如果账户已锁定且节点公开了 `personal` API，弹窗可以请求输入密码并短暂解锁账户（参考页面中为 3 秒）。\n\n## 示例代码\n\ndapp 一侧，通过弹窗发送交易：\n\n```ts\nconst NODE = \"http://localhost:8545\";\nconst popup = window.open(`${NODE}/authorization.html`, \"eth-auth\", \"width=420,height=520\")!;\n\nwindow.addEventListener(\"message\", (ev) =\u003e {\n  if (ev.origin !== NODE) return;\n  if (ev.data === \"ready\") {\n    popup.postMessage({\n      id: 1,\n      payload: {\n        jsonrpc: \"2.0\", id: 1, method: \"eth_sendTransaction\",\n        params: [{ from: \"0x…\", to: \"0x…\", value: \"0x2386f26fc10000\",\n                   gas: \"0x5208\", gasPrice: \"0x4a817c800\" }],\n      },\n    }, NODE);\n  } else if (ev.data.id === 1) {\n    if (ev.data.error?.type === \"cancel\") console.log(\"user rejected\");\n    else console.log(\"tx hash\", ev.data.result);\n  }\n});\n```\n\n## 需要注意\n\n- 该提案处于 **Stagnant** 状态，从未被标准化，也未被广泛部署。\n- 生态系统走了另一条路。浏览器扩展等钱包会注入提供者（[EIP-1193](/eip-1193/)），请求用户连接账户（[EIP-1102](/eip-1102/)、[EIP-2255](/eip-2255/)），并显示自己的确认界面。如今节点通常根本看不到用户的密钥。\n- 该设计假定账户在节点内部解锁，而这种做法现在已不被提倡。\n- 它仍然是一份有价值的历史记录，说明了\"dapp 绝不能在没有用户参与的情况下签名\"为何成为钱包的核心原则。\n"}}}
