{"id":21340471,"url":"https://github.com/lacrypta/typescript-opentimestamps","last_synced_at":"2026-02-27T00:04:19.554Z","repository":{"id":236147409,"uuid":"742213748","full_name":"lacrypta/typescript-opentimestamps","owner":"lacrypta","description":"An OpenTimestamps client written in TypeScript","archived":false,"fork":false,"pushed_at":"2024-11-04T13:38:55.000Z","size":1227,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-21T14:18:09.569Z","etag":null,"topics":["bitcoin","blockchain","lib","opentimestamps","timechain"],"latest_commit_sha":null,"homepage":"https://lacrypta.ar/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lacrypta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-12T01:38:03.000Z","updated_at":"2025-08-27T12:35:57.000Z","dependencies_parsed_at":"2024-05-06T01:33:13.881Z","dependency_job_id":"939db28b-d72a-4c7d-b854-18fc16db1139","html_url":"https://github.com/lacrypta/typescript-opentimestamps","commit_stats":null,"previous_names":["lacrypta/typescript-opentimestamps"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lacrypta/typescript-opentimestamps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacrypta%2Ftypescript-opentimestamps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacrypta%2Ftypescript-opentimestamps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacrypta%2Ftypescript-opentimestamps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacrypta%2Ftypescript-opentimestamps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lacrypta","download_url":"https://codeload.github.com/lacrypta/typescript-opentimestamps/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacrypta%2Ftypescript-opentimestamps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29878277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","blockchain","lib","opentimestamps","timechain"],"created_at":"2024-11-22T00:50:51.787Z","updated_at":"2026-02-27T00:04:17.516Z","avatar_url":"https://github.com/lacrypta.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript OpenTimestamps (`typescript-opentimestamps`)\n\nAn OpenTimestamps client written in TypeScript\n\nThis project aims to provide a fully-tested, fully typed, OpenTimestamps Client.\nIt currently supports stamping, upgrading, and verifying timestamps.\n\n## Table of Contents\n\n1. [Table of Contents](#table-of-contents)\n2. [Background](#background)\n3. [Install](#install)\n4. [Usage](#usage)\n5. [API](#api)\n6. [Contributing](#contributing)\n7. [License](#license)\n\n## Background\n\nThe OpenTimestamps project currently hosts a number of Server, Client, and CLI [implementations](https://opentimestamps.org/#code-repositories).\nThis is our contribution to that list, adding TypeScript to it.\n\nThe project may be used as-is in Typescript directly, or it may be compiled and packaged for usage in the browser or NodeJS modules.\n\n## Install\n\nInstalling the library is straightforward:\n\n```sh\nnpm add @lacrypta/typescript-opentimestamps\n```\n\n```sh\nyarn add @lacrypta/typescript-opentimestamps\n```\n\n```sh\npnpm add @lacrypta/typescript-opentimestamps\n```\n\nThe only run-time dependency is [`@noble/hashes`](https://github.com/paulmillr/noble-hashes).\n\n## Usage\n\nOnce installed the library can be directly imported:\n\n```typescript\nimport {\n  type Timestamp,\n  read as read,\n  verify as verify,\n  //\n  verifiers,\n} from '@lacrypta/typescript-opentimestamps';\n\nconst rawTimestamp: Uint8Array = Uint8Array.from(someTimestampBytes);\nconst timestamp: Timestamp = read(rawTimestamp);\n\nverify(\n  timestamp,\n  verifiers,\n).then(\n  ({ attestations,  errors }: { attestations: Record\u003cnumber, string[]\u003e; errors: Record\u003cstring, Error[]\u003e }): void =\u003e {\n    Object.entries(attestations).forEach(([time, verifiers]: [string, string[]]): void =\u003e {\n      console.log(`Verifiers ${verifiers.join(', ')} attest to this timestamp as of ${time}`);\n    });\n    Object.entries(errors).forEach(([verifier, errorList]: [string, Error[]]): void =\u003e {\n      console.log(`${verifier} reported the following errors:`);\n      errorList.forEach((error: Error): void =\u003e {\n        console.log(error.message);\n      });\n    });\n  },\n);\n```\n\n## API\n\nThis library exports the following types:\n\n- **`Timestamp`:** a type alias containing version, file hash, and validation tree information.\n\nIt exports the following functions:\n\n- **`info`:** obtain a human-readable description of the `Timestamp`'s content.\n- **`canShrink`:** determine whether the given `Timestamp` can be shrunk to a single attestation chain.\n- **`canUpgrade`:** determine whether the given `Timestamp` ca be upgraded via a Calendar.\n- **`canVerify`:** determine whether the given `Timestamp` can be verified in the blockchain(s).\n- **`read`:** read a `Uint8Array` and transform it into a `Timestamp` if valid.\n- **`shrink`:** eliminate all but the _oldest_ attestation found in the given `Timestamp` for the given chain.\n- **`submit`:** submit the given `Timestamp` to a Calendar for eventual inclusion in a blockchain.\n- **`upgrade`:** upgrade the given `Timestamp` via a Calendar so as to make it independently verifiable.\n- **`is`:** a [TypeScript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) that simply applies validation to the given `Timestamp`.\n- **`validate`:** validate the given parameter and determine whether it is indeed a `Timestamp` object.\n- **`verify`:** verify the given `Timestamp` against the blockchain(s).\n- **_verifiers_:** a set of predefined lambda functions that will query the blockchain via explorer-provider APIs to check for the presence of a given Merkle root on-chain.\n- **`write`:** generate a `Uint8Array` consisting of the standard serialization of the given `Timestamp` value.\n\nMore in-depth information and prototypes can be found in the generated documentation.\n\n## Contributing\n\nThis project uses [`pnpm`](https://pnpm.io/) (think `npm` but faster), you'll need to [install it](https://pnpm.io/installation) if you haven't already.\n\nYou may clone the repository as usual:\n\n```sh\ngit clone git@github.com:lacrypta/typescript-opentimestamps.git\ncd typescript-opentimestamps\n```\n\nNow, simply install all dependencies:\n\n```sh\npnpm install\n```\n\nWe provide several `pnpm` commands for your convenience:\n\n- **`pnpm format`:** will run formatters and linters in all the codebase.\n- **`pnpm build`:** will build all targets (TypeScript type declarations included) in the `/dist` directory.\n- **`pnpm analyze`:** will analyze previous build.\n- **`pnpm doc`:** will generate _internal_ and _external_ documentation in the `/dist` directory.\n- **`pnpm clean`:** will remove the `/dist` directory entirely.\n- **`pnpm test`:** will run all tests and report coverage on the whole codebase.\n- **`pnpm reset`:** will run `pnpm clean`, and remove the `/node_modules` directory and `pnpm-lock.yaml` file, so as to completely reset the installation.\n\nYou'll probably want to run the tests first, build the documentation, and take it from there:\n\n```sh\npnpm test\npnpm doc\n```\n\nNow navigate to `/dist/docs/api/index.html` (for the end-use documentation) or `/dist/docs/internal/index.html` (for developer documentation) and peruse the generated documentation at your leisure.\n\nPlease follow contribution guidelines at [the GitHub repository](https://github.com/lacrypta/typescript-opentimestamps), we encourage PRs!\n\n## License\n\nGNU Lesser General Public License v3 or later, see [LICENSE.md](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flacrypta%2Ftypescript-opentimestamps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flacrypta%2Ftypescript-opentimestamps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flacrypta%2Ftypescript-opentimestamps/lists"}