{"_id":"@bsv/chirp","_rev":"4-a8d262de2d719921a5540926518eb2d2","name":"@bsv/chirp","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@bsv/chirp","version":"0.1.0","keywords":["bsv","brc-167","chirp","uhrp","merkle","content-addressing"],"author":{"name":"BSV Blockchain Association"},"license":"SEE LICENSE IN LICENSE.txt","_id":"@bsv/chirp@0.1.0","maintainers":[{"name":"johngalt5","email":"dylan@murraydt.com"},{"name":"loftsteinn","email":"oli@oskarsson.nl"},{"name":"dkellen","email":"darrkellen@gmail.com"},{"name":"braydude","email":"brayden167@gmail.com"},{"name":"tyeverett","email":"p2ppsr@tyweb.us"}],"homepage":"https://github.com/bsv-blockchain/ts-stack/tree/main/packages/network/chirp#readme","bugs":{"url":"https://github.com/bsv-blockchain/ts-stack/issues"},"bin":{"chirp":"dist/cli.js"},"dist":{"shasum":"dee5ccf3c381d51a888629b184ba1f3d6b10d289","tarball":"https://registry.npmjs.org/@bsv/chirp/-/chirp-0.1.0.tgz","fileCount":37,"integrity":"sha512-2V2FcyF2IHrrFV/PW7oj05vgK2wkN/+ekU0MMAW+x28Z3vRhLkcGHSHCcBrdrqi10RpkevD5nyoKMIG6S7mLiA==","signatures":[{"sig":"MEUCIARYTtuZRCpHR3a9ovP3raCcFoA+8j0PL7lDfrCpFayHAiEA4wA/YdTsoUU9snSyE2s3w2b3khPSTkE/3tTxDhxWyC4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bsv%2fchirp@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":119482},"main":"./dist/index.js","type":"module","_from":"file:/home/runner/work/ts-stack/ts-stack/release-artifacts/packages/bsv-chirp-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./openapi":{"types":"./dist/openapi.d.ts","import":"./dist/openapi.js","default":"./dist/openapi.js"},"./package.json":"./package.json"},"scripts":{"lint":"oxlint src test --deny-warnings","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --watchman=false","build":"tsc","typecheck":"tsc --noEmit","pack:check":"pnpm build && node ../../../scripts/check-package-artifact.mjs . --modes esm --exports CHIRPBuilder,CHIRPDownloader,CHIRPUploader,MemoryCHIRPCache,decodeCHIRPNode,encodeBranchNode,encodeRootNode,parseCHIRPURL,validateCHIRPClosure --entry-exports \"./openapi=CHIRP_OPENAPI_DOCUMENT\" --bin chirp --bin-args --help","format:check":"pnpm --workspace-root exec prettier --check \"packages/network/chirp/**/*.{json,md,ts}\"","test:browser":"pnpm build && node ../../../scripts/check-browser-package.mjs .","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --runInBand --watchman=false","test:property":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --watchman=false test/codec.property.test.ts"},"_npmUser":{"name":"tyeverett","email":"p2ppsr@tyweb.us"},"_resolved":"/home/runner/work/ts-stack/ts-stack/release-artifacts/packages/bsv-chirp-0.1.0.tgz","_integrity":"sha512-2V2FcyF2IHrrFV/PW7oj05vgK2wkN/+ekU0MMAW+x28Z3vRhLkcGHSHCcBrdrqi10RpkevD5nyoKMIG6S7mLiA==","repository":{"url":"git+https://github.com/bsv-blockchain/ts-stack.git","type":"git","directory":"packages/network/chirp"},"_npmVersion":"11.16.0","description":"BRC-167 Chunked, Hashed, Interleaved Resolution Protocol reference implementation","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"openapi":["dist/openapi.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.4.2","oxlint":"^1.76.0","ts-jest":"^29.4.12","@bsv/sdk":"^2.4.1","fast-check":"^4.9.0","typescript":"npm:@typescript/typescript6@6.0.2","@types/jest":"^30.0.0","@types/node":"^26.1.2","@jest/globals":"^30.4.1","@typescript/native":"npm:typescript@7.0.2"},"peerDependencies":{"@bsv/sdk":"^2.4.1"},"_npmOperationalInternal":{"tmp":"tmp/chirp_0.1.0_1787850787430_0.9190250507860918","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bsv/chirp","version":"0.1.1","keywords":["bsv","brc-167","chirp","uhrp","merkle","content-addressing"],"author":{"name":"BSV Association"},"license":"SEE LICENSE IN LICENSE.txt","_id":"@bsv/chirp@0.1.1","maintainers":[{"name":"johngalt5","email":"dylan@murraydt.com"},{"name":"loftsteinn","email":"oli@oskarsson.nl"},{"name":"dkellen","email":"darrkellen@gmail.com"},{"name":"braydude","email":"brayden167@gmail.com"},{"name":"tyeverett","email":"p2ppsr@tyweb.us"}],"homepage":"https://github.com/bsv-blockchain/ts-stack/tree/main/packages/network/chirp#readme","bugs":{"url":"https://github.com/bsv-blockchain/ts-stack/issues"},"bin":{"chirp":"dist/cli.js"},"dist":{"shasum":"39898f94ab621596b73d5ff48fd9a815b8dbc232","tarball":"https://registry.npmjs.org/@bsv/chirp/-/chirp-0.1.1.tgz","fileCount":37,"integrity":"sha512-pAB1kcHuL7Xt8Re3cY1mC+yCISIDudECd1gBuZlwuBuJSOIvx6WoBTRI3SvBLyDG4pW72KszC1+OaV16h3QJVw==","signatures":[{"sig":"MEQCIHNU8hnwPXacS0DpZXzNo6NHkFQaLPlG65lC6Ye81jCkAiAJveDYHeSmXxvCLzKVwEVcPRSKFJEkFRgFSDoMu91HPQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bsv%2fchirp@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":119471},"main":"./dist/index.js","type":"module","_from":"file:/home/runner/work/ts-stack/ts-stack/release-artifacts/packages/bsv-chirp-0.1.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./openapi":{"types":"./dist/openapi.d.ts","import":"./dist/openapi.js","default":"./dist/openapi.js"},"./package.json":"./package.json"},"scripts":{"lint":"oxlint src test --deny-warnings","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --watchman=false","build":"tsc","typecheck":"tsc --noEmit","pack:check":"pnpm build && node ../../../scripts/check-package-artifact.mjs . --modes esm --exports CHIRPBuilder,CHIRPDownloader,CHIRPUploader,MemoryCHIRPCache,decodeCHIRPNode,encodeBranchNode,encodeRootNode,parseCHIRPURL,validateCHIRPClosure --entry-exports \"./openapi=CHIRP_OPENAPI_DOCUMENT\" --bin chirp --bin-args --help","format:check":"pnpm --workspace-root exec prettier --check \"packages/network/chirp/**/*.{json,md,ts}\"","test:browser":"pnpm build && node ../../../scripts/check-browser-package.mjs .","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --runInBand --watchman=false","test:property":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --watchman=false test/codec.property.test.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b86335-b615-4ce1-9db1-f3d10ab1365e"}},"_resolved":"/home/runner/work/ts-stack/ts-stack/release-artifacts/packages/bsv-chirp-0.1.1.tgz","_integrity":"sha512-pAB1kcHuL7Xt8Re3cY1mC+yCISIDudECd1gBuZlwuBuJSOIvx6WoBTRI3SvBLyDG4pW72KszC1+OaV16h3QJVw==","repository":{"url":"git+https://github.com/bsv-blockchain/ts-stack.git","type":"git","directory":"packages/network/chirp"},"_npmVersion":"11.16.0","description":"BRC-167 Chunked, Hashed, Interleaved Resolution Protocol reference implementation","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"openapi":["dist/openapi.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.4.2","oxlint":"^1.76.0","ts-jest":"^29.4.12","@bsv/sdk":"^2.4.2","fast-check":"^4.9.0","typescript":"npm:@typescript/typescript6@6.0.2","@types/jest":"^30.0.0","@types/node":"^26.1.2","@jest/globals":"^30.4.1","@typescript/native":"npm:typescript@7.0.2"},"peerDependencies":{"@bsv/sdk":"^2.4.1"},"_npmOperationalInternal":{"tmp":"tmp/chirp_0.1.1_1787866067239_0.9892545057547424","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@bsv/chirp","version":"0.1.2","keywords":["bsv","brc-167","chirp","uhrp","merkle","content-addressing"],"author":{"name":"BSV Association"},"license":"SEE LICENSE IN LICENSE.txt","_id":"@bsv/chirp@0.1.2","maintainers":[{"name":"johngalt5","email":"dylan@murraydt.com"},{"name":"loftsteinn","email":"oli@oskarsson.nl"},{"name":"dkellen","email":"darrkellen@gmail.com"},{"name":"braydude","email":"brayden167@gmail.com"},{"name":"tyeverett","email":"p2ppsr@tyweb.us"}],"homepage":"https://github.com/bsv-blockchain/ts-stack/tree/main/packages/network/chirp#readme","bugs":{"url":"https://github.com/bsv-blockchain/ts-stack/issues"},"bin":{"chirp":"dist/cli.js"},"dist":{"shasum":"ac4b761a26ba6cb2dad844d8299343696962fa74","tarball":"https://registry.npmjs.org/@bsv/chirp/-/chirp-0.1.2.tgz","fileCount":37,"integrity":"sha512-0e2MFtI1iQ8+gc3vvruBgAmMx4Igw7FaSorMGZ3tifLO7i9vCXAqEmAFJUDBYEuXMwK4/vCPMh67XrYiB9S+lw==","signatures":[{"sig":"MEQCIH1omrgYKD+9g3Yh+viqzroFsMnVQzMhvaDrJDgWPNIfAiAaDWCGEjd7zR3GDXPSARSOxn9RnHl5Q2Vrtwsbj3dqsQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIDLjKvYghoqbxjRx/xtjjIBbSXmJaKn/h1V2eN1VCN2CAiEA/itpZRBnio7w2eGUqrucYsbIBKxItYN4C9aEge/ecmI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bsv%2fchirp@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":174844},"main":"./dist/index.js","type":"module","_from":"file:/home/runner/work/ts-stack/ts-stack/release-artifacts/packages/bsv-chirp-0.1.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./openapi":{"types":"./dist/openapi.d.ts","import":"./dist/openapi.js","default":"./dist/openapi.js"},"./package.json":"./package.json"},"scripts":{"lint":"oxlint src test --deny-warnings","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --watchman=false","build":"tsc","typecheck":"tsc --noEmit","pack:check":"pnpm build && node ../../../scripts/check-package-artifact.mjs . --modes esm --exports CHIRPBuilder,CHIRPDownloader,CHIRPUploader,MemoryCHIRPCache,decodeCHIRPNode,encodeBranchNode,encodeRootNode,parseCHIRPURL,validateCHIRPClosure --entry-exports \"./openapi=CHIRP_OPENAPI_DOCUMENT\" --bin chirp --bin-args --help","format:check":"pnpm --workspace-root exec prettier --check \"packages/network/chirp/**/*.{json,md,ts}\"","test:browser":"pnpm build && node ../../../scripts/check-browser-package.mjs .","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --runInBand --watchman=false","test:property":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --watchman=false test/codec.property.test.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b86335-b615-4ce1-9db1-f3d10ab1365e"}},"_resolved":"/home/runner/work/ts-stack/ts-stack/release-artifacts/packages/bsv-chirp-0.1.2.tgz","_integrity":"sha512-0e2MFtI1iQ8+gc3vvruBgAmMx4Igw7FaSorMGZ3tifLO7i9vCXAqEmAFJUDBYEuXMwK4/vCPMh67XrYiB9S+lw==","repository":{"url":"git+https://github.com/bsv-blockchain/ts-stack.git","type":"git","directory":"packages/network/chirp"},"_npmVersion":"11.16.0","description":"BRC-167 Chunked, Hashed, Interleaved Resolution Protocol reference implementation","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"openapi":["dist/openapi.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.4.2","oxlint":"^1.76.0","ts-jest":"^29.4.12","@bsv/sdk":"^2.8.0","fast-check":"^4.9.0","typescript":"npm:@typescript/typescript6@6.0.2","@types/jest":"^30.0.0","@types/node":"^26.1.2","@jest/globals":"^30.4.1","@typescript/native":"npm:typescript@7.0.2"},"peerDependencies":{"@bsv/sdk":"^2.4.1"},"_npmOperationalInternal":{"tmp":"tmp/chirp_0.1.2_1790139870116_0.35712101884368197","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"_id":"@bsv/chirp@0.1.3","bin":{"chirp":"dist/cli.js"},"bugs":{"url":"https://github.com/bsv-blockchain/ts-stack/issues"},"dist":{"shasum":"f6d6e835d540926b8726f171f5a2b76ca8f3203d","tarball":"https://registry.npmjs.org/@bsv/chirp/-/chirp-0.1.3.tgz","fileCount":37,"integrity":"sha512-TYWa4TXpgJwyVodk4KXSJhEmhC5ERe4cEQKZHlfIZaksUDC2JxsKw7wk0pob9EMu66MgnnuRTA83AfMqU9FTOQ==","signatures":[{"sig":"MEUCIQDMYCG30Fo1p39lO7Z0k75II17S8nf8H3+fe6BIelJPBQIgeFrVy6vjUGHe0Tvfn898y4W+d+ULt3mLhM6iJVDGJZI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBXmOK7RfjKbrBqwQmdfF/oMhyOXqtBPwCZPI9OMCNB3AiBMH9HSk3eFRHP0o18HLh9bQ510CnzriPKlOJHnz3z/vA=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bsv%2fchirp@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":175420},"main":"./dist/index.js","name":"@bsv/chirp","type":"module","_from":"file:/home/runner/work/ts-stack/ts-stack/release-artifacts/packages/bsv-chirp-0.1.3.tgz","types":"./dist/index.d.ts","author":{"name":"BSV Association"},"engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./openapi":{"types":"./dist/openapi.d.ts","import":"./dist/openapi.js","default":"./dist/openapi.js"},"./package.json":"./package.json"},"license":"SEE LICENSE IN LICENSE.txt","scripts":{"lint":"oxlint src test --deny-warnings","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --watchman=false","build":"tsc","typecheck":"tsc --noEmit","pack:check":"pnpm build && node ../../../scripts/check-package-artifact.mjs . --modes esm --exports CHIRPBuilder,CHIRPDownloader,CHIRPUploader,MemoryCHIRPCache,decodeCHIRPNode,encodeBranchNode,encodeRootNode,parseCHIRPURL,validateCHIRPClosure --entry-exports \"./openapi=CHIRP_OPENAPI_DOCUMENT\" --bin chirp --bin-args --help","format:check":"pnpm --workspace-root exec prettier --check \"packages/network/chirp/**/*.{json,md,ts}\"","test:browser":"pnpm build && node ../../../scripts/check-browser-package.mjs .","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --runInBand --watchman=false","test:property":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --watchman=false test/codec.property.test.ts"},"version":"0.1.3","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b86335-b615-4ce1-9db1-f3d10ab1365e"}},"homepage":"https://github.com/bsv-blockchain/ts-stack/tree/main/packages/network/chirp#readme","keywords":["bsv","brc-167","chirp","uhrp","merkle","content-addressing"],"_resolved":"/home/runner/work/ts-stack/ts-stack/release-artifacts/packages/bsv-chirp-0.1.3.tgz","_integrity":"sha512-TYWa4TXpgJwyVodk4KXSJhEmhC5ERe4cEQKZHlfIZaksUDC2JxsKw7wk0pob9EMu66MgnnuRTA83AfMqU9FTOQ==","repository":{"url":"git+https://github.com/bsv-blockchain/ts-stack.git","type":"git","directory":"packages/network/chirp"},"_npmVersion":"11.16.0","description":"BRC-167 Chunked, Hashed, Interleaved Resolution Protocol reference implementation","directories":{},"maintainers":[{"name":"johngalt5","email":"dylan@murraydt.com"},{"name":"loftsteinn","email":"oli@oskarsson.nl"},{"name":"dkellen","email":"darrkellen@gmail.com"},{"name":"braydude","email":"brayden167@gmail.com"},{"name":"tyeverett","email":"p2ppsr@tyweb.us"}],"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"openapi":["dist/openapi.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.4.2","oxlint":"^1.76.0","express":"^5.2.1","ts-jest":"^29.4.12","@bsv/sdk":"^2.8.8","fast-check":"^4.9.0","typescript":"npm:@typescript/typescript6@6.0.2","@types/jest":"^30.0.0","@types/node":"^26.1.2","@jest/globals":"^30.4.1","@types/express":"^5.0.6","@typescript/native":"npm:typescript@7.0.2","express-rate-limit":"8.6.1","@bsv/auth-express-middleware":"^2.2.8"},"peerDependencies":{"@bsv/sdk":"^2.4.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chirp_0.1.3_1790482329371_0.5482644726251797"}}},"time":{"created":"2026-08-27T17:13:07.234Z","modified":"2026-09-27T04:12:09.814Z","0.1.0":"2026-08-27T17:13:07.617Z","0.1.1":"2026-08-27T21:27:47.392Z","0.1.2":"2026-09-23T05:04:30.216Z","0.1.3":"2026-09-27T04:12:09.480Z"},"bugs":{"url":"https://github.com/bsv-blockchain/ts-stack/issues"},"author":{"name":"BSV Association"},"license":"SEE LICENSE IN LICENSE.txt","homepage":"https://github.com/bsv-blockchain/ts-stack/tree/main/packages/network/chirp#readme","keywords":["bsv","brc-167","chirp","uhrp","merkle","content-addressing"],"repository":{"url":"git+https://github.com/bsv-blockchain/ts-stack.git","type":"git","directory":"packages/network/chirp"},"description":"BRC-167 Chunked, Hashed, Interleaved Resolution Protocol reference implementation","maintainers":[{"name":"johngalt5","email":"dylan@murraydt.com"},{"name":"loftsteinn","email":"oli@oskarsson.nl"},{"name":"dkellen","email":"darrkellen@gmail.com"},{"name":"braydude","email":"brayden167@gmail.com"},{"name":"tyeverett","email":"p2ppsr@tyweb.us"}],"readme":"# `@bsv/chirp`\n\nReference implementation of BRC-167, the Chunked, Hashed, Interleaved\nResolution Protocol. CHIRP is an additive Merkle-object layer over UHRP: roots\nare discovered with the existing `ls_uhrp` service and complete hosts advertise\nthe canonical root as an ordinary BRC-26 object.\n\nThe package supports browsers and Node.js and includes:\n\n- canonical v1 root and branch codecs;\n- deterministic profile 1 construction (4 MiB blobs, fanout 256);\n- `Uint8Array`, browser `Blob`, `ReadableStream<Uint8Array>`, and Node\n  `AsyncIterable<Uint8Array>` sources;\n- progressive multi-host publication with resumable upload sessions;\n- lazy, bounded, range-aware, interleaved download and per-object retry;\n- verified-object caching and full closure validation; and\n- the `chirp` publication, retrieval, and verification CLI.\n\n## Install\n\n```sh\nnpm install @bsv/chirp @bsv/sdk\n```\n\n## Build a canonical root\n\n```ts\nimport { CHIRPBuilder } from '@bsv/chirp'\n\nconst result = await new CHIRPBuilder().build(new Blob([largeFile]), {\n  mediaType: 'application/octet-stream',\n  sink: {\n    async putObject(identifier, bytes, kind) {\n      // Persist or upload each verified object. Blobs arrive before EOF.\n    }\n  }\n})\n\nconsole.log(result.chirpURL)\n```\n\nDirect byte arrays and build options are snapshotted before asynchronous work.\nEvery object passed to a sink is an owned copy, so a sink cannot mutate the\nverified result. Pass an `AbortSignal` as `signal` when a stream or asynchronous\niterator must remain cancellable. A custom sink is still a local authority: it\ndecides where verified bytes are persisted and must provide its own durability\nand access-control policy.\n\n## Publish to complete hosts\n\n`CHIRPUploader` uses the same BRC-103/104 `WalletInterface` and `AuthFetch`\nboundary as `StorageUploader`. Existing UHRP upload APIs are unchanged.\n\nObject uploads sign their `Content-Type` and send the verified bytes unchanged.\nThe HTTP transport supplies `Content-Length` from the byte body; omitting\n`Content-Encoding` means identity encoding. These transport headers are not\npassed through `AuthFetch` as signed application headers. Custom authenticated\ntransports must retain the exact bytes and ordinary HTTP framing.\n\n```ts\nimport { CHIRPUploader } from '@bsv/chirp'\n\nconst result = await new CHIRPUploader({\n  wallet,\n  storageURLs: ['https://storage-a.example', 'https://storage-b.example'],\n  resilienceLevel: 2\n}).publish({\n  source: file.stream(),\n  logicalLength: file.size,\n  retentionSeconds: 2_592_000,\n  mediaType: file.type || undefined\n})\n```\n\nTo customize DNS pinning or HTTP transport while retaining `AuthFetch`, provide\n`fetchClient`. The legacy `fetch` option replaces the complete request path,\nincluding `AuthFetch`, and is appropriate only for tests or a caller-supplied\nauthenticated client. Both callbacks are local trust boundaries; CHIRP cannot\nmake an unrestricted custom transport safe.\n\n## Retrieve or stream\n\n```ts\nimport { CHIRPDownloader } from '@bsv/chirp'\n\nconst downloader = new CHIRPDownloader({ concurrency: 4 })\nfor await (const chunk of downloader.stream(chirpURL, {\n  range: { start: 8_388_608n, endExclusive: 12_582_912n }\n})) {\n  consume(chunk.data)\n}\n```\n\nEach complete blob is hash-verified before release. A complete stream also\nchecks root `logicalLength` and `contentHash` at termination. Use `download()`\nfor an atomic bounded `Uint8Array` result. Object responses may stream without\n`Content-Length`; when the header is present it must match the verified\nreference. Readers always enforce the referenced blob length and a finite node\nor future-profile object bound.\n\nCustom cache entries are never trusted for integrity: reads are copied and\nhash-verified before use, writes receive owned copies, and `MemoryCHIRPCache`\nverifies the identifier before insertion. Configuration, per-call ranges, and\ncallbacks are captured before network awaits so later caller mutation cannot\nchange an in-flight operation.\n\n## CLI\n\n```sh\nchirp --help\nchirp publish ./large.bin \\\n  --host https://storage.example \\\n  --wallet-module ./wallet.mjs \\\n  --retention-seconds 2592000 \\\n  --resume-file .chirp-upload.json\nchirp retrieve chirp://... --output ./large.bin --range 0:4194304\nchirp verify chirp://...\n```\n\nThe wallet module exports a default `WalletInterface` or async\n`createWallet()`. Resume files contain opaque host session capabilities and\nshould be protected like other authenticated client state. The built-in CLI\nreads at most 1 MiB from a regular non-symlink checkpoint and replaces\ncheckpoints atomically with mode `0600`. Retrieved output is first written to a\nprivate same-directory temporary and linked into its final name without\nfollowing or overwriting an existing path.\nStorage hosts must use HTTPS unless `allowInsecureHTTP` (or the CLI's\n`--allow-insecure-http`) is selected explicitly for local development. Private\nhosts additionally require `allowPrivateHosts` or `--allow-private-hosts`.\n\n## Compatibility and limits\n\n- `uhrp:` and existing `StorageUploader`, `StorageDownloader`, `/upload`,\n  `/put`, `/find`, `/list`, `/renew`, and `/cdn` contracts are unchanged.\n- CHIRP never introduces `tm_chirp` or `ls_chirp`; root discovery remains\n  `tm_uhrp` / `ls_uhrp`.\n- Default atomic downloads are limited to 512 MiB. Streaming, object count,\n  concurrency, retry, depth, response size, and cache sizes are bounded and\n  configurable; object/reference traversal defaults to 100,000 and depth\n  cannot exceed the v1 limit of 16. Profile 1 blobs are always capped at 4 MiB;\n  `maxObjectBytes` sets the absolute local ceiling for blobs from unknown future\n  profiles.\n- Object requests and UHRP resolution have bounded timeouts. Browser clients\n  inherit the browser network boundary; server-side consumers can provide a\n  `urlPolicy`, and the CLI rejects DNS results outside public address space by\n  default. Timeout races also bound custom asynchronous adapters that ignore an\n  abort signal, although their own abandoned work remains their responsibility.\n  `--allow-private-hosts` is an explicit local-development override.\n- Resolution of a future chunking profile remains hash-, length-, and\n  `contentHash`-verified, while `profileCanonical` reports `false` until the\n  profile-specific construction is understood. Profile 1 reports canonical\n  only after a complete traversal validates its chunk boundaries and tree\n  shape; partial-range downloads conservatively report `false`.\n- `mediaType` is untrusted advisory metadata. CHIRP integrity is not author\n  authenticity or permission to execute content.\n\n## Production integration\n\nSet `resilienceLevel` to the number of complete hosts required for a successful\npublication, retain resumable checkpoints until every intended host commits,\nand monitor root retention and renewal. A root advertisement means the host\nvalidated and retains the complete transitive closure; do not describe a\npartial cache as a complete host. Readers should bound logical bytes, object\nbytes and count, depth, retries, concurrency, redirects, and cache use, and\nserver-side readers should enforce a connection-pinned public-address policy.\n\nFor licensed media, publish LCH ciphertext through `CHIRPContentSink` and put\nthe returned `chirp:` locator in the LCH Asset representation. CHIRP then owns\nverified availability while LCH independently owns encryption, rights,\npayment, keys, and composition. See the\n[production CHIRP and LCH guide](https://github.com/bsv-blockchain/ts-stack/blob/main/docs/guides/chirp-lch-production.md)\nfor the complete topology, persistence model, failure matrix, deployment gate,\nand agent implementation contract.\n\nSee [BRC-167](https://bsv.brc.dev/overlays/0167) for the normative protocol. If\npackage behavior and the standard differ, the standard is authoritative.\n\n## License\n\nOpen BSV License v6. See [LICENSE.txt](./LICENSE.txt).\n","readmeFilename":"README.md"}