Bitcoin Forum
April 26, 2024, 04:12:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  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]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!