Bitcoin Forum
June 22, 2018, 11:44:31 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
  Home Help Search Donate Login Register  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / do I need transaction in a blockchain application that is not for cryptocurrency on: March 08, 2018, 08:34:42 AM
I learned blockchain concept by using some tutorials based on cryptocurrency.

However, to make me understand this fully, I am thinking of this example: A blockchain to track the ingredients for restaurants so their customers know that the food they eat are indeed from the claimed source.

In this example usage, do I still need the concept of transaction? Can't I use a minimal block like this

public class Block{
  public int number;
  public string hash;
  public string previoushash;
  public int timestamp;
  public string data;
}

I am not sure how to solve a conflict? Say a restaurant and a hacker both send a block relating to an ingredient, how the algorithm knows which one is valid? The tutorial says longer chain will win, but how it works in reality?

Say in total there are 10 nodes. 2 nodes send a conflicting block (say block 10) and as a third node on the network, how can I know which block is valid if no further block has been added?
Pages: [1]
Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!