CryptoCoinsInfoClub.com

Using Ethereum To Store Data

Blockchain Bloat: How Ethereum Is Tackling Storage Issues

Blockchain Bloat: How Ethereum Is Tackling Storage Issues

Blockchain Bloat: How Ethereum Is Tackling Storage Issues Jan 18, 2018 at 05:22 UTC|UpdatedJan 24, 2018 at 02:53 UTC 24,270 tokens. 27,358 pending transactions. 463,713 digital kittens . Ethereum has hosted a lot of activity recently, and while many crypto enthusiasts see that as a positive sign, as the network's usage soars, its history gets longer and its blockchain more unruly. And although network congestion leading to transaction backlogs and rising fees has taken the spotlight, there's another issue this scale causes - a growing database that puts significant storage costs on users wanting to run a full node. That database, called the ethereum state, hold all the computations that need to be memorized by the computers supporting the platform and the ethereum blockchain itself. And with the costs (both in time and money) of storing the state increasing, fewer and fewer people are choosing to run full nodes, which many worry will centralize the network into the hands of only a few arbitrators. For one thing, ethereum developers are well underway engineering protocol-level changes such as sharding , aimed at minimizing the database. But since these technologies are still in development, other stakeholders, namely those running ethereum clients - the software needed for users to communicate with the blockchain - have been under fresh pressure to cope with the growth of the state database. "The fact that improving this stuff is critical has been known since late 2016, the ideas have been floating around for half a year to over a year. Where are the implementations?" said ethereum creator Vitalik Buterin on a developer channel recently. The frustration is palpable with both Buterin and Afri Schoedon, who manages technical communications at ethereum software client prov Continue reading >>

Typing And Your Contracts Storage

Typing And Your Contracts Storage

Solidity includes 7 basic types, listed below: hash: 256-bit, 32-byte data chunk, indexable into bytes and operable with bitwise operations. uint: 256-bit unsigned integer, operable with bitwise and unsigned arithmetic operations. int: 256-bit signed integer, operable with bitwise and signed arithmetic operations. string32: zero-terminated ASCII string of maximum length 32-bytes (256-bit). address: account identifier, similar to a 160-bit hash type. Solidity is a statically typed language this means that a variables type must be known at compile time, thus it differs from javascript whose loose typing allows more flexibility in the typing of variables. Explicit type conversion is typically only allowed when converting between signed and unsigned integers, or when converting an address or an integer to a hash. It is also possible to specify the size of uint, int and hash by suffixing the required bit width in steps of 8 bits (hash160, int8, uint32 etc..). In addition to these types it is possible to define structs and mappings as datatypes (which I will show below). Every type is based around Ethereums 32byte word limit. Every contract on the blockchain has its own storage which only it can write to. This is known as the contracts state and it is a flexible database which allows you almost unlimited storage space if you are willing to pay for it! A contracts storage is at its most basic a key-value store with 2^256 possible keys and 2^256 values. This makes for sufficient possible storage to create database structures of any type imaginable. Solidity has several tools for you to use to structure the storage of a contract as a relational database model. In the previous contract you used a mapping to store value associated with an address but this only one of many options Continue reading >>

How Can Blockchain Be Used As A Database To Store Data?

How Can Blockchain Be Used As A Database To Store Data?

How can blockchain be used as a database to store data? Currently decentralized blockchain applications have few options to store data. Decentralized storage options are: Decentralized cloud file storages, such as Storj, Sia, Ethereum Swarm, etc. Distributed Databases, such as Apache Cassandra, Rethink DB, etc. Storing everything in blockchain itself: Storing everything in blockchain is the simplest solution. Currently most of the simple decentralized applications work exactly this way. However, this approach has significant drawbacks. First of all transactions to blockchain are slow to confirm. It may seem to be fast for money transfer (anyone can wait a minute), but it is extremely slow for a rich application data flow. Rich application may require many thousands transactions per second. Secondly, it is immutable. The immutability is the strength of blockchain that gives it high robustness but it is a weakness for a data storage. User may change their profile or replace their photo, still all the previous data will sit in blockchain forever and can be seen by anyone. The immutability results in one more drawback - the capacity. If all the applications would keep their data in blockchain, the blockchain size will grow rapidly, exceeding publicly available hard drive capacity. Full nodes can require special hardware. It may result in dangerous centralization of blockchain. Thats why storing data in blockchain only is not a good option for a rich decentralized application. Peer to peer file system, such as InterPlanetary File System. IPFS allows to share files on client computers and unites them in the global file system. The technology is based on BitTorrent protocol and Distributed Hash Table. There are several good moments. It is really peer to peer - to share anythi Continue reading >>

