How does a non-validating notary knows if a participant is allowed to consume a state?

爷,独闯天下 提交于 2019-12-24 02:16:31

问题


Since non-validating notaries in Corda are not performing input/output state validation of a transaction, how does a notary service know that a transaction initiator is allowed to consume specific input states?

For instance, in this simple cash example:

State0{} -issueCashTX-> State1{owner:issuer, amount: 1000}
                        -transferTX-> State2{owner:issuer,   amount: 500}
                                      State3{owner:CompanyA, amount: 500}

Smart Contract Rules validate that transfer transactions are only valid, if input state is owner by the transaction initiator and sum of output amounts is equal to sum of input amounts.

[Q]: How the non-validating notary knows that consuming State1 is ok, since it has no idea about the validation rules?


回答1:


He doesn't knows that State1 is ok but He knows if the inputs have already been used in another transactions. Transactions send to the notary have been signed by all peers so the transactions must be valid or that's means that all peers in the transactions are cheating with each other.




回答2:


In addition to MohamedLEGH's answer some additional information from the discussion at GitHub (https://github.com/corda/corda/issues/2971):

The fraudlent participant could create an arbitrary transaction and let it get signed by the non-validating notary, however, the notary will store the identity of the transaction creator. Since all identities are known, sanctions can be enforced. Moreover there is a mechanism in planing to raise a disupte and revert such transactions. (See https://github.com/corda/corda/blob/master/node/src/main/kotlin/net/corda/node/services/transactions/NonValidatingNotaryFlow.kt#L18)



来源:https://stackoverflow.com/questions/49870232/how-does-a-non-validating-notary-knows-if-a-participant-is-allowed-to-consume-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!