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 🙏

© 2026 – Pkg Stats / Ryan Hefner

bithoven

v0.1.0

Published

A smart contract language for composing powerful and secure instruments on Bitcoin.

Readme

Bithoven 🎼

A High-Level, Imperative Language for Bitcoin Smart Contracts

Bithoven is a type-safe, developer-friendly programming language designed to compile down to native Bitcoin Script. It bridges the gap between complex smart contract logic and the low-level stack machine of the Bitcoin Virtual Machine (VM).

Write readable, auditable code with modern control flow (if/else), named variables, and built-in safety checks—then compile it to highly optimized Bitcoin Script for SegWit or Taproot.

⚡ Key Features

  • Imperative Syntax: Write logic using familiar if, else, and return statements instead of mental stack juggling.
  • Type Safety: First-class support for bool, signature, string, and number types to prevent common runtime errors.
  • Multiple Spending Paths: Define complex contracts (like HTLCs) with distinct execution branches and input stack requirements.
  • Targeted Compilation: Support for legacy, segwit, and taproot compilation targets via pragmas.
  • Native Bitcoin Primitives: Built-in keywords for timelocks (older, after), cryptography (sha256, checksig), and verification (verify).

🚀 Quick Start

  • Bithoven Web IDE, see: https://bithoven-lang.github.io/bithoven/ide/
  • Bithoven Documentation, see: https://bithoven-lang.github.io/bithoven/docs/

Installation

# For CLI user
cargo install bithoven
# For rust user
cargo add bithoven
# For js user
npm install bithoven

Writing Your First Contract

Bithoven contracts are defined with a .bithoven extension. Below is an implementation of a standard Hashed Time-Locked Contract (HTLC), demonstrating how Bithoven simplifies conditional spending paths.

htlc.bithoven

pragma bithoven version 0.0.1;
pragma bithoven target segwit;

/* * Stack Input Definitions
 * Each line defines a valid input stack configuration for a spending path.
 */
(condition: bool, sig_alice: signature)
(condition: bool, preimage: string, sig_bob: signature)

{
    // If 'condition' is true, we enter the Refund Path (Alice)
    if condition {
        // Enforce relative timelock of 1000 blocks
        older 1000;

        // If timelock is satisfied, Alice can spend with her signature
        return checksig(sig_alice, "0245a6b3f8eeab8e88501a9a25391318dce9bf35e24c377ee82799543606bf5212");

    } else {
        // Redeem Path (Bob)
        // Bob must reveal the secret preimage that hashes to the expected value
        verify sha256(sha256(preimage)) == "53de742e2e323e3290234052a702458589c30d2c813bf9f866bef1b651c4e45f";

        // If hash matches, Bob can spend with his signature
        return checksig(sig_bob, "0345a6b3f8eeab8e88501a9a25391318dce9bf35e24c377ee82799543606bf5212");
    }
}

📖 Examples Gallery

Bithoven comes with a rich collection of examples demonstrating real-world Bitcoin smart contracts:

| Example | Description | Key Features | |---------|-------------|--------------| | HTLC | Hash Time-Locked Contract | Hash locks, timelocks, conditional payments | | Atomic Swap 🆕 | Cross-chain trading | Double SHA256 hash locks, trustless exchange | | Escrow 🆕 | 2-of-3 multisig marketplace | Arbitrator, buyer/seller, time-locked refunds | | Vault 🆕 | Security-enhanced wallet | Time-delayed withdrawals, immediate cold storage recovery | | Multisig Voting 🆕 | DAO treasury / board approvals | 2-of-3 threshold voting, emergency 3-of-3 override | | Prediction Market 🆕 | Decentralized betting with hash-based oracle | Cryptographic commitment schemes, oracle proof verification | | Multisig | 2-of-2 multisig | Taproot multi-signature support | | Inheritance | Tiered access control | Multiple heir levels, secret-based access | | Hashlock | Simple hash lock | SHA256 hash verification | | Timelock | Absolute timelock | CLTV (CheckLockTimeVerify) | | Single Sig | Basic signature check | Simple P2PKH-style contract |

See all examples: Examples Directory

🛠 Compilation

When compiled, Bithoven translates the high-level imperative logic into the equivalent Bitcoin Script opcodes, handling the control flow and stack management automatically.

Command:

bithoven compile htlc.bithoven

Generated Bitcoin Script (ASM):

OP_IF
    <0xe803> OP_CHECKSEQUENCEVERIFY OP_DROP
    <pubkey_alice> OP_CHECKSIG
OP_ELSE
    OP_HASH256 OP_TOALTSTACK <hash_digest> OP_FROMALTSTACK OP_SWAP OP_EQUALVERIFY
    <pubkey_bob> OP_CHECKSIG
OP_ENDIF

📚 Documentation

Primitives

  • older <n>: Enforces relative timelock (Sequence).
  • after <n>: Enforces absolute timelock (LockTime).
  • checksig(sig, pubkey): Validates a signature against a public key.
  • verify <expr>: Ensures an expression evaluates to true, otherwise fails the script.

Types

  • bool: Boolean values (true, false).
  • signature: ECSDA or Schnorr signatures.
  • string: Hex or ASCII string data.
  • number: Integer values.

🤝 Contributing

Contributions are welcome! Please check out the issues page for roadmap items or submit a PR.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📄 Citation

If you use Bithoven in your research, please cite the following paper:

Bithoven: Formal Safety for Expressive Bitcoin Smart Contracts. Hyunhum Cho and Ik Rae Jeong, 2026. arXiv preprint arXiv:2601.01436. https://arxiv.org/abs/2601.01436

BibTeX:

@misc{bithoven,
      title={Bithoven: Formal Safety for Expressive Bitcoin Smart Contracts}, 
      author={Hyunhum Cho and Ik Rae Jeong},
      year={2026},
      eprint={2601.01436},
      archivePrefix={arXiv},
      primaryClass={cs.CR},
      url={https://arxiv.org/abs/2601.01436}, 
}