Off-chain Data Storage: Ethereum &ipfs

Off-chain Data Storage: Ethereum &ipfs

function read() public view returns (bytes) { Ive deployed this contract on Rinkeby test net and generated 1024 of random bytes using then stored 1kB of data using the write function. The resulting transaction can be seen here: The Gas used amounted to 754,365 @ 20Gwei Gas price = 0.0150873 Ether. At the time of writing this post (Oct 17, 2017) the Ether price is currently 328.79 USD/ETH. So storing 1kB of data would have cost $4.96 to run on the Ethereum Main Net. That means ~ 5 Million USD / GB! Saving a few bytes to the EVM is ok but for larger chunks of data the costs are probably too high for most projects. One solution is to modify our data storage strategy and save the data off-chain (as opposed to the on-chain approach we took above). There are multiple off-chain storage options: IPFS and Swarm are 2 popular ones. Ill use IPFS in this post but Swarm works equally well. Looking at the wikipedia article on IPFS: InterPlanetary File System (IPFS) is a protocol designed to create a permanent and decentralized method of storing and sharing files IPFS allows p2p storage and we can use it as a distributed file system to store data. Saving data on IPFS provides a unique hash. Instead of storing the data on the contract, well only store the hash on the contract and then we can use the hash to retrieve the data. In production wed need to create our own IPFS node, but INFURA provides a node for developers which we can use for free. Here is a js snippet you can try out on to save data to IPFS: const ipfs = new IPFS({host: ipfs.infura.io, port: 5001, protocol: https}); const randomData = 8803cf48b8805198dbf85b2e0d514320; // random bytes for testing and this should return our data: 8803cf48b8805198dbf85b2e0d514320 One remark is that the hash string size is independent of the Continue reading >>

Understanding Data Storage

Understanding Data Storage

I'm trying to understand how Ethereum stores data that I send, if I have a transaction that sends 20 bytes of data to a contract then before the contract has even been executed the blockchain has access to my sender account, the 20 bytes of data and my tx signature. Does this get stored in the blockchain? Can I access it via an API? Or do I need to make sure my contract uses storage to save the 20 bytes because its not saved in the blockchain? I would have thought the blockchain needs to store the full tx including 20 bytes so that other nodes can replicate it. Continue reading >>

How Should I Store Data In An Ethereum Blockchain : Ethereumnoobies

How Should I Store Data In An Ethereum Blockchain : Ethereumnoobies

I am working on a blockchainbased voting system and I have to store large amount of data like list of voters , their details , who they voted for and so on . How should I store this data . I have a few options Smart contracts - I can have multiple smart contract each concerned with specific data - One for storing a map from voters address to a voter_details struct . Another one for voting details . Is this method feasible ? I can have maybe 1 million users. Is there any limit to the amount of data stored ? OrbitDB - Apart from the blockchain , I can maintain a p2p database system ie every system can run an ipfs node and an ethereum node . 3.A mongodb server - I can have a server dedicated for database application . In method 2 & 3 I'm planing to index data with its hash . I can maintain a collection for votes with details of to whom vote is cast . The details of vote is stores in a db and can be indexed by hash of voting details . The vote is cast by sending a transaction to a specific ethereum node from voters address with data field containing hash to index db . Which method should I use . I really want to know more about using smart contract for data storage . Continue reading >>

Github - Howardwu/ipfs-ethereum-storage: A Simple Datastore Solution Using Ipfs And Ethereum

Github - Howardwu/ipfs-ethereum-storage: A Simple Datastore Solution Using Ipfs And Ethereum

A simple datastore solution using IPFS and Ethereum We will create a simple datastore solution using IPFS and Ethereum. IPFS provides a convenient interface for distributed data storage, with a hash-based content address for reference to our file. This address will be stored in our smart contract on a private Ethereum blockchain. To retrieve the latest data, we will fetch the address from our blockchain and query IPFS for the associated file. Continue reading >>

Zero-storage Data Publishing Onethereum

Zero-storage Data Publishing Onethereum

Taking advantage of real-time, off-chain monitoring Whats the cheapest way to publish data while maintaining an unchangeable, permanent record of having done so? Whats the most expensive way to do computing today? Actually this second point may or may not be true, but one thing is true, if the blockchain is expensive, storing data is the reason why. Any data. Part of the Fee Schedule from the Ethereum Yellow Paper (as of May 16,2017) In this article we will recount our experience trying to create a simple one-way publisher-to-consumer data delivery smart contract. At the same time, well explain an idea we have called off-chain monitoring and how our project, QuickBlocks , helps us use this idea to lessen the cost of running a smart contract. QuickBlocks allows us to monitor Ethereum addresses in real time. We initiate a monitoring session with a simple command: (Chiffra is a command line tool that builds off-chain monitors.) Given the above command, the system first asks a few questions (What addresses to monitor? When they were first deployed?) and then generates C++ code and builds the new off-chain monitor. The first time the monitor runs, it syncs to the locally running blockchain node, optionally caching the data as it goes. It then begins periodically pulling new blocks from the node. If the monitor finds a transaction (either an external or an internal contract-to-contract transaction) either to or from one of the addresses weve indicated, it responds. By default, the response is to simply display the transaction to the screen. However, we can modify the monitor code to do anything we want. For example, it could keep a daily list of transactions and email us a summary of the activity on the contract at the end of each day. QuickBlocks is a customizable, per-acco Continue reading >>

Introduction To Smart Contracts

Introduction To Smart Contracts

Let us begin with the most basic example. It is fine if you do not understand everythingright now, we will go into more detail later. pragma solidity ^0.4.0;contract SimpleStorage { uint storedData; function set(uint x) public { storedData = x; } function get() public constant returns (uint) { return storedData; }} The first line simply tells that the source code is written forSolidity version 0.4.0 or anything newer that does not break functionality(up to, but not including, version 0.5.0). This is to ensure that thecontract does not suddenly behave differently with a new compiler version. The keyword pragma is called that way because, in general,pragmas are instructions for the compiler about how to treat thesource code (e.g. pragma once ). A contract in the sense of Solidity is a collection of code (its functions) anddata (its state) that resides at a specific address on the Ethereumblockchain. The line uint storedData; declares a state variable called storedData oftype uint (unsigned integer of 256 bits). You can think of it as a single slotin a database that can be queried and altered by calling functions of thecode that manages the database. In the case of Ethereum, this is always the owningcontract. And in this case, the functions set and get can be used to modifyor retrieve the value of the variable. To access a state variable, you do not need the prefix this. as is common inother languages. This contract does not do much yet (due to the infrastructurebuilt by Ethereum) apart from allowing anyone to store a single number that is accessible byanyone in the world without a (feasible) way to prevent you from publishingthis number. Of course, anyone could just call set again with a different valueand overwrite your number, but the number will still be stored in the Continue reading >>

How Do Ethereum Smart Contracts Work?

How Do Ethereum Smart Contracts Work?

Like many ideas in the blockchain industry, a general confusion shrouds so called 'smart contracts'. A new technology made possible by public blockchains, smart contracts are difficult to understand because the term partly confuses the core interaction described. While a standard contractoutlines the terms of a relationship (usually one enforceable by law), a smart contract enforces a relationship with cryptographic code. Put differently, smart contracts are programs that execute exactly as they are set up to by their creators. First conceived in 1993, the idea was originally described by computer scientist and cryptographer Nick Szabo as a kind of digital vending machine. In his famous example , he described how users could input data or value, and receive a finite item from a machine, in this case a real-world snack or a soft drink. In a simple example, ethereum users can send 10 ether to a friend on a certain date using a smart contract (Seeour guide" What is Ether? "). In this case, the user would create a contract, and push the data to that contract so that it could execute the desired command. Ethereum is a platform thats built specifically for creating smart contracts. But these new tools arent intended to be used in isolation. It is believed that they can also form the building blocks for 'decentralized applications' (See: " What is a Dapp? ")and even whole decentralized autonomous companies (See:" What is a DAO? ') Its worth noting that bitcoin was the first to support basic smart contracts in the sense that the network can transfer value from one person to another. The network of nodes will only validate transactions if certain conditions are met. But, bitcoin is limited to the currency use case. By contrast, ethereum replaces bitcoin's more restrictive langu Continue reading >>

Marriage Smart Contract On Ethereum

Marriage Smart Contract On Ethereum

I got the inspiration to make this page because of a tweet from Joseph Lubin after I posted about my 1 year wedding anniversary. I am storing data immutably to the Ethereum blockchain. This is an example of a proof-of-existence application of blockchains that is very important. Blockchains, when properly designed, provide a way to permanently store data with an un-hackable audit trail. On the Ethereum blockchain, users create smart contracts to store and manipulate data. Smart contracts are permanently on the Ethereum blockchain and contain their own storage. Whenever the internal contract storage is changed, the blockchain updates the smart contract data, while still maintaining a history of the previous data. Cool, huh? View smart contract on the Ethereum blockchain Continue reading >>

Chainy: Aeon Short Links And Proof Of Exists. Engraved On The Ethereum Blockchain.

Chainy: Aeon Short Links And Proof Of Exists. Engraved On The Ethereum Blockchain.

Irreplaceable short URLS engraved on the blockchain Be sure, that link once created will always point to original location URL shorteners (e.g. bit.ly) are useful in our online life. But did it occur to you that those links may not always lead where they're supposed to? Using short links is a great way for hackers and malware operators to send you to a phishing or malware-infected site, instead of your favorite cookie recipe. Chainy.link solves this problem with the help of an Ethereum smart contract ( how it works? ). If you are a moderator of content submitted by different users, you need to make sure users can't replace the short links included with their submitted content. If you know the shortened URL in the article today leads to Forbes.com, you want to make sure that long after publication this link won't lead users somewhere else. Replacing linked shortened with third-party services, after content has been approved and published, is the most common way to get unexpecting traffic to bad sites. Using Chainy prevents this and makes it impossible to ever replace short URLs. The real address destination is saved in the blockchain with the unique short code, and never can be changed by anybody. Sample link to chainy github: Blockchain record of this link: A short link to a file and digital signature in one place How often you need to sign a file and provide a link, allowing others to see this file and to check its signature? For security or privacy reasons you may not want to trust saving your file on a server belonging to a third party. Chainy solves this problem by saving the proof and a link to the file together in a smart contract. You can even include the proof link directly in the smart contract. We made the link so short (and unique at the same time) that it's Continue reading >>

Contract Design - Is There Anything Stopping Me From Using The Ethereum Blockchain As Data Storage? - Ethereum Stack Exchange

Contract Design - Is There Anything Stopping Me From Using The Ethereum Blockchain As Data Storage? - Ethereum Stack Exchange

Is there anything stopping me from using the ethereum blockchain as data storage? As I understand it, smart contracts are currently immortal by default. Does this mean that I could create a contract that happened to contain an encoded form of baby photos and have it stored forever? If not, what prevents it? Nothing prevents it. 5 months ago, I demonstrated storing audio (a very highly compressed mp3 file) in the blockchain. And it's still there and being replicated by every full node today! Only 3.5kB and I had to pay quite a bit of ether, but still cool! To make this answer last the test of time (if something happens to the above link), here is the relevant command to run in your terminal: geth --exec "eth.getTransaction('0xbb8ee9866ee67277986b6f40775469c7a674810ce99dce3caff0d1117c8dcdac').input" console | xxd -p -r | mpg321 - A smarter way uses the storage only as a hash as other answers have said, use StorJ, IPFS, etc., because then you can store more off the blockchain and link to it. That is awesome! It took me awhile to actually get the data and play it, geth didn't seem to think the address existed, xxd wasn't installed, mpg321 wasn't in the official repos, so I had to find it on a blockchain explorer site, install xxd, and then use ffplay, and it was all worth it XD. Shelvacu Jan 23 '16 at 7:44 shelvacu: Great to hear! Glad you had a bit of fun with it, I know I did. :) I had the first functional contract on the Ethereum blockchain. linagee Jan 23 '16 at 7:48 Nothing prevents it....except the extraordinarily high costs compared to any other solution. Please mention in your answer that people shouldn't actually do this--as mentioned IPFS is a much better way to have some data stored forever without bloating the Ethereum blockchain. And in fact, if people wait fo Continue reading >>

Storing Medical Records On The Ethereum Blockchain Healthcare In America

Storing Medical Records On The Ethereum Blockchain Healthcare In America

Building a Foundation for the Decentralized Web Storing Medical Records On The Ethereum Blockchain Heres an uncontroversial take: medicine in the United States is fucked. Not so much regarding the actual treatment of patients, but more the bureaucracy surrounding (and often impeding) treatment of those patients. Whether you believe in medical deregulation or single-payer nationalized health insurance, the current system blows, as 54% of Americans are dissatisfied with a healthcare industry that often puts the onus on individuals to coordinate their own care. Unsurprisingly, much of the conversation about healthcare in the United States revolves around health insurance and cost. Insurance and procedure/drug costs are enormous enormous factors in the quality and availability of the care people receive. However, in looking to improve the efficiency and equity of flawed systemssomething toward which I imagine the blockchain community is particularly inclinedit is important to examine smaller, less obvious routes toward managing and improving the system as a whole. TL; DR: We should all put medical records on the blockchain (eventually). But how would storing medical records on the blockchain work? What purpose would it serve? And, is it even possible? Right now, the truth is we dont really know what Ethereum can do. A lot of very impressive people believe the network and its underlying blockchain technology will revolutionize the way we lead our livesperhaps even save the world. Of course, that will take time. As of right now, storing information on the Ethereum blockchain is very expensive. Just in case youre new, or need a quick review, heres why: Most people think of ether as a currency, like dollars or even Bitcoin, but it is also possible to think of ether as the fuel Continue reading >>

Where And How Application Data Is Stored In Ethereum?

Where And How Application Data Is Stored In Ethereum?

Where and how application data is stored in Ethereum? Ethereum can host decentralized applications, DAPPs. These applications exist through small programs that live on the Blockchain: Smart Contracts. But when I write a Smart Contract, where is my application data Stored? We want to understand how data storage works before working on this platform. Code execution, servers and programming language are rarely critical to the design of an application. But the Data, its structure, and its security will constrain most of our design. Lets imagine we are porting apps to Ethereum: For a Facebook-like, where are the publications and comments data? For a Dropbox-like, where are my private files? Or for a Slack-like chat app, where do we store discussion channels? What about Private Messages? Were going to forget about the Blockchain for a minute: we already know its a machine that generates Consensus . We can forget the Blockchain and assume that Ethereum is a big, slow, reliable, computer. Were looking at the Ethereum System from a higher level of abstraction: the Software part. Ethereum holds a set of accounts. Every account has an owner and a balance (some Ether). If I prove my identity, I can transfer Ether from my account to another. The money will flow from one account to the other. Its an atomic operation called a Transaction. The Ethereum Software is a Transaction Processing System: 1. We have a state: the set of all accounts and their balance, 3. We get a new state: an updated set of accounts and their balances. Today we look into the ability to execute code and programs within a transaction. Thats where Smart Contracts come into play. Every account has an owner and a balance. But some of these accounts are special; they own themselves. At creation time, we give them a Continue reading >>

More in ethereum