Update app.py
Browse files
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["
|
| 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 |
|