> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/demos-and-onboardings/demo-solutions/demos/natural-chain/technical-natural-chain.md).

# Technical Documentation

**Demo ID**: `demo-2025-005` **Version**: `1.0.0` **Last Updated**: `August 2025`

***

## Overview

Natural Chain is a blockchain-based application for capturing natural gas-related environmental data on the BSV blockchain. It ensures data integrity and supports carbon credit creation through tokenization and immutable record-keeping.

***

## Features

* Immutable blockchain records for natural gas lifecycle data
* Token-based system for carbon credit creation and tracking
* Web-based dashboard for monitoring and data entry
* Real-time transparency and audit logging
* Integration with BSV blockchain for secure anchoring

***

## System Architecture

### Frontend (TypeScript, React)

* User interface for environmental data capture and visualization
* Token and carbon credit management dashboard
* Real-time updates of blockchain status related to data entries

### Backend (Node.js, Express)

* REST APIs for data submission, token issuance, and queries
* Blockchain integration to anchor data on BSV network
* Database management for metadata and off-chain information

***

## Quick Start

### Prerequisites

* Node.js and npm installed
* Familiarity with BSV blockchain basics

### Running Locally

```bash
npm i
npm run dev
```

Open <http://localhost:3000> in a browser to access the application.

***

## Usage Guide

* Capture natural gas lifecycle data including extraction, transportation, and usage metrics
* Generate and manage tokens representing carbon credits based on certified data
* Monitor and audit all records through an intuitive web interface and blockchain verification

***

## API Endpoints

* Data submission and retrieval endpoints
* Token issuance and transfer APIs
* Blockchain proof verification services

(See `src/routes` directory for detailed API code)

***

## Security Features

* Blockchain immutability guarantees data integrity
* Tokenization prevents fraudulent issuing of carbon credits
* Secure authentication and authorization for data access

***

## Testing & Validation

* Unit and integration tests for API and blockchain interaction
* Manual testing for UI workflows and token lifecycle

***

## Performance & Scalability

* Scalable backend architecture with Node.js and MongoDB
* Efficient blockchain integration for frequent anchoring
* Designed for extensibility with other environmental data sources

***

## Troubleshooting & Support

* Check logs for API and blockchain errors
* Validate blockchain connectivity and transaction status
* Use issue tracker on GitHub for reporting

***

## Resources

* **Business Documentation:** [business-natural-chain.md](/demos-and-onboardings/demo-solutions/demos/natural-chain/business-natural-chain.md)
* **Repository:** [GitHub - bsv-blockchain-demos/natural-chain](https://github.com/bsv-blockchain-demos/natural-chain)
* **Demo URL:** [Natural Chain Site](https://natural-chain.vercel.app)

***

*For business context and detailed workflows, see the business document.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hub.bsvblockchain.org/demos-and-onboardings/demo-solutions/demos/natural-chain/technical-natural-chain.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
