trh
trh

Reputation: 181

Why send a nonce as part of a Chainweb transaction?

The Pact documentation describes metadata that can be sent with your transaction to a Chainweb node. In that metadata is an optional nonce field:

https://pact-language.readthedocs.io/en/stable/pact-reference.html#yaml-exec-command-request

What benefit is there in specifying my own nonce?

Upvotes: 2

Views: 56

Answers (1)

spopejoy
spopejoy

Reputation: 841

It's not optional in the API, see https://api.chainweb.com/openapi/pact.html#tag/model-payload . The yaml file tool simply inserts the current time if you leave it out.

It's salt for the transaction hash that you can use as you see fit, ie to change the transaction hash without changing anything functional. Note that georgep's technique does not need the nonce, as changing the gas price would change your transaction hash all by itself.

Upvotes: 1

Related Questions