# Introduction

This microsite contains the detailed documentation that helps any organisation get a strong understanding about ONEST and helps them go live on the network.

In today's rapidly growing and evolving world, access to quality education and skill development has become a global challenge. Our traditional education system suffers from multiple limitations like financial barriers, geographical limitation, lack of discoverability, portability and high cost of trust verification, leaving individuals with limited opportunities to acquire essential skills. To empower individuals, it is crucial to provide them with the right skills, knowledge, and opportunities to adapt and succeed in an ever-evolving environment.

Additionally, as the technology and industries advance, there is an urgent need to bridge the ever-widening skill gaps in the job market and it demands continuous upskilling and reskilling efforts. The emergence of EdTech has brought promising opportunities, but there are certain challenges faced by them also. These challenges encompass difficulties in reaching the right audience, grappling with the high operational costs associated with platform-led service models, encountering a digital divide based on platform popularity, and struggling to establish trust with users. The inability to effectively address these obstacles hampers the seamless dissemination of services and undermines the overall efficacy of educational platforms.

To address these multifaceted challenges,  a paradigm shift from relying solely on centralized platforms for storing and exchanging value to embracing a decentralized network comprising interconnected ecosystem actors that facilitate the flow of value is necessary . An open network for education and skilling becomes indispensable, striving to bridge the skill gap, provide quality and trustworthy education, leverage EdTech's potential while fostering a collaborative community of learners and educators, thus empowering individuals to thrive in an ever-changing world.

**Open Network for Employment and Skilling Tranformations (ONEST)** fosters a fair and accessible network that is both open and decentralized, allowing individuals and organizations to harness its power to unlock their full potential, facilitating access to learning and livelihood opportunities.

The objective of setting up ONEST is to break the current siloed ecosystem where the education & content providers, education facilitators, education seekers, education facilitators & job providers operate in a fragmented and secluded manner which restricts collaborations that could have otherwise flourished into business & social partnerships aiming towards the same goal of “**equitable education** & skilling to **enhance employability** and **sustainable livelihood**.” &#x20;

<figure><img src="/files/zPsQShMNoGViv76unJhK" alt=""><figcaption></figcaption></figure>

### What will ONEST enable?

ONEST will enable B2B & B2C discovery and transactions and will help address the needs of service providers as well as service consumers in the education and job ecosystem by establishing platform-agnostic interoperability on the same analogy of UPI. Organizations and individuals will also be able to broadcast their services & content facilitating a democratic and informed approach facilitating “freedom of choice” to end consumers select the services from a surplus pool of providers of their choice as per their preferences in terms of services, location, and affordability.  The initiative also envisages a mechanism to identify each other uniquely, trust each other, and store their credentials including proof of work in machine-readable formats which are portable and verifiable across different tenets, to help them build reputation and credibility.

<figure><img src="/files/xADulPCJCaLK5U1ZlW1Z" alt=""><figcaption></figcaption></figure>

