What are Ricardian Contracts?

in #eos6 years ago (edited)

Ricardian Contracts are digital documents that define the terms and conditions of an interaction between two or more parties.

In the 1990s, Ian Grigg after looking at friend working for a vision creating digitalized cash learned digitalization of the assets. Ian Grigg finds the need for digitization of bond and tried to issue the same on the internet as they are also the financial assets and the world was diving towards creating businesses over the internet. In the process of working towards solving the problem, Ian Grigg developed Ricardian Contract.

How Ricardian Contracts is different from Smart Contracts we have today?

Smart Contract is the machine-readable set of instruction while a Ricardian Contract is a document specifying the intention of instruction followed by smart contracts.

A smart contract looks like this


 `#include <eosiolib/eosio.hpp>

class simpletoken : public eosio::contract {
   public:
      simpletoken( account_name self )
      :contract(self),_accounts( _self, _self){}

      void transfer( account_name from, account_name to, uint64_t quantity ) {
         require_auth( from );

         const auto& fromacnt = _accounts.get( from );
         eosio_assert( fromacnt.balance >= quantity, "overdrawn balance" );
         _accounts.modify( fromacnt, from, [&]( auto& a ){ a.balance -= quantity; } );

         add_balance( from, to, quantity );
      }

      void issue( account_name to, uint64_t quantity ) {
         require_auth( _self );
         add_balance( _self, to, quantity );
      }

   private:
      struct account {
         account_name owner;
         uint64_t     balance;

         uint64_t primary_key()const { return owner; }
      };

      eosio::multi_index<N(accounts), account> _accounts;

      void add_balance( account_name payer, account_name to, uint64_t q ) {
         auto toitr = _accounts.find( to );
         if( toitr == _accounts.end() ) {
           _accounts.emplace( payer, [&]( auto& a ) {
              a.owner = to;
              a.balance = q;
           });
         } else {
           _accounts.modify( toitr, 0, [&]( auto& a ) {
              a.balance += q;
              eosio_assert( a.balance >= q, "overflow detected" );
           });
         }
      }
};

EOSIO_ABI(simpletoken, (transfer)(issue) )`

The above example shows the C++ smart contract designed for issuing a new token.

While the Ricardian Contract looks something like this


TOKENNAME = XYZ
INFLATION = 5%
INITIALISSUE = 1,000,000,000

The Community hereby creates a currency known as {{TOKENNAME}}, possession of which is evidence of a contribution to the community. The quantity of {{TOKENNAME}} shall increase no more than INFLATION per year after the first {{INITIALISSUE}} of {{TOKENNAME}} are distributed.


The front end of the Ricardian Contract will look something like a regular software contract


With tick marks specifying the conditions and a click-button to Agree with the conditions specified and the whole contract.

Are they Secure?

Yes, A Ricardian Contract is extremely secure because of the cryptographic signature. Every Ricardian Contract document is uniquely identifiable by its hash. It is difficult to edit the document and it becomes immutable once all the parties agree and sign on it using a private key.

How it works with the Smart Contract?

I found a self-explanatory image on iang.org

Remember: A Ricardian Contract is first Human Readable then machine readable contract.

A visual Representation of Ricardian Contract

A Contract Schema of Open Bazaar: Visual Representation

Who enforce it on the Network?

The constitution and the Arbitrators on EOS networks!

I hope it helped you understand the Ricardian Contracts better. Thank You for reading.

Why the world needs EOS Contract?

It was explained very well by @iang in one of his posts. Suppose we have a contract transferring certain token in exchange of 100 dollars.

here's the smart contract

{Alice,Bob,100,dollarsvalue,token}

the dollar could be Singapore dollar or Hong Kong dollar, how would a computer know the specified dollar is American Dollar and how the Human reading the contract will know the mentioned dollar is US dollar?

To clear the intention of the smart contract a detailed Ricardian contract is needed. As on EOS network, the stakeholder agrees to the constitution, they are liable to go through an arbitration process if they do something against someone else. The Richardian contract helps the arbitrator and members undergoing a trial of the intention of contract. Remember: Not everyone is a techie

Sort:  

Bitcoin has contracts, too. Looks interesting. I like smart contracts.

I am sorry, it's about EOS.