Hot answers tagged

114

DApp is an abbreviated form for decentralized application. A DApp has its backend code running on a decentralized peer-to-peer network. Contrast this with an app where the backend code is running on centralized servers. A DApp can have frontend code and user interfaces written in any language (just like an app) that can make calls to its backend. ...


48

The Solidity FAQ on "memory" is highly recommended reading in entirety, and a snippet is provided below. The Ethereum Virtual Machine has three areas where it can store items. The first is “storage”, where all the contract state variables reside. Every contract has its own storage and it is persistent between function calls and quite expensive to ...


40

It's not certain yet, but: Do NOT rely on very fine-grained calculations of current gas costs. Assume that gas costs of contract calling may go up or down by up to an order of magnitude in a future hard fork. If creating contracts in assembly (ie. not serpent, solidity or LLL), do NOT use dynamic JUMP/JUMPI operations (ie. every JUMP/JUMPI should be ...


40

Whisper is a part of the Ethereum P2P protocol suite that allows for messaging between users via the same network that the blockchain runs on. There are many uses, some of which are listed on the wiki The protocol is seperate from the blockchain, so smart contracts do not have access. Whisper has existed in a sort of alpha, working-prototype state for ...


35

Warning, I'm not a huge fan of Lisk. This is obviously one side of the story and I'm sure there are more advantages of Lisk than I give them credit for. But I don't know them. A blog post (not by me): Why Lisk is inferior to Ethereum Author's main points regarding Lisk: Lisk "sandbox" cannot be used to run untrusted code Lisk framework provides no ...


33

Basically, you store any file into IPFS and then you store the IPFS hash in the Ethereum contract. Any user with an IPFS node is going to be able to access the file using that hash. You can store data, images, the front end, etc. whatever you want. Here you have an example: https://github.com/AdrianClv/ethereum-ipfs No. Even if your DAPP frontend (the HTML/...


26

Solution: MyContract = new web3.eth.Contract(abi) Docs https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#eth-contract When using version 1.0.x you need to pass in the Application Binary Interface, i.e. abi. And use the new keyword.


25

This question is too broad to be easily answered, and there are several good existing tutorials available online. But here are the first steps you might take: Read up on the basic concepts. The Ethereum white paper isn't a bad place to start, and some of the tutorials I linked above intersperse conceptual explanations with step-by-step tutorial instructions....


24

So it is only possible to send HEX data in the data field. This will not be a standard transaction but will require you to use geth, MyCrypto advanced settings on the send page, or another client that allows you to access and edit the data field. Google and visit an ascii->hex site and type your message. Copy the hexadecimal output, and remove all the ...


22

@tayvano: Unfortunately, I can't comment directly. I need "50 reputation" for this. Therefore I will write it as a new answer. I don't know as much about Serpent, but it appears to have the same goals and purpose as Solidity, but is meant to be similar to Python (and therefore be great for Python devs.) This, along with the range of clients, also ...


16

Yes you can. This little snippet might help. It's just a little toy to show how the two-dimensional array elements are referenced. It might be helpful to point out that things may be a little counter-intuitive because the X & Y axis may seem to be reversed. bool[2][] flags; It starts by describing a length 2 array of bools. Then it goes on to say ...


15

There are a few modules around that let you keep track of the "state" of a transaction (unconfirmed, X confirmations, conflicting transaction exists and is being confirmed, fully confirmed, definitely failed) and represent this info in the UI with color-coding. You should then probably only make "irreversible" changes to the data that's represented in the UI ...


15

One of the main things you'll want to focus on is determining which part of the application needs to be on-chain and which part might happen in the browser. This could separates the application into a few possible groups: Compute (Logic written in Solidity/Serpent, compiling to EVM bytecode) Storage (Static assets such as HTML/JS/CSS) Messaging (Ephemeral ...


15

Seems like you can unlock it for as long as the geth instance is running using a 0 as duration parameter: web3.personal.unlockAccount("address", "pass", 0);


14

A good Blog post by Vitalik Buterin goes through and the concept of a Dapp and other related concepts such as smart contract, Decentralised Autonomous Organisation, Decentraclised Corporation ect.. Here is the link with the Blog Post: DAOs, DACs, DAs and More: An Incomplete Terminology Guide


