LordXido commited on
Commit
7428d08
·
verified ·
1 Parent(s): 86d78c0

Update proof_engine.py

Browse files
Files changed (1) hide show
  1. proof_engine.py +6 -18
proof_engine.py CHANGED
@@ -1,24 +1,12 @@
1
- # proof_engine.py
2
 
3
- import hashlib
4
- import json
5
- import time
6
- from typing import Dict
7
-
8
- def generate_proof(input_data: Dict, output_data: Dict) -> Dict:
9
- """
10
- Generates a reproducible proof hash.
11
- """
12
  payload = {
13
- "input": input_data,
14
- "output": output_data,
15
- "timestamp": int(time.time()),
16
  }
17
-
18
  canonical = json.dumps(payload, sort_keys=True, separators=(",", ":"))
19
- proof_hash = hashlib.sha256(canonical.encode()).hexdigest()
20
-
21
  return {
22
- "hash": proof_hash,
23
- "payload": payload,
24
  }
 
1
+ import json, hashlib, time
2
 
3
+ def prove(state):
 
 
 
 
 
 
 
 
4
  payload = {
5
+ "state": state,
6
+ "timestamp": int(time.time())
 
7
  }
 
8
  canonical = json.dumps(payload, sort_keys=True, separators=(",", ":"))
 
 
9
  return {
10
+ "hash": hashlib.sha256(canonical.encode()).hexdigest(),
11
+ "payload": payload
12
  }