{"action":"opened","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/9197","repository_url":"https://api.github.com/repos/bitcoin/bitcoin","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/9197/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/9197/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/9197/events","html_url":"https://github.com/bitcoin/bitcoin/issues/9197","id":190843889,"number":9197,"title":"RPC idempotency and RPC request replay protection","user":{"login":"kanzure","id":101238,"avatar_url":"https://avatars.githubusercontent.com/u/101238?v=3","gravatar_id":"","url":"https://api.github.com/users/kanzure","html_url":"https://github.com/kanzure","followers_url":"https://api.github.com/users/kanzure/followers","following_url":"https://api.github.com/users/kanzure/following{/other_user}","gists_url":"https://api.github.com/users/kanzure/gists{/gist_id}","starred_url":"https://api.github.com/users/kanzure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanzure/subscriptions","organizations_url":"https://api.github.com/users/kanzure/orgs","repos_url":"https://api.github.com/users/kanzure/repos","events_url":"https://api.github.com/users/kanzure/events{/privacy}","received_events_url":"https://api.github.com/users/kanzure/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-21T21:43:54Z","updated_at":"2016-11-21T21:43:54Z","closed_at":null,"body":"I noticed [pull request 128 to python-bitcoinlib](https://github.com/petertodd/python-bitcoinlib/pull/128) where an RPC client retry wrapper is proposed. The retry wrapper would retry in the event of an `IOError` exception. However, this does not seem particularly safe for RPC calls like `sendmany` because it could be possible to experience a socket or connection timeout even though bitcoind satisfied the original RPC request. In some cases, auto retrying could result in duplicate spending.\r\n\r\nRPC requests should have at least a nonce in every request. It should maybe be a nonce and sequence pair, per @gmaxwell's suggestion in below chat logs. It would be good to have RPC request replay protection in bitcoind.\r\n\r\nConcurrent writes should require locks. Applications should have some sense of guarantees around isolation of competing parallel RPC calls, too. It's not enough to \"check state\" over RPC with `listtransactions` because you can check state as much as you like, the state still might change between the time you check state and the time you resend the original RPC command, especially in distributed systems.\r\n\r\nhttps://botbot.me/freenode/bitcoin-core-dev/2016-11-21/?msg=76819688&page=2"}}
{"actor":{"display_login":"kanzure"}}