Reputation: 2143
I am very new to blockchains. I am trying to figure out how I can use blockchain in my particular scenario, while trying to learn about it and have some very basic questions.
Business Scenario B purchases product P from A. A charges $x for each unit of P delivered under condition C1 and $y for each unit of P delivered under condition C2. B pays A at the end of a billing cycle.
Questions
Thanks in advance.
Regards, Ritwik
Upvotes: 0
Views: 88
Reputation: 65
There are a lot of things to be considered before designing a Smart contract. I will try to explain it with minimum technicality.
Your Smart contract scenario:
deliver product P from A to B under 2 conditions.
So your Smart contract will have 2 addresses i.e. of A and B. Upon delivery of P by A to B, there will be method(verify) that B and A can verify(using some protocol where 2 parties agree upon a decision and only when both say yes it is true or false) that a certain condition is met i.e. either C1 or C2.
When that condition is met that payment is done (either $x or $y)
If upon delivery of P from A to B both will try to invoke the method verify and agree upon the condition. This invocation of methods will be transactions.
Delivery of "event" will be the invocation of the method in this scenario. Like i said before these invocations are transactions which are stored on the blockchain. These transactions will have information about which method was invoked with what arguements and the timestamp. These transactions will be present with other transactions on that particular block which is mined.
When defining your conditions in a method. You will have conditions on who can call those methods. The miner will only run the code irrespective if the code returns an error or not. So if verify method is invoked by someone who is not suppose to, your code should return an error(this is your responsibility on how you code your smart contract). The miner only runs the code and returns whatever your code will output.
Yes blockchain history cannot be tampered with and hence can be used as proof.
Upvotes: 1