Signature – How to Use a Signed Transaction to Execute on Another Account

signature

Will that transaction function as if the signer sent it? I am assuming this is how limit orders for dapps such as Cowswap work.

For example (assuming this is true): wallet A signs a Uniswap transaction to swap tokenA for tokenB. Wallet B executes that transaction, whos wallet will recieve tokenB and pay for tokenA?

Best Answer

If you build and sign a valid transaction transferring 1 Eth from your account A to another account B, this is exactly what the transaction will do, whoever submits it, and to whatever RPC it's being submitted.

If an external actor was attempting to take your transaction, replace the receiving address by an address of their own, then the transaction signature would not be valid anymore, and would be rejected by any node on the network.

To elaborate on your example, submitting a transaction to an RPC doesn't involve a wallet at all, it's just sending an RPC request containing the signed transaction. So the statement "wallet B sending a transaction signed by wallet A" does not make sense here.

Related Topic