You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a smart-contract address is generated from a hash of the creator’s account and the creating transaction’s nonce, prefixed with the byte 0x0C to arrive at a compatible length of 33 bytes : https://docs.aergo.io/en/v0.12/specs/addresses.html
In a near futur, users will be able to hold assets on different aergo sidechains and will most likely use the same private key to interact on those different chains.
Therefore a user might end up creating contracts with the same addresses on different chains.
Apart from possible confusion, and mistakes due to calling a contract on the wrong sidechain, other applications like multisigs and merkle-bridge would benefit from contract addresses being unique accross sidechains.
But it would be better for applications that make use of signed nonces (multisigs, state channels ...) not to have to worry about creating a custom contract id for sidechain replay protection.
We can instead generate the contract address from Hash(sender_address + nonce + chainIDHash).
The text was updated successfully, but these errors were encountered:
aspiers
added
the
UX
Not bugs or features, but areas where the user/developer experience could be better
label
Feb 13, 2020
Currently a smart-contract address is generated from a hash of the creator’s account and the creating transaction’s nonce, prefixed with the byte 0x0C to arrive at a compatible length of 33 bytes : https://docs.aergo.io/en/v0.12/specs/addresses.html
In a near futur, users will be able to hold assets on different aergo sidechains and will most likely use the same private key to interact on those different chains.
Therefore a user might end up creating contracts with the same addresses on different chains.
Apart from possible confusion, and mistakes due to calling a contract on the wrong sidechain, other applications like multisigs and merkle-bridge would benefit from contract addresses being unique accross sidechains.
Currently, the merkle-bridge POC and standard-token use a custom contract id to prevent replay accross sidechains :
https://github.com/aergoio/merkle-bridge/blob/837e78d7bc87efaafec09b37ce96217efe505667/contracts/merkle_bridge.lua#L70
https://github.com/aergoio/merkle-bridge/blob/837e78d7bc87efaafec09b37ce96217efe505667/contracts/standard_token.lua#L45
But it would be better for applications that make use of signed nonces (multisigs, state channels ...) not to have to worry about creating a custom contract id for sidechain replay protection.
We can instead generate the contract address from Hash(sender_address + nonce + chainIDHash).
The text was updated successfully, but these errors were encountered: