Smart contract limitations in Ethereum and Hyperledger Fabric

0 votes

I am trying to make a smart contract to achieve the following automatically. But I stuck in the implementation. How can I run the (2) Tx without having B to sign the Tx, ie: I want it to run automatically once (1) is activated and condition (2) is ready.

Pseudocode:

A send 50 to B        (1)
if (B > 50)           (2)
    B send 10 to C    (3)

The code above involves multiple owners, ie. A, B and C. Firstly, A actives the contract by running/signing Tx (1). Then the contract checks condition (2). Now but how can run(3) automatically without having to force B to sign?

Ultimately, is the contract able to sign (or proxy sign) on behave of B?

Sep 11, 2018 in Blockchain by sabby
• 4,350 points
77 views

1 answer to this question.

0 votes

No, the contract cannot sign on behave of B.

A starts the transactions by sending necessary funds to the contract, and then the contract disperses funds according to the rules. So, A -> contract, contract -> B and possibly, contract -> C.

Although it's outside the question raised, it will possibly help you avoid refactoring later to observe the best practice of separating the two sends if B and/or C are untrusted contracts. You would just do the accounting in the deposit step, and then use a withdrawal pattern as B & C claim their entitlements (separate transactions).

Hope it helps.

answered Sep 11, 2018 by Christine
• 15,790 points

Related Questions In Blockchain

+1 vote
7 answers
0 votes
1 answer
0 votes
1 answer

How to prevent the smart contract from being modified and deployed in the blockchain network?

To expand on Matthew's answer, each state ...READ MORE

answered Jul 5, 2018 in Blockchain by ariaholic
• 7,340 points
58 views
0 votes
1 answer
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
172 views
+1 vote
5 answers

Where does the smart contracts stored and executed on blockchain?

Ethereum smart contracts are executed on EVM ...READ MORE

answered May 2, 2018 in Blockchain by Shashank
• 10,350 points
1,059 views
0 votes
1 answer

sellprice and buyprice fixing in smart contract.

It is due to the fact you ...READ MORE

answered Oct 17, 2018 in Blockchain by Christine
• 15,790 points
35 views
+4 votes
2 answers

How do I create a new block in Hyperledger Fabric?

This link might help you: https://github.com/hyperledger/fabric-sample ...READ MORE

answered Oct 11, 2018 in Blockchain by Sahu
521 views