Home

Awesome

GitHub last commit Uptime GitHub Workflow Status (with branch) GitHub Workflow Status (with branch)

<a name="about"></a>

National Carbon Credit Registry

About

The National Carbon Credit Registry is an open-source toolkit developed by UNDP to help countries develop a national registry to fulfil the requirements of Article 6 (Paris Agreement).

It allows countries to track, record, issue, monitor, and trade credits from various mitigation activities, all while ensuring data integrity through a secure ledger. The system tracks the entire process of carbon credits, from issuance to retirement, and makes the data publicly available to enhance transparency.

The UNDP hosts and maintains a free standard code base on this Github, with basic feature functionality. Countries can customize and deploy their version of the registry, so that it meets national requirements, linking it to other national and international systems. Using open-source code helps reduce costs, avoid duplication, and ensure compatibility with existing systems, simplifying the creation of domestic carbon markets.

More information about the project’s background, vision, policy context, support provided can be found in the demo site https://www.demo.carbreg.org/. Please contact the UNDP DPG team digital4planet@undp.org to request a walkthrough demonstration and to discuss further support and collaboration.

:red_circle: ANNOUNCEMENT: Following recent announcements and outcomes of COP29, the open-source carbon registry will undergo updates to align with the latest requirements and guidelines under Article 6 of the Paris Agreement. These updates aim to enhance transparency, interoperability, and environmental integrity in international carbon transactions, as well as to support Parties in meeting their Nationally Determined Contributions (NDCs) more effectively.

Index

<a name="standards"></a>

Standards and License

This codebase follows the digital public goods standard: https://digitalpublicgoods.net/standard/ It is built according to the Principles for Digital Development: https://digitalprinciples.org/

The tool is developed and maintained by UNDP and is licensed under the GNU Affero General Public License (AGPL-3.0), which permits free use, modification, and sharing of the software.

We kindly ask users to inform us of your usage by contacting digital4planet@undp.org, as this helps us track the tool’s impact and guide future improvements.

Under AGPL-3.0, any modifications to the code must be made publicly available by creating a new branch on GitHub. The software cannot be relicensed under more restrictive terms without adhering to the AGPL-3.0 guidelines.

<a name="changelog"></a>

Changelog

Learn about the latest improvements.

<a name="userflow"></a>

Features and User Flow

Every country has distinct carbon market policies, processes, and governance structures and will need to customize the Carbon Registry to accommodate local needs.

The open-source code (demo version) includes the following common set of steps (features) that will be needed in most countries.

The demo version provides an example user flow that can act as a starting point for customization: Example Carbon Registry Workflows

Key features of the software include:

<a name="demo"></a>

Demo Site

A demo site at https://www.demo.carbreg.org/login illustrates the basic functionality of the carbon registry for your country. Please contact the UNDP DPG team to request a walkthrough of the demo and to be added to the user list for the demo site.

<a name="architecture"></a>

System Architecture

UNDP Carbon Registry is based on service oriented architecture (SOA). Following diagram visualize the basic components in the system.

alt text

<a name="services"></a>

System Services

National Service

Authenticate, Validate and Accept user (Government, Project Developer/Certifier) API requests related to the following functionalities,

Service is horizontally scalable and state maintained in the following locations,

Uses the Carbon Credit Calculator and Serial Number Generator node modules to estimate the project carbon credit amount and issue a serial number. Uses Ledger interface to persist project and credit life cycles.

Analytics Service

Serve all the system analytics. Generate all the statistics using the operational database. Horizontally scalable.

Replicator Service

Asynchronously replicate ledger database events in to the operational database. During the replication process it injects additional information to the data for query purposes (Eg: Location information). Currently implemented for QLDB and PostgresSQL ledgers. By implementing replicator interface can support more ledger replicators. Replicator select based on the LEDGER_TYPE environment variable. Support types QLDB, PGSQL(Default).

Deployment

System services can deploy in 2 ways.

External Service Providers

All the external services access through a generic interface. It will decouple the system implementation from the external services and enable extendability to multiple services.

Geo Location Service

Currently implemented for 2 options.

  1. File based approach. User has to manually add the regions with the geo coordinates. Sample File. To apply new file changes, replicator service needs to restart.
  2. Mapbox. Dynamically query geo coordinates from the Mapbox API.

Can add more options by implementing location interface

Change by environment variable LOCATION_SERVICE. Supported types MAPBOX, FILE(Default)

File Service

Implemented 2 options for static file hosting.

  1. NestJS static file hosting using the local storage and container volumes.
  2. AWS S3 file storage.

Can add more options by implementing file handler interface

Change by environment variable FILE_SERVICE. Supported types S3, LOCAL(Default)

