I hear often that the Ethereum virtual Machine is Turing complete and so you can simulate essentially any computation on it.
This got me wondering. How do I sort n numbers using EVM? One obvious thing to do is to set up a smart contact. Any address can send a sequence of transactions to the contract and when the smart contact receives a particular transaction (say of 0 eth) from the calling but address, it sends back all previously received eth from it in sorted order (by transaction value).
This seems incredibly stupid but at least there is a way to perform the computation.
Is there a more reasonable/clever way?
I suppose i am primarily struggling with coming up with a decent way to enter input and read output from EVM. Encoding inputs as values of eth in transactions sent to smart contacts clearly works only in theory.
Does someone have a link to any article discussing the Turing completeness of EVM. Any fun projects exploring this aspect (and not about making money or adding useful features)? I want some pointless and fun project!
[link] [comments]
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments