Skip to main content
Add explanation and place link where it should be
Source Link
JohnAllen
  • 1.3k
  • 1
  • 13
  • 29

This question is answered here by an authoritative figure in the Ethereum community, so I will refrain from addressing it except to say that either you probably don't have that much data or certainly couldn't afford to store as much as the blockchain could "take". That said, since each node stores a copy of the blockchain's data, if you could afford it, you would burden each of the nodes and possibly cause fewer nodes to exist since running a node would cost more because the size of the data would be so huge.

  • Storing data on-chain is very expensive relative to centralized solutions.

  • Storing 1 kB costs 640,000 gas

  • 640,000 gas costs $0.08- $0.90 using current ether prices depending on how quickly you would like your transaction to be mined/confirmed

  • If the price of ether continues to rise, the price of storing your data will increase with it, assuming a commensurate decrease in the accepted gas price miners are willing to take does not happen.

  • Every change to the blockchain, no matter how small, costs gas (or "money" in legacy parlance)

    • For instance, sending ether with the built-in send() method costs 21,000 gas
    • From the yellow paper 4: Gtransaction 21000 Paid for every transaction. So every tx costs at least 21,000 -- that is the minimum cost [yellow paper]
  • Getting data from the blockchain is free though:

    • We can get data from the blockchain a few ways:
      • Getter functions that are automatically created for us for each public variable in our contracts
        • For instance, the line: uint public numRestaurants = 42; creates a function we can call from our contract this.numRestaurants()
        • In web3 client we could call this function with contractInstance.numRestaurants.call()
      • Contract functions that promise to not modify state can be declared constant or view functions
        •        return a * (b + 42) + now; // does math but doesn't change state!
             }```
          
      • Events are data that are stored in the blockchain
        • LogUpdateRestaurant('mandalay', 8.7, 'restaurant') in the function that will store your restaurant data
        • We define events with event LogUpdate(indexed string restaurantName, uint8 rating, TypeEnum type);

This question is answered here by an authoritative figure in the Ethereum community, so I will refrain from addressing it except to say that either you probably don't have that much data or certainly couldn't afford to store as much as the blockchain could "take". That said, since each node stores a copy of the blockchain's data, if you could afford it, you would burden each of the nodes and possibly cause fewer nodes to exist since running a node would cost more.

  • Storing data on-chain is very expensive relative to centralized solutions.

  • Storing 1 kB costs 640,000 gas

  • 640,000 gas costs $0.08- $0.90 using current ether prices depending on how quickly you would like your transaction to be mined/confirmed

  • If the price of ether continues to rise, the price of storing your data will increase with it, assuming a commensurate decrease in the accepted gas price miners are willing to take does not happen.

  • Every change to the blockchain, no matter how small, costs gas (or "money" in legacy parlance)

    • For instance, sending ether with the built-in send() method costs 21,000 gas
    • Gtransaction 21000 Paid for every transaction. So every tx costs at least 21,000 -- that is the minimum cost [yellow paper]
  • Getting data from the blockchain is free though:

    • We can get data from the blockchain a few ways:
      • Getter functions that are automatically created for us for each public variable in our contracts
        • For instance, the line: uint public numRestaurants = 42; creates a function we can call from our contract this.numRestaurants()
        • In web3 client we could call this function with contractInstance.numRestaurants.call()
      • Contract functions that promise to not modify state can be declared constant or view functions
        •        return a * (b + 42) + now; // does math but doesn't change state!
             }```
          
      • Events are data that are stored in the blockchain
        • LogUpdateRestaurant('mandalay', 8.7, 'restaurant') in the function that will store your restaurant data
        • We define events with event LogUpdate(indexed string restaurantName, uint8 rating, TypeEnum type);

