EIPs Explained

EIP-5345 · Stagnant · Interface · 2022-07-26

EIP-5345: Silent Signing Extension for JSON-RPC

Proposed wallet JSON-RPC methods that let a user pre-approve an app to sign transactions silently for a limited time, contract and function list, mainly for games.

What problem does it solve?

Games and metaverse apps can trigger many on-chain actions in a short session: equip an item, craft, move, trade. If every action pops up the wallet, or on mobile switches to a separate wallet app and back, play becomes unbearable.

EIP-5345 proposes Silent Signing: the user approves once, for a bounded scope and time, and the app can then get transactions signed or sent in the background without further prompts.

How it works

Three new wallet RPC methods:

Method What it does
wallet_requestSilentSign Opens the wallet and asks the user to allow silent signing. Returns a random permissionSecret if approved
wallet_silentSignTransaction With the secret, the wallet signs a transaction in the background and returns it; the app broadcasts it
wallet_silentSendTransaction With the secret, the wallet signs and sends a transaction, returning its hash

The permission request is scoped by:

  • until: a Unix timestamp when the permission expires
  • chainId and contractAddress: one contract on one chain
  • allowedFunctions: function signatures such as "equip(address,uint256)"
  • description: text the wallet shows to the user

Flow: request permission, then the user approves or declines. If declined or unsupported, the app falls back to normal eth_sendTransaction prompts. Existing methods are unchanged.

For mobile wallets the spec describes using WalletConnect with push notifications to wake the wallet so it can pick up pending silent requests from the bridge server.

Sample code

Requesting permission through an EIP-1193 provider (illustrative; no wallet is assumed to support these methods):

const permissionSecret = await provider.request({
  method: "wallet_requestSilentSign",
  params: [{
    until: Math.floor(Date.now() / 1000) + 60 * 60,      // one hour
    chainId: 137,
    contractAddress: gameItemsAddress,
    allowedFunctions: ["equip(address,uint256)", "unequip(address,uint256)"],
    description: "Equip and unequip items during this session",
  }],
});

const txHash = await provider.request({
  method: "wallet_silentSendTransaction",
  params: [permissionSecret, {
    from: player,
    to: gameItemsAddress,
    data: iface.encodeFunctionData("equip", [hero, 7n]),
  }],
});

Things to know

  • Status is Stagnant. Do not assume any wallet supports these methods; treat it as a design reference.
  • Security rests entirely on the wallet enforcing the scope: expiry, chain, contract and function list. The spec does not cap value, gas or number of transactions, and a leaked permissionSecret would allow silent signing until expiry.
  • Related, more general work: EIP-2255 wallet permissions, ERC-7715 (Draft) for requesting fine-grained permissions such as session keys, and EIP-5792 for batched wallet calls.
  • Session keys in smart-contract accounts are another common way to reach the same "no popup per action" goal.

#wallet #json-rpc #ux #gaming #permissions

Details

Authors
Stanley Wu (@fruit37), Mücahit Büyükyılmaz (@anndro), Muhammed Emin Aydın (@muhammedea)
Status
Stagnant
Type
Standards Track / Interface
Created
2022-07-26

Machine-readable: Markdown · JSON