Ixian SDK
IXICore.AddressClient Class Reference

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...
 

Detailed Description

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 24 of file AddressClient.cs.

Constructor & Destructor Documentation

◆ AddressClient()

IXICore.AddressClient.AddressClient ( )

Definition at line 28 of file AddressClient.cs.

Member Function Documentation

◆ addAddress()

void IXICore.AddressClient.addAddress ( byte []  addr)

Adds an addres to the matcher.

Parameters
addrIxian wallet address.

Definition at line 37 of file AddressClient.cs.

◆ clearAddresses()

void IXICore.AddressClient.clearAddresses ( )

Removes all addresses from the matcher.

Definition at line 48 of file AddressClient.cs.

◆ containsAddress()

bool IXICore.AddressClient.containsAddress ( byte []  addr)

Checks if the matcher contains the given address.

Parameters
addrAddress to search
Returns
True, if the matcher already contains this address.

Definition at line 142 of file AddressClient.cs.

◆ generateHiddenMatchAddresses()

List<byte[]> IXICore.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.

Parameters
rndSource of entropy - this should be pseudo-random, but doesn't need to be cryptographically secure.
bytes_per_addrHow many bytes should be used to encode each address. See remarks.
Returns
Matcher value, which can be used to determine if any random address was included in this matcher's set.

Definition at line 101 of file AddressClient.cs.

◆ getAddresses()

List<byte[]> IXICore.AddressClient.getAddresses ( )

Retrieves all addresses from the matcher.

Returns
All addresses in the matcher.

Definition at line 57 of file AddressClient.cs.

◆ numAddresses()

int IXICore.AddressClient.numAddresses ( )

Retrieves the number of addresses currently in the matcher.

Returns

Definition at line 66 of file AddressClient.cs.


The documentation for this class was generated from the following file: