Constructors

Properties

formats: {
    web2: {
        discord: string[];
        domain: string[];
        github: string[];
        twitter: string[];
    };
} = ...

Methods

  • Add a domain identity to the GCR (CCI).

    Proves the connected wallet controls a web domain by pointing at a well-known file the owner hosts: https://<host>/.well-known/demos-cci.txt. The file body must be the payload from createDomainProofPayload. The node fetches the file over HTTPS (the TLS cert binds the content to the hostname), verifies the signed payload against the sender, and writes a web2.domain entry on the CCI.

    Mirrors addTwitterIdentity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • hostname: string

      The domain being claimed (e.g. "example.com"). A full URL is also accepted; only the hostname is used.

    • OptionalreferralCode: string

      Optional referral code for incentive points.

    Returns Promise<RPCResponseWithValidityData>

    The response from the RPC call.

    const identities = new Identities()
    // 1. Generate the proof the user hosts at /.well-known/demos-cci.txt
    const proof = await identities.createDomainProofPayload(demos)
    // 2. After the file is live, link the domain:
    await identities.addDomainIdentity(demos, "example.com")
  • Link a Human Passport identity to the GCR.

    Verifies the Human Passport score via the node and persists the identity if the score meets the threshold (default: 20).

    Parameters

    Returns Promise<RPCResponseWithValidityData>

    The RPC response for the identity inference operation.

    const result = await identities.addHumanPassportIdentity(demos, {
    address: "0x...",
    verificationMethod: "api"
    })
  • Add an Unstoppable Domain identity to the GCR.

    Flow:

    1. User selects an authorized address from their domain records
    2. User signs challenge with their wallet (MetaMask for EVM, Phantom for Solana)
    3. Submit domain + signature for verification

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC

    • signingAddress: string

      The address used to sign (from domain's authorized addresses)

    • signature: string

      Signature from the signing address

    • challenge: string
    • resolutionData: UnifiedDomainResolution
    • OptionalreferralCode: string

      Optional referral code

    Returns Promise<RPCResponseWithValidityData>

    The response from the RPC call

    const identities = new Identities()
    // Get signable addresses for the domain
    const addresses = await identities.getUDSignableAddresses("brad.crypto")
    const signingAddress = addresses[0].address // User selects address

    // Generate challenge with selected address
    const challenge = identities.generateUDChallenge(demos.publicKey, signingAddress)

    // User signs challenge (EVM example with MetaMask)
    const signature = await ethereum.request({
    method: 'personal_sign',
    params: [challenge, signingAddress]
    })

    await identities.addUnstoppableDomainIdentity(
    demos,
    "brad.crypto",
    signingAddress,
    signature,
    challenge
    )
  • Add a Web2 identity via TLSNotary attestation.

    This generic method uses a cryptographic proof from TLSNotary to verify identity ownership. The context determines which platform's API was attested:

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • context: TLSNIdentityContext

      The platform context ("github", "discord", or "telegram").

    • proof: TLSNotaryPresentation

      The TLSNotary presentation (from attestResult.presentation).

    • recvHash: string
    • proofRanges: TLSNProofRanges
    • revealedRecv: number[]
    • username: string

      Username from the proven response.

    • userId: string | number

      User ID from the proven response.

    • OptionalreferralCode: string

      Optional referral code.

    Returns Promise<RPCResponseWithValidityData>

    The response from the RPC call.

  • Build the proof payload a domain owner must host to prove control.

    Host the returned string at https://<host>/.well-known/demos-cci.txt, then call addDomainIdentity. The format is identical to the web2 proof payload, so the node verifies it with the same parser.

    The signed message is domain-separated and bound to the host + signer (dacs-domain:v1:<host>:<ed25519Address>), so a signature cannot be lifted across domains, identities, or web2 contexts (node #897 / DEM-767). NOTE: the exact message shape MUST stay in lockstep with the node's verifyWeb2Proof reconstruction. Freshness (nonce/issuedAt) is the Tier-2 follow-up tracked in DEM-767.

    Parameters

    • demos: Demos

      A connected Demos instance.

    • hostname: string

      The domain this proof is for (e.g. "example.com"). Must be the same domain later passed to addDomainIdentity.

    Returns Promise<string>

    The proof payload string (demos:dw2p:<algorithm>:<signature>).

  • Create a web2 proof payload for use with web2 identity inference.

    Parameters

    Returns Promise<string>

    The web2 proof payload string.

  • Generate a challenge message for Unstoppable Domain ownership verification.

    The user must sign this challenge with one of their domain's authorized addresses using MetaMask (EVM) or Phantom (Solana) wallet.

    Parameters

    • demosPublicKey: string

      The user's Demos public key (hex string)

    • signingAddress: string

      The address that will sign the challenge (from domain's authorized addresses)

    Returns string

    Challenge message to be signed

  • Get demos accounts by linked discord identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

      The user id to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get demos accounts by linked github identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

      The user id to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get demos accounts by linked telegram identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

      The user id to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get demos accounts by linked twitter identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

    Returns Promise<Account[]>

    The account associated with the username.

  • Get demos accounts by linked web2 identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • context:
          | "github"
          | "twitter"
          | "telegram"
          | "discord"

      The context of the identity to get the account for.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

      The user id to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get demos accounts by linked web3 identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • chain: `${string}.${string}`

      The chain as a string containing the chain and subchain separated by a period (eg. "eth.mainnet" | "solana.mainnet", etc.)

    • address: string

      The address to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get the Ethos identities associated with an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • Optionaladdress: string

      The address to get identities for. Defaults to the connected wallet's address.

    Returns Promise<RPCResponse>

    The identities associated with the address.

  • Retrieve the Ethos reputation score for a given wallet address.

    Parameters

    • demos: Demos

      A Demos instance used to communicate with the RPC.

    • walletAddress: string

      The EVM wallet address to retrieve the Ethos score for.

    Returns Promise<RPCResponse>

    The RPC response containing the Ethos score data.

  • Get Human Passport identities for a Demos address.

    Parameters

    • demos: Demos

      A Demos instance used to communicate with the RPC.

    • demosAddress: string

      The Demos address to get identities for.

    Returns Promise<SavedHumanPassportIdentity[]>

    The RPC response containing the Human Passport identities.

  • Fetch Human Passport score for an address.

    Calls the getHumanPassportScore GCR routine via the Demos RPC. This fetches the score from the node's cached data, not directly from Human Passport API.

    Parameters

    • demos: Demos

      A Demos instance used to communicate with the RPC.

    • address: string

      The EVM address to retrieve the Human Passport score for.

    Returns Promise<RPCResponseWithValidityData>

    The RPC response containing the Human Passport score data.

  • Get the identities associated with an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • call: string = "getIdentities"
    • Optionaladdress: string

      The address to get identities for.

    Returns Promise<RPCResponse>

    The identities associated with the address.

  • Fetch a Nomis score for a wallet.

    Calls the getNomisScore GCR routine via the Demos RPC.

    Parameters

    • demos: Demos

      A Demos instance used to communicate with the RPC.

    • walletAddress: string

      The wallet address to retrieve the Nomis score for.

    • Optionalchain: string

      Optional blockchain type (e.g. "evm", "solana").

    • Optionalsubchain: string

      Optional subchain or network identifier.

    • OptionalscoreType: number

      Optional Nomis score type identifier.

    Returns Promise<RPCResponse>

    The RPC response containing the Nomis score data.

  • Get referral information for an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • Optionaladdress: string

      The address to get referral info for. Defaults to the connected wallet's address.

    Returns Promise<RPCResponse>

    The referral information associated with the address.

  • Get the Unstoppable Domain identities associated with an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC

    • Optionaladdress: string

      The address to get identities for. Defaults to the connected wallet's address.

    Returns Promise<RPCResponse>

    The identities associated with the address.

  • Get the web2 identities associated with an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • Optionaladdress: string

      The address to get identities for.

    Returns Promise<RPCResponse>

    The identities associated with the address.

  • Get the crosschain identities associated with an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • Optionaladdress: string

      The address to get identities for.

    Returns Promise<RPCResponse>

    The identities associated with the address.

  • Validate a referral code to check if it exists and is valid.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • referralCode: string

      The referral code to validate.

    Returns Promise<RPCResponse>

    The validation result containing validity status, referrer public key, and message.