Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@keeex/afterbc

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keeex/afterbc

Provide and parse string that indicate a "not before" date.

  • 2.2.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
Created
Source

@keeex/afterbc

Library that provide strings that could not have existed before the time of the call.

The first version is based on the Bitcoin blockchain and BlockCypher. It returns the last block hash value, providing a string that effectively could not be guessed beforehand.

This value, combined with proper timestamping that provide a "not after" date can provide a limited timeframe for the creation of any associated data.

Usage

The library exposes two functions as the default export. A quick example follows:

import {getAfterString, parseAfterString} from "@keeex/afterbc";

const main = async() => {
  const str = await getAfterString();
  // At this point the value of str can be embedded in any data to be
  // timestamped
  const ouptut = await parseAfterString(str);
  // output contains a `date` property that is a JavaScript Date
  console.log("Returned string date: ", output.date);
  // it also contains a `checkUrl` property that provides third-party
  // verification
  console.log("Check URL: ", output.checkUrl);
}

Restrictions

The output is limited to the resolution of the source. In this case, bitcoin blocks are only created once in a while.

The library manages a cache that should be acceptable for any given source. Multiple calls that uses the same source will use that cache and avoid hitting the underlying service.

In the future, this library might support multiple data providers; the output string is made in a way that allow transparent handling of these future sources. Any string produced in the past should be handled appropriately to some extent.

We currently depend on BlockCypher's API to provide this service.

Keywords

FAQs

Package last updated on 29 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc