I have read about smart contracts and I am left with some doubts. Every invocation of a function in smart contract is a transaction which costs some ether.A miner chooses a smart contract on blockchain to complete the transaction.My doubts are :
1) If we have many smart contracts written by many developers to serve same purpose in the blockchain, who will decide that a particular smart contract is best one out of all ? How can miners choose that this smart contract has best logic and rules to be verified against or users tell to use a specific smart contract ? Ex : If I wanted to verify my certificate using a smart contract, and there are many smart contracts to serve this purpose, which and how does miners choose only one of them to verify ?
2) Suppose, I have mapping data structure in solidity smart contract A and I stored some data say mapping(uint => string) vals and it is stored with 5 values till vals . Now in another transaction , I wanted to access vals or store a new value at another index from the same smart contract by creating a new transaction , is it feasible ?If so, how will miners choose same smart contract everytime ?
3) Can I create a private smart contract in ethereum ? Suppose a Govt institution wants to store its certificates in blockchain using some mapping data structure say mapping(stu_ID => Certificate_ID) and others can only read it or use the same mapping data structute to verify their certificate if it's fake or genuine ?Is it possible ?
4) Can I edit a smart contract in blockchain ? Suppose I wanted to change some rules or logic of my own smart contract , can I do it ?
forgive me if queries are noobish.