Ricardo Ruano
Ricardo Ruano

Reputation: 31

How to prevent the smart contract from being modified and deployed in the blockchain network?

This question is more to private blockchain frameworks such as Corda,Hyperledger, and others. In all this platforms is posible write some programs named chaincode, smart contracts, etc, that allow us to implement the business logic . All of this are deployed in each peer of the blockchain network, but how to avoid and detect that are deployed a different version of the code in some peers?

I'm talking that the final result of smart contract are the same, so the consensus not is committed, but yes some peers can modified the code that it run in for any reason.

how we can manage this scenario in private blockchain?

Upvotes: 2

Views: 352

Answers (2)

Joel
Joel

Reputation: 23150

To expand on Matthew's answer, each state in a transaction is associated with a given contract. This contract is uniquely identified using a [contract name, hash of the JAR file containing the contract] pair.

If the contract is modified, this will modify the hash of the JAR containing the contract, and thus the contract JAR will no longer be considered valid.

As Matthew says, the transaction which contains (among other things) the information about which contract to use with each state is then digitally signed, preventing it from being modified.

Upvotes: 0

Matthew Stannard
Matthew Stannard

Reputation: 165

Smart contracts can be definitive if they are both signed by a valid digital signature and are deterministic.

The presence of a digital signature provides a mechanism to all nodes to allow them to determine whether the contract code has been manipulated.

If the smart contract code is deterministic, all nodes that execute the code will arrive at the same final state.

Upvotes: 0

Related Questions