Skip to content

Question on contract instances #1027

Answered by sanity
orthecreedence asked this question in Q&A
Discussion options

You must be logged in to vote

To my understanding, a contract is a WASM program (I'm assuming a hash of it). Does the key for this program contain metadata? In other words, can two instances of the same WASM program exist under different keys, but also (verifiably) running the exact same code?

Sorry for the slow reply. Contracts are identified on the network by:

id = hash(hash(wasm) + parameters)

Where the hash algorithm is Blake3.

The parameters are an arbitrary block of bytes that's typically used to configure the contract - for example it would often contain the contract owner's public key.

So you could have two contracts with the same wasm code but different parameters and these would have completely different …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@orthecreedence
Comment options

Answer selected by orthecreedence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants