File size: 8,455 Bytes
ef6eb55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# Sovereign Node Key System

This directory contains the cryptographic authorization infrastructure for PAX-Coder.

## What This Is

The Sovereign Node Key system provides:

1. **Ed25519 Node Authorization** β€” cryptographic identity with authorization for protected operations
2. **Node Authorization Record** β€” external authority-signed proof that this node is authorized
3. **Repository Commitment** β€” SHA-256 hash of the repository state at key generation time
4. **Prior-Art Timestamp** β€” tamper-evident record that this work existed at a particular git commit
5. **Authorization Verification** β€” tools to verify node authorization status
6. **Verification Scripts** β€” tools to independently verify integrity and authorization

## How to Use

### Step 1: Generate a New Node

```bash

cd pax-coder/sovereign

./generate_node_key.sh

```

This creates:
- `node.json` β€” Public identity manifest
- `node_pk.pem` β€” Public key (PEM format)
- `manifest.json` β€” Repository file list with hashes
- `prior_art.json` β€” Prior-art timestamp record
- `verification.json` β€” Cryptographic verification record
- `.node_sk` β€” **PRIVATE KEY** (never committed, permissions 400)

### Step 2: Request Authorization

Contact PAX-Coder at:
- Email: jessica@collectivekitty.com
- Form: https://snapkittywest.com/pax-coder/request

Provide your `node.json` (public identity only). Do NOT share `.node_sk`.

### Step 3: Receive Authorization Record

After approval and provisioning, you receive:
- `authorization.json` β€” Authority-signed authorization record for your node

The authorization record contains:
- Your node ID and public key
- Authorization status (ACTIVE, REQUESTED, SUSPENDED, REVOKED, EXPIRED)
- Authorization scope (what operations you can perform)
- Issue/expiration dates
- Authority signature

### Step 4: Verify Authorization

```bash

./verify_node_key.sh     # Verify node identity integrity

../scripts/verify-node-authorization  # Verify authorization status

```

### Verify Existing Authorization

```bash

./verify_node_key.sh     # Verify node key integrity

../scripts/verify-node-authorization  # Verify authorization status

```

Checks (node key):
- All public files are present and valid JSON
- Private key has correct permissions
- Git commit exists in repository
- Repository commitment hash is correct

Checks (authorization):
- Authorization record exists
- Authorization status is ACTIVE
- Authorization has not expired
- Node ID matches
- Revocation status is not REVOKED

## Security Model

### What This Proves

βœ“ **Node Identity** β€” Cryptographic identity of the node (Ed25519 public key)
βœ“ **Node Authorization** β€” External authority has approved this node for protected operations
βœ“ **Authorization Status** β€” Node is ACTIVE, REQUESTED, SUSPENDED, REVOKED, or EXPIRED
βœ“ **Authorization Scope** β€” What protected operations this node is authorized to perform
βœ“ **Integrity** β€” Repository state at a specific git commit  
βœ“ **Timestamp** β€” Work existed no later than this UTC time  
βœ“ **Authenticity** β€” Outputs are signed with a specific Ed25519 key  
βœ“ **Non-repudiation** β€” Holder of the private key can sign artifacts

### What This Does NOT Prove

βœ— **Alone without authorization record** β€” Node identity alone does not prove authority
βœ— **Legal ownership** β€” No embedded legal claims  
βœ— **Blockchain confirmation** β€” Timestamp is local only (unconfirmed)  
βœ— **Work quality** β€” Only proves authorization and existence, not correctness or usefulness

### Public vs. Private

**Never commit to git:**
- `.node_sk` (private key file)
- Any file containing the private key material
- Passwords or passphrases

**Safe to commit:**
- `node.json` (public identity)
- `node_pk.pem` (public key)
- `manifest.json` (repository fingerprint)
- `prior_art.json` (prior-art record)
- `verification.json` (cryptographic metadata)

## Files

### node.json

Public identity manifest. Contains:
- `node_id` β€” Unique identifier
- `algorithm` β€” "Ed25519"
- `public_key_hex` β€” Public key in hex format
- `created_at_utc` β€” ISO 8601 timestamp
- `repository` β€” GitHub repo path
- `git_commit` β€” Commit hash at generation time
- `version` β€” System version

