npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hodl

v0.1.6

Published

Proof of HODL - provable bitcoin time-lock

Downloads

8

Readme

proof-of-hodl

proof-of-hodl is a command line tool to time-lock and release bitcoins using OP_CHECKSEQUENCEVERIFY - and - a web voting system where votes are weighted by amount of coins * lock duration.

NOTE: this is early hackathon-grade software, currently running on testnet.

Why lock?

Proving the sacrifice of some limited resource is a common technique in a variety of cryptographic protocols. In the case of locking coins, the option to trade and invest them is being temporarily sacrificed.

However, unlike similar forms of sacrifice such as sacrifice to miners fees or proof of burn, the time-lock sacrifice leaves the coins under one's control and thus implying confident and skin in the future value of bitcoin. This property makes HODL voting especially interesting for questions relevant to the future of bitcoin such as protocol changes.

CHECKSEQUENCEVERIFY

OP_CHECKSEQUENCEVERIFY is a new opcode in the bitcoin scripting language (activated July 2016) that allows to create time-locked outputs that cannot be spent until a pre-determined amount of time passes.

See BIP 112 and BIP 68 for more details.

CLI

The hodl lock command takes a lock-duration (in number of blocks), a refund address and a message (which the lock commits to), creates an address where funds to be locked can be deposited and once a payment was received, present the redeeming transaction so it can be saved and broadcast when the time arrives. It also provides a proof that can be shared and verified using the hodl verify command.

$ npm install -g hodl

$ hodl --help

$ hodl lock --duration [lock duration in blocks] --refund [addr] 'I support SegWit'

$ hodl verify [proof]

HODL.voting

HODL.voting is a web voting system based on proof-of-HODL sacrifices.

The code is at /web, and a live version is available at HODL.voting.

Votes over multiple choice questions are weighted by Bitcoin Days Locked (BDL) - the amount of coins multiplied by the number of days locked. The voter is prompted for an amount, lock duration and a refund address and presented with a QR code of a deposit address. Once a payment is received, a refund transaction is presented to be kept and broadcast later, as well as kept on the server for backup, and the vote is cast. Keys never leave the browser.

Technical

  1. generate a random parentPrivkey, calculate parentPubkey = G*parentPrivkey
  2. calculate seq = HMAC-SHA256(msg, parentPubkey)
  3. derive childPrivkey = parentPrivkey+seq, childPubkey = G*childPrivkey
  4. redeemScript = [childPubkey] OP_CHECKSIG [rlocktime] OP_CHECKSEQUENCEVERIFY OP_DROP
  5. outputScript = RIPEMD160(SHA256(redeemScript))

License (ISC)

Copyright (c) 2017, Nadav Ivgi

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.