input-output-hk / js-cardano-wasm

various cardano javascript using wasm bindings
MIT License
31 stars 21 forks source link

Provide hdaddress filter function #14

Closed NicolasDP closed 6 years ago

NicolasDP commented 6 years ago

Provide interface to filter addresses with an hdpayload;

I have added to tests:

  1. to check if 10000 addresses (known to not be any of mines) are filtered out;
  2. to check if 10000 addresses (known to be one of mine) are still in.

Results are:

  Random Address Checker
    ✓ Check 10000 random addresses are not mine (374ms)
    ✓ Check 10000 random addresses are not mines (payload replay) (1767ms)
    ✓ Check 10000 random addresses are mines (2456ms)

i.e.

time to check what that means
check all 10000 addresses are not mine 374ms This means that, we tried to decrypt the address' HDPayload and it failed to decrypt.
check all 10000 addresses are not mine but with reused payload 1767ms This means that, we tried to decrypt the address' HDPayload, it succeeds, but reconstructing the address failed (reuse of the payload).
check all 10000 addresses are mines 2456ms This means that we tried to decrypt the address' HDPayload and it succeeded. We then reconstruct the address and check it still matches (avoid payload reuse)