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

0 votes
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?
Jul 5, 2018 in Blockchain by charlie_brown
• 7,720 points

recategorized Jul 6, 2018 by Vardhan 46 views

1 answer to this question.

0 votes
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.
answered Jul 5, 2018 by ariaholic
• 7,340 points

Related Questions In Blockchain

0 votes
1 answer

How do I send back ethers to the sender of the tokens in a smart contract?

Whenever a smart contract receives ether via ...READ MORE

answered May 30, 2018 in Blockchain by Perry
• 17,010 points
317 views
0 votes
1 answer

How can I retrieve to and from address in transaction directly from blockchain?

The spending conditions, i.e., who is able ...READ MORE

answered Jul 11, 2018 in Blockchain by Shashank
• 10,330 points
63 views
0 votes
1 answer
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
126 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 27,630 points
2,590 views
0 votes
1 answer