latest.ipv8.attestation.communication_manager

Module Contents

Classes

CommunicationChannel

A communication channel for business and proving logic of a single pseudonym.

PseudonymFolderManager

Perform file management of pseudonyms.

CommunicationManager

Manager of pseudonym managers, usually operated from the REST API by a user app.

Attributes

AttributePointer

MetadataDict

latest.ipv8.attestation.communication_manager.AttributePointer
latest.ipv8.attestation.communication_manager.MetadataDict
class latest.ipv8.attestation.communication_manager.CommunicationChannel(attestation_community: latest.ipv8.attestation.wallet.community.AttestationCommunity, identity_community: latest.ipv8.attestation.identity.community.IdentityCommunity)

A communication channel for business and proving logic of a single pseudonym.

property public_key_bin: bytes

Get the public key of our pseudonym in bytes .

property peers: list[latest.ipv8.types.Peer]

List all the business logic peers for our pseudonym.

property schemas: list[str]

List all the identity formats we support.

on_request_attestation(peer: latest.ipv8.types.Peer, attribute_name: str, metadata: MetadataDict) asyncio.Future

Return the measurement of an attribute for a certain peer.

on_attestation_complete(for_peer: latest.ipv8.types.Peer, attribute_name: str, attribute_hash: bytes, id_format: str, from_peer: latest.ipv8.types.Peer | None = None) None

Callback for when an attestation has been completed for another peer. We can now sign for it.

on_verify_request(peer: latest.ipv8.types.Peer, attribute_hash: bytes) asyncio.Future

Return the measurement of an attribute for a certain peer.

on_verification_results(attribute_hash: bytes, values: list[float]) None

Callback for when verification has concluded.

_drop_identity_table_data() list[bytes]

Remove all metadata from the identity community.

Returns:

the list of attestation hashes which have been removed

Return type:

[bytes]

_drop_attestation_table_data(attestation_hashes: list[bytes]) None

Remove all attestation data (claim based keys and ZKP blobs) by list of attestation hashes.

Parameters:

attestation_hashes ([bytes]) – hashes to remove

Returns:

None

remove() None

Remove this pseudonym from existence.

get_my_attributes() dict[bytes, tuple[str, MetadataDict, list[bytes]]]

Get the known attributes for our pseudonym.

get_attributes(peer: latest.ipv8.types.Peer) dict[bytes, tuple[str, MetadataDict, list[bytes]]]

Get the known attributes of a given peer.

request_attestation(peer: latest.ipv8.types.Peer, attribute_name: str, id_format: str, metadata: MetadataDict) None

Request another peer to attest to our attribute.

attest(peer: latest.ipv8.types.Peer, attribute_name: str, value: bytes) None

Attest to another peer’s attribute (if it’s value is what we expect).

import_blob(attribute_name: str, id_format: str, metadata: MetadataDict, value: bytes) None

Import an external proof as a raw blob (advanced use only!).

allow_verification(peer: latest.ipv8.types.Peer, attribute_name: str) None

Consent to verification of an attribute by a peer.

disallow_verification(peer: latest.ipv8.types.Peer, attribute_name: str) None

Do not consent to verification of an attribute by a peer.

verify(peer: latest.ipv8.types.Peer, attribute_hash: bytes, reference_values: list[bytes], id_format: str) None

Play out the Zero-Knowledge Proof of a given attribute hash for a peer.

class latest.ipv8.attestation.communication_manager.PseudonymFolderManager(directory: str)

Perform file management of pseudonyms.

get_or_create_private_key(name: str) latest.ipv8.types.PrivateKey

Get the private key for a pseudonym by either reading it or generating it. In the latter case, write to a file.

Parameters:

name – the name of the pseudonym to load or generate a private key for.

Returns:

the private key for the given pseudonym.

remove_pseudonym_file(name: str) None

Remove a pseudonym file by its name.

Parameters:

name – the name of the pseudonym file to remove.

Returns:

None

list_pseudonym_files() list[str]

List all the pseudonym files in our pseudonym directory.

Returns:

the list of pseudonym names.

class latest.ipv8.attestation.communication_manager.CommunicationManager(ipv8_instance: latest.ipv8.types.IPv8, pseudonym_folder: str = 'pseudonyms', working_directory: str | None = None)

Manager of pseudonym managers, usually operated from the REST API by a user app.

lazy_identity_manager() latest.ipv8.attestation.identity.manager.IdentityManager

Lazy load the IdentityManager.

async load(name: str, rendezvous_token: str | None = None) CommunicationChannel

Load a pseudonym.

async unload(name: str) None

Unload a pseudonym.

async remove(name: str) None

Remove a pseudonym from existence by name.

async shutdown() None

Close down all communication.

list_names() list[str]

List all known pseudonyms.

list_loaded() list[str]

List all loaded pseudonyms by name.