14

Ethereum is a smart contract platform. You don't run websites neither on it, nor with it. You can only deploy smart contracts on Ethereum and interact with them from the outside world. To interact with the smart contracts running within Ethereum, you need a client that can translate your worldly requests into Ethereum transactions. The most popular ones are ...


13

There are several options: dApp developers/companies can pay the transaction fees themselves, but only for transactions that interact with their app, and with some sort of rate limiting the way most real-world web apps work. This is what OneName did when their product depended on the need for fees to be paid in NameCoin, for example. Various techniques can ...


13

With tools like Metamask and other "lightwallet"-based infrastructure (wallets-in-the-browser), you are simply trusting that the browser environment keeps the keys safe. In terms of writing information: The centralized component in this architecture is that the remote RPC node that Metamask points to, accepts the raw signed transactions to inject into the ...


13

First, you don't want to think of contracts as analogous to tables. Each contract can hold multiple mappings of information. You could have a single ReviewSystem.sol that has mappings for both Restaurants and Reviews, and in line with what you suggested earlier you could have addRestaurant() and addReview() methods that would add records to the mappings ...


12

This following image helped me understand how decentralised applications fitted together. I'm typically a Java developer so I'm more familiar with writing middleware for some J2EE-server and hosting the application like that. I'm keeping this explanation somewhat very high-level. I'm currently opting for the approach of: Replacing Java (backend code) with ...


11

One place to start would be Dapps for Beginners you could follow the progression via Introduction to development on Ethereum and then Setting up your development environment or jump straight to;- Your first Dapp The tutorial focuses on your first steps using Alethzero (the development client), and the creation of a simple coin contract – the backend of ...


11

There are a variety of resources online that are helpful for both experienced developers and beginners who want to learn more about building applications on the Ethereum blockchain. Keep in mind that because the technology is so new, many of these resources are continually being updated and improved by the community. The most comprehensive resource for ...


11

The default answer would be: No, you cannot use an account without Ether for anything related to the Fancycoin, as any interaction with a standard token requires a transaction which you need to sign and broadcast to the network and conversely pay for the transaction costs in Ether (at least for the time being you can only pay fees in Ether). The more ...


11

First check your account balance : balance = web3.eth.getBalance(someAddress); then try to specify the gaslimit contractInstance.createProposal("ADHD", "Foo", 2, {from: web3.eth.accounts[1], gas:3000000})


10

Find below a definition of DApp written in this doc called "The General Theory of Decentralized Applications, Dapps". For an application to be considered a Dapp (pronounced Dee-app, similar to Email) it must meet the following criteria: The application must be completely open-source, it must operate autonomously, and with no entity controlling ...


10

Shuffling a deck Commutative encryption: Alice and Bob want to shuffle a deck of cards, such that neither knows what the other's hand contains, but the hands are disjoint (i.e. only one may have a particular card). Protocol: Alice and Bob decide on an encryption protocol with the following features EK(X) is X encrypted with key K DK[ EK(X) ] = X for all ...


10

It is achievable in a trustless manner as a smart contract using ring signatures. How it could work One such scheme would look like this. A group of people who wish to mix their funds would all submit funds from their origin address as well as public key to the smart contract. Each member would use the set of public keys to create a ring signature of ...


10

You may use Infura as a "read only / signed transactions only" node. The use of the API is free: https://infura.io Your may recommend your users to use Metamask Browser extension to be able to sign transactions in your App.


10

For point number one, this should work: geth --rpc --rpccorsdomain="*" console 2>> geth.log Running --rpccorsdomain="*" is dangerous though, especially if you have unlocked accounts. Put your domain name instead of *. For localhost, add --rpcaddr="localhost"


10

In alphabetical order, here are some DApps implementing a stablecoin, and the differences in their approaches. This is a community wiki for all to improve. (This is just a starting point.) Decentralized Capital How do I know that each DC asset is backed by its real world counterpart? We are working with our banking partner institute a mechanism ...


Only top voted, non community-wiki answers of a minimum length are eligible