# ⦃param⦄ documentation v0.1

⦃param⦄ is a blockchain for real-world commerce.

## Introduction

* The Protocol
  * [⦃param⦄ Overview](/the-protocol/param-overview)
  * [Multi signature state recording](/the-protocol/multi-signature-state-recording)
  * [Commerce Data Interchange Format](/the-protocol/multi-signature-state-recording)
  * [Decentralised Knowledge Graph](/the-protocol/decentralised-knowledge-graph)
  * [⦃param⦄ Node](/the-protocol/param-node)
* The Platform
  * [directConnect - Network](/param-platform/directconnect-network)&#x20;
  * [directCommerce - Client](/param-platform/directcommerce-client)
  * [directERP - SDK for Enterprises](/param-platform/directerp-sdk-for-enterprises)
  * [Roadmap](broken://pages/-L_h8zgt4a2LqOulb-Ct)
* Developer Resources
  * [Testnet](/developer-resources/introduction)
  * [Libraries](/developer-resources/libraries)
  * [⦃param⦄ dev community](/developer-resources/param-dev-community)


# ⦃param⦄ Overview

Blockchain for Commerce, for Real-World.

**⦃param⦄** is a blockchain with enhanced ledger structure suitable for commerce transactions and well-defined data interchange formats, which is compatible with most ERP & EDI systems. It provides utmost enterprise-class data protection to interconnect large, medium and small companies on the permissioned public network to harness the power of blockchain seamlessly.

### Commerce Thinking

⦃param⦄ is a natural evolution of blockchain thinking for commerce, as most blockchain are designed specifically for finance industry, especially around currency & payments. Typical commerce transaction would involve multiple dialogues between two entities. In the process, specific documents are shared to support the transaction, and payments happens to be just one step in between.

<div align="left"><img src="/files/-L_ku2mKx9TyFp_I_Pu_" alt=""></div>

Therefore, the blockchain for commerce need to go beyond payments, this calls for enhanced ledger structure to record state-information and documents (source of truth) relevant to each step of the commerce transactions.&#x20;

### Primary features

**Permissioned blockchain without Consortium -** ⦃param⦄ offers a Permissioned Public network seeded by foundation and expanded by as many enterprise as participate on the network, which supporting the goal of creating a truly holistic collaboration and providing one of the fastest ways to add blockchain capabilities to your application without managing cryptocurrencies, wallets, or network nodes.

**Full Data Privacy on Private & Protected nodes -** Like any other private or consortium blockchain, the documents are transferred between "private" nodes on a dedicated private point-to-point connection without any data being transmitted on the public chain. Only the transaction hash is stored on the public chain for future validation. There is also a special "protected" mode of storing documents on the public chain along with the keys, fully encrypted and only accessible by the subscribers of the documents. The encryption standards should meet the large enterprise security/privacy requirements.

**Complete value-chain on blockchain -** More so often, the blockchain projects fail to record complete truth in a supply-chain as it is difficult for SMEs to participate with the blockchain infrastructure needs. ⦃param⦄ provides a light client - *directCommerce,* with necessary visual-interface for SMEs to participate and record their documents securely on the public network by choosing "protected" mode of transfer.

**Enhanced Ledger for Commerce -** Records item-level details from the Quotations, Purchase Orders and Invoice documents, which enables smart contracts to be written at a granular level with the knowledge of current transaction states and particulars in detail.

**Decentralised Knowledge Graph -** The documents recorded on the chain follows one of the latest state-of-art standard (*JSON-LinkedData)* with semantics, which allows param nodes to construct a collective knowledge graph specific to them. This enables faster data queries, data-driven solutions including machine-learning capabilities to be unlocked on blockchain applications.

**Seamless ERP Integration -** The platform comes with reference document convertors and API that can be easily customised and integrated in major ERP / EDI Softwares.

**Transaction Speed -** As the network uses voting-based consensus mechanisms, the transactions are almost instantaneous to match the today's typical commerce requirements.

**Public node -** There is a support for public transaction, which will allow full transparent recording of commerce transaction and documents in open format to aid new age DAPP/B2C applications to be build on this chain and harness the power of  knowledge graph on public blockchain.

### Architecture

High level architecture diagram is depicted below:&#x20;

<div align="left"><img src="/files/-L_pJ5FbEEiMfl780KG4" alt=""></div>

> Whitepaper reference

> [⦃param⦄ Node](/the-protocol/param-node) section details more technical implementation details.


# Multi signature state recording

States: Quotation >> Purchase Order >> Invoice >> Payments >> Digital Receipt

Commerce transactions has more states as compared to typical financial transaction. Any state change would involve minimum two parties to fulfil the associated contractual obligations. In order to bring this into universal commerce blockchain, where most of the contracts can be build seamlessly on a single chain, ⦃param⦄ records the transaction states and transitions on the ledger natively.

![](/files/-L_zjsM_jVswq9p45BxC)

⦃param⦄ protocol records states after necessary validations such as:

* Quotations are always initiated by party-Seller to a party-Buyer, which serves as the base for rest of the state-change validations
* Create Purchase Order transaction can only be initiated by Buyer
* Create Invoice transaction can only be initiated by Seller
* Create Record Payment  transaction can only be initiated by Buyer
* Create Digital Receipt transaction can only be initiated by Seller
* Only Buyer or Seller can add subscribers to the transaction, which is detailed in [later](/the-protocol/param-node) section.

Although the network is permissioned, for spam protection, the creating Quotation on the network would come at a stake or a cost.

> Its worthwhile to note, a single "*commerce transaction"* is equal to multiple ⦃param⦄ transaction on the chain


# Commerce Data Interchange Format

Standard behind the semantic blockchain.

### EDI on Blockchain

Enterprises have recognised the need for standardisation of documents that are shared across organisation, to enable process automation. Hence, today standards like [EDI](/the-protocol/commerce-data-interchange-format#external-references) is a common practise to share across large enterprises. However EDI solution come with infrastructure overhead and the document shared are flat files.

As **⦃param⦄** provides an EDI like capabilities in the form of permissioned public blockchain network for enterprises of all sizes to collaborate and share documents in a well structured format called JSON-LinkedData, referred as Commerce Data Interchange Format (CDIF).

### JSON-LinkedData as CDIF

JSON-LinkedData is originally created as a standard for Semantic web. This is now, can be very well extended for establishing machine-readable data on the commerce blockchain. We can enhance the data links by adding supporting documents such as Catalogues, Booking Tickets, Payments, Shipments, etc...&#x20;

A valid Invoice described using schema.org's (modified) JSON-LD structure:

```
{
  "@context": "http://schema.org/",
  "@type": "Invoice",
  "provider": { #Optionally details are included for the first time invoices between B2B
    "@type": "Organization",
    "@id": "0x131783612317312678316238172376",
    "address": {
      "@type": "PostalAddress",
      "@id": "0x131783612317312678316238172376",   
      "addressLocality": "Seattle",
      "addressRegion": "WA",
      "postalCode": "98052",
      "streetAddress": "20341 Whitworth Institute 405 N. Whitworth"
    },
    "employee": {
      "@type": "Person",
      "@id": "0x131783612317312678316238172376",   
      "name": "Jane Doe - Point of Contact"
    },
    "email": "mailto:info@divum.in",
    "name": "Divum Labs Pvt. Ltd.",
    "telephone": "(425) 123-4567",
    "faxNumber":"(425) 123-4569"
  },
  "customer": { #Optionally details are included for the first time invoices between B2B
    "@type": "Organization",
    "@id": "0x131783612317312678316238172376",
    "address": {
      "@type": "PostalAddress",
      "@id": "0x131783612317312678316238172376",   
      "addressLocality": "Seattle",
      "addressRegion": "WA",
      "postalCode": "98052",
      "streetAddress": "20341 Whitworth Institute 405 N. Whitworth"
    },
    "employee": {
      "@type": "Person",
      "@id": "0x131783612317312678316238172376",   
      "name": "Jane Doe - Point of Contact"
    },
    "email": "mailto:info@divum.in",
    "name": "Customer of this Receipt Inc.",
    "telephone": "(425) 123-7654",
    "faxNumber": "(425) 123-7659"
  },
  "referencesOrder": {
    "@type": "Order",
    "orderDate": "2014-12-01",
    "orderNumber": "123ABC", # receipt / document id. As it is autogenerated, this field will be missing in txn argument
    "paymentMethod": "#ByInvoice",
    "orderedItem": [
      {
        "@type": "OrderItem",
        "@id": "<receiptId>_<index>", // managed by events handler
        "orderQuantity": 1,
        "orderedItem": {
          "@type": "Product",
          "@id": "0x131783612317312678316238172376", 
          "name": "Sony 101.4 cm TV",
          "mpn": 101, //Optional
          "productID": "sony123",
          "gtin8": "", //Unique id for product....
          "offers": {
            "@type": "Offer",
            "priceCurrency": "USD",
            "price": 44999,
            "priceValidUntil": "2020-11-05", //Optinal
            "itemCondition": "NewCondition", //Optinal
            "availability": "InStock",//Optinal
          }
        }
      },
      # Second Item
      {
        "@type": "OrderItem",
        "@id": "<receiptId>_<index>", // managed by events handler
        "orderQuantity": 2,
        "orderedItem": {
          "@type": "Product",
          "@id": "0x131783612317312678316238172376", 
          "name": "Samsung 101.4 cm TV",
          "mpn": 101, //Optional
          "productID": "sam123",
          "gtin8": "", //Unique id for product....
          "offers": {
            "@type": "Offer",
            "priceCurrency": "USD",
            "price": 44999,
            "priceValidUntil": "2020-11-05", //Optinal
            "itemCondition": "NewCondition" //Optinal
          }
        }
      }
    ]
  },
  "minimumPaymentDue": {
    "@type": "PriceSpecification",
    "price": 44999000,
    "priceCurrency": "USD"
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "price": 44999000,
    "priceCurrency": "USD"
  }
}
```

### ERP Integration

⦃param⦄ aim to provide standard convertors for direct ERP integration. Where convertors will plugin to systems like SAP, Zoho Books, connect via standard API interfaces to translate the native ERP formats into CDIF compatible to ⦃param⦄ CLI and API.&#x20;

### Knowledge Extension

One could extend the knowledge of the commerce transaction by adding more standard documents. For example:

* Seller can be update the transaction with [DeliveryMethod](https://schema.org/DeliveryMethod)
* Online Travel Agent could add Schema.org complaint [**Invoice**](https://schema.org/Invoice) -> [**Ticket**](https://schema.org/Ticket)  -> [**Seat Booking**](https://schema.org/Seat) by Airline operator.&#x20;

Each knowledge extension transaction will go through schema validation at the node-level before the transaction is sent on the network.

### External References

> <https://www.edibasics.com/what-is-edi/>
>
> <https://xedi.com/resources/edi-standards/edifact>
>
> <https://en.wikipedia.org/wiki/JSON-LD>
>
> <https://schema.org/Invoice>
>
> EDIFACT Invoice 810 standard
>
> [SAP SchemA ABAP GIT Project](https://github.com/se38/SchemA)


# Decentralised Knowledge Graph

Enable data-driven smart-contracts.

### Cayley as Graph Database

⦃param⦄ uses [Cayley Graph](https://cayley.io) for building decentralised knowledge graph, which is a open source graph inspired by the graph database behind Freebase and Google's Knowledge Graph.

As ⦃param⦄ records commerce documents with semantics using CDIF (JSON-LinkedData) format, which allows the enterprises (local nodes) to build decentralised knowledge graph from the documents which are sent/received via blockchain.

<div align="left"><img src="/files/-L_uwaHmRFURCFEwJOKb" alt=""></div>

### Constructing local Knowledge Graph

Constructing knowledge graph is a basic feature of all the nodes (light, private, protected, public node) present on the ⦃param⦄ network. The steps are as follows:

* Each node is aware of its local public addresses
* All ⦃param⦄ transactions will follow Ethereum like behaviour
  * they emit events upon successful transaction on the chain
* Each node listens to the transaction events specific to its registered local public address
* Inserts them into the graph database whenever a new transaction to these address happens
* Whenever a state change happens or an knowledge extension transaction happens to the same, the node will update the local knowledge graph.

### Decentralisation ensures Data Privacy

Network harness the power of decentralisation to ensure data-privacy by construction. In a typical enterprise application, the private transactions are visible only to two nodes and its [subscribers](/the-protocol/param-node#subscribers). Therefore it is impossible to build knowledge graph of transactions outside the node visibility as the public ledger does not contain the document except but the signature of the transaction. For more details refer [Data Privacy](/the-protocol/param-node#data-privacy) section on [⦃param⦄ Node](/the-protocol/param-node).


# ⦃param⦄ Node

### Ethereum + Quorum Tessara + Cayley Graph

⦃param⦄ is a Quorum-based (Ethereum) blockchain protocol that has been developed to provide the Commerce Industry with a permissioned public implementation of Quorum that supports sharing documents such as Quotations, Purchase Orders and Invoices to *zero-infrastructure* enterprises without a need for consortium and with utmost data-privacy.

<div align="left"><img src="/files/-L_pJ5FbEEiMfl780KG4" alt=""></div>

The full node consists of:

* Modified Geth client from Quorum node - will have ledger structure changes to record commerce transaction states
* Modified Tessera transaction manager with support for sending PGP encrypted documents on public network with subscribers support
* Cayley Graph to construct node-level knowledge graph based on network events
* Ready-made libraries & services for integration with enterprise resource planning (ERP) softwares

### Transactions Processing and Privacy

⦃param⦄ supports three modes of document transfer between nodes.&#x20;

#### Private mode

This mode is used for transferring the documents between two private nodes securely without leaving any trace on the public blockchain except for the signature of the transaction for future validation. The steps followed are:

* The local node sends the documents to transaction manager
* Transaction manager generates a random symmetric key for encrypting the document
* Document is encrypted using random symmetric key
* Later, symmetric key is encrypted using RSA with receiver's public address for sharing the key via the network
* Private nodes will create a dedicated point-to-point secure connection
* Both encrypted key and the document are shared via secure connection
* The receiver acknowledges the document transfer
* Signature hash including the acknowledgement and the document is created
* Finally, upon successful private document transfer, the transaction is sent to P2P public network

#### Protected mode

Protected Mode of transfer mimics the private mode on the public node. Here, the encrypted documents are stored on the public nodes. This enables the small/medium enterprises and consumers to store documents such as invoices and purchase receipts securely on blockchain and claim ownership for forward use-cases, such as financing, insurance, resale, etc... The steps are:

* Documents are encrypted using symmetric keys like Private mode
* Encrypted keys and documents are stored as part of the public ledger
* Transaction is processed and block is mined like public transaction
* Nodes that are opted for storing protected transaction will sync as part of the block sync mechanism

Note that although the document is stored on public nodes, its readable only for the sender & receiver by default.

#### Public mode

Public mode is in compliance with Ethereum like transaction, where the documents are open-format, included as part of the transaction and all nodes syncs this data.

### **Smart Contracts**

Largely Smart contracts behaviour at a node level remains same, but as a network it would look different depending on the mode of transfer. Smart-contracts that involve Private/Protected documents, the contracts can be executed only on the sender and receiver nodes, who have access to these documents. Whereas, for public documents, multiple node can participate in execution and consensus.

### Data Privacy

⦃param⦄ provides enterprise level data-privacy, additionally it democratize the data by making it available equally for both sender and receiver, empowering them with the data ownership. Below tables gives the overview of the data access across parties and transfer types.

| Transfer Type | <p>Buyer Node</p><p>(all node-type)</p> | <p>Seller Node</p><p>(all node-type)</p> | <p>Protected Node</p><p>(third-party)</p> | <p>Public Node</p><p>(third-party)</p> |
| ------------- | :-------------------------------------: | :--------------------------------------: | :---------------------------------------: | :------------------------------------: |
| Private       |                 Visible                 |                  Visible                 |               Not Applicable              |             Not Applicable             |
| Protected     |                 Visible                 |                  Visible                 |                Not-Visible                |               Not-Visible              |
| Public        |                 Visible                 |                  Visible                 |                  Visible                  |                 Visible                |

### Subscribers

"*Subscribers*" is the concept of attaching ownership of the documents that are shared on the network. In private/protected mode, the sender and receiver becomes subscribers automatically and they have equal access on the data, such as:

* Add more subscribers
* Execute smart-contracts on their nodes where private key is available
* Independently run data-queries on their data for self consumption

The existing subscribers can add more subscribers to share the documents. For example, a buyer can share the invoice document with financial institutes for loan processing.

### Consensus

> Raft based Consensus being used in testnet. There will IBFT


# directConnect - Node

Permissioned-Public Network

⦃param⦄ blockchain node consists of three components:

* Blockchain node
* Enterprise Edition Lite&#x20;
* Enterprise Edition Full

#### Blockchain Node

⦃param⦄ is a modified Quorum blockchain, the node runs the following services:

* Ethereum
* Quorum (Tessara)
* ⦃param⦄ protocol related smart-contracts
* IPFS for ledger extension
* Spam control modules
* SD-WAN Edge (FlexiWAN / VeloCloud compatible)

#### Enterprise Edition Lite (EE Lite)

EE Lite hides the blockchain related overheads from the application layer. The core functionalities include:

* Web3 Transaction Queue Manager
* Off-Chain DB for faster indexing and querying the chain (MySQL)
* GraphQL API layer for Thin Client interface

#### Enterprise Edition Full (EE Full)

EE Full enables seamless integration into enterprise (ERP) environment. The core functionalities include:

* Keystore management
* Single Sign On (SSO) / Active Directory (AD) integration
* NoSQL DB for Decrypted Data storage (MongoDB)
* Graph DB for building knowledge graph (JanusGraphDB)
* High abstract GraphQL for application development and integration


# directCommerce - Client

## Install ⦃param⦄.invoice wallet

Download the mac build from the following link and double click on the downloaded file from the Finder.

{% embed url="<http://param.network/rel/param-network-wallet-beta-0.4.2.dmg>" %}

{% hint style="info" %}
Since Beta software is distributed outside Apple app-store, you will get a Security Warning. You can override by following step

Please go "System Preferences" -> "Security & Privacy" -> "General" Tab and Open the app.

![](/files/-LbCRl7LgzygaiVZds11)
{% endhint %}

## Create new identity on the node

1. Click on "Create New Identity". This will create private-key/public-key on the remote node protected by password.

![](/files/-LbCTCxUb_AC9uaPv6l4)

1. Set new "Password" to protect your wallet

{% hint style="warning" %}
Its your blockchain wallet password, there is no way to reset it.
{% endhint %}

![](/files/-LbCVjtn9uXYu_lIFSFQ)

1. If the identity is created successfully, you should see 12-phase recovery words. You can ignore this for now, beta release does not support this recovery.&#x20;

![](/files/-LbCVxcXZV9lnpq0hUAU)

## Add contacts

Click on the "Manage Contacts" -> "Create New"

![](/files/-LbCWSiivQSIwmENaC4W)

You can add a business contact to whom you want to send invoice. For now, you can add some of the test account id as given below:

| Name   | Param-Public-Id                            | Private ID |
| ------ | ------------------------------------------ | ---------- |
| Vaidee | 0xe1b990b69b404c31089f885c426a1f050ee15681 | -NA-       |

![](/files/-LbCWx9YK6v8yVoKwDLY)

{% hint style="success" %}
You should get a success toast message
{% endhint %}

## Add Item

1. Click on the "Manage Items" -> "Create New"
2. You can add a product or service item, which you invoice for.
   1. Name could be "Mobile Phone" or "Software Services"
   2. Item "Id" could be any free-format text
   3. Type: Choose "Goods" or "Services"
   4. Purpose: Choose "Sell"

![](/files/-LbC_UmX4a2WAts34QRS)

{% hint style="success" %}
You should get a Success toast message
{% endhint %}

## Now you are ready to share Quotation (as a Seller)

1. Click on top-corner "⦃p⦄" logo for navigating to Home page
2. Click on "E-invoicing" -> "Create New Quotation"
3. Enter Customer Name, its a drop-down, you must pick what you have added from the Contacts
4. Choose Quotation Type as "Private"
5. Enter Quotation Date by clicking on the Select date
6. Click on "Add Item"
   1. Choose ITEM you have added ("Mobile" or "Software Services") from the drop down
   2. Double Click "UNIT PRICE" and enter price of the item (float field)
   3. Double Click "QUANTITY" and type number of items (integer field)
7. Click on the SEND button

![](/files/-LbCZPWS-FKbT1twejqW)

{% hint style="success" %}
Congratulations!! You have created your first quotation on the blockchain
{% endhint %}

## Receive Purchase Order (Buyer)

Now you need to wait for Customer to send you an purchase order, typically they do

![](/files/-LbCcfDcJPr8UyKlnOB3)

## Send Invoice (Seller)

![](/files/-LbCcos9k-zqZWbtB6mb)

## Record Payments (Buyer)

![](/files/-LbCcz4NhLkgq4-pWHS-)

![](/files/-LbCdjn2t0cXGkS1Be97)

## Built-in Chain Explorer

Click on the lower-right bottom to open up the explorer

![](/files/-LbCdUtnmzD9qgjnJ5OB)

![](/files/-LbCdGkeO2LqL6-Ytgv5)


# directERP - SDK for Enterprises

Client SDK for faster integration

Following SDK are being developed

* NodeJs library for direct Web3 level blockchain querying
* NodeJs library for native blockchain query using GraphQL&#x20;
* NodeJs client library for EE Lite and EE Full GraphQL API integration
* NodeJs library for bulk document Import (PO/Invoice/GRN/CN/DN/Catalogue)
* Java client library for native blockchain query using GraphQL

More libraries will be announced for go-lang developers soon


# Testnet


# Libraries


# ⦃param⦄ dev community


