Junaidb commited on
Commit
10f42d2
·
verified ·
1 Parent(s): 120820f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -65,11 +65,18 @@ def verify_wots(signature, message, public_key):
65
 
66
 
67
 
 
 
 
 
 
 
 
68
 
69
  @app.post("/relay-txn")
70
  async def relay_txn(payload: dict):
71
  # 1. Verification Math
72
- message = base58.b58decode(payload["message"])
73
  signature = payload["signature"] # list[str]
74
  public_key = payload["anchorB58"] # list[str]
75
 
 
65
 
66
 
67
 
68
+ @app.get("/challenge")
69
+ def get_challenge():
70
+ nonce = os.urandom(16)
71
+ return {"nonce": base58.b58encode(nonce).decode()}
72
+
73
+
74
+
75
 
76
  @app.post("/relay-txn")
77
  async def relay_txn(payload: dict):
78
  # 1. Verification Math
79
+ message = base58.b58decode(payload["challange"])
80
  signature = payload["signature"] # list[str]
81
  public_key = payload["anchorB58"] # list[str]
82