Project title: Logical contracts on Stellar.
Summary: Stellar smart contracts on an artificial intelligence programming language.
Goals:
- - Development and testing of an interface of LPS for Stellar.
- - Development, testing and documentation on line of examples of logical contracts running on the Stellar testing network.
- - Experimental Service website deployment for teaching purposes at logicalcontracts.com.
Timeline: How and when you will accomplish your goals.
- - 8 weeks
- - 7 weeks
- - 5 weeks
Description:
Smart contracts are hard to develop, test and debug. Stellar has achieved a extraordinary level of of usability and security by keeping its smart contracts API concealed to a very well defined set of operations. However, users still need to code to have the services they actually want from the contracts. We propose a higher level language for that: LPS. Logic Production Systems are programs written in a form of logic which has been extensible researched and applied for artificial intelligence applications.
We have some experience developing interfaces between LPS and other blockchains (An API for Ethereum actually exists). Our first goal is to develop such an interface between LPS kernel and the Stellar network. Then, we could write logical contracts for the smart contracts required in Stellar. For example, the very well documented case explained in the stellar documentation (Stellar Smart Contracts), could be summarized like this:
An escrow contract between A and B
If A and B agree for A to make a payment P to B and the date T and allowing for B to rescue P should A decide to ignore it T+D days laters then
A creates an account to make the deposit for B on Stellar
and A sets the date to make the payment P to B on T
and A sets a date for a possible rescue of P should B decide to abandon it on T+D
and B agrees to this contract (by signing previous operations)
and A deposits P on the account on date T.
If A and B has signed the escrow contract with payment P on date T and rescue date on T+D
and A deposits P on the proper account on date T or before
then B must be informed that she has until T+D to withdraw P.
If A and B has signed the escrow contract with payment P on date T and rescue date on T+D
and A deposits P on the proper account on date T or before
and B has not withdrawn P by date T+D
then A must be informed, after T+D, that he will have a reasonable time R to withdraw P back to his accounts, of course before T+D+R.
This compact form of the escrow contract is written in English, but in a form of English that is very close to LPS. We have even trying to translate this kind of texts into LPS automatically (some succesful examples on line). We could present templates of this kind of logical contracts for users to analyze and quickly adapt or simply to deploy as their own, well understood, smart contracts on Stellar.
Thus, we are offering a higher level, logic programming language, to encode smart contracts for the Stellar blockchain. We also propose to explore more flexible and more secure and trust-able ways to deploy smart contracts. Logical contracts could well be saved on the blockchain, with all the data to execute them. But then, we would try offline execution with respect to the blockchain by running the contract on an machine out of the network, particularly on the client's browser as there exists a version of LPS for JS. Online execution, by embedding the LPS Kernel within the blockchain is, of course, a more complex undertaking that will require a separate project.
Links:
LPS http://lps.doc.ic.ac.uk/
The Syntax of LPS
https://bitbucket.org/lpsmasters/lps_corner/wiki/Syntax%20of%20lps.swi
LPS Reference
https://bitbucket.org/lpsmasters/lps_corner/wiki/lps.swi%20Reference
Logical Contract Web Site http://logicalcontracts.com/
Logical Contract Virtual Classroom http://demo.logicalcontracts.com/
Documents and presentations http://logicalcontracts.com/server/
Repository https://bitbucket.org/lpsmasters/lps_corner