Ability to get the current network id #461

Closed
opened 2023-06-17 14:28:46 +09:00 by davidyuk · 1 comment
davidyuk commented 2023-06-17 14:28:46 +09:00 (Migrated from gitlab.com)

I've checked https://docs.aeternity.com/aesophia/v7.1.0/ and didn't find anything like this.

It is useful in case we validate a signature including network id in a smart contract. In two cases

  • we deploy the same source code in different networks and want to don't have signatures replayable between them
  • in case a fork of blockchain happens with a different id we want signatures to be incompatible between contracts

While the first use case can be solved by slightly adjusting a contract between deployments, the second can't unless there is a way to get the actual network id in runtime.

I've checked https://docs.aeternity.com/aesophia/v7.1.0/ and didn't find anything like this. It is useful in case we validate a signature including network id in a smart contract. In two cases - we deploy the same source code in different networks and want to don't have signatures replayable between them - in case a fork of blockchain happens with a different id we want signatures to be incompatible between contracts While the first use case can be solved by slightly adjusting a contract between deployments, the second can't unless there is a way to get the actual network id in runtime.
zxq9 commented 2023-06-21 16:10:17 +09:00 (Migrated from gitlab.com)

Created by: hanssv

Good idea - should be a straightforward addition!

Though it is consensus breaking (adding new operation) - so won't be available until Ceres

*Created by: hanssv* Good idea - should be a straightforward addition! Though it is consensus breaking (adding new operation) - so won't be available until Ceres
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/sophia#461
No description provided.