3

Counters are only mentioned briefly in the developer documentation.

Furthermore each operation has a counter (explained in more detail later) that prevents replays so it is usually safe to re-emit an operation that seems lost.

  1. What is a counter in this context?

  2. What is replay and why do we want to prevent it?

  3. I tried to perform operations in parallel with a single public/private key pair in tezos-client and it complained about the counter. If I manually increase the counter in the second operation will it work properly?

1 Answer 1

4
  1. The counter is simply a number that is incremented with each operation.
  2. I think the documentation refers to a replay attack. If operations where not tagged with a counter, that is signed along with the original operation by the author, then an attacker could inject the same operation again. For instance, if you forge an operation that transfers tokens to me, had the operation not been tagged with a unique counter, then I could simply copy your operation and inject it on the network again. This way I would be paid twice!
  3. Yes, did you try? What did you find out? However, be careful about doing this in on the main net. Some operations, such as endorsements and baking, are penalised if done in double. One should therefore be careful when using the same key pairs in parallel.

Your Answer

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

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