What Smart Contracts Aren't Good For?

Do repost and rate:

How can I use Ethereum Solidity in order to draw graphics?

The Ethereum blockchain and the Ethereum programming language Solidity are not designed for graphics. If you want to have a visual representation of something in the blockchain you typically go and code up a web front end - the blockchain is more like a database, and databases aren't used for drawing graphics either. Now with a database what you can do is you can store the data in the database that is then used in order to render some graphics on a web browser or on a computer screen. You can do this with Ethereum too, however the cost of storing data on the Ethereum blockchain is high and  it's not what the system is designed for. The system is primarily designed as an identity and access management system - so that's what you have these wallets and Ethereum accounts for - and it's designed for moving tokens around. Not for graphics.

How can I do trigonometric calculations using Solidity?

Well, Solidity is a cut-down... although Turing-complete, it's a cut-down programming language that focuses, as I said in answer to the previous question, on moving tokens around and ensuring  that you know who owns what tokens, and basically providing identity and access management  to provide ownership of those tokens. So it doesn't have floating point built in. It uses integers because tokens, generally speaking, come in integers. And if you think that you're  seeing a token where it has 18 decimal places, well actually what they're doing there is they're  using something called fixed-point arithmetic and the 18 decimal places are actually not really decimal places, they're storing numbers and then presenting them by dividing them by  18 in order to make them seem like there are decimal places there.

So with no floating-point  arithmetic you would have to implement your own mathematical functions like sine and cos and log  and so on and so forth, and there are libraries out there that do that, but again the system's  not really designed for that kind of mathematical operation, so it's a bit clunky if you try to  use it, and at the moment there aren't many use cases that I've seen where you really would  want to be able to use things like sine and cos. Maybe if you had some token that had some location  information and you were calculating the distances between those tokens, but then you might as well  be storing the location information (if you're using an NFT for example) in the metadata, which is off chain, in which case you can use the trigonometric functions that come with Javascript in your web browser when you're placing your tokens on a map and measuring  distances between them or something. So again, it's not the primary purpose of Ethereum.

Doing artificial intelligence stuff on a blockchain such as Ethereum

Now I'm not an AI expert, but I do know that the go-to language for convolutional neural networks or things like that  is Python plus a library, for example, TensorFlow, so there are specific languages with specific  libraries that have been coded up over years by large teams of people in  order to do these kinds of things.

Solidity in Ethereum doesn't have that kind of functionality, and again the Ethereum machine that is running is not a high-power high-performance computer with lots of graphical processing units. It's doing an awful lot of calculation but  it is repeats of the same calculations on lots and lots of different machines in order  to get the same answer out, and that answer should be "this person owns that token" or "this  contract has transferred that balance to this person" and so on and so forth.

So it's not the  system that you would turn to in order to do the kind of things that AI researchers or AI developers do - it's in a different space. So again you've got to look at what the purpose and  the aims of the system are, and they are really about identifying who owns what and that's  about it.

Interested in learning more about Bitcoin, Blockchain, and Cryptocurrencies?

Subscribe to my Publish0x blog

The links throughout this article are provided for informational purposes only. I am not an affiliate of these companies, I make no recommendation regarding the companies or their services, and I have not received any compensation for linking to their content.

Follow me on instagram

Follow me on twitter

Thank you for reading!

Regulation and Society adoption

Events&meetings

Ждем новостей

Нет новых страниц

Следующая новость