This question is answered here by an authoritative figure in the Ethereum community, so I will refrain from addressing it except to say that either you probably don't have that much data or certainly couldn't afford to store as much as the blockchain could "take". That said, since each node stores a copy of the blockchain's data, if you could afford it, you would burden each of the nodes and possibly cause fewer nodes to exist since running a node would cost more because the size of the data would be so huge.

  • Storing data on-chain is very expensive relative to centralized solutions.

  • Storing 1 kB costs 640,000 gas

  • 640,000 gas costs $0.08- $0.90 using current ether prices depending on how quickly you would like your transaction to be mined/confirmed

  • If the price of ether continues to rise, the price of storing your data will increase with it, assuming a commensurate decrease in the accepted gas price miners are willing to take does not happen.

  • Every change to the blockchain, no matter how small, costs gas (or "money" in legacy parlance)

    • For instance, sending ether with the built-in send() method costs 21,000 gas
    • From the yellow paper 4: Gtransaction 21000 Paid for every transaction. So every tx costs at least 21,000 -- that is the minimum cost
  • Getting data from the blockchain is free though:

    • We can get data from the blockchain a few ways:
      • Getter functions that are automatically created for us for each public variable in our contracts
        • For instance, the line: uint public numRestaurants = 42; creates a function we can call from our contract this.numRestaurants()
        • In web3 client we could call this function with contractInstance.numRestaurants.call()
      • Contract functions that promise to not modify state can be declared constant or view functions
        •        return a * (b + 42) + now; // does math but doesn't change state!
             }```
          
      • Events are data that are stored in the blockchain
        • LogUpdateRestaurant('mandalay', 8.7, 'restaurant') in the function that will store your restaurant data
        • We define events with event LogUpdate(indexed string restaurantName, uint8 rating, TypeEnum type);
Add space
Source Link
JohnAllen
  • 1.3k
  • 1
  • 13
  • 29
Cleanup
Source Link
JohnAllen
  • 1.3k
  • 1
  • 13
  • 29
  1. ~Charge~~Charge your users gas~gas~~
  2. Compensate your users with additional units of your native app token, if you have a flexible supply of your token
  3. At the org I contribute to we store a hash that is a cryptographic proof of the data off-chain and we store just the IPFS hash on chain. IPFS hashes are unfortunately more than the 32 byte EVM word (see this highly informativeanswer about storing IPFS hashes on chain in a struct).
  • Storing data on-chain is very expensive relative to centralized solutions we are used to.

  • Storing 1 kB costs 640,000 gas

  • 640,000 gas costs $0.08- $0.90 using current ether prices depending on how quickly you would like your transaction to be mined/confirmed

  • If the price of ether continues to rise, the price of storing your data will increase with it, assuming a commensurate decrease in the accepted gas price miners are willing to take does not happen.

  • Every change to the blockchain, no matter how small, costs gas (or "money" in legacy parlance)

    • For instance, sending ether with the built-in send() method costs 21,000 gas
    • Gtransaction 21000 Paid for every transaction. So every tx costs at least 21,000 -- that is the minimum cost [yellow paper]
  • Getting data from the blockchain is free though:

    • We can get data from the blockchain a few ways:
      • Getter functions that are automatically created for us for each public variable in our contracts
        • For instance, the line: uint public numRestaurants = 42; creates a function we can call from our contract this.numRestaurants()
        • In web3 client we could call this function with contractInstance.numRestaurants.call()
      • Contract functions that promise to not modify state can be declared constant or view functions
        •        return a * (b + 42) + now; // does math but doesn't change state!
             }```
          
      • Events are data that are stored in the blockchain
        • LogUpdateRestaurant('mandalay', 8.7, 'restaurant') in the function that will store your restaurant data
        • We define events with event LogUpdate(indexed string restaurantName, uint8 rating, TypeEnum type);
  1. ~Charge your users gas~
  2. Compensate your users with additional units of your native app token, if you have a flexible supply of your token
  3. At the org I contribute to we store a hash that is a cryptographic proof of the data off-chain and we store just the IPFS hash on chain. IPFS hashes are unfortunately more than the 32 byte EVM word (see this highly informativeanswer about storing IPFS hashes on chain in a struct).
  • Storing data on-chain is very expensive relative to centralized solutions we are used to.

  • Storing 1 kB costs 640,000 gas

  • 640,000 gas costs $0.08- $0.90 using current ether prices depending on how quickly you would like your transaction to be mined/confirmed

  • If the price of ether continues to rise the price of storing your data will increase with it, assuming a commensurate decrease in the accepted gas price miners are willing to take does not happen.

  • Every change to the blockchain, no matter how small, costs gas (or "money" in legacy parlance)

    • For instance, sending ether with the built-in send() method costs 21,000 gas
    • Gtransaction 21000 Paid for every transaction. So every tx costs at least 21,000 -- that is the minimum cost [yellow paper]
  • Getting data from the blockchain is free though:

    • We can get data from the blockchain a few ways:
      • Getter functions that are automatically created for us for each public variable in our contracts
        • For instance, the line: uint public numRestaurants = 42; creates a function we can call from our contract this.numRestaurants()
        • In web3 client we could call this function with contractInstance.numRestaurants.call()
      • Contract functions that promise to not modify state can be declared constant or view functions
        •        return a * (b + 42) + now; // does math but doesn't change state!
             }```
          
      • Events are data that are stored in the blockchain
        • LogUpdateRestaurant('mandalay', 8.7, 'restaurant') in the function that will store your restaurant data
        • We define events with event LogUpdate(indexed string restaurantName, uint8 rating, TypeEnum type);
  1. ~~Charge your users gas~~
  2. Compensate your users with additional units of your native app token, if you have a flexible supply of your token
  3. At the org I contribute to we store a hash that is a cryptographic proof of the data off-chain and we store just the IPFS hash on chain. IPFS hashes are unfortunately more than the 32 byte EVM word (see this highly informativeanswer about storing IPFS hashes on chain in a struct).
  • Storing data on-chain is very expensive relative to centralized solutions.

  • Storing 1 kB costs 640,000 gas

  • 640,000 gas costs $0.08- $0.90 using current ether prices depending on how quickly you would like your transaction to be mined/confirmed

  • If the price of ether continues to rise, the price of storing your data will increase with it, assuming a commensurate decrease in the accepted gas price miners are willing to take does not happen.

  • Every change to the blockchain, no matter how small, costs gas (or "money" in legacy parlance)

    • For instance, sending ether with the built-in send() method costs 21,000 gas
    • Gtransaction 21000 Paid for every transaction. So every tx costs at least 21,000 -- that is the minimum cost [yellow paper]
  • Getting data from the blockchain is free though:

    • We can get data from the blockchain a few ways:
      • Getter functions that are automatically created for us for each public variable in our contracts
        • For instance, the line: uint public numRestaurants = 42; creates a function we can call from our contract this.numRestaurants()
        • In web3 client we could call this function with contractInstance.numRestaurants.call()
      • Contract functions that promise to not modify state can be declared constant or view functions
        •        return a * (b + 42) + now; // does math but doesn't change state!
             }```
          
      • Events are data that are stored in the blockchain
        • LogUpdateRestaurant('mandalay', 8.7, 'restaurant') in the function that will store your restaurant data
        • We define events with event LogUpdate(indexed string restaurantName, uint8 rating, TypeEnum type);
Strikethrough already passed over solution
Source Link
JohnAllen
  • 1.3k
  • 1
  • 13
  • 29
Loading
Source Link
JohnAllen
  • 1.3k
  • 1
  • 13
  • 29
Loading