1

When reading about Signed Extensions in the transaction-format post it states that AdditionalSigned can be used to

to handle any additional data to go into the signed payload. This makes it possible to attach any custom logic prior to dispatching a transaction.

I noticed that CheckGenesis uses it but no clear on how it works.

Can you please explain how AdditionalSigned works and provide some additional use cases of AdditionalSigned?

Also, what does it mean by "attach any custom logic prior to dispatching a transaction"? How is it different than pre-dispatch and when should I use it over pre-dispatch?

1 Answer 1

1

The point of AdditionalSigned to include data in the signed data, aka the data is given to the sign function and is being "secured" by the signature of the transaction. The nice property of AdditionalSigned is that this data isn't part of the transaction itself. This means it doesn't increase the size of the transaction. However, this also means it needs to be data that both sides (signer and the chain) are aware of. An example of this is the genesis hash as you already said or the the spec_version.

CheckGenesis is for example used to protect against replays of transactions on different chains as they all have a different genesis. CheckSpecVersion is used to invalidate all transactions after a runtime upgrade, because the Call format may changed and you don't want to apply "invalid" calls.

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.