Systems and methods for trusted chain code system
A method of generating a trusted chain code (“TCC”) message, comprising: receiving a smart contract whose execution causes a transfer of value in response to at least one of an occurrence of an event or a fulfillment of a condition, wherein the smart contract is digitally signed by a first entity private key and a second entity private key; generating a chain code comprising a hash of a chain code of the smart contract, the chain code corresponding to at least one of an occurrence of an event or a fulfillment of a condition of the smart contract; and posting the TCC message to a distributed ledger, wherein an execution of a portion of the chain code in response to at least one of the occurrence of the event or the fulfillment of the condition is validated against corresponding chain code in the chain code manifest.
1. A method of generating a trusted chain code (“TCC”) message, comprising:
receiving, by a computing system, a smart contract whose execution causes a transfer of value in response to at least one of an occurrence of an event or a fulfillment of a condition, comprising:
receiving an agreement message, the agreement message formatted as the smart contract;
wherein the smart contract is digitally signed by a first entity private key of a first entity and a second entity private key of a second entity,
wherein the agreement message comprises a digitally signed first message by the first entity, the first message comprising a second message digitally signed by the second entity, and
wherein receiving the agreement message comprises receiving a first SignedData message and a second SignedData message, the first SignedData message comprising at least first content and a first digital signature of the first entity on at least a hash of the first content and a first chain code, wherein the first content includes terms of an agreement between the first entity and the second entity, the second SignedData message comprising at least second content and a second digital signature of the second entity on at least a hash of the second content and a second chain code, wherein the second content includes terms of the agreement between the first entity and the second entity;
generating, by the computing system, a chain code manifest, the chain code manifest comprising a hash of a chain code of the smart contract, the chain code corresponding to the at least one of the occurrence of the event or the fulfillment of the condition of the smart contract; and
posting, by the computing system, the TCC message to a distributed ledger,
wherein an execution of a portion of the chain code in response to the at least one of the occurrence of the event or the fulfillment of the condition is validated against corresponding chain code in the chain code manifest.
2. The method of claim 1 , wherein generating the TCC message further comprises comparing the first content and the second content and the first chain code with the second chain code, wherein a difference in the first content and the second content or the first chain code with the second chain code will prevent the generation of the TCC message.
3. The method of claim 1 , wherein the first digital signature is generated using the first entity private key, wherein the second digital signature is generated using the second entity private key, and wherein validating the execution of the portion of the chain code comprises:
retrieving, by the computing system, a first entity public key, the first entity public key of a public/private key pair that includes the first entity private key;
verifying, by the computing system, that the first entity public key is associated with the first entity and signed the first SignedData message;
retrieving, by the computing system, a second entity public key, the second entity public key of a public/private key pair that includes the second entity private key;
verifying, by the computing system, that the second entity public key is associated with the second entity and signed the second SignedData message; and
generating, by the computing system, a hash of the portion of the chain code; and comparing, by the computing system, the hash of the portion of the chain code to the corresponding portion of the chain code manifest.
4. The method of claim 1 , generating the TCC message further comprises:
time stamping, by the computing system, the chain code manifest using a trusted timing authority to generate a time stamp token, wherein the time stamp token associated with the chain code manifest provides reliability and verifiability of when the chain code manifest was generated.
5. The method of claim 1 , wherein generating the TCC message further comprises:
digitally signing, by the computing system, the smart contract using SignedData cryptographic message syntax to generate the TCC message; and
binding, by the computing system, the chain code manifest to the TCC message via an attribute of the TCC message.
6. The method of claim 1 , further comprising generating, by the computing system, an event journal entry that comprises a hash of the TCC message and a time stamp token from a trusted timing authority.
7. The method of claim 1 , wherein the chain code manifest comprises a plurality of hashes, each hash in the plurality of hashes corresponding to a hash of a chain code associated with a response to the at least one of the occurrence of the event or the fulfillment of the condition.
8. A system comprising:
a processor; and
a non-transitory machine readable medium with instructions stored thereon that, when executed by the processor, cause the system to:
receive a smart contract whose execution causes a transfer of value in response to at least one of an occurrence of an event or a fulfillment of a condition, comprising:
receiving an agreement message, the agreement message formatted as the smart contract;
wherein the smart contract is digitally signed by a first entity private key of a first entity and a second entity private key of a second entity,
wherein the agreement message comprises a digitally signed first message by the first entity, the first message comprising a second message digitally signed by the second entity, and
wherein receiving the agreement message comprises receiving a first SignedData message and a second SignedData message, the first SignedData message comprising at least first content and a first digital signature of the first entity on at least a hash of the first content and a first chain code, wherein the first content includes terms of an agreement between the first entity and the second entity, the second SignedData message comprising at least second content and a second digital signature of the second entity on at least a hash of the second content and a second chain code, wherein the second content includes terms of the agreement between the first entity and the second entity;
generate a chain code manifest, the chain code manifest comprising a hash of a chain code of the smart contract, the chain code corresponding to the at least one of the occurrence of the event or the fulfillment of the condition of the smart contract; and
post a trusted chain code (“TCC”) message to a distributed ledger,
wherein an execution of a portion of the chain code in response to the at least one of the occurrence of the event or the fulfillment of the condition is validated against corresponding chain code in the chain code manifest.
9. The system of claim 8 , wherein generating the TCC message further comprises:
time stamping the chain code manifest using a trusted timing authority to generate a time stamp token, wherein the time stamp token associated with the chain code manifest provides reliability and verifiability of when the chain code manifest was generated.
10. The system of claim 8 , wherein generating the TCC message further comprises:
digitally signing the smart contract using SignedData cryptographic message syntax to generate the TCC message; and
binding the chain code manifest to the TCC message via an attribute of the TCC message.
11. The system of claim 8 , further comprising generating an event journal entry that comprises a hash of the TCC message and a time stamp token from a trusted timing authority.
12. The system of claim 8 , wherein the chain code manifest comprises a plurality of hashes, each hash in the plurality of hashes corresponding to a hash of a chain code associated with a response to the at least one of the occurrence of the event or the fulfillment of the condition.
13. A non-transitory computer readable media having computer-executable instructions embodied therein that, when executed by a computing system, causes the computing system to perform operations comprising:
receiving a smart contract whose execution causes a transfer of value in response to at least one of an occurrence of an event or a fulfillment of a condition, comprising:
receiving an agreement message, the agreement message formatted as the smart contract;
wherein the smart contract is digitally signed by a first entity private key of a first entity and a second entity private key of a second entity,
wherein the agreement message comprises a digitally signed first message by the first entity, the first message comprising a second message digitally signed by the second entity, and
wherein receiving the agreement message comprises receiving a first SignedData message and a second SignedData message, the first SignedData message comprising at least first content and a first digital signature of the first entity on at least a hash of the first content and a first chain code, wherein the first content includes terms of an agreement between the first entity and the second entity, the second SignedData message comprising at least second content and a second digital signature of the second entity on at least a hash of the second content and a second chain code, wherein the second content includes terms of the agreement between the first entity and the second entity;
generating a chain code manifest, the chain code manifest comprising a hash of a chain code of the smart contract, the chain code corresponding to the at least one of the occurrence of the event or the fulfillment of the condition of the smart contract; and
posting a trusted chain code (“TCC”) message to a distributed ledger,
wherein an execution of a portion of the chain code in response to the at least one of the occurrence of the event or the fulfillment of the condition is validated against corresponding chain code in the chain code manifest.
14. The computer-readable media of claim 13 , wherein generating the TCC message further comprises:
time stamping, by the computing system, the chain code manifest using a trusted timing authority to generate a time stamp token, wherein the time stamp token associated with the chain code manifest provides reliability and verifiability of when the chain code manifest was generated.
15. The computer-readable media of claim 13 , wherein generating the TCC message further comprises:
digitally signing, by the computing system, the smart contract using SignedData cryptographic message syntax to generate the TCC message; and
binding, by the computing system, the chain code manifest to the TCC message via an attribute of the TCC message.
16. The computer-readable media of claim 13 , further comprising generating, by the computing system, an event journal entry that comprises a hash of the TCC message and a time stamp token from a trusted timing authority.
17. The computer-readable media of claim 13 , wherein the chain code manifest comprises a plurality of hashes, each hash in the plurality of hashes corresponding to a hash of a chain code associated with a response to the at least one of the occurrence of the event or the fulfillment of the condition.