update readme

This commit is contained in:
callebtc
2022-09-12 01:12:06 +03:00
parent 367a618a7c
commit 5df35156f3
2 changed files with 7 additions and 7 deletions

View File

@@ -2,7 +2,9 @@
**The author is NOT a cryptographer and has not tested the libraries used or the code nor has anyone reviewed the work. This means it's very likely a fatal flaw somewhere. This is meant only as educational and is not production ready.**
Ecash implementation based on David Wagner's variant of Chaumian blinding. Token logic based on [minicash](https://github.com/phyro/minicash) ([description](https://gist.github.com/phyro/935badc682057f418842c72961cf096c)) which implements a [Blind Diffie-Hellman Key Exchange](https://cypherpunks.venona.com/date/1996/03/msg01848.html) scheme written down by Ruben Somsen [here](https://gist.github.com/RubenSomsen/be7a4760dd4596d06963d67baf140406).
Ecash implementation based on David Wagner's variant of Chaumian blinding. Token logic based on [minicash](https://github.com/phyro/minicash) ([description](https://gist.github.com/phyro/935badc682057f418842c72961cf096c)) which implements a [Blind Diffie-Hellman Key Exchange](https://cypherpunks.venona.com/date/1996/03/msg01848.html) scheme written down by Ruben Somsen [here](https://gist.github.com/RubenSomsen/be7a4760dd4596d06963d67baf140406). The database mechanics and the Lightning backend is inspired by [LNbits](https://github.com/lnbits/lnbits-legend).
Big thanks to [phyro](https://github.com/phyro) for their work and further discussions and improvements.
## Install

View File

@@ -63,8 +63,7 @@ class LedgerAPI:
json={"x": str(B_.x), "y": str(B_.y)},
).json()
if "error" in promises:
print("Error: {}".format(promises["error"]))
return []
raise Exception("Error: {}".format(promises["error"]))
return self._construct_proofs(promises, [(r, secret)])
def split(self, proofs, amount):
@@ -94,8 +93,7 @@ class LedgerAPI:
json={"proofs": proofs, "amount": amount, "output_data": output_data},
).json()
if "error" in promises:
print("Error: {}".format(promises["error"]))
return [], []
raise Exception("Error: {}".format(promises["error"]))
# Obtain proofs from promises
fst_proofs = self._construct_proofs(
@@ -129,7 +127,7 @@ class Wallet(LedgerAPI):
for amount in split:
proofs = super().mint(amount)
if proofs == []:
return []
raise Exception("received no proofs")
new_proofs += proofs
await self._store_proofs(proofs)
self.proofs += new_proofs
@@ -141,7 +139,7 @@ class Wallet(LedgerAPI):
async def split(self, proofs, amount):
fst_proofs, snd_proofs = super().split(proofs, amount)
if len(fst_proofs) == 0 and len(snd_proofs) == 0:
return [], []
raise Exception("received no splits")
used_secrets = [p["secret"] for p in proofs]
self.proofs = list(
filter(lambda p: p["secret"] not in used_secrets, self.proofs)