Allows a client to generated a secret value with incorporated markers for multiple addresses. Such a value obscures which addresses it represents, but allows others to check whether a given address is part of the set or not with a configurable degree of false-positives. See also AddressMatcher
.
More...
Public Member Functions | |
AddressClient () | |
void | addAddress (byte[] addr) |
Adds an addres to the matcher. More... | |
void | clearAddresses () |
Removes all addresses from the matcher. More... | |
List< byte[]> | getAddresses () |
Retrieves all addresses from the matcher. More... | |
int | numAddresses () |
Retrieves the number of addresses currently in the matcher. More... | |
List< byte[]> | generateHiddenMatchAddresses (Random rnd, int bytes_per_addr) |
Generates the 'matcher' value (see description of this class AddressClient . More... | |
bool | containsAddress (byte[] addr) |
Checks if the matcher contains the given address. More... | |
Allows a client to generated a secret value with incorporated markers for multiple addresses. Such a value obscures which addresses it represents, but allows others to check whether a given address is part of the set or not with a configurable degree of false-positives. See also AddressMatcher
.
This mechanism is used by clients, who do not wish to disclose all their addresses ahead of time, to 'register' to an untrusted DLT Node in order to receive information (events) when the client's addresses are encountered on the blockchain. It would be unfeasible for the DLT Node to send all events to all clients (bandwidth prohibitative), so some filtering is required. By using this object, the client sends the DLT Node a 'condensed' piece of information which matches multiple addresses, including the ones the client is interested in. There are false positives, but never false negatives. Of course, the DLT Node may record which addresses match the 'matcher', but it is impossible to determine which of the matches are false positives and which are real. Whether a given address truly belongs to a client can only be determined with 100% accuracy when the client chooses to use it - send a transaction from that address, thus revealing the public key and nonce associated with it.
Definition at line 25 of file AddressClient.cs.
DLT.AddressClient.AddressClient | ( | ) |
Definition at line 29 of file AddressClient.cs.
void DLT.AddressClient.addAddress | ( | byte [] | addr | ) |
Adds an addres to the matcher.
addr | Ixian wallet address. |
Definition at line 38 of file AddressClient.cs.
void DLT.AddressClient.clearAddresses | ( | ) |
Removes all addresses from the matcher.
Definition at line 49 of file AddressClient.cs.
bool DLT.AddressClient.containsAddress | ( | byte [] | addr | ) |
Checks if the matcher contains the given address.
addr | Address to search |
Definition at line 143 of file AddressClient.cs.
List<byte[]> DLT.AddressClient.generateHiddenMatchAddresses | ( | Random | rnd, |
int | bytes_per_addr | ||
) |
Generates the 'matcher' value (see description of this class AddressClient
.
The random generator for this function doesn't strictly have to be cryptographically secure, but it is recommended to use a cryptographically secure random if possible. The bytes_per_addr
value determines how many false positives are likely to occur when matching random addresses. A smaller value will produce more false positives, straining the bandwith and making the client process more data, while a higher number will yield fewer false positives, but give away client's addresses with more certainty. 2-4 are usually good values. Please note that both parties must agree on what value to use in bytes_per_addr
in order for the matcher to work.
rnd | Source of entropy - this should be pseudo-random, but doesn't need to be cryptographically secure. |
bytes_per_addr | How many bytes should be used to encode each address. See remarks. |
Definition at line 102 of file AddressClient.cs.
List<byte[]> DLT.AddressClient.getAddresses | ( | ) |
Retrieves all addresses from the matcher.
Definition at line 58 of file AddressClient.cs.
int DLT.AddressClient.numAddresses | ( | ) |
Retrieves the number of addresses currently in the matcher.
Definition at line 67 of file AddressClient.cs.