3.0.ipv8.attestation.communication_manager ========================================== .. py:module:: 3.0.ipv8.attestation.communication_manager Attributes ---------- .. autoapisummary:: 3.0.ipv8.attestation.communication_manager.AttributePointer 3.0.ipv8.attestation.communication_manager.MetadataDict Classes ------- .. autoapisummary:: 3.0.ipv8.attestation.communication_manager.CommunicationChannel 3.0.ipv8.attestation.communication_manager.PseudonymFolderManager 3.0.ipv8.attestation.communication_manager.CommunicationManager Module Contents --------------- .. py:data:: AttributePointer .. py:data:: MetadataDict .. py:class:: CommunicationChannel(attestation_community: 3.0.ipv8.attestation.wallet.community.AttestationCommunity, identity_community: 3.0.ipv8.attestation.identity.community.IdentityCommunity) A communication channel for business and proving logic of a single pseudonym. .. py:attribute:: attestation_overlay .. py:attribute:: identity_overlay .. py:attribute:: attestation_requests :type: dict[AttributePointer, tuple[asyncio.Future, str]] .. py:attribute:: verify_requests :type: dict[AttributePointer, asyncio.Future] .. py:attribute:: verification_output :type: dict[bytes, list[tuple[bytes, float | None]]] .. py:attribute:: attestation_metadata :type: dict[AttributePointer, MetadataDict] .. py:property:: public_key_bin :type: bytes Get the public key of our pseudonym in bytes . .. py:property:: peers :type: list[3.0.ipv8.types.Peer] List all the business logic peers for our pseudonym. .. py:property:: schemas :type: list[str] List all the identity formats we support. .. py:method:: on_request_attestation(peer: 3.0.ipv8.types.Peer, attribute_name: str, metadata: MetadataDict) -> asyncio.Future Return the measurement of an attribute for a certain peer. .. py:method:: on_attestation_complete(for_peer: 3.0.ipv8.types.Peer, attribute_name: str, attribute_hash: bytes, id_format: str, from_peer: 3.0.ipv8.types.Peer | None = None) -> None Callback for when an attestation has been completed for another peer. We can now sign for it. .. py:method:: on_verify_request(peer: 3.0.ipv8.types.Peer, attribute_hash: bytes) -> asyncio.Future Return the measurement of an attribute for a certain peer. .. py:method:: on_verification_results(attribute_hash: bytes, values: list[float]) -> None Callback for when verification has concluded. .. py:method:: _drop_identity_table_data() -> list[bytes] Remove all metadata from the identity community. :return: the list of attestation hashes which have been removed :rtype: [bytes] .. py:method:: _drop_attestation_table_data(attestation_hashes: list[bytes]) -> None Remove all attestation data (claim based keys and ZKP blobs) by list of attestation hashes. :param attestation_hashes: hashes to remove :type attestation_hashes: [bytes] :returns: None .. py:method:: remove() -> None Remove this pseudonym from existence. .. py:method:: get_my_attributes() -> dict[bytes, tuple[str, MetadataDict, list[bytes]]] Get the known attributes for our pseudonym. .. py:method:: get_attributes(peer: 3.0.ipv8.types.Peer) -> dict[bytes, tuple[str, MetadataDict, list[bytes]]] Get the known attributes of a given peer. .. py:method:: request_attestation(peer: 3.0.ipv8.types.Peer, attribute_name: str, id_format: str, metadata: MetadataDict) -> None Request another peer to attest to our attribute. .. py:method:: attest(peer: 3.0.ipv8.types.Peer, attribute_name: str, value: bytes) -> None Attest to another peer's attribute (if it's value is what we expect). .. py:method:: import_blob(attribute_name: str, id_format: str, metadata: MetadataDict, value: bytes) -> None Import an external proof as a raw blob (advanced use only!). .. py:method:: allow_verification(peer: 3.0.ipv8.types.Peer, attribute_name: str) -> None Consent to verification of an attribute by a peer. .. py:method:: disallow_verification(peer: 3.0.ipv8.types.Peer, attribute_name: str) -> None Do not consent to verification of an attribute by a peer. .. py:method:: verify(peer: 3.0.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. .. py:class:: PseudonymFolderManager(directory: str) Perform file management of pseudonyms. .. py:attribute:: pseudonym_folder .. py:attribute:: crypto .. py:method:: get_or_create_private_key(name: str) -> 3.0.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. :param name: the name of the pseudonym to load or generate a private key for. :return: the private key for the given pseudonym. .. py:method:: remove_pseudonym_file(name: str) -> None Remove a pseudonym file by its name. :param name: the name of the pseudonym file to remove. :returns: None .. py:method:: list_pseudonym_files() -> list[str] List all the pseudonym files in our pseudonym directory. :return: the list of pseudonym names. .. py:class:: CommunicationManager(ipv8_instance: 3.0.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. .. py:attribute:: ipv8_instance .. py:attribute:: channels :type: dict[bytes, CommunicationChannel] .. py:attribute:: name_to_channel :type: dict[str, CommunicationChannel] .. py:attribute:: crypto .. py:attribute:: identity_manager .. py:attribute:: working_directory .. py:attribute:: pseudonym_folder_manager .. py:method:: lazy_identity_manager() -> 3.0.ipv8.attestation.identity.manager.IdentityManager Lazy load the IdentityManager. .. py:method:: load(name: str, rendezvous_token: str | None = None) -> CommunicationChannel :async: Load a pseudonym. .. py:method:: unload(name: str) -> None :async: Unload a pseudonym. .. py:method:: remove(name: str) -> None :async: Remove a pseudonym from existence by name. .. py:method:: shutdown() -> None :async: Close down all communication. .. py:method:: list_names() -> list[str] List all known pseudonyms. .. py:method:: list_loaded() -> list[str] List all loaded pseudonyms by name.