Bitcoin Forum
May 06, 2024, 09:12:51 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: do I need transaction in a blockchain application that is not for cryptocurrency  (Read 173 times)
daxu7509 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 08, 2018, 08:34:42 AM
 #1

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?
1715029971
Hero Member
*
Offline Offline

Posts: 1715029971

View Profile Personal Message (Offline)

Ignore
1715029971
Reply with quote  #2

1715029971
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715029971
Hero Member
*
Offline Offline

Posts: 1715029971

View Profile Personal Message (Offline)

Ignore
1715029971
Reply with quote  #2

1715029971
Report to moderator
1715029971
Hero Member
*
Offline Offline

Posts: 1715029971

View Profile Personal Message (Offline)

Ignore
1715029971
Reply with quote  #2

1715029971
Report to moderator
HeRetiK
Legendary
*
Offline Offline

Activity: 2926
Merit: 2091


Cashback 15%


View Profile
March 08, 2018, 10:29:39 AM
Merited by NeuroticFish (1), ABCbits (1)
 #2

What you are missing in your example is that with cryptocurrencies transactions are validated using asymmetrical cryptography. That is, only the owner of the private key can sign a transaction (or any form of data, for that matter) while everyone can verify the validity of said transaction using the corresponding public key.

So in your example the restaurant needs to hold a private key that the hacker has no access to. This means that everyone who knows the public key of the restaurant is able to verify that the data has been sent by the restaurant and not a random impostor -- unless said impostor has access to the private key, the safekeeping of which is one of the main challenges of cryptocurrencies.

Of course you still need to trust the restaurant to not make any false claims, which may limit the viability of such a blockchain (the other question being how consensus is enforced, but that's a problem class of its own).

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
daxu7509 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 08, 2018, 11:37:31 AM
 #3

Hi,
Thanks for the reply, you are right a private key will stop the hacker.

Do you think that a transaction is needed or not in this example? I am still thinking not.
HeRetiK
Legendary
*
Offline Offline

Activity: 2926
Merit: 2091


Cashback 15%


View Profile
March 08, 2018, 12:14:26 PM
 #4

Do you think that a transaction is needed or not in this example? I am still thinking not.

In general I doubt that any sort of coinless blockchain can be decentrally and trustlessly secured for lack of a financial incentive. It follows that (financial) transactions are a prerequisite for such a blockchain to function.

Things may look differently for private, permissioned blockchains, but in this case I'm not sure why you'd use a blockchain in the first place.


That being said:

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

What's the data?

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
daxu7509 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 08, 2018, 04:17:23 PM
 #5

Hi,

For this public string data; it can be any data. For example some status information about an ingredient.

I am just a learner, so not really sure if blockchain will have any use when financial transactions are not involved.

Thinking for example recent food scandal (some company put horse meat in beef products), if the database can be decentralized and queried by everyone, but only certain nodes can write to db, it will be easy for everyone to see where the beef was sourced as we can trace from top to bottom. Maybe that will deter people from doing such thing?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!