Database Architecture

Primary/secondary database architecture used to store carbon project and account balances. Ledger database is the primary database. Add/update projects and update account balances in a single transaction. Currently implemented only for AWS QLDB

Operational Database is the secondary database. Eventually replicated to this from primary database via data stream. Implemented based on PostgresSQL

Why Two Database Approach?

  1. Cost and Query capabilities - Ledger database (blockchain) read capabilities can be limited and costly. To support rich statistics and minimize the cost, data is replicated in to a cheap query database.
  2. Disaster recovery
  3. Scalability - Primary/secondary database architecture is scalable since additional secondary databases can be added as needed to handle more read operations.

Why Ledger Database?

  1. Immutable and Transparent - Track and maintain a sequenced history of every carbon project and credit change.
  2. Data Integrity (Cryptographic verification by third party).
  3. Reconcile carbon credits and company account balance.

Ledger Database Interface

This enables the capability to add any blockchain or ledger database support to the carbon registry without functionality module changes. Currently implemented for PostgresSQL and AWS QLDB.

PostgresSQL Ledger Implementation storage all the carbon project and credit events in a separate event database with the sequence number. Support all the ledger functionalities except immutability.

Single database approach used for user and company management.

Ledger Layout

Carbon Registry contains 3 ledger tables.

  1. Project ledger - Contains all the project and credit transactions.
  2. Company Account Ledger (Credit) - Contains company accounts credit transactions.
  3. Country Account Ledger (Credit) - Contains country credit transactions.

The below diagram demonstrates the the ledger behavior of project create, authorise, issue and transfer processes. Blue color document icon denotes a single data block in a ledger.

alt text

Authentication

<a name="structure"></a>

Project Structure

.
├── .github                         # CI/CD [Github Actions files]
├── deployment                      # Declarative configuration files for initial resource creation and setup [AWS Cloudformation]
├── backend                         # System service implementation
    ├── services                    # Services implementation [NestJS application]
        ├── src
            ├── national-api        # National API [NestJS module]      
            ├── stats-api           # Statistics API [NestJS module]
            ├── ledger-replicator   # Blockchain Database data replicator [QLDB to Postgres]
            ├── shared              # Shared resources [NestJS module]     
        ├── serverless.yml          # Service deployment scripts [Serverless + AWS Lambda]
├── libs
    ├── carbon-credit-calculator    # Implementation for the Carbon credit calculation library [Node module + Typescript]
    ├── serial-number-gen           # Implementation for the carbon project serial number calculation [Node module + Typescript]
├── web                             # System web frontend implementation [ReactJS]
├── .gitignore
├── docker-compose.yml              # Docker container definitions
└── README.md

<a name="container"></a>

Run Services As Containers

<a name="local"></a>

Run Services Locally

<a name="cloud"></a>

Deploy System on the AWS Cloud

<a name="external"></a>

External Connectivity

UNDP'S ITMO Platform

The Carbon Registry is designed to be linked to the ITMO Voluntary Bilateral Cooperation Platform, https://carboncooperation.undp.org/, managed by UNDP. This enables countries to automatically sync projects created/authorised and credits issued within its national registry to the international trading platform. The system does this by:

  1. Carbon Registry make a daily to the retrieve ITMO platform projects.
  2. Projects create in the Carbon Registry when projects are authorized in the ITMO Platform
  3. The Carbon Registry update when the projects are Issued with credits in the ITMO Platform

<b>Lifecycle</b>

alt text

<b>Project Creation and Authorisation</b>

<b>Credit Issuance</b>

<b>Field Mapping</b>

<b>Company</b>

Name in the Carbon RegistryMandatory in the Carbon RegistryName in the ITMO Platform
Tax ID (taxId)Yescompany
Name (name)Yescompany
Email (email)YesSet default : nce.digital+[organisation]@undp.org
Phone Number (phoneNo)YesSet default : 00
Website
AddressSet default : Country if the Registry
Logo
Country (country)Set default : Country of the Registry
Role (companyRole)YesSet default : ProgrammeDeveloper

<br><b>User</b>

Name in the Carbon RegistryMandatory in the Carbon RegistryName in the ITMO Platform
Email (email)YesSet default : nce.digital+[organisation]@undp.org
Role (role)YesSet default : Admin
Phone Number (phoneNo)Set default : 00

<br><b>Project</b>

Name in the Carbon RegistryMandatory in the Carbon RegistryName in the ITMO Platform
Project Name (title)YesName
External ID (externalId)Yesid
Credit Issuance Serial Number
Current StatusSet default : Pending
Applicant TypeSet default : Project Developer
Sector (sector)YesSector
Sectoral Scope (sectoralScope)YesSector
Project Start Date (startTime)YescreatedAt
Project End Date (endTime)YescreatedAt + 10 years
Geographical Location (Regional) (geographicalLocation)Yescountry (Name not mentioned as ISO3 or actual name)
Buyer Country Eligibility
Project Cost (USD) (programmeCostUSD)YesSet default : Null
Financing Type
Grant Equivalent Amount
Carbon Price (Dollars per ton)
Companycompany
Company Tax ID (proponentTaxVatId)Yescompany
Company Percentage (proponentPercentage)YesSet default : 100%
Type of Mitigation Action/Activity (typeOfMitigation)YesSector
GHGs Covered (greenHouseGasses)YesSet default : CO2
Credits AuthorisedSet default : 100
Credits IssuedSet default : 10
Credits Transferred
Credits Frozen
Credits Retired
Credits authorised for international transfer and use (Total cumulative maximum amount of Mitigation Outcomes for which international transfer and use is authorized)
Crediting Period (years)
Project MaterialsFiles *
Project MaterialsFiles *
Credit Calculation Fields / Mitigation Type Calculation
Agriculture
Land Area
Land Area Unit
Solar
energy generation
energy generation unit
consumer group

<b>ITMO Sector Mapping</b>

ITMO Sector Field ValueSectorSectoral ScopeType Of Mitigation
energy-distributionEnergyEnergy DistributionEnergy Distribution
agricultureAgricultureAgricultureAgriculture
energy-industriesEnergyEnergy IndustryEE Industry
DefaultOtherEnergy IndustryEE Industry

<b>Assumptions</b>

<b>Docker Integration Setup</b>

  1. Append data-importer to docker-compose file replicator service RUN_MODULE env variable with comma separated.
  2. Update following env variables in the docker-compose file replicator service.
    • ITMO_API_KEY
    • ITMO_EMAIL
    • ITMO_PASSWORD
    • ITMO_ENDPOINT
  3. Projects will import on each docker restart.

<a name="user"></a>

User Onboarding and Permissions Model

User Roles

System pre-defined user roles are as follows,

User Onboarding Process

  1. After the system setup, the system have a Root User for the setup email (one Root User for the system)
  2. Root User is responsible for creating the Government entity and the Admin of the Government
  3. The Government Admin is responsible for creating the other companies and Admins of each company.
  4. Admin of the company has the authority to add the remaining users (Admin, Managers, View Only Users) to the company.
  5. When a user is added to the system, a confirmation email should be sent to users including the login password.

User Management

All the CRUD operations can be performed as per the following table,

Company RoleNew User RoleAuthorized User Roles (Company)
GovernmentRootCannot create new one other than the default system user and Can manage all the users in the system
GovernmentAdmin<br>Manager<br>View OnlyRoot<br>Admin(Government)
All other Company RolesAdmin<br>Manager<br>View OnlyRoot<br>Admin(Government)<br>Admin(Company)

<a name="frontend"></a>

Web Frontend

Web frontend implemented using ReactJS framework. Please refer getting started with react app for more information.

<a name="localization"></a>

Localization

<a name="api"></a>

Application Programming Interface (API)

For integration, reference RESTful Web API Documentation documentation via Swagger. To access

<a name="resource"></a>

Resource Requirements

ResourceMinimumRecommended
Memory4 GB8 GB
CPU4 Cores4 Cores
Storage20 GB50 GB
OSLinux <br> Windows Server 2016 and later versions.

Note: Above resource requirement mentioned for a single instance from each microservice.

<a name="status"></a>

Status Page

For transparent uptime monitoring go to status.APP_URL Open source code available at https://github.com/undp/carbon-registry-status

<a name="support"></a>

Governance and Support

The United Nations Development Program (UNDP) is responsible for managing the application. To ensure alignment with international demand, Digital For Climate (D4C) will act as an advisory body to the Digital Public Good Carbon Registry codebase. D4C is a collaboration between European Bank for Reconstruction and Development (EBRD), United Nations Development Program (UNDP), United Nations Framework Convention on Climate Change (UNFCCC), International Emissions Trading Association (IETA), European Space Agency (ESA), and World Bank Group  that aims to coordinate respective workflows and create a modular and interoperable end-to-end digital ecosystem for the carbon market. The overarching goal is to support a transparent, high integrity global carbon market that can channel capital for impactful climate action and low-carbon development.

This code is managed by United Nations Development Programme as custodian, detailed in the press release. For technical questions, please visit the community of practice ‘Keeping Track of the Paris Agreement’ or submit through the open forum. For any other questions, contact us at digital4planet@undp.org.