Let's say I have a raw transaction that I broadcast to the network. At what point does its operation hash (opHash) get generated? Is it when the baker is forming the block? And what are the inputs to that calculation?

I also want to confirm that it's impossible to know a transaction's opHash before it has been baked.


The operation hash is generated at the time of submission to the network. You submit the raw transaction bytes to any node which validates the operation, validates your signature, and then creates the opHash before putting the operation into the mempool. The opHash is immediately returned to you, so yes, you absolutely know the opHash before it is baked. Even though the op is now in the mempool, that is not a guarantee it will be baked. A baker may choose to not include your operation because fee is too low, for example. If you use the tezos-client CLI, it waits, by default, for your operation to be included before exiting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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