open-index/open-npm huggingface dataset:
npm package: @nextera.one/vnp-cli
Description: VNP CLI - Network Presence Layer command-line interface
Author: NextEra.One
Latest version: 1.0.0

# @nextera.one/vnp-cli

Command-line interface for **VNP (Network Presence Layer)** operations.

## Quick Start

### 1. Installation

```bash
npm install -g @nextera.one/vnp-cli
```

### 2. Generate your VNP-ID

```bash
vnp id generate --subject "user:alice"
```

## Commands

### Presence Objects

```bash
# Create a presence object
vnp presence create -s "device:sensor-001" --scopes net,log --ttl 5

# Validate a presence object
vnp presence validate '{"ver":1,"alg":"ed25519","pay":{...}}'
```

### VNP-ID

```bash
# Generate presence and compute VNP-ID
vnp id generate -s "user:alice" --scopes net,auth

# Compute VNP-ID from existing presence
vnp id compute '{"ver":1,"alg":"ed25519","pay":{...}}'
```

### Resolution Records

```bash
# Create a resolution record
vnp rr create --vnp-id <hash> --ip 192.168.1.1 --ip 10.0.0.1 --ttl 5

# Validate a resolution record
vnp rr validate '{"ver":1,"typ":"VNP-RR",...}'
```

### Keypairs

```bash
# Generate Ed25519 keypair
vnp keypair generate

# Generate with base64 format
vnp keypair generate --format base64
```

## License

Apache-2.0
npm package: @nextera.one/vnp-sdk
Description: TypeScript SDK for VNP (Network Presence Layer) - Cryptographic Presence Verification
Author: NextEra.One
Latest version: 1.0.0

# @nextera.one/vnp-sdk

TypeScript SDK for **VNP (Network Presence Layer)** - cryptographic presence verification.

> "IP moves packets. DNS finds locators. VNP proves presence."

## Quick Start

### 1. Installation

```bash
npm install @nextera.one/vnp-sdk
```

### 2. Usage Example

```typescript
import {
  createPresence,
  computeVnpId,
  signPresence,
  validatePresence,
  generateKeypair,
} from '@nextera.one/vnp-sdk';

// Generate a keypair
const keypair = await generateKeypair();

// Create a presence object
const presence = createPresence('device:sensor-001', ['net', 'log'], 5);

// Compute VNP-ID
const vnpId = computeVnpId(presence);
console.log('VNP-ID:', vnpId);

// Sign the presence
const signedPresence = await signPresence(presence, keypair);

// Validate
const result = validatePresence(signedPresence);
console.log('Valid:', result.ok);
```

## API Reference

### Presence Objects

| Function                                          | Description                   |
| ------------------------------------------------- | ----------------------------- |
| `createPresence(subject, scopes?, ttl?, anchor?)` | Create a new presence object  |
| `computeVnpId(presence)`                          | Compute VNP-ID hash           |
| `signPresence(presence, keypair)`                 | Sign with Ed25519             |
| `validatePresence(presence)`                      | Validate structure and timing |
| `isPresenceValid(presence)`                       | Check if within time window   |

### Resolution Records

| Function                                         | Description                     |
| ------------------------------------------------ | ------------------------------- |
| `createResolutionRecord(vnpId, ips, ttl?, ctx?)` | Create RR binding VNP-ID to IPs |
| `signResolutionRecord(rr, keypair)`              | Sign the resolution record      |
| `validateResolutionRecord(rr)`                   | Validate RR structure           |

### Cryptographic Utilities

| Function                                | Description              |
| --------------------------------------- | ------------------------ |
| `generateKeypair()`                     | Generate Ed25519 keypair |
| `sign(message, privateKey)`             | Sign raw bytes           |
| `verify(signature, message, publicKey)` | Verify signature         |
| `hash(data)`                            | SHA-256 hash             |

## License

Apache-2.0