### manifest.json

Repository state snapshot. Contains:
- `files` β€” Object mapping each tracked file to its SHA-256 hash
- `generated_at_utc` β€” When manifest was created
- `git_commit` β€” Which commit this reflects

### prior_art.json



Prior-art timestamp record. Contains:

- `artifact` β€” "PAX-Coder"

- `repository` β€” GitHub path

- `git_commit` β€” Commit hash
- `repository_sha256` β€” Hash of the manifest
- `node_id` β€” Node that signed it
- `created_at_utc` β€” UTC timestamp
- `status` β€” "UNCONFIRMED" (or "BITCOIN-CONFIRMED" if anchored)

### verification.json

Cryptographic record. Contains:
- `node_id` β€” Node identifier
- `algorithm` β€” "Ed25519"
- `repository_commitment_algorithm` β€” "SHA-256"
- `repository_commitment` β€” The actual commitment hash
- `git_commit` β€” Which commit
- `manifest_file` β€” Path to manifest
- `verification_timestamp` β€” When verified

### .node_sk



**PRIVATE KEY FILE** β€” Never commit, share, or upload.



File permissions: 400 (owner read-only)



Stored locally for signing operations:

```bash

export PAX_NODE_KEY=$(cat sovereign/.node_sk | xxd -p | tr -d '\n')
```



## Workflow



### 1. Generate Key (Once)



```bash

./generate_node_key.sh

```

Outputs all files. Private key is generated once and kept secure.

### 2. Commit Public Files

```bash

git add sovereign/node.json sovereign/manifest.json sovereign/prior_art.json sovereign/verification.json

git commit -m "Add Sovereign Node Key public identity"

```

**DO NOT** commit `.node_sk`.

### 3. Verify (Any time)

```bash

./verify_node_key.sh

```

Confirms all artifacts are consistent.

### 4. Sign Outputs

Use the private key (externally or via environment):
```bash

openssl dgst -sha256 -sign sovereign/.node_sk -out output.sig output.ptx

```

Verify with public key:
```bash

openssl dgst -sha256 -verify <(openssl pkey -in sovereign/node_pk.pem -pubin -outform DER) -signature output.sig output.ptx

```

## Key Rotation

To rotate to a new key:

1. Generate new key in a new subdirectory (e.g., `sovereign/v2/`)
2. Record the old public key in a rotation record
3. Sign the rotation record with the old key
4. Commit new key and rotation record
5. Keep old private key in secure archive (not in git)

Example rotation record:
```json

{

  "old_node_id": "pax-coder-1234567890",

  "new_node_id": "pax-coder-1234567999",

  "rotation_reason": "scheduled rotation",

  "rotation_timestamp": "2026-08-18T00:00:00Z",

  "signature_by_old_key": "..."

}

```

## Verification for Others

To verify this artifact (without the private key):

1. Clone the repository
2. Run `./sovereign/verify_node_key.sh`
3. Check that all files are present and valid
4. Compare the git commit hash with the timestamp
5. Verify the repository commitment by spot-checking a few files:
   ```bash

   sha256sum sovereign/node.json  # Should match value in manifest.json

   ```
6. Confirm the node's public key (from `node.json`) against any signatures

## CI/CD Integration

Add to `.github/workflows/security.yml`:

```yaml

- name: Check for private key material

  run: |

    if grep -r "BEGIN.*PRIVATE\|-----END.*PRIVATE" sovereign/ --include="*.json"; then

      echo "ERROR: Private key material in public files"

      exit 1

    fi



- name: Verify node key integrity

  run: |

    cd sovereign

    bash verify_node_key.sh

```

## Questions?

- **What does this prove?** See "Security Model" section above.
- **Is this blockchain-based?** No, it's local + optional Bitcoin anchoring. See `prior_art.json` status.
- **Can I use a different algorithm?** Yes, but Ed25519 is recommended. Update `algorithm` field in `node.json`.
- **What if I lose the private key?** Key rotation required; new public identity generated; old key recorded.
- **Can I backup the private key?** Yes, but store encrypted in a secure vault outside git.

---

**Generated by:** PAX-Coder Sovereign Node Key System  
**License:** Same as PAX-Coder (BSL-1.1 / AGPL-3.0 / MPL-2.0)