0

Say eligible voters are sent voting keys they need to use to vote. A contract would have a list of the hashes of these voting keys for verification. A voter would call a function passing in their voting keys. Then, the hash of the voting key is checked against the list of hashes. Once complete, the voting key is then tied to the address of the sender so that only the sender can use it again (if he so chooses to change the vote).

Would there be a risk of someone anticipating these transactions, extracting the voting key, then creating a new transaction of the same voting key but a different vote but with a different gas price so that it is more likely to be mined?

1 Answer 1

0

In theory, yes.

Whenever a transaction is broadcasted to the network it gets relayed from node to node. It is then considered to be part of the transaction pool. At some point (if the gas price is good enough) a miner includes the transaction in a block and wins the block.

While the transaction is being relayed through the network it's possible for someone to issue another transaction with the properties the OP stated and get 'ahead' of the older transaction. There are no guarantees in either way. Even if the older transaction is already part of a mined block, that block may become an uncle block as another chain becomes the canonical chain.

You can read more about the order of execution for example here: https://medium.com/blockchannel/life-cycle-of-an-ethereum-transaction-e5c66bae0f6e

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.