Initial commit.

This commit is contained in:
libroot 2025-08-06 16:58:36 +00:00
commit 0a9434be1b
18 changed files with 1860 additions and 0 deletions

75
README.md Normal file
View file

@ -0,0 +1,75 @@
# NOJSCAP
**NOJSCAP** is a minimal Proof-of-Work system. It includes both:
- A **NOJSCAP client** that computes valid nonces for challenge strings using SHA-256.
- A **NOJSCAP server** that issue challenges and verify solutions over HTTP.
This repository is structured as a monorepo containing both the client and server codebases.
---
## Structure
```
.
├── client/ # Proof-of-Work nonce generator implementations
└── server/ # Server-side challenge issuers & verifiers
```
---
## Client
The client directory includes NOJSCAP client implementations in multiple languages. Each version takes a challenge string and a difficulty level, then searches for a nonce such that the SHA-256 hash of `challenge + nonce` begins with the required number of leading zero bits.
### Supported Languages
- **C**: `nojscap.c`
- **Go**: `nojscap.go`
- **Python**: `nojscap.py`
- **JavaScript (Node.js)**: `nojscap.js`
- **Rust**: `nojscap.rs`
Each implementation is self-contained and demonstrates equivalent functionality.
---
## Server
The `server` directory contains example implementations in multiple languages of NOJSCAP servers that issue PoW challenges and validate solutions.
### Available Servers
* **Python + Flask**
```sh
cd server/python-html
python3 server.py
```
* **TypeScript + Express**
```sh
cd server/ts-express
npm install
npx tsx start
```
* **Go + net/http**
```sh
cd server/go-http
go run server.go
```
Each server implementation listens for challenge requests and verifies submitted nonces against the configured difficulty level.
---
## License
TODO