{"eip":1175,"title":"Wallet \u0026 shop standard for all tokens (erc20)","description":"Make wallets and shops created from certified contracts make erc20 tokens easy to use for commerce.","authors":["Jet Lim (@Nitro888)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2018-06-21","requires":[20],"discussionsTo":"https://github.com/ethereum/EIPs/issues/1182","repo":"ERCs","label":"ERC-1175","officialUrl":"https://eips.ethereum.org/EIPS/eip-1175","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1175.md","url":"https://eips.huatuo.xyz/eip-1175/","tldr":{"en":"A proposed set of wallet, shop and registry contracts that would let users buy items with any ERC-20 token in a single call instead of the usual approve-then-transferFrom dance.","ja":"ユーザーが、通常の approve してから transferFrom するという手順の代わりに、任意の ERC-20 トークンで 1 回の呼び出しでアイテムを購入できるようにする、ウォレット・ショップ・レジストリのコントラクト群の提案。","ko":"사용자가 흔히 쓰는 approve 후 transferFrom 절차 대신, 어떤 ERC-20 토큰으로든 한 번의 호출로 아이템을 구매할 수 있게 하자는 지갑, 상점, 레지스트리 컨트랙트 묶음 제안.","zh":"一套提议中的钱包、商店和注册表合约，让用户能用任意 ERC-20 代币在一次调用中购买商品，而无需通常的先 approve 再 transferFrom 的流程。"},"tags":["token","payments","commerce","erc20","wallet"],"explainers":{"en":{"lang":"en","tldr":"A proposed set of wallet, shop and registry contracts that would let users buy items with any ERC-20 token in a single call instead of the usual approve-then-transferFrom dance.","tags":["token","payments","commerce","erc20","wallet"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1175/","markdown":"## What problem does it solve?\n\nPaying a merchant contract with an [ERC-20](/eip-20/) token normally takes two transactions: the buyer calls `approve` on the token, then the shop calls `transferFrom` to pull the funds. Every shop also has to write its own payment logic for every token it accepts.\n\nERC-1175 proposes a shared framework so that a user's wallet contract and a merchant's shop contract can trust each other. Once both exist, a purchase is one call from the wallet owner: `paySafe(shop, item)`.\n\n## How it works\n\nThere are three kinds of contract:\n\n| Contract | Role |\n| --- | --- |\n| **WalletCenter** | Factory and registry. `createWallet()` and `createShop(erc20)` deploy new instances; `isWallet` / `isShop` tell whether an address was created by it. |\n| **Wallet** | Owned by a user. Holds ETH and tokens, and pays shops with `paySafe`, `payUnsafe` or cancels with `payCancel`. `withdrawal` returns funds to the owner. |\n| **Shop** | Owned by a merchant and tied to one ERC-20 token (or ETH). Lists items with `resister(category, price, stock)`, quotes with `price(item)`, and accepts `pay(item)` only from registered wallets. |\n\nA shop created by the WalletCenter is a **safe shop**. `paySafe` only works for safe shops; `payUnsafe` lets a wallet pay a shop that merely reuses the interface.\n\nDuring a payment the wallet looks up the item's token and price, approves the shop for that amount, and calls `shop.pay(item)`. The shop checks that the caller is a registered wallet and pulls the tokens. Because the wallet contract performs both steps internally, the user only signs one transaction.\n\nThe reference code defines item categories: one-time purchases, items that expire after a week (with cancellation and refund), and stackable items with a stock count. Shops and items also carry free-form info bytes and up/down vote counters.\n\n## Sample code\n\nPaying a safe shop from a user's wallet contract with ethers v6 (addresses are placeholders):\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst owner = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst center = new Contract(CENTER_ADDRESS, [\n  \"function isShop(address) view returns (bool)\",\n], provider);\n\nconst wallet = new Contract(MY_WALLET_ADDRESS, [\n  \"function paySafe(address shop, uint256 item) payable returns (bool)\",\n], owner);\n\nconst shop = new Contract(SHOP_ADDRESS, [\n  \"function price(uint256 item) view returns (address erc20, uint256 value)\",\n  \"function canBuy(address who, uint256 item) view returns (bool)\",\n], provider);\n\nconst item = 0n;\nif (await center.isShop(SHOP_ADDRESS) \u0026\u0026 await shop.canBuy(MY_WALLET_ADDRESS, item)) {\n  const [token, value] = await shop.price(item);\n  console.log(`item costs ${value} of token ${token}`);\n  await (await wallet.paySafe(SHOP_ADDRESS, item)).wait(); // one transaction\n}\n```\n\n## Things to know\n\n- **Status: Stagnant.** The proposal never gained adoption and there is no widely used implementation.\n- The reference code targets Solidity 0.4.24 (`constant`, `now`, `.transfer`) and will not compile on modern compilers without changes. It has not been audited; treat it as a sketch.\n- Funds must sit in a per-user wallet contract rather than the user's own address, which is the main trade-off versus simply calling `approve` and `transferFrom`.\n- Several method names in the spec are unusual (`resister` for \"register\", `dnVote` for \"down vote\"); keep the spelling exact if you implement against it.\n- Today, single-transaction token payments are more commonly achieved with signature-based approvals such as [ERC-2612](/eip-2612/) `permit`.\n"},"ja":{"lang":"ja","tldr":"ユーザーが、通常の approve してから transferFrom するという手順の代わりに、任意の ERC-20 トークンで 1 回の呼び出しでアイテムを購入できるようにする、ウォレット・ショップ・レジストリのコントラクト群の提案。","tags":["token","payments","commerce","erc20","wallet"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1175/","markdown":"## 何を解決するのか\n\n[ERC-20](/eip-20/) トークンで販売者のコントラクトに支払うには、通常 2 つのトランザクションが必要です。購入者がトークンに対して `approve` を呼び、その後ショップが `transferFrom` を呼んで資金を引き出します。また、すべてのショップは、受け付けるトークンごとに独自の支払いロジックを書く必要があります。\n\nERC-1175 は、ユーザーのウォレットコントラクトと販売者のショップコントラクトが互いを信頼できるようにする共有フレームワークを提案します。両方が存在すれば、購入はウォレット所有者による 1 回の呼び出し `paySafe(shop, item)` で済みます。\n\n## 仕組み\n\nコントラクトは 3 種類あります。\n\n| コントラクト | 役割 |\n| --- | --- |\n| **WalletCenter** | ファクトリー兼レジストリ。`createWallet()` と `createShop(erc20)` が新しいインスタンスをデプロイし、`isWallet` / `isShop` で、アドレスがこのコントラクトによって作られたかどうかがわかります。 |\n| **Wallet** | ユーザーが所有。ETH とトークンを保持し、`paySafe`、`payUnsafe` でショップに支払い、`payCancel` でキャンセルします。`withdrawal` は資金を所有者に返します。 |\n| **Shop** | 販売者が所有し、1 つの ERC-20 トークン（または ETH）に結び付けられます。`resister(category, price, stock)` でアイテムを登録し、`price(item)` で価格を提示し、登録済みのウォレットからのみ `pay(item)` を受け付けます。 |\n\nWalletCenter によって作られたショップは**セーフショップ**です。`paySafe` はセーフショップに対してのみ動作し、`payUnsafe` は、インターフェースを再利用しているだけのショップにウォレットが支払うことを可能にします。\n\n支払い時、ウォレットはアイテムのトークンと価格を調べ、その金額についてショップを承認（approve）し、`shop.pay(item)` を呼びます。ショップは、呼び出し元が登録済みのウォレットであることを確認し、トークンを引き出します。ウォレットコントラクトが両方のステップを内部で実行するため、ユーザーが署名するトランザクションは 1 つだけです。\n\nリファレンスコードは、アイテムのカテゴリを定義しています。1 回限りの購入、1 週間後に期限切れになるアイテム（キャンセルと返金あり）、在庫数を持つ積み重ね可能なアイテムです。ショップとアイテムは、自由形式の情報バイトと、賛成／反対の投票カウンターも持ちます。\n\n## サンプルコード\n\nethers v6 で、ユーザーのウォレットコントラクトからセーフショップに支払う例（アドレスはプレースホルダーです）:\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst owner = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst center = new Contract(CENTER_ADDRESS, [\n  \"function isShop(address) view returns (bool)\",\n], provider);\n\nconst wallet = new Contract(MY_WALLET_ADDRESS, [\n  \"function paySafe(address shop, uint256 item) payable returns (bool)\",\n], owner);\n\nconst shop = new Contract(SHOP_ADDRESS, [\n  \"function price(uint256 item) view returns (address erc20, uint256 value)\",\n  \"function canBuy(address who, uint256 item) view returns (bool)\",\n], provider);\n\nconst item = 0n;\nif (await center.isShop(SHOP_ADDRESS) \u0026\u0026 await shop.canBuy(MY_WALLET_ADDRESS, item)) {\n  const [token, value] = await shop.price(item);\n  console.log(`item costs ${value} of token ${token}`);\n  await (await wallet.paySafe(SHOP_ADDRESS, item)).wait(); // one transaction\n}\n```\n\n## 知っておくべきこと\n\n- **ステータス: Stagnant。** この提案は採用が進まず、広く使われている実装はありません。\n- リファレンスコードは Solidity 0.4.24（`constant`、`now`、`.transfer`）を対象としており、変更なしでは現代のコンパイラでコンパイルできません。監査も受けていないため、スケッチとして扱ってください。\n- 資金は、ユーザー自身のアドレスではなくユーザーごとのウォレットコントラクトに置く必要があります。これが、単に `approve` と `transferFrom` を呼ぶ方法と比べた主なトレードオフです。\n- 仕様のいくつかのメソッド名は変わっています（「register」の `resister`、「down vote」の `dnVote`）。これに合わせて実装する場合は、スペルを正確に保ってください。\n- 現在、1 トランザクションでのトークン支払いは、[ERC-2612](/eip-2612/) の `permit` のような署名ベースの承認によって実現されることが多くなっています。\n"},"ko":{"lang":"ko","tldr":"사용자가 흔히 쓰는 approve 후 transferFrom 절차 대신, 어떤 ERC-20 토큰으로든 한 번의 호출로 아이템을 구매할 수 있게 하자는 지갑, 상점, 레지스트리 컨트랙트 묶음 제안.","tags":["token","payments","commerce","erc20","wallet"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1175/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-20](/eip-20/) 토큰으로 판매자 컨트랙트에 결제하려면 보통 트랜잭션이 두 번 필요합니다. 구매자가 토큰에 `approve`를 호출한 다음, 상점이 `transferFrom`을 호출해 자금을 가져옵니다. 또한 모든 상점은 받는 토큰마다 자체 결제 로직을 작성해야 합니다.\n\nERC-1175는 사용자의 지갑 컨트랙트와 판매자의 상점 컨트랙트가 서로 신뢰할 수 있도록 하는 공유 프레임워크를 제안합니다. 둘 다 있으면 구매는 지갑 소유자의 호출 한 번, `paySafe(shop, item)`으로 끝납니다.\n\n## 어떻게 동작하나요?\n\n컨트랙트는 세 종류가 있습니다.\n\n| 컨트랙트 | 역할 |\n| --- | --- |\n| **WalletCenter** | 팩토리이자 레지스트리. `createWallet()`과 `createShop(erc20)`이 새 인스턴스를 배포하고, `isWallet` / `isShop`은 어떤 주소가 이 컨트랙트로 만들어졌는지 알려 줍니다. |\n| **Wallet** | 사용자가 소유. ETH와 토큰을 보관하고, `paySafe`, `payUnsafe`로 상점에 결제하거나 `payCancel`로 취소합니다. `withdrawal`은 자금을 소유자에게 돌려줍니다. |\n| **Shop** | 판매자가 소유하며 ERC-20 토큰 하나(또는 ETH)에 묶입니다. `resister(category, price, stock)`로 아이템을 등록하고, `price(item)`으로 가격을 알려 주며, 등록된 지갑에서 온 `pay(item)`만 받습니다. |\n\nWalletCenter가 만든 상점은 **안전한 상점(safe shop)**입니다. `paySafe`는 안전한 상점에만 작동하고, `payUnsafe`는 인터페이스만 재사용한 상점에 지갑이 결제할 수 있게 합니다.\n\n결제 중에 지갑은 아이템의 토큰과 가격을 조회하고, 그 금액만큼 상점을 승인(approve)한 뒤 `shop.pay(item)`을 호출합니다. 상점은 호출자가 등록된 지갑인지 확인하고 토큰을 가져갑니다. 지갑 컨트랙트가 두 단계를 내부에서 모두 수행하므로 사용자는 트랜잭션 하나만 서명하면 됩니다.\n\n레퍼런스 코드는 아이템 카테고리를 정의합니다. 일회성 구매, 일주일 뒤 만료되는 아이템(취소와 환불 포함), 재고 수량이 있는 중첩 가능한 아이템입니다. 상점과 아이템은 자유 형식의 정보 바이트와 찬성/반대 투표 카운터도 가집니다.\n\n## 샘플 코드\n\nethers v6로 사용자의 지갑 컨트랙트에서 안전한 상점에 결제하기(주소는 자리표시자입니다):\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst owner = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst center = new Contract(CENTER_ADDRESS, [\n  \"function isShop(address) view returns (bool)\",\n], provider);\n\nconst wallet = new Contract(MY_WALLET_ADDRESS, [\n  \"function paySafe(address shop, uint256 item) payable returns (bool)\",\n], owner);\n\nconst shop = new Contract(SHOP_ADDRESS, [\n  \"function price(uint256 item) view returns (address erc20, uint256 value)\",\n  \"function canBuy(address who, uint256 item) view returns (bool)\",\n], provider);\n\nconst item = 0n;\nif (await center.isShop(SHOP_ADDRESS) \u0026\u0026 await shop.canBuy(MY_WALLET_ADDRESS, item)) {\n  const [token, value] = await shop.price(item);\n  console.log(`item costs ${value} of token ${token}`);\n  await (await wallet.paySafe(SHOP_ADDRESS, item)).wait(); // one transaction\n}\n```\n\n## 알아둘 점\n\n- **상태: Stagnant.** 이 제안은 채택되지 못했고 널리 쓰이는 구현도 없습니다.\n- 레퍼런스 코드는 Solidity 0.4.24(`constant`, `now`, `.transfer`)를 대상으로 하며, 수정 없이는 현대 컴파일러에서 컴파일되지 않습니다. 감사도 받지 않았으니 스케치로 취급하세요.\n- 자금은 사용자 본인의 주소가 아니라 사용자별 지갑 컨트랙트에 두어야 하며, 이것이 단순히 `approve`와 `transferFrom`을 호출하는 방식 대비 주된 트레이드오프입니다.\n- 명세의 일부 메서드 이름은 특이합니다(\"register\"를 뜻하는 `resister`, \"down vote\"를 뜻하는 `dnVote`). 이에 맞춰 구현한다면 철자를 정확히 유지하세요.\n- 오늘날 단일 트랜잭션 토큰 결제는 [ERC-2612](/eip-2612/) `permit` 같은 서명 기반 승인으로 구현하는 경우가 더 많습니다.\n"},"zh":{"lang":"zh","tldr":"一套提议中的钱包、商店和注册表合约，让用户能用任意 ERC-20 代币在一次调用中购买商品，而无需通常的先 approve 再 transferFrom 的流程。","tags":["token","payments","commerce","erc20","wallet"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1175/","markdown":"## 它解决什么问题？\n\n用 [ERC-20](/eip-20/) 代币向商家合约付款，通常需要两笔交易：买家对代币调用 `approve`，然后商店调用 `transferFrom` 来提取资金。每个商店还得为它接受的每种代币编写自己的支付逻辑。\n\nERC-1175 提出了一个共享框架，让用户的钱包合约和商家的商店合约可以互相信任。两者都就位之后，一次购买只需钱包所有者发起一次调用：`paySafe(shop, item)`。\n\n## 它如何运作\n\n共有三种合约：\n\n| 合约 | 角色 |\n| --- | --- |\n| **WalletCenter** | 工厂兼注册表。`createWallet()` 和 `createShop(erc20)` 部署新实例；`isWallet` / `isShop` 用来判断某个地址是否由它创建。 |\n| **Wallet** | 归用户所有。持有 ETH 和代币，通过 `paySafe`、`payUnsafe` 向商店付款，或用 `payCancel` 取消。`withdrawal` 把资金退还给所有者。 |\n| **Shop** | 归商家所有，并绑定一种 ERC-20 代币（或 ETH）。用 `resister(category, price, stock)` 上架商品，用 `price(item)` 报价，并且只接受来自已注册钱包的 `pay(item)`。 |\n\n由 WalletCenter 创建的商店是**安全商店**。`paySafe` 只对安全商店有效；`payUnsafe` 则允许钱包向仅仅复用了该接口的商店付款。\n\n付款时，钱包会查询商品的代币和价格，为该金额授权商店（approve），然后调用 `shop.pay(item)`。商店检查调用者是否为已注册的钱包，并提取代币。由于钱包合约在内部完成这两个步骤，用户只需签署一笔交易。\n\n参考代码定义了商品类别：一次性购买、一周后过期的商品（支持取消和退款），以及带库存数量的可叠加商品。商店和商品还带有自由格式的信息字节，以及赞成/反对的投票计数器。\n\n## 示例代码\n\n用 ethers v6 从用户的钱包合约向安全商店付款（地址为占位符）：\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst owner = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst center = new Contract(CENTER_ADDRESS, [\n  \"function isShop(address) view returns (bool)\",\n], provider);\n\nconst wallet = new Contract(MY_WALLET_ADDRESS, [\n  \"function paySafe(address shop, uint256 item) payable returns (bool)\",\n], owner);\n\nconst shop = new Contract(SHOP_ADDRESS, [\n  \"function price(uint256 item) view returns (address erc20, uint256 value)\",\n  \"function canBuy(address who, uint256 item) view returns (bool)\",\n], provider);\n\nconst item = 0n;\nif (await center.isShop(SHOP_ADDRESS) \u0026\u0026 await shop.canBuy(MY_WALLET_ADDRESS, item)) {\n  const [token, value] = await shop.price(item);\n  console.log(`item costs ${value} of token ${token}`);\n  await (await wallet.paySafe(SHOP_ADDRESS, item)).wait(); // one transaction\n}\n```\n\n## 需要注意\n\n- **状态：Stagnant。** 该提案从未获得采用，也没有被广泛使用的实现。\n- 参考代码面向 Solidity 0.4.24（`constant`、`now`、`.transfer`），不经修改无法在现代编译器上编译。它也未经审计，请把它当作草图。\n- 资金必须存放在每个用户各自的钱包合约中，而不是用户自己的地址里，这是相对于直接调用 `approve` 和 `transferFrom` 的主要取舍。\n- 规范中的一些方法名比较特别（用 `resister` 表示\"register\"，用 `dnVote` 表示\"down vote\"）；如果按它实现，请保持拼写完全一致。\n- 如今，单笔交易的代币支付更常通过基于签名的授权来实现，例如 [ERC-2612](/eip-2612/) 的 `permit`。\n"}}}
