Skip to content

Instantly share code, notes, and snippets.

View Renelvon's full-sized avatar

Nikolaos Korasidis Renelvon

View GitHub Profile
@Renelvon
Renelvon / contract_api.md
Last active August 29, 2015 14:10
Thoughts on designing an API for Contracts in the OpenBazaar platform.

This is how I envision the Contract API in OpenBazaar.

Disclaimer: I may not be staying completely within the bounds of Ricardian Contracts; I am prioritizing flexibility and ease of use above formality, because I would like to have a working prototype soon, and polish it for FOSDEM. The structure will accept plugins that will ultimately enable OpenBazaar to support diverse kinds of business.

The new Contract API comprises of 3 major types of Classes: ContractParts, Contracts and Trades. Here's a breakdown:

Contract parts

A ContractPart is the smallest autonomous part of a contract, and as such, it is meant to be used as a building block. Each ContractPart represents exactly one step towards the materialization of the contract. Subclasses of ContractPart will be tailored to the semantic role of the relevant part/step. So, there can be a BuyerContractPart, a SellerContractPart, a NotaryContractPart, etc. Each such subclass shall be mapped to a JSON object in a 1-1 way. For this

Verifying that +renelvon is my Bitcoin username. You can send me #bitcoin here: https://onename.io/renelvon