Read more [***here***](https://onest.network/images/PDF/ONEST-Concept-Paper.pdf)***.***<br>

<br>


# ONEST- Focus Areas

<figure><img src="/files/4DZsv8lpoU3cqERcNTKP" alt=""><figcaption></figcaption></figure>

ONEST will primarily focus on enabling equitable opportunities for education, upskilling & jobs under the following four key categories,

#### Skilling Experiences: Content, Courses, Training

ONEST facilitates skilling and upskilling by onboarding education providers and consumers, enabling the broadcast and discovery of courses, content, and training opportunities. It fosters healthy competition, drives innovation, and bridges supply-demand gaps, empowering individuals, organizations, and the Government to address challenges in the competitive job ecosystem effectively.

#### Financial Aid: Scholarship, Grants, CSR

ONEST aims to combat high dropout rates in school and higher education caused by economic factors by collaborating with multilateral and not-for-profit organizations to provide financial aid, scholarships, and grants. By offering a unified user experience, ONEST will enable students and professionals to discover and track their applications for financial support, increasing youth employability and improving job prospects in India. This multifaceted strategy involves schools, educators, families, communities, legislators, and various organizations to address the concerns surrounding dropout rates effectively.

#### Work Opportunities: Internship, Jobs, Gigs

ONEST will forge partnerships with large employment organizations, job portals, and employment agencies to connect job seekers with potential employers, facilitating the discovery of relevant internships and job opportunities for students and professionals. Additionally, it will cater to gig workers, offering them a means to explore project-based or short-term work, addressing the challenge of irregular and unpredictable income by providing a centralized gig discovery platform.

#### Expert Connect: Mentorship, Volunteering, and Tutoring

ONEST will connect learners with experienced mentors, coaches, and tutors, enabling personalized mentorship, coaching, and tutoring based on individual career goals. Utilizing algorithms for suitable mentor matches and a transaction fabric for discovery, booking, and feedback, it can  accelerate career paths, guiding learners towards better professional decisions and growth.

<br>


# Core Principles

The ONEST architecture is based on three core principles,&#x20;

* **Access** - ONEST will leverage DSEP protocols to enable discovery and access to education, upskilling, and job opportunities irrespective of financial or geographical status thus enabling equitable distribution. It will not only facilitate discovery but an end-to-end workflow discovery-ordering-fulfilment-post fulfilment on the network between provider and consumer platforms.&#x20;
* **Trust** - The trust layer will be powered by digitally verifiable credentials (VCs) & electronic registries. VC issuance, thus, can be made available as a service for service provider platforms to issue verifiable education, training, and work certificates & licences to augment trust in the education and job ecosystem. The verifiable certificates will help the students, professionals and employers to fast-track hiring and background checks with enhanced credibility.&#x20;
* **Ownership** - ONEST will enable a consumer-centered ecosystem, where the end consumer (student, professional, organization) can store their VCs in their choice of  digital wallet. ONEST will leverage existing consent and data exchange architecture under the data protection framework. The digital wallet can also be linked to a student’s ID to facilitate government sponsorships and scholarship programs.&#x20;

<br>


# Roles You Can Play

An entity can play various roles on ONEST, the primary roles are

**Provider Platform:** If you aspire to broaden the reach of the training, scholarships, jobs, and mentorship opportunities you offer, we invite you to join the network as a Provider Platform.\
\
**Provider**: If you’d like to be onboarded on an existing provider platform as one of the providers of the training, scholarships, jobs, and mentorship opportunities, we invite you to join the network as a Provider.\
\
**Seeker Platform**: If you seek to explore the vast array of training, scholarships, jobs, and mentorship opportunities available within the network, we encourage you to join as a Seeker Platform.\
\
**Seeker**: If you’d like to consume the information made available by the ONEST network through any of the seeker platforms, you can join as a seeker. \
\
**Technology Service Provider**: If you choose to enable other organizations to join this network through your technology, business or onboarding services, this role will suit you the best.\
\
You have the flexibility to choose one of the aforementioned roles or even assume more than one role within the network, enabling you to actively engage in and benefit from the diverse opportunities provided by the network.


# Join the network

Write to us on <hello@onest.network>


# Network Observability


# Introduction

Observability of the ONEST network provides the ability to understand and gain insights into the inner workings of the network by observing its behaviour, performance, and state. Observability provides a range of benefits, including but not limited to:

1. Debugging & Troubleshooting: Observability provides the necessary data and insights to identify & diagnose issues, and determine their root causes. This is crucial for resolving bugs, performance bottlenecks, and other operational problems quickly.
2. Compliance & Auditing: Observability is essential for maintaining compliance with the ONEST protocol, specifications & policies. It provides the necessary data for auditing and reporting purposes.
3. Data-driven Services: Observability provides data-driven insights that can help ONEST evolve its services to help network and the network participants make informed choices based on real-time and historical data.
4. Security: Observability helps in detecting and responding to security threats. Unusual patterns or anomalies in data can be indicators of potential security breaches or threats.

The observability infrastructure within ONEST is designed to offer the following key features:

* Process the incoming data: validate for protocol compliance and mask any PII information present in the input data
* Query the processed data via multiple modes: query API, dashboards (pre-created & ability to create new), and download the ingested data as files from cloud storage

The observability infrastructure and services will be accessible to all network participants, allowing them to harness these resources for various purposes, in accordance with the policies set forth by the ONEST network

Note: This observability infrastructure & its services are applicable only when working with DSEP 1.0.


# Telemetry Implementation

Following are the 3 ways to generate and send telemetry events. However note that this is applicable only when operating on DSEP 1.0

### 1. Using the Protocol Server

Protocol Server is enhanced to emit telemetry and send to ONEST Obsrv (the data platform where telemetry events are captured and stored). Use this[ GitHub Repo](https://github.com/ONEST-Network/protocol-server) to get the updated protocol server code and use it. \
\
Backup the logs generated by protocol server till now before doing a deployment. Extract the API data from the backed up logs and ingest [#using-the-protocol-server](#using-the-protocol-server "mention")\
\
Add the following configuration in `default-bap-client.yml` , `default-bap-network.yml` ,  `default-bpp-client.yml` , `default-bpp-network.yml` files and deploy the protocol server.

```yaml
telemetry:
    network:
      url: "TELEMETRY_SERVER_URL"
    # raw events are optional
    raw:
      url: ""  
    batchSize: 100
    # In minutes
    syncInterval: 5
    # Either can be LOCAL or REDIS
    storageType: "LOCAL"
    backupFilePath: "backups"
    redis:
      db: 4
    messageProperties: []
 service: 
   name: "network_service"
   version: "1.0.0"
```

The protocol server will generate telemetry events and send them in batches of 100 or every 5 minutes to ONEST Obsrv.

**Note:** Configure the telemetry URL to "<https://data.onest.network/data/v1/in/onest-telemetry-testing>" for lower environments such as dev, staging, and preprod during testing. For the production telemetry URL, contact the ONEST team when the application is ready for go-live

### 2. Using the Open Network Telemetry SDK

Open Network Telemetry SDK is a javascript SDK which takes API request message and context object  and generates the telemetry events.

Please refer to the [readme](https://github.com/Sunbird-Obsrv/open-network-telemetry) for more details.

### 3. Using the API

Use the following API to send telemetry events to ONEST Obsrv.

**API curl command**

```url
curl --location '{TELEMETRY_SERVER_URL}' \
--header 'Content-Type: application/json' \
--data '{
    "data": {
        "id": "onest-batch-1",
        "events": [{}]
    }
}'
```

**Note:** Send the telemetry events in a batch size of **50, 100** or send **once in every 30 min**.

**Sample API Payloads**

```json
curl --location '{TELEMETRY_SERVER_URL}' \
--header 'Content-Type: application/json' \
--data '{
    "data": {
        "id": "onest-batch-1-1",
        "events": [
            {
                "resourceSpans": [
                    {
                        "resource": {
                            "attributes": [
                                {
                                    "key": "eid",
                                    "value": {
                                        "stringValue": "API"
                                    }
                                },
                                {
                                    "key": "producer",
                                    "value": {
                                        "stringValue": "fs-ps-bap-network.onest.network"
                                    }
                                },
                                {
                                    "key": "domain",
                                    "value": {
                                        "stringValue": "ONDC:ONEST12"
                                    }
                                }
                            ]
                        },
                        "scopeSpans": [
                            {
                                "scope": {
                                    "name": "network_service",
                                    "version": "1.0.0",
                                    "attributes": [
                                        {
                                            "key": "scope_uuid",
                                            "value": {
                                                "stringValue": "640a7f6438e722b31a8b44e23762767f"
                                            }
                                        },
                                        {
                                            "key": "checksum",
                                            "value": {
                                                "stringValue": ""
                                            }
                                        },
                                        {
                                            "key": "count",
                                            "value": {
                                                "intValue": 1
                                            }
                                        }
                                    ]
                                },
                                "spans": [
                                    {
                                        "name": "search",
                                        "traceId": "15e956e5-2a8d-4a3a-8556-e33108e70226",
                                        "spanId": "9509845c-5a32-4a8c-b5bd-78a1de071bd6",
                                        "span_uuid": "b63cc6bcc452a73fd479f2e888a5b044",
                                        "startTimeUnixNano": "1708691608401",
                                        "endTimeUnixNano": "1708691609440",
                                        "status": "Ok",
                                        "attributes": [
                                            {
                                                "key": "sender.id",
                                                "value": {
                                                    "stringValue": "fs-ps-bap-network.onest.network"
                                                }
                                            },
                                            {
                                                "key": "recipient.id",
                                                "value": {
                                                    "stringValue": "fs-ps-bpp-network.onest.network"
                                                }
                                            },
                                            {
                                                "key": "sender.uri",
                                                "value": {
                                                    "stringValue": "https://fs-ps-bap-network.onest.network/"
                                                }
                                            },
                                            {
                                                "key": "recipient.uri",
                                                "value": {
                                                    "stringValue": "https://fs-ps-bpp-network.onest.network"
                                                }
                                            },
                                            {
                                                "key": "sender.type",
                                                "value": {
                                                    "stringValue": "seeker"
                                                }
                                            },
                                            {
                                                "key": "recipient.type",
                                                "value": {
                                                    "stringValue": "provider"
                                                }
                                            },
                                            {
                                                "key": "observedTimeUnixNano",
                                                "value": {
                                                    "intValue": 1708691601754
                                                }
                                            },
                                            {
                                                "key": "http.request.method",
                                                "value": {
                                                    "stringValue": "POST"
                                                }
                                            },
                                            {
                                                "key": "http.request.route",
                                                "value": {
                                                    "stringValue": "/search"
                                                }
                                            },
                                            {
                                                "key": "http.request.host",
                                                "value": {
                                                    "stringValue": "8da0-49-207-215-34.ngrok-free.app"
                                                }
                                            },
                                            {
                                                "key": "http.request.scheme",
                                                "value": {
                                                    "stringValue": "http"
                                                }
                                            },
                                            {
                                                "key": "http.status.code",
                                                "value": {
                                                    "intValue": 200
                                                }
                                            }
                                        ],
                                        "events": []
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}'
```

### Telemetry Event

```json
{
 "resourceSpans": [{
   "resource": { // Required. Contextual information as per envelope structure
     Attribute("eid", String), // Required. Event ID - must be API for all api events
     Attribute("producer", String), // Required. Identifier of the system that produced this event
     Attribute("domain", String), // Required. Domain where the event has occurred.
   }, 
   "scopeSpans": [{
     "scope": { // Optional. Contextual information as per envelope structure
       "name": String, 
       "version": String, 
       "attributes": [
         Attribute("scope_uuid", String), // Optional. unique id for the batch for idempotency
         Attribute("checksum", String), // Optional. checksum to enable tampering checks
         Attribute("count", String), // Optional. Total count of spans in this batch 
       ]
     },
     "spans": [{ // Required. One or more API events in detail
       "name": String, // Required. API Name
       "traceId": String, // Required. Unique ID of the entire transaction
       "spanId": String, // Required. Unique ID of the API event call
       "span_uuid": String, //Required. Unique identifier for this span record
       "startTimeUnixNano": String, // Required. Start time of the API call in nano-seconds
       "endTimeUnixNano": String, // Required. End time of the API call in nano-seconds
       "status": String, // Required. one of Unset, Error, Ok
       "attributes": [ // Required. List of attributes providing additional details about the span
         Attribute("observedTimeUnixNano", String), // Required. Event generated time as ISO datetime
         Attribute("sender.id", String), // Required. Identifier of the system initiated the API call
         Attribute("recipient.id", String), // Required. Identifier of the system that is expected to be the recipient of the API call
         Attribute("http.method", String), // Required. Http method one of GET/POST/PATCH/DELETE etc
         Attribute("http.server_name", String), // Optional. Server name if any
         Attribute("http.route", String), // Required. URL of the request
         Attribute("http.scheme", String), // Optional. Is the call http or https
         Attribute("http.host", String), // Required. Host ip or domain name
         Attribute("http.status.code", Int), // Required. Status code of the API call
       ],
       "events": [{ // Optional. Capture additional API specific data like errors, req & res data, or multiple events that occurred during the API processing
         "name": String, // Required. Name of the additional data or event
         "time": String, // Required. Event time as ISO datetime
         "attributes": [Attribute] // Optional. List of attributes 
       }]
     }]
   }]
 }]
}

```

#### Example Sample Event

```json
[
    {
        "resourceSpans": [
            {
                "resource": {
                    "attributes": [
                        {
                            "key": "eid",
                            "value": {
                                "stringValue": "API"
                            }
                        },
                        {
                            "key": "producer",
                            "value": {
                                "stringValue": "fs-ps-bap-network.onest.network"
                            }
                        },
                        {
                            "key": "domain",
                            "value": {
                                "stringValue": "ONDC:ONEST12"
                            }
                        }
                    ]
                },
                "scopeSpans": [
                    {
                        "scope": {
                            "name": "network_service",
                            "version": "1.0.0",
                            "attributes": [
                                {
                                    "key": "scope_uuid",
                                    "value": {
                                        "stringValue": "640a7f6438e722b31a8b44e23762767f"
                                    }
                                },
                                {
                                    "key": "checksum",
                                    "value": {
                                        "stringValue": ""
                                    }
                                },
                                {
                                    "key": "count",
                                    "value": {
                                        "intValue": 1
                                    }
                                }
                            ]
                        },
                        "spans": [
                            {
                                "name": "search",
                                "traceId": "15e956e5-2a8d-4a3a-8556-e33108e70226",
                                "spanId": "9509845c-5a32-4a8c-b5bd-78a1de071bd6",
                                "span_uuid": "b63cc6bcc452a73fd479f2e888a5b044",
                                "startTimeUnixNano": "1708691608401",
                                "endTimeUnixNano": "1708691609440",
                                "status": "Ok",
                                "attributes": [
                                    {
                                        "key": "sender.id",
                                        "value": {
                                            "stringValue": "fs-ps-bap-network.onest.network"
                                        }
                                    },
                                    {
                                        "key": "recipient.id",
                                        "value": {
                                            "stringValue": "fs-ps-bpp-network.onest.network"
                                        }
                                    },
                                    {
                                        "key": "sender.uri",
                                        "value": {
                                            "stringValue": "https://fs-ps-bap-network.onest.network/"
                                        }
                                    },
                                    {
                                        "key": "recipient.uri",
                                        "value": {
                                            "stringValue": "https://fs-ps-bpp-network.onest.network"
                                        }
                                    },
                                    {
                                        "key": "sender.type",
                                        "value": {
                                            "stringValue": "seeker"
                                        }
                                    },
                                    {
                                        "key": "recipient.type",
                                        "value": {
                                            "stringValue": "provider"
                                        }
                                    },
                                    {
                                        "key": "observedTimeUnixNano",
                                        "value": {
                                            "intValue": 1708691601754
                                        }
                                    },
                                    {
                                        "key": "http.request.method",
                                        "value": {
                                            "stringValue": "POST"
                                        }
                                    },
                                    {
                                        "key": "http.request.route",
                                        "value": {
                                            "stringValue": "/search"
                                        }
                                    },
                                    {
                                        "key": "http.request.host",
                                        "value": {
                                            "stringValue": "8da0-49-207-215-34.ngrok-free.app"
                                        }
                                    },
                                    {
                                        "key": "http.request.scheme",
                                        "value": {
                                            "stringValue": "http"
                                        }
                                    },
                                    {
                                        "key": "http.status.code",
                                        "value": {
                                            "intValue": 200
                                        }
                                    }
                                ],
                                "events": []
                            }
                        ]
                    }
                ]
            }
        ]
    },
    {
        "resourceSpans": [
            {
                "resource": {
                    "attributes": [
                        {
                            "key": "eid",
                            "value": {
                                "stringValue": "API"
                            }
                        },
                        {
                            "key": "producer",
                            "value": {
                                "stringValue": "fs-ps-bpp-network.onest.network"
                            }
                        },
                        {
                            "key": "domain",
                            "value": {
                                "stringValue": "ONDC:ONEST12"
                            }
                        }
                    ]
                },
                "scopeSpans": [
                    {
                        "scope": {
                            "name": "network_service",
                            "version": "1.0.0",
                            "attributes": [
                                {
                                    "key": "scope_uuid",
                                    "value": {
                                        "stringValue": "640a7f6438e722b31a8b44e23762767f"
                                    }
                                },
                                {
                                    "key": "checksum",
                                    "value": {
                                        "stringValue": ""
                                    }
                                },
                                {
                                    "key": "count",
                                    "value": {
                                        "intValue": 1
                                    }
                                }
                            ]
                        },
                        "spans": [
                            {
                                "name": "on_search",
                                "traceId": "15e956e5-2a8d-4a3a-8556-e33108e70226",
                                "spanId": "9509845c-5a32-4a8c-b5bd-78a1de071bd6",
                                "span_uuid": "b63cc6bcc452a73fd479f2e888a5b044",
                                "startTimeUnixNano": "1708691608401",
                                "endTimeUnixNano": "1708691609440",
                                "status": "Ok",
                                "attributes": [
                                    {
                                        "key": "sender.id",
                                        "value": {
                                            "stringValue": "fs-ps-bpp-network.onest.network"
                                        }
                                    },
                                    {
                                        "key": "recipient.id",
                                        "value": {
                                            "stringValue": "fs-ps-bap-network.onest.network"
                                        }
                                    },
                                    {
                                        "key": "sender.uri",
                                        "value": {
                                            "stringValue": "https://fs-ps-bpp-network.onest.network/"
                                        }
                                    },
                                    {
                                        "key": "recipient.uri",
                                        "value": {
                                            "stringValue": "https://fs-ps-bap-network.onest.network"
                                        }
                                    },
                                    {
                                        "key": "sender.type",
                                        "value": {
                                            "stringValue": "provider"
                                        }
                                    },
                                    {
                                        "key": "recipient.type",
                                        "value": {
                                            "stringValue": "seeker"
                                        }
                                    },
                                    {
                                        "key": "observedTimeUnixNano",
                                        "value": {
                                            "intValue": 1708691601754
                                        }
                                    },
                                    {
                                        "key": "http.request.method",
                                        "value": {
                                            "stringValue": "POST"
                                        }
                                    },
                                    {
                                        "key": "http.request.route",
                                        "value": {
                                            "stringValue": "/on_search"
                                        }
                                    },
                                    {
                                        "key": "http.request.host",
                                        "value": {
                                            "stringValue": "8da0-49-207-215-34.ngrok-free.app"
                                        }
                                    },
                                    {
                                        "key": "http.request.scheme",
                                        "value": {
                                            "stringValue": "http"
                                        }
                                    },
                                    {
                                        "key": "http.status.code",
                                        "value": {
                                            "intValue": 200
                                        }
                                    }
                                ],
                                "events": [
                                    {
                                        "name": "error",
                                        "time": "2023-04-29T18:52:58.114561Z",
                                        "attributes": [
                                            {
                                                "key": "type",
                                                "value": {
                                                    "stringValue": "CORE-ERROR"
                                                }
                                            },
                                            {
                                                "key": "code",
                                                "value": {
                                                    "stringValue": "ERR_BPP_1010"
                                                }
                                            },
                                            {
                                                "key": "msg",
                                                "value": {
                                                    "stringValue": "Unable to fetch the catalog. Please try later"
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
]
```

Refer to this [repo](https://github.com/Sunbird-Obsrv/network-telemetry-spec), for more details about the open network telemetry specifications

### Test Telemetry Generation

1. Use the <https://webhook.site/> to generate an endpoint URL.
2. Set the web hook URL as Telemetry URL.
3. Ensure telemetry events are getting generated for all the relevant APIs in this [format](#telemetry-event).


# Transaction Dashboard

This dashboard provides a detailed overview of active network participants who are using DSEP 1.0, along with the domains they operate in and the transactions occurring between them

URL: <https://data.onest.network/superset/dashboard/20/>\
Username: onest-viewer \
Password: onest\@123


# Beckn Protocol - Video Library

Beckn Protocol (or Beckn in short) enables the creation of open, peer-to-peer decentralized networks for pan-sector economic transactions.

Here are 10 videos that explain how to use to leverage the protocol for your business and offerings


# Chapter 1: Open Networks as a Digital Marketplace

{% embed url="<https://www.youtube.com/watch?v=7Otfcy37-NE>" %}


# Chapter 2: Beckn – An open protocol for decentralized commerce

{% embed url="<https://www.youtube.com/watch?v=41RiBu6zT9Y>" %}


# Chapter 3: Beckn Ecosystem Architecture

{% embed url="<https://www.youtube.com/watch?v=Ni-WySb47mE>" %}


# Chapter 4: Specification and Support Layer

{% embed url="<https://www.youtube.com/watch?v=dQlMJManVmA>" %}


# Chapter 5: Transaction Layer

{% embed url="<https://www.youtube.com/watch?v=1tURkGLhSTs>" %}


# Chapter 6: Implementing Beckn Protocol

{% embed url="<https://www.youtube.com/watch?v=OrzPf9rQiu0>" %}


# Chapter 7: Network Topologies

{% embed url="<https://www.youtube.com/watch?v=-dMnZNb3GHc>" %}


# Chapter 8: Beckn API Overview

{% embed url="<https://www.youtube.com/watch?v=EvH9sQLk3yw>" %}


# Chapter 9: Example of a Retail Transaction

A retail transaction on Beckn protocol using a chat-based application

{% embed url="<https://www.youtube.com/watch?v=xsfMjSDe7Zw>" %}


# Chapter 10: Example of a Logistics Transaction

A Logistics transaction on Beckn protocol using a chat-based application

{% embed url="<https://www.youtube.com/watch?v=iTjPtYEwq7U>" %}


# Chapter 11: Example of a Transaction using Interactive UI

{% embed url="<https://www.youtube.com/watch?v=U5Zo3ANw5Dw>" %}


# Getting started on DSEP - Video Library

Please watch the 10 videos that will give you a preliminary understanding of how to get started with ONEST

This content will give any network participant a bird's eye view of carrying out business on the network and the possible use cases you can explore


# Chapter 1: Understanding Challenges in the Ecosystem

{% embed url="<https://drive.google.com/file/d/19v4fJOToUNZzHUyTKFRMLM9RJHzZC7nx/view?usp=drive_link>" %}

1. Global predictions say that the digital education sector is showing healthy signs of growth worldwide
2. Digitization in the education sector, especially in a post-COVID-world, is leading the growth and would be one of the primary factors for the Global Education Market to reach $10 Trillion by 2030
3. Bridging skill gaps, and solving for the parity in Labour Force Participation between men (72.3%) & women (47.4%) and rural & urban participation are two low hanging fruits for service providers in the sector
4. A platform model that is a widespread reality today does not make discovery and access convenient - hence open networks is a solution for equitable access to education services

<figure><img src="/files/txx8Gl4DKjvOaNetdOMY" alt=""><figcaption><p> Slide 1 - 0:15</p></figcaption></figure>

<figure><img src="/files/hU3y7SYKzGBUzaFo7Bzk" alt=""><figcaption><p>Slide 2 - 1:15</p></figcaption></figure>

<figure><img src="/files/6ojAT0HgQiKqxj9E99yx" alt=""><figcaption><p>Slide 3 - 2:38</p></figcaption></figure>


# Chapter 2: Open Networks for Skilling and Education

{% embed url="<https://drive.google.com/file/d/1Z5Gf3CuJ6P2btEzZpMDn5A9gHLCmWkM8/view?usp=drive_link>" %}

1. The protocol makes federated approach to Education, Skilling, mentorship and Jobs ecosystem, possible and increases access to these services
2. DSEP helps in breaking the platform centric and siloed approach&#x20;
3. DSEP which is based on on Beckn Protocol brings in the single common language for both opportunity providers and seekers to easily interact
4. For this service provider organisation should integrating existing platforms into ONEST to speak and interact in the same language
5. Advantages of using open network infrastructure would that small players can leverage the network benefits for business development & reach wider user-base and play an active role in coming up with policies in the domain along with other participants - big or small

<figure><img src="/files/WFGlmiGBKpqBcVpnCV8u" alt=""><figcaption></figcaption></figure>

1.

<figure><img src="/files/Ju7YFvHcmZn2ifJQbgya" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/5vdrGyrZRfcj6xkig9lp" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/xFvLpGufviJefVTPkHNf" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/AuekZRxM0iJcQS44kZfR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6LN742nicdTqOe71UJ1t" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tjU1EJjQO5tcun7w0i45" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/keeXv0GZZ7UQB7Cf1PDq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/hvZ02GEolW17nJ1dwfRG" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/HaeGvoq8hLyTxeZU0ad1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/pqx3d2G9BXIsl5hsGQxT" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/p5jbPybJefEA1pTZUI1b" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/hi5Kye2DaLA9Jqt9X1IK" alt=""><figcaption></figcaption></figure>


# Chapter 3: DSEP Overview

{% embed url="<https://drive.google.com/file/d/1Y_nLKp-LXHjvcNkg5loNCaZ87Md9hLQP/view?usp=drive_link>" %}

1. DSEP is an adaptation of Beckn Protocol for the skilling and education sector.
2. It enables creation of public digital infrastructure such as ONEST, that can connect education, skilling,  job and scholarship consumer platform (user facing) to the education skilling, job and scholarship provider platform (service provider facing) platform through standard, interoperable APIs.
3. A DSEP lifecycle has FOUR stages - Discovery, Ordering, Fulfillment and Post-Fulfillment.
4. Every stage in the DSEP lifecycle has one or more APIs to be implemented, that is, Discovery stage will have Search API; Ordering stage will have Select and Init APIs; Fulfillment will have Confirm and Status API; and Post-Fulfillment stage will have Status, Update, Rating APIs to be implemented (more in Chapter 5).

<figure><img src="/files/TMVPFywBlYeYOSMHaZIt" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7SHTdwo9A0yPTlh9SyAb" alt=""><figcaption><p><a href="https://github.com/beckn/DSEP-Specification
">https://github.com/beckn/DSEP-Specification<br></a></p></figcaption></figure>

<figure><img src="/files/VkRDiL7COwqwaEK0Kmk6" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/o1FVkfGPrbUVX8XubRNQ" alt=""><figcaption></figcaption></figure>


# Chapter 4: DSEP Specification and Network Architecture

{% embed url="<https://drive.google.com/file/d/1Agc6waBaNZrsnPFb144efV1A74zcR_GJ/view?usp=drive_link>" %}

1. DSEP contains a layered architecture of - Network Actors, APIs, DSEP Schema, Communication Protocol and Sector-specific Tags
2. Network Actors include - Beckn Application Platform (BAP), Beckn Provider Platform (BPP), DSEP Gateway and DSEP Registry
3. Actors and their roles
   * BAP is a consumer-focused experience with a "super-charged browser", and interfaces with BPP eg. Aggregator apps, Super Apps, Standalone platforms like LinkedIn, Unacademy, Monster.com and Udemy etc.; End-consumer facing Chatbots like Telegram, WhatsApp or IVRS, Blogs or consumer-focused software utilities such as marketing widgets, browser extensions etc.
   * BPPs is a provider-focused experience and hence, acquire education and skill development service providers as users. A BPP maintains an active inventory, provides rich, service-focused experience, interfaced with BAP and Gateways via DSEP API to publish a catalog of providers, machine-readable terms of service, receive bookings for products and services, provide status updates regarding fulfillment . Eg of BPP are backends of platforms such as UDEMY, Coursera, Enterprise Backends of Education and Skill Development Enterprise Service-provider-facing chatbots like Telegram Bot and WhatsApp bots.
   * DSEP Gateway is a part of DSEP network infrastructure and it interfaces with the BAP and BPPs to enable discovery of BPPs by BAPs and to broadcast search requests. Providers an equal opportunity for BPPs to be discovered and respond.
   * DSEP Registry – Allows permissioned onboarding of platforms on the DSEP network through a certification and compliance process. Interfaces with consumer Applications  (BAPs) Provider platforms and gateways – which is help authenticated lookup of trusted platforms on the network, store public keys for digital signing and verification of transactions between network participants and allows broadcast optimization by allowing network-level filtering by industry sector, country and city.

<figure><img src="/files/5xGRCSuNvYnXw0cNG4Yx" alt=""><figcaption></figcaption></figure>


# Chapter 5: DSEP APIs

{% embed url="<https://drive.google.com/file/d/1HhxRHGzF4CqkxJnMhpUojC_GIvcmRyoM/view?usp=drive_link>" %}

1. DSEP has 10 pairs of APIs - the pairs being categorised as by request and callback in the DSEP order lifecycle from Discovery to Post-Fulfillment.&#x20;
2. These APIs are asynchronous, that is, a request and a response are not in the same session. The response is delivered via a callback corresponding to the request API.
3. The interactions are all server-to-server. The DSEP specification is agnostic of the implementation of these APIs.
4. The DSEP do not impose any recommendations on the implementation of the services behind the API.
5. The DSEP APIs are stateless APIs by default, but can transmit state information if needed.
6. **Stage-wise API break-up:**\
   **Discovery** - Search & On\_Search\
   **Ordering** - Select & On\_Select ; Init & On\_Init ; Confirm & On\_Confirm\
   **Fulfillment** - Status & On\_Status ; Update & On\_Update ; Track & On\_Track ; Cancel & On\_Cancel\
   **Post-Fulfillment** - Rating & On\_Rating ; Support & On\_Support .
7. **In the Discovery stage,** \
   A BAP fires a **Search API** request that passes through the DSEP gateway. The gateway broadcasts the search to the BPPs, and the relevant BPPs respond through individual **On\_Search API** with their respective catalogues and service character corresponding to the search request from BAP.  This search request from BAP contains the `Intent` - which is to "buy", "avail" or "enroll".
8. **In the Ordering Stage,** \
   the BAP fires a **Select API** where the user selects the service provider basis the items in BPP's catalogue, service character & offers. The BPP then responds through an **On\_Select API** with the service details along with any add-on promotional offers and then sends dynamic quote to the BAP.\
   Once having received the quote from BPP, the BAP fires an **Init API** call indicating that the consumer has agreed to the quote from BPP. The consumer shares their details and requests to understand the terms of engagement. In response through **On\_Init API**, the BPP may re-calculate the quote basis the consumer details and send the final quote. \
   To agree to the quote the consumer through the BAP fires a **Confirm API** call to the BPP. The BPP creates an order and responds to BAP with the order details through the **On\_Confirm API**.
9. **In the Fulfillment Stage,** once the order is confirmed\
   The **Status** and **On\_Status API** is used to fetch the latest state of the order to inform the Consumer (BAP) of the status of the order. \
   The **Update API** is fired by consumer (BAP) to revise the terms of the order and the other party will respond through **On\_Update AP**I with the new terms of the order. This stage **may route back to ordering stage** where the participant has to confirm the order with new terms.\
   The BAP can use **Track API** to track orders where relevant. The BPP will respond with **On\_Track API** to the BAP with a link to track the order. \
   An order can be cancelled by both parties. A **Cancel API** can be called by consumer (BAP) and BPP responds to the request through the **On\_Cancel API**. When a BPP cancels an order they send the request through **On\_Cancel API**.
10. **In the Post-Fulfillment stage**,\
    The **Rating API** is used by the BAP to rate a product/service and the BPP can provide a feedback URL to the BAP through an **On\_Rating API.**\
    The **Support API** request is sent by the Consumer (BAP) and the Provider (BPP) responds through the **On\_Support API** with a phone number, email or chat URL to the BAP.\
    &#x20;

<figure><img src="/files/S4QHMVkZpo379OUO9Kbq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/c7srVtKZs16JzXidZM9H" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lpQKH0WisTwJQIgo8rM4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/me3uzbYcGQtmtFtDwzrl" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/WQ69vrfcB1MR9o8WCRjF" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6h2L2OfP8hYHRjdpnB6n" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/NvOv0hZ6hRomoKBYiyJo" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4DtuhJskHUvIQDwm2h29" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/22KmkyVzqNsq4nX04deC" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/q45YuyZyWfgfjeOKGJ6k" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4DudhBqm5uopR2iItmns" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/3EQl8ofYxOTzI3JCQSHZ" alt=""><figcaption></figcaption></figure>


# Chapter 6: DSEP Schema

{% embed url="<https://drive.google.com/file/d/1Lni2gik01lEqpZTktodjf5kMczgn3mGM/view?usp=drive_link>" %}

1. Schemas are similar to the Beckn Protocol Schema but their interpretation is based on the use-case or sector.&#x20;
2. A typical structure of the API call is the context and message.
3. Context contains contextual information like domain category codes (As per DSEP domains), protocol version, location, registered ID of the BAP, BAP callback URL, register ID of the BPP, the BPP callback URL , timestamp of generating the request and TTL of the request.
4. The message contains the business logic.
5. The DSEP schema (similar to the Beckn schema) **contains Item, Provider, Fulfillment, Location and Order** - **these need to be interpreted basis the sector.** *Watch video for interpretation.*
6. The Order schema in the context of education **contains Order ID, Items, Provider, Status, Fulfillment terms and Cancellation Terms - these need to be interpreted based on the DSEP domain sought after.** *Watch video for interpretation.*

<figure><img src="/files/vXepY7Rcy8z4Apdq1PCq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/UAyr0VIrRdRRLBLTpOA8" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/5FbR5elMh4FqeHw8UY7v" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/DWilwK7pAYXF6z8M2zEj" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/w5Gr7zSGvwUcTuvBNobd" alt=""><figcaption></figcaption></figure>


# Courses and Training Transaction Workflow

{% embed url="<https://drive.google.com/file/d/1FQ7Ly3RKSwNiEe67uhge0mAXA6_EkNw7/view?usp=drive_link>" %}


# Mentorships and Coaching Transaction Workflow

{% embed url="<https://drive.google.com/file/d/147SUTNrnxbWMq7_g6rKDkbEab_0Mtu35/view?usp=drive_link>" %}


# Scholarships and Grants Transaction Workflow

{% embed url="<https://drive.google.com/file/d/1g9oELNtikWdonnsopBceBZzhTq-R9xPS/view?usp=drive_link>" %}


# Internships and Jobs Transaction Workflow

{% embed url="<https://drive.google.com/file/d/1k713sL53SbdRnR8vQEHPQIkcvUXR4W1F/view?usp=drive_link>" %}


# Reference Implementation Guides

Choose the guide basis your domain.

| Domain code  | Domain Name            |
| ------------ | ---------------------- |
| ONDC:ONEST10 | Work Opportunities     |
| ONDC:ONEST11 | Skilling opportunities |
| ONDC:ONEST12 | Financial support      |
| ONDC:ONEST13 | Expert connect         |

[Skilling Experience (DSEP 1.0)](/learn/reference-implementation-guides/learning-experience)

[Work Opportunities (DSEP 2.0)](/learn/reference-implementation-guides/work-opportunities)

[Financial Support (DSEP 1.0)](/learn/reference-implementation-guides/financial-support)


# Financial Support (DSEP 1.0)

* [**Implementation Guide**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/financial-support/implementation_guide.md)
* [**Schema Field Definitions and Enums**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/financial-support/schema_definitions_and_enums.md)
* [**Mandatory Fields**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/financial-support/mandatory_fields.md)
* [**Recommended Tags**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/financial-support/recommended_tags.md)


# Skilling Experience (DSEP 1.0)

* [**Implementation Guide**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/learning-experiences/implementation_guide.md)
* [**Schema Field Definitions and Enums**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/learning-experiences/schema_definitions_and_enums.md)
* [**Mandatory Fields**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/learning-experiences/mandatory_fields.md)
* [**Recommended Tags**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/learning-experiences/recommended_tags.md)


# Course with scholarship

* [**Implementation Guide**](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/implementation_guides/learning-experiences/course%20with%20scholarship/implementation_guide.md)


# Work Opportunities (DSEP 2.0)

<https://github.com/ONEST-Network/ONEST-Specification-v2>


# Suggested Form Structure for xInput

<https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/ONEST-001-Suggested-xInput-Form-Fields.md>


# Understanding the APIs

### Introduction

ONEST Protocol layered architecture is illustrated as shown in the diagram below. The base layer refers to the [Beckn Protocol](https://becknprotocol.io/), which is an open source decentralized protocol. Over the base layer, the network extension layer comprises the API contracts customized to the ONEST context, along with other specs that have been adopted in order to facilitate transactions in the network.

<figure><img src="/files/JqOMRLRjCldSMDCCUh6G" alt=""><figcaption></figcaption></figure>

Here is an overview to help you visualize the mapping between transactional flow and the APIs as part of ONEST protocol.

<figure><img src="/files/YBFUmLF2047w3pzuixH3" alt=""><figcaption></figcaption></figure>

Refer to [Beckn Protocol Specification](https://developers.becknprotocol.io/docs/introduction/beckn-protocol-specification/) for more details about the APIs.

### Example

Below is the example usage of protocol APIs in ONEST Learning Experiences Domain.

| API            | Usage                                                    |
| -------------- | -------------------------------------------------------- |
| Search API     | Discover the courses                                     |
| On Search API  | Returns the course catalogue                             |
| Select API     | Select the course and get quote                          |
| On Select API  | Returns the complete course details along with quote     |
| Init API       | Initialize the course subscription                       |
| On Init API    | Send order details with payment terms                    |
| Confirm API    | Confirm the course subscription                          |
| On Confirm API | Send course content details (like video player, PDF etc) |
| Status API     | Request the course consumption status                    |
| On Status API  | Returns the course consumption status                    |
| Rating API     | Provide rating for the course, course provider etc       |
| On Rating API  | Acknowledge rating                                       |

\
Refer to [Reference Implementation Guides](/learn/reference-implementation-guides)to understand APIs usage in other ONEST domains (Learning Experience, Financial Support, Work Opportunities and Expert Connect).

### Reference

ONEST network is an implementation of the DSEP protocol, which is based on the Beckn protocol.

* Beckn Protocol APIs Specification: <https://developers.becknprotocol.io/docs/core-specification/core-apis/>
* Understand Beckn protocol: <https://developers.becknprotocol.io/docs/introduction/video-overview/>
* Understand DSEP Protocol:
  * <https://dsep.sunbird.org/>
  * DSEP Tech Overview Videos: [HERE](https://drive.google.com/drive/folders/18mwSy3u-MSj1FpU7i79e39h0x6ylins7?usp=sharing)


# Developing the APIs

DSEP 2.0 should be followed for Work opportunities, while DSEP 1.0 should be adhered to for Financial support & Skilling


# Work Opportunities (DSEP 2.0)

https\://github.com/ONEST-Network/ONEST-Specification-v2


# Financial support, Skilling (DSEP 1.0)

Following are the APIs to be developed by BAP and BPP for the above two domains

**BAP**

BAP should consume the following on\_action APIs and trigger action APIs.

* on\_search API
* on\_select API
* on\_init API
* on\_confirm
* on\_status
* on\_update
* on\_rating
* on\_support

#### BPP

BPP should consume the following action APIs and trigger on\_action APIs.

* search API
* select API
* init API
* confirm
* status
* update
* rating
* support

### Steps to create a Request:

<figure><img src="/files/S4xjNh1qFpfkhXCfm2i8" alt=""><figcaption></figcaption></figure>

1. All the action and on\_action APIs have `context` and `message` objects. Refer to this [link](https://developers.becknprotocol.io/docs/core-specification/schema-reference/context/) to understand the list of properties in the context object.\
   \
   Message object varies based on the API, refer [Reference Implementation Guides](/learn/reference-implementation-guides) for examples. Below is the sample API request with context and message objects.

```
{
  "context": {
    "domain": "ONDC:ONEST11",
    "transaction_id": "a9aaecca-10b7-4d19-b640-b047a7c62196",
    "message_id": "$bb579fb8-cb82-4824-be12-fcbc405b6608",
    "action": "search",
    "timestamp": "2022-12-15T05:23:03.443Z",
    "version": "1.1.0",
    "bap_uri": "https://sample.bap.io/",
    "bap_id": "sample.bap.io",
    "ttl": "PT10M"
  },
  "message": {
    "intent": {
      "item": {
        "descriptor": {
          "name": "english"
        }
      }
    }
  }
}
```

2. Participant should sign the payload and send to gateway. [Steps](https://github.com/beckn/protocol-specifications/blob/master/docs/BECKN-006-Signing-Beckn-APIs-In-HTTP-Draft-01.md) to sign the request payload and verify when a payload received.
3. [Error codes](https://github.com/beckn/protocol-specifications/blob/master/docs/BECKN-005-Error-Codes-Draft-01.md) implementation by BAP and BPP.
4. Only search API goes through gateway, rest all APIs are between BAP and BPP.\
   Example: BAP sends search API to gateway, and it will broadcast to all available providers in that domain. Next, BPP will make on\_search API directly to BAP.

### **Note:**

[Protocol Server](/learn/integration-of-adaptors/beckn-protocol-server) is a reference application, which helps the participants to quickly develop the protocol APIs. It will help in signing and verification of payload signature, schema validation, sending and receiving requests to Gateway and Participants.

It is not mandatory to use the protocol server; you can build your own network adaptors to connect to the ONEST network.

[Sample code](https://github.com/beckn-on-succinct/beckn-sdk-java/blob/master/src/test/java/in/succinct/beckn/SampleUseCase.java) for implementing signature and verification.

### Registry Lookup API

The registry lookup API can be used to get the details of all the participants in the registry. In request body, `type` can be `BG`,`BAP`, `BPP`

```url
curl --location 'https://staging.registry.ondc.org/lookup' \
--header 'Content-Type: application/json' \
--data '{
    "country": "IND",
    "type":"BPP"
}'
```

\[<https://staging.registry.ondc.org/lookup>\\

<br>]\(<https://staging.registry.ondc.org/lookup&#xD;&#xA;&#xD;&#xA;>)\[<https://staging.registry.ondc.org/vlookup\\>

<br>]\(<https://staging.registry.ondc.org/vlookup&#xD;&#xA;&#xD;&#xA;>)

### Gateway URL

```url
https://staging.gateway.proteantech.in/search
```


# Integration of Adaptors


# Protocol Server


# Introduction & Features

Protocol Server is a service that helps the application connect to ONEST Network. It follows the [Beckn Protocol](https://beckn.network/protocol) and makes it more accessible for the applications to get started quickly. Any network participant can run this server and connect to ONEST Network.&#x20;

**Note: This applies only when working with DSEP 1.0 across any domain**

## Features

* Connects a client application with the ONEST network.
* Acts as BAP Adaptor in case of Beckn Application Platform.
* Acts as BPP Adaptor in case of Beckn Provider Platform.
* Validates each request as per the Beckn Network’s Open API schema.
* Generates signatures for the outgoing requests and validates signatures for the incoming requests.
* Stores log for each process.
* Comes with key generation scripts for the Network participants.

### Note

[Protocol Server](https://starterpack.onest.network/learn/integration-of-adaptors/beckn-protocol-server) is a reference implementation of a network adaptor. It is not mandatory to use the protocol server. you can build your own network adaptor to connect to the ONEST network.


# Architecture

There would 2 instances of Protocol Server that is running. One is `Client` facing and the other is `Network` facing.\
\
**In the case of BAP**\
\
`Client` facing Protocol Server manages building the context, validating the request body as per the Standard Beckn Open API schema, listens to the Message Queue, Aggregates the results in the case of Synchronous mode and forwards the results to the client side application as a webhook callback.

`Network` facing Protocol Server manages forwarding the request to the respective Participant or Beckn Gateway (BG). Also it validates the incoming requests from Participants & BG as per the Standard Beckn Open API schema and then validates the signature sent from the clients to ensure the data integrity.

<figure><img src="/files/2brhcrWH6nUPG7taA1Ev" alt=""><figcaption></figcaption></figure>

**In the case of BPP**\
\
`Client` facing Protocol Server listens to the Message Queue and forwards the request to client side application, exposes an endpoint where the client side application can send the results to the network which is again validated against the Standard Beckn Open API schema and pushed to the network facing Protocol Server.

`Network` facing Protocol Server also listens to the Message Queue and forwards the request to the respective Participant or BG. Also it validates the incoming requests from Participants & BG as per the Standard Beckn Open API schema and then validates the signature sent from the clients to ensure the data integrity.

<figure><img src="/files/l7EGVRidPjiYUTWNavFU" alt=""><figcaption></figcaption></figure>


# Installation

### Setup Videos

| Mode             | Video Link                                                                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------ |
| BAP Mode Setup   | <https://www.loom.com/share/daec8556ddb74a65a893fd67d862b805?sid=fb24a0af-49a3-4c66-bf5a-e0a16389b8f1> |
| BAP Mode Testing | <https://www.loom.com/share/0cda9a05ab824ce288a82319155377f3?sid=339a4707-b4bb-43ff-81ba-d6e047d62945> |
| BPP Mode Setup   | <https://www.loom.com/share/b320e436e5c04a529f1133a4f1f42c0a?sid=cc0e5fe7-95ba-41c2-9729-7b41c8328f4d> |
| BPP Mode Testing | <https://www.loom.com/share/37311b91bef747959a59420612a64a68?sid=df35c0cc-703d-4852-b87e-df7a690eea8e> |

### Pre-requisites

* Docker version 20.10 or above ([setup guide](https://docs.docker.com/desktop/))

### Infra Requirements:

2 CPU, 8GB RAM - Ubuntu&#x20;

### Installation

1. Go to the root path (`~/`) in your system and clone this [repository](https://github.com/ONEST-Network/protocol-server).

```sh
git clone https://github.com/ONEST-Network/protocol-server.git
cd protocol-server
git checkout master
```

2. Run below command to configuration, docker, shell scripts files to root(\`\~/\`) path. Following are the   file that will be copied: `deploy-bap.sh, deploy-bpp.sh, default-bap-client.yml, default-bap-network.yml, default-bpp-client.yml, default-bpp-network.yml, docker_data/docker_compose.yaml`

```sh
bash setup.sh
```

3. Go to docker\_data directory and run docker command.

```sh
cd ~/protocol-server/docker
docker-compose up -d
```

4. If sandbox registration is not done, Follow the steps [Generate Keys](/learn/integration-of-adaptors/beckn-protocol-server/generate-keys) to generate key pairs that will be used in registry entry and follow [Join the network](/onboarding-sandbox-registration)to register.
5. Update the client and network server configuration by following below setups:&#x20;

**For BAP:**

* In the BAP Client and BAP Network codebases, update the `~/default-bap-client.yml` and `~/default-bap-network.yml` file with the following values:

  * Private Key: Copy the private key of your participant.

  * Public Key: Copy the public key of your participant.

  * Use the Registry  lookup API to get the `subscriber id`, `subscriber url` and `unique key` .

    ```
    curl --location 'https://sandbox.onest.network/onest/lookup' \
    --header 'Content-Type: application/json' \
    --data '{
        "country": "IND",
        "type":"BAP"
    }'
    ```

  * Subscriber ID: Get using registry lookup API

  * Subscriber URI: Get using registry lookup API

  * Unique Key: Get using registry lookup API

  * Registry URL: `https://sandbox.onest.network/onest`

&#x20; **For BPP:**

* In the BPP Client and BPP Network codebases, update the `~/default-bpp-client.yml` and `~/default-bpp-network.yml` file with the following values:

  * Private Key: Copy the private key of your participant.

  * Public Key: Copy the public key of your participant.

  * Use the Registry  lookup API to get the `subscriber id`, `subscriber url` and `unique key`.

    ```
    curl --location 'https://sandbox.onest.network/onest/lookup' \
    --header 'Content-Type: application/json' \
    --data '{
        "country": "IND",
        "type":"BPP"
    }'
    ```

  * Subscriber ID: Get using registry lookup API

  * Subscriber URI: Get using registry lookup API

  * Unique Key: Get using registry lookup API

  * Registry URL: `https://sandbox.onest.network/onest`

  * Webhook URL: The endpoint URL of your service the hosts protocol APIs like search, on\_search etc.

5. After making the changes in configuration files, run the below commands to create bap/bpp client and network docker containers:       &#x20;

* Execute `./deploy-bap.sh` file to deploy the BAP Client and Network.
* Execute `./deploy-bpp.sh` file to deploy the BPP Client and Network.

6. Test the protocol server by following the steps in [Testing](/learn/integration-of-adaptors/beckn-protocol-server/testing)section.

#### For PM2 Deployment

For PM2 deployment you need to git clone protocol-server four times to setup the BAP Client and Network and BPP Client and Network. Then copy `~/default-bap-client.yml` and `~/default-bap-network.yml` to config directory in respective git clone directory of BAP Client and Network. Also copy `~/default-bpp-client.yml` and `~/default-bpp-network.yml` to config directory in respective git clone directory of BPP Client and Network.

After configuration, Protocol Server can be run as below.

To run the instance in Development Mode (For Debug Purposes):

```
npm run dev
```

To run the instance in Production Mode:

```
npm i -g pm2
pm2 start ecosystem.config.js
```


# Testing

1. Import this [collection](https://github.com/ONEST-Network/ONEST-Specification/blob/main/docs/postman_collection/sandbox-sample-collection.json) into postman.
2. Click on ONEST Sanbox collection and Go to variables tab.
3. Update the required variables based on the mode:
   1. For BAP mode:
      1. Update bap\_id with participant id
      2. Update bap\_uri with network server url
      3. Update base\_url with client server url
   2. For BPP mode:
      1. Update bpp\_id with participant id
      2. Update bpp\_uri with network server url


# Generate Keys

Below are the steps to generate public-private key value pair, which are used to sign the payload while transaction in the network.

1. Go to \`protocol server\` folder and execute the below command

```
npm i
```

2. To generate the public key, execute the below command

```
npm run generate-keys
```

3. Encryption public key is not being used, This sample key(MCwwBwYDK2VuBQADIQAfXfZGKVMWhsJrC+BTN6ON0Df4R/E874SZWRSxGHMIRQ==) can be given as encryption public key while registering.


# Local Tunnelling and Nginx Setup

## Exposing local Protocol-server to Internet

### Setting up LocalTunnel when there is no DNS tool available

Note: use this when you don't have any DNS URLs to assign

1. Install local tunnel globally using `npm install -g localtunnel`.
2. Run `lt --port <BAP/BPP network port> --subdomain <any subdomain>` for both BAP and BPP networks (use the same subdomain each time for consistency). \[Example: `lt --port 5001 --subdomain beckn-bap-network`]

**Note: Whenever the system or LocalTunnel is restarted the the generated localtunnel DNS will be changed. We have to register the newly generated local-tunnel DNS after restarting in Registry and default.yml files respectively.**

### Nginx in Production System (Ubuntu) if you have DNS Tools

Nginx is used to

1. Update your system: `sudo apt update`.
2. Install Nginx: `sudo apt-get install nginx -y`.
3. Navigate to the Nginx configuration directory: `cd /etc/nginx/conf.d`.
4. Create a new configuration file: `sudo nano {enter-any-name.conf}`. Enter the configuration to map your DNS with the port of BAP/BPP Network\&Client.

**Example Configuration:**

```
server {
    listen 80;
    listen [::]:80;
    server_name example.domain.com;

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_pass http://localhost:port;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name example.domain.com;

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_pass http://localhost:port;
    }

    ssl_certificate /etc/letsencrypt/live/example.domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.domain.com/privkey.pem;

    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;
    ssl_session_tickets off;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-
    ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    ssl_prefer_server_ciphers on;

    add_header Strict-Transport-Security "max-age=63072000" always;

    ssl_stapling on;
    ssl_stapling_verify on;

    resolver 8.8.8.8;
}
```

Replace `example.domain.com` and `port` with your desired values in multiple places.

Obtain an SSL certificate for your domain and configure it on your machine.


# FAQs

<details>

<summary>Is it required to use Protocol Server as a network adaptor?</summary>

No, network participants can develop and use their own network adaptor as well.

</details>

<details>

<summary>Can i make customization in the protocol server?</summary>

Yes, customizations are allowed. As protocol server is a reference implementation and open source adaptors, features can be contributed.

</details>

<details>

<summary>can i deploy protocol server other than in docker?</summary>

&#x20; Protocol server can be deployed as PM2 deployment as well.

</details>

<details>

<summary>Can i use existing redis, mongodb, rabbitmq servers?</summary>

Yes, existing redis, mongodb, rabbitmq servers can be used.

</details>

<details>

<summary>default-bap-client.yml, default-bap-network.yml, default-bpp-client.yml, default-bpp-network.yml should be inside or outside the protocol server folder?</summary>

configuration files should be outside the protocol server folder.

</details>

<details>

<summary>How do we install the provider side of the protocol server?</summary>

In default-bap-client.yml and default-bpp-client.yml, set app.mode: BPP

</details>

<details>

<summary>How do we install the seeker side of the protocol server?</summary>

In default-bap-client.yml and default-bpp-client.yml, set app.mode: BAP

</details>

<details>

<summary>can i run the protocol server on some context path instead of base path "/"?</summary>

In deploy-bap.sh and deploy-bpp.sh, change the $HOME to the required context path and run the scripts.

</details>

<details>

<summary>What are the default ports for BAP client and network servers?</summary>

5001 and 5002

</details>

<details>

<summary>What are the default ports for BPP client and network servers?</summary>

6001 and 6002

</details>

<details>

<summary>Can i use other than default ports for Network and Client server?</summary>

Yes, can be changed in the default.yml file.

</details>

<details>

<summary>Do we need to expose both network and client server ip with a domain name?</summary>

Only network server IP should be exposed with a domain name, as it receives the requests.

</details>

<details>

<summary>How to connect the Protocol server to the Provider system?</summary>

In default-bap-client.yml, set the provider system end point as webhook url.

</details>

<details>

<summary>What is webhook URL in config?</summary>

It is the endpoint of BAP/BPP internal System API (POST), to which protocol server will send the API payload.&#x20;

</details>

<details>

<summary>Does the protocol server append the API action as a path to the webhook URL when it invokes the same?</summary>

No, action is available as part of the context object.

</details>

<details>

<summary>What should be done if a participant want to be on multiple domains (learning-experiences / work-opportunities / financial-support / expert-connect) and/or multiple roles (seeker/provider)?</summary>

Protocol Server with same role will work for multiple domains. Register with same participant ID in required domains and use the same in protocol server configuration.&#x20;

</details>

<details>

<summary>How does network server and client server connects together?</summary>

Network and client server communicates through RabbitMQ.

</details>

<details>

<summary>How to generate public and private keys?</summary>

Protocol server provides a script to generate the keys. Go to the protocol server folder and execute this command: npm run generate-keys.

</details>

<details>

<summary>How to get the subscriber id and url?</summary>

Using the registry lookup API, users can fetch the participant details, which includes the subscriber id and url.

</details>

<details>

<summary>Based on what criteria does the protocol server caches the request?</summary>

protocol server caches only the search requests based on msg id. If a search request with the same msg id is made a second time, the response is returned from the cache.

</details>

<details>

<summary>What kind of schema validation does the protocol server will do?</summary>

below are the validations done by protocol server:

1\. for the context object, it checks for schema (well-formedness) , mandatory fields, data types (incase if the field is populated) as per schema

2\. for message object, it only checks for the schema (well-formedness) and data types (incase if the field is populated).

</details>


# Job Manager

### Prerequisites

* Go (v1.23.3 or higher)
* MongoDB
* Docker

### Building and Running Locally

1. Clone the repository:

```sh
git clone https://github.com/yourusername/Job-Manager-Adapter.git
cd Job-Manager-Adapter/bpp/backend
```

2. Create a `.env` file in the root directory and add your environment variables.

```sh
DB_SERVER=<mongo-db-server-address>
DB_USER=<mongo-db-username>
DB_PASSWORD=<mongo-db-password>
BPP_ID=<bpp-id>
BPP_URI=<bpp-uri>
```

3. Start the development server:

```sh
export $(cat .env | xargs) && go run main.go
```

5. The server should now be running at `http://localhost:8080`.

### Deploying Using Docker

1. Build the Go program

```sh
go build -o bpp main.go
```

2. Update the Makefile

```makefile
DOCKER_REGISTRY ?= <docker-registry>
DOCKER_REPO ?= <docker-repo>
DOCKER_IMAGE ?= bpp
DOCKER_TAG ?= <image-tag>
```

3. Build the docker image

```sh
make build-amd64
```

3. Run the docker image container

```sh
docker run --env-file ./.env -p 8080:8080 <docker-repo>/bpp:<image-tag>
```


# Profile Manager


# AI Matching Engine


# Contribution Guide

Link to Contribution Board: <https://github.com/ONEST-Network/ONEST-Specification-v2/pulls>


# Discussion Forum

Join our [Discord](https://discord.gg/kHNW46Tp) for any help or queries


# Issues Board

Link to Issue Board :<https://github.com/ONEST-Network/ONEST-Specification-v2/issues>


# FAQs

#### Who can join the network?&#x20;

It is an open network. We welcome all stakeholders involved in the employment and skilling sector, including individuals and organizations committed to advancing learning and livelihood opportunities, to join this dynamic network.

#### How do I choose my role in the network?

You have the flexibility to choose one of the aforementioned roles or even assume more than one role within the network, enabling you to actively engage in and benefit from the diverse opportunities provided by the network.

**Provider Platform:** If you aspire to broaden the reach of the training, scholarships, jobs, and mentorship opportunities you offer, we invite you to join the network as a Provider Platform.\
\
**Provider:** If you’d like to be onboarded on an existing provider platform as one of the providers of the training, scholarships, jobs, and mentorship opportunities, we invite you to join the network as a Provider Platform.

**Seeker Platform:** If you seek to explore the vast array of training, scholarships, jobs, and mentorship opportunities available within the network, we encourage you to join as a Seeker Platform.\
**Seeker:** If you’d like to consume the information made available by the ONEST network through any of the seeker platforms, you can join as a seeker.&#x20;

**Technology Service Provider:** If you choose to enable other organizations to join this network through your technology, business or onboarding services, this role will suit you the best.

#### Who will benefit from ONEST?&#x20;

ONEST is a multi-dimensional ecosystem touching all the aspects of skilling, and employment in India. It will promote and facilitate synergies and public-private partnerships enabling a holistic human development ecosystem.

#### Is it possible to join the network without any technological expertise or know how?

Ofcourse, we have several Technology Service Providers who can help you join the network.&#x20;

####

\ <br>

\ <br>

<br>


