7 ms·
You should try writing a smart contract and it will become clear how it works.
by rcme 3y ago
You should try writing a smart contract and it will become clear how it works.
- em-bee 3y agoas i understand it, a smart contract is stored on the chain and is executed on your computer whenever you make a transaction that triggers the contract, or something like that. so the whole thing happens on my or your computer and not somewhere else. when i host a website and a user access that website, then it causes the host server to compute whatever the user asks for. if i put my "website" on the chain as an app (a dapp?) then i guess it is downloaded to the users computer and executed there. how can the blockchain help me access computing resources on third party services? i suppose that devices could register themselves on the blockchain as having computing resources available, and an application can then access those resources. am i missing anything?
- dale_glass 3y agoIt's much, much worse than that. Smart contracts execute on the blockchain, which means they execute on thousands or millions of computers in lockstep. Extra hardware doesn't add capability, it adds redundancy. Since the blockchain is public there are things you can get out of it for free by looking at the public state, but actually performing a computation that has some sort of world-wide visible effect involves executing that code on every node at once, so it's amazingly costly.
- em-bee 3y agoa cursory search suggests that this is not the case and that smart contracts only run on a single node. the result of the smart contract that creates another blockchain entry causes the calculation of the new entry on every node that is mining. internet computer should be using the blockchain to manage computing resources that themselves also don't run on the blockchain.
- dale_glass 3y agoIt amounts to the same thing, really. Blockchains are structured so that you don't need to trust, you can verify. You follow the longest valid chain, and by "valid" I mean that your node verifies every block and checks everything complies with the rules. For running code, it's the same thing. You can trust that your code won't be subverted by some rogue node because everyone else is double-checking those computations, and if a node breaks the rules its work will be rejected. > internet computer should be using the blockchain to manage computing resources that themselves also don't run on the blockchain. Not sure what's this supposed to mean. In general though blockchains are only effective within themselves. Any interaction with the outside hits the oracle problem -- you're trusting some outside source not to lie, so the blockchain doesn't really add anything.
- em-bee 3y agothe blockchain doesn't really add anything well, that is what i am trying to understand. for now i don't think that is right. it doesn't make sense to put everything directly on the chain. that would be to costly. not every computation needs to be trusted. i can still implement some checks to verify that computations are ok without the computation needing to run on the chain itself. but the chain can provide a mechanism to manage the resources (who gets to use how much and where, and who pays for it) which would be more difficult to do without a chain.
- dale_glass 3y agoNo, the chain only has authority over itself. It's the same issue as with NFTs. Yes, you can store on the blockchain stuff like "User 0xabcdef owns the Godslayer of Hitpoints sword". And a game can look at the blockchain, and make use of that record. But absolutely nothing whatsoever stops it from deciding to stop caring, or replacing your fancy sword with a rubber duck, or deciding that screw this particular user, they're banned regardless of what the chain says. Also even to the extent this stuff works it's not nice to use. If the blockchain has you have some sort of resource (money, quota, etc), then if somebody ever gets their hands on your account they're now the rightful owner as far as the blockchain is concerned. So if per the chain you're owed say, 1 year worth of GPU time or something, that automatically becomes a self-paying bounty. Everyone can see it, and has an incentive to try and hack you.