OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-kb / skills / blind-pairing-core / api-extract.json

98 lines · json ref:
{
  "repo": "blind-pairing-core",
  "timestamp": "2026-01-16T23:56:00.047Z",
  "entryPoint": "index.js",
  "exports": {
    "packageJson": {
      "main": "index.js"
    }
  },
  "api": {
    "file": "index.js",
    "exports": [],
    "classes": [
      {
        "name": "CandidateRequest"
      },
      {
        "name": "MemberRequest"
      }
    ],
    "functions": [
      {
        "name": "createReceipt"
      },
      {
        "name": "verifyReceipt"
      },
      {
        "name": "deriveInviteId"
      },
      {
        "name": "deriveKey"
      },
      {
        "name": "deriveNonce"
      },
      {
        "name": "deriveToken"
      },
      {
        "name": "createSessionToken"
      },
      {
        "name": "deriveRequestId"
      },
      {
        "name": "createInvite"
      },
      {
        "name": "decodeInvite"
      },
      {
        "name": "encrypt"
      },
      {
        "name": "decrypt"
      },
      {
        "name": "createAuth"
      },
      {
        "name": "openAuth"
      },
      {
        "name": "createReply"
      },
      {
        "name": "openReply"
      },
      {
        "name": "createSignature"
      },
      {
        "name": "verifySignature"
      }
    ]
  },
  "readme": {
    "content": "# blind-pairing-core\n\n### Pairing Flow\n\nThe pairing flow proceeds as follows:\n\n1. The member (inviter) creates an invitation (a new signing keypair) and shares `{ discoveryKey, seed }` with a candidate (invitee). `publicKey` is set aside for later use.\n2. The candidate produces a request with arbitrary `userData` signed by the invitation keyPair, this is encrypted to a key derived from the invite `publicKey`.\n3. Upon receiving the request, the member decrypts the payload and verifies the signature against the invitation `publicKey`, proving that the invitee has `secretKey`.\n4. The member can evaluate `userData` and either confirm or deny the request. A response is returned to the candidate which may contain the `{ key, encryptionKey }` needed to join the room.\n5. The candidate verifies that `key` corresponds to `discoveryKey`, confirming that the remote peer has read-access to `key` (is a valid member).\n\n## Usage\n\n```js\nimport {\n  CandidateRequest,\n  MemberRequest,\n  createInvite\n} fro",
    "sections": [
      "intro",
      "usage",
      "api",
      "license"
    ],
    "hasApi": true,
    "hasExamples": true,
    "exampleCount": 2,
    "examples": [
      "import {\n  CandidateRequest,\n  MemberRequest,\n  createInvite\n} from 'blind-pairing-core'\n\nconst { invite, publicKey } = createInvite(key) // key is a Hypercore or Autobase key\n\n// candidate\n\nconst candidate = new CandidateRequest(invite, { userData: 'hello world' })\ncandidate.on('accepted', () => console.log('accepted!'))\n\nconst transport = candidate.encode()\n\n// member\n\nconst request = MemberRequest.from(transport)\n\nconst userData = request.open(publicKey)\nconsole.log(userData) // hello world\n\nrequest.confirm({ key })\n\n// candidate\n\ncandidate.handleResponse(request.response)\n// candidate accepted event will fire\n\nconsole.log(candidate.auth) // { key }",
      "{\n  CandidateRequest,\n  MemberRequest,\n  createInvite,\n  decodeInvite,\n  verifyReceipt\n}"
    ]
  },
  "patterns": [
    "binary-encoding",
    "cryptography"
  ]
}