问题
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