-
Notifications
You must be signed in to change notification settings - Fork 0
Prometheus Protocol Wiki: API Reference
Prometheus Protocol Wiki: API Reference This document provides a high-level reference for the primary modules and functions available in the Prometheus Protocol SDK. For detailed parameter and return value information, please refer to the auto-generated documentation or the in-code JSDoc comments.
3.1 did Module The did module contains all functionality related to the creation and management of Decentralized Identifiers.
create()
Description: Creates a new, cryptographically secure DID and its associated DID Document. This is the entry point for establishing a new sovereign identity.
Usage: agent.did.create()
resolve(didString)
Description: Retrieves the public DID Document associated with a given DID string. This is necessary to find the public keys required for secure interaction.
Usage: agent.did.resolve('did:empower1:...')
update(didObject, newDocumentInfo)
Description: Updates a DID Document. Requires the full DID object (including private keys) to sign the update transaction.
Usage: agent.did.update(myDid, { ... })
3.2 credentials Module The credentials module handles the lifecycle of Verifiable Credentials (VCs).
issue(issuerDid, payload)
Description: Creates and signs a new Verifiable Credential. This can only be performed by an "Issuer" entity.
Usage: agent.credentials.issue(issuerDid, { ... })
verify(signedVc)
Description: Verifies the cryptographic signature and integrity of a Verifiable Credential. This is used by a "Verifier" to confirm the validity of a presented credential.
Usage: agent.credentials.verify(vcObject)
createPresentation(credentialsArray)
Description: Bundles one or more VCs into a Verifiable Presentation (VP), which can then be signed by the user and presented to a verifier.
Usage: agent.credentials.createPresentation([vc1, vc2])
3.3 consent Module The consent module provides tools for managing user consent for data access in a transparent and auditable way.
request(requestPayload)
Description: Generates a structured, signable consent request object.
Usage: agent.consent.request({ permission: '...', purpose: '...' })
approve(didObject, signedRequest)
Description: (Typically run inside a user's wallet) Approves a consent request by signing it with the user's DID.
Usage: wallet.agent.consent.approve(myDid, request)
verifyConsent(signedConsent)
Description: Verifies a signed consent object to ensure it was approved by the correct user and has not been tampered with.
Usage: agent.consent.verify(consentObject)
3.4 crypto Module The crypto module exposes the low-level cryptographic primitives that power the protocol. It is intended for advanced use cases.
sign(didObject, data)
Description: Signs arbitrary data using the private key associated with a DID.
Usage: agent.crypto.sign(myDid, 'message')
verifySignature(didDocument, signature, data)
Description: Verifies a signature against a public key found in a DID Document.
Usage: agent.crypto.verifySignature(theirDidDoc, sig, 'message')
hash(data)
Description: Computes a SHA-256 hash of the input data.
Usage: agent.crypto.hash('data')
sss.split(secret, options) & sss.recombine(shards)
Description: The functions for implementing Shamir's Secret Sharing for social recovery.
Usage: agent.crypto.sss.split(...)