Earlier quoted context omitted.
Scaling is definitely a serious concern and is a large focus of Ethereum developers at the moment. I don't understand much about the proposed solutions, but they generally think the Ethereum network can be sharded in a way that allows only a small subset of the network to run any given contract and still guarantee reliability similar to as if the whole network had run it.
You'll need some very hard guarantees that that 'small subset' can never be under the control of a single entity.
Understanding Ethereum Smart Contracts
81–90 of 162 posts
Re: Understanding Ethereum Smart Contracts
#82I've been programing my own Ethereum smart contract (virtual currency) for awhile now. Here's some gotchas off the top of my head: - You have about 500 lines of code to work with. This of course varies, but smart contracts have to be really small to fit in the max gas limit (6.7 million wei). - You can't pass strings between contracts (coming soon). - There are no floating point numbers. Since you're probably working…
Re: Understanding Ethereum Smart Contracts
#83I published a code walkthrough tutorial yesterday on this: https://hackernoon.com/full-stack-smart-contract-development...
Thanks !
Re: Understanding Ethereum Smart Contracts
#84I've been programing my own Ethereum smart contract (virtual currency) for awhile now. Here's some gotchas off the top of my head: - You have about 500 lines of code to work with. This of course varies, but smart contracts have to be really small to fit in the max gas limit (6.7 million wei). - You can't pass strings between contracts (coming soon). - There are no floating point numbers. Since you're probably working…
> You can break up your code into multiple contracts, but the tradeoff is an increased attack area. This is the way to get programs over 500 lines, and it doesn't increase the attack area as much as you'd think, since you can essentially hard-code the addresses of outside contracts into your code--it's not a combinatorial explosion.
Re: Understanding Ethereum Smart Contracts
#85Earlier quoted context omitted.
regarding number 2, the child would not have a way of selling that Ethereum before 2035.
Can't they just sell access to their address?
Realistically anything that requires people to have decent data management / opsec is going to fail for >99% of people.
Re: Understanding Ethereum Smart Contracts
#86Doesn't Bitcoin script allow you to do far more complex things than just send btc from person A to person B?
Re: Understanding Ethereum Smart Contracts
#87> Bitcoin transactions are pretty simple in what they do. You can do one single thing. One type of transaction. Skipping some details, it all boils down to TO (who is receiving money), FROM (who is sending money) and AMOUNT (how much money). This let’s bitcoin be a store of value with the capability to transfer the value between participants in the network. Doesn't Bitcoin script allow you to do far more complex thin…
Re: Understanding Ethereum Smart Contracts
#88I've also just begun to play with smart contract programming. One problem I'm having is with event listening. It seems that MetaMask doesn't yet support subscriptions, nor does my localhost testRPC instance pass it in the web3 object. Some have suggested I need to run my own node just to listen for contract events. Has anyone figured out an easier solution?
Re: Understanding Ethereum Smart Contracts
#89I've been programing my own Ethereum smart contract (virtual currency) for awhile now. Here's some gotchas off the top of my head: - You have about 500 lines of code to work with. This of course varies, but smart contracts have to be really small to fit in the max gas limit (6.7 million wei). - You can't pass strings between contracts (coming soon). - There are no floating point numbers. Since you're probably working…
> There are no floating point numbers. Since you're probably working with "money", this can make things tricky. That is actually a feature when it comes to working with money. You don't ever want to use floating-point arithmetic with monetary values due to its inability to represent all possible decimal fractions of your base unit. This is just as true for over-hyped blockchain stuff as it is for any imaginable appli…
I feel like this is constantly repeated but is simply untrue and working in the financial sector (high frequency trading) I don't know anyone who actually uses fixed digit number systems to represent money. Normally what I do see are people outside of finance who need to represent money who read the common mantra about using a fixed digit representation only to eventually encounter all the issues that floating point was invented to solve. When they encounter those issues they then end up having to adapt their code only to basically re-invent a broken, unstable quasi-floating point system when they would have been much better off using the IEEE floating point system and actually taking the time to understanding how it works.
BigDecimal will solve the issue but it's absolute overkill both in terms of space and time, we're talking many many orders of magnitude in terms of performance degradation and it's entirely unneeded.
One simple solution that works very well for up to 6 decimal places is to take your idea of having an implied number of digits, but instead of using an integer data type, you use a floating point data type. So 1 dollar and 5 cents becomes (double)(1050000.0). This lets you represent a range from 0.000001 up to 9999999999.999999 exactly, without any loss of precision. Values outside of that range can still be represented as well but you may have some precision issues.
Another solution which is less efficient but more flexible is to use decimal floating point numbers instead of binary floating point numbers. There is an IEEE decimal floating point standard that can represent an enormous range of decimal values exactly. Intel even provides a C/C++ implementation that meets formal accounting standards.
Both of the solutions I list above are orders of magnitude more efficient than using fixed-point numeric types and are by no means difficult to use.
Re: Understanding Ethereum Smart Contracts
#90I've also just begun to play with smart contract programming. One problem I'm having is with event listening. It seems that MetaMask doesn't yet support subscriptions, nor does my localhost testRPC instance pass it in the web3 object. Some have suggested I need to run my own node just to listen for contract events. Has anyone figured out an easier solution?