Re:Ethereum from scratch – Part 1: Ping
by j2kun on Thursday July 20, 2017 @07:08PM
(#14816961)
From my limited understanding, a smart contract essentially runs in a VM with a dedicated memory space that is unique to that contract (and copied along with the contract). However, there is a limited ability for it to interact with other contracts via their (hard-coded) addresses. So a contract can, for example, listen for events occurring with a specific contract, and invoke itself based on the results. It can do this because parts of a contract's memory space are private (I think this is how it works), and so a contract can have secret keys and manage money.
Moreover, a point that was not made clear to me when I first read about Ethereum, the programs are inherently limited in the number of steps that can be run, and the VM monitors this and terminates the program prematurely if it exceeds the limit. Moreover, longer programs cost the caller (the person or other contract asking the network to run this program) more money.
Moreover, a point that was not made clear to me when I first read about Ethereum, the programs are inherently limited in the number of steps that can be run, and the VM monitors this and terminates the program prematurely if it exceeds the limit. Moreover, longer programs cost the caller (the person or other contract asking the network to run this program) more money.