Hi,
After some digging I still don't understand some major stuff about Ethereum and I hope someone can explain the following:
1. The miners are executing the smart contract code - right?
Does all of the miners in the system execute all the smart contracts code? And if so, how is the system able to scale and keep writing blocks every 15-17 secs when more and more contracts are being created?
2. In bitcoin, the miner that gets to write the next block gets it because they where able to find the solution for the specific hashing problem - how does this work in Ethereum?
I mean, how does the execution of smart contracts code and hashing the blocks works together?
3. A DAPP is basically a collection of smart contracts that work together and sending each other ether to run and do specific tasks - right?
If I got this right, what happens if someone else sends eth to one of the components (smart contract) that shouldn't run separately?
4. If I build a DAPP (let's say a new ERC20 token) - and I have only 1 ETH to use - how this affects my new coin?
Or in other words, how does the ether currency relates to these erc20 coins? When I buy or sell Golem for example, how is ETH part of that process?
5. Bitcoin has a limited number of coins - how does this works here? When are ethers created and is there a limit? What are the rules?
I really hope someone can help me.
Thanks again
1. Yes miners all execute the code and update states for every block. There's a gas limit of 4.7million for each block, so there is a limit to how many smart contracts can be executed per second (or per block). The gas pricing mechanism also forces smart contract creators to write code efficiently, to ensure transactions will not cost too much and expensive operations that cannot fit into the gas limit will be developed off-chain. Sharding is currently being considered as a solution for scalability in the future, to allow decentralized contract execution.
https://github.com/ethereum/wiki/wiki/Sharding-FAQ2. It's a similar concept, just a different hashing algorithm (memory hard hashing algorithm to prevent chip optimizations and allowing average users and home-use computers to mine profitably).
3. It depends on how it is implemented. But usually the creator would throw an error in the contract if functions are run by someone without permissions. Throwing an error essentially reverses the transaction and ethers are refunded.
4. Ethers are usually exchanged for tokens via a smart contract. Once a token is created, it runs on Ethereum and by default is independent of ether.
5. Ethers can be mined right now in PoW. The total ether supply will increase by about 10% more if PoS is implemented only after a year. Then there will likely be no more Ethers generated and all reward for confirming a block will be paid by other users.