frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Bithoven – A high-level, imperative language for Bitcoin Smart Contract

https://github.com/ChrisCho-H/bithoven
21•hyunhum•3d ago
Hey HN! I’m a researcher working on Bitcoin smart contracts, and today I’m releasing Bithoven—a high-level imperative language that compiles to native Bitcoin Script (Legacy, SegWit, and Taproot).

The Goal:

Raw Bitcoin Script is notoriously difficult to reason about. Writing raw Bitcoin Script today feels like writing Assembly in the 1970s. You have to mentally juggle the stack (`OP_SWAP`, `OP_ROT`), manually manage distinct execution branches, and pray you didn't leave a stack item unconsumed (which crashes the script). My goal was to bridge the gap between complex contract logic and raw opcodes, allowing developers to write readable, compile-time-safe code.

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 runtime errors.

- Targeted Compilation: Support for Legacy, SegWit, and Taproot compilation targets.

- Native Primitives: Built-in keywords for timelocks (older, after) and cryptography (sha256, checksig).

You can try it in the browser here (runs via WASM): https://bithoven-lang.github.io/bithoven/ide/

Here is an example of a Hashed Time-Locked Contract (HTLC):

  (condition: bool, sig_alice: signature)
  (condition: bool, preimage: string, sig_bob: signature)
  {
      if condition {
          // Relative locktime (Sequence)
          older 1000;
          return checksig (sig_alice, alice_pk);
      } else {
          // Hashlock verification
          verify sha256 sha256 preimage == hash;
          return checksig (sig_bob, bob_pk);
      }
  }
The project is free open source and the academic paper is currently under review. I’d love to hear any feedback. Thanks for checking it out!

Comments

hyunhum•3d ago
Docs: https://bithoven-lang.github.io/bithoven/docs/
OsrsNeedsf2P•6h ago
Looks pretty neat. As someone who hasn't followed Bitcoin for the last 5 years, what are some things people have built with smart contracts? Also, are Bitcoin smart contracts Turing Complete and suffer the same gas issue as ETH where you don't know how much gas you need?
hyunhum•4h ago
Bitcoin Script is non-turing-complete in nature(so no gas issue!), so does Bithoven. Bithoven doesn't extend Bitcoin Script Opcodes(which requires consensus upgrade on the protocol), but inherit and abstract for the expressiveness. Moreover, it supports static analysis to cache some known security bugs.

Even if limited nature, there are many applications of smart contract like hashed-time lock contract, inheritance and multisig contract! You can see examples: https://github.com/ChrisCho-H/bithoven/tree/main/example

I would be glad to anyone who would add example bithoven code!

vessenes•5h ago
I love this! Thanks for making it.

Quick suggestion - adding simulators for checking all spend paths would add comfort. A lot of comfort. I understand you're doing static analysis on construction, which is great; more safety would be awesome too.

If I missed that you have these, then, I doubly love this! :)

hyunhum•4h ago
Yes, simulator definitely would! Actually I'm planning to add input constructor or simulator to generate safe symbolic/static inputs for users, and simulate with symbolic script engine to validate even stricter. As it might require the Bitcoin Script interpreter (with symbolic execution for things like signature), I left it as a near future work.
wslh•5h ago
I don't think it makes any sense except for fun, Bitcoin scripts are pretty limited and there are a lot of previous work [1][2][3][4][5].

[1] https://bitcoin.sipa.be/miniscript/

[2] https://min.sc/

[3] https://docs.scrypt.io/

[4] https://github.com/sapio-lang/sapio

[5] https://github.com/ivy-lang/ivy-bitcoin

hyunhum•4h ago
I've researched the previous works surely, and actually contributed miniscript(the most notable one in industry AFAIK) quite a lot(https://github.com/rust-bitcoin/rust-miniscript). Contributions to the previous work has actually motivated me to research and implement this. As you may know, miniscript, while could be safer as restricted policy lang, is not really expressive enough to express many bitcoin opcodes(e.g. + and - op), and really hard to understand and write for dev not familiar with Bitcoin Script.

I understand that Bitcoin Script itself is pretty limited(no mul/div, no bit-operation, no loop), but there must be safe and expressive language as it's standard for UTXO blockchain including bitcoin. The security bug happening because of primitive and hard-to-understand Bitcoin Script could be as severe issue as other advanced programming language bug, as it's directly related to money! Lack of expressiveness also does discourage the possible smart contract application on Bitcoin, which has a high potential value considering mega-economy of Bitcoin.

Bithoven has added expressiveness(and I think it does make a sense for real world impact), and also tried to catch severe agonizing money loss bug with a static anaylzer.

hyunhum•3h ago
I omitted one detail in the original post: Bithoven uses an LALR parser generator (Lalrpop) to strictly define the formal grammar and avoid ambiguities when parsing to the AST!

Show HN: Orbit a systems level programming language that compiles .sh to LLVM

https://github.com/SIE-Libraries/orbit
4•TheCodingDecode•15m ago•1 comments

Show HN: Xsql – SQL schema conversion via an intermediate representation (Rust)

https://github.com/Dawaman43/xsql
2•dawitworku•14m ago•0 comments

Show HN: Picknplace.js, an alternative to drag-and-drop

https://jgthms.com/picknplace.js/
277•bbx•2d ago•111 comments

Show HN: Stop AI scrapers from hammering your self-hosted blog (using porn)

https://github.com/vivienhenz24/fuzzy-canary
227•misterchocolat•2d ago•152 comments

Show HN: Helix – AI-powered API mocking with strict schema enforcement

https://github.com/ashfromsky/helix
4•ashfromsky•40m ago•0 comments

Show HN: Learning a Language Using Only Words You Know

https://simedw.com/2025/12/15/langseed/
61•simedw•3d ago•18 comments

Show HN: Bithoven – A high-level, imperative language for Bitcoin Smart Contract

https://github.com/ChrisCho-H/bithoven
21•hyunhum•3d ago•8 comments

Show HN: Composify – Open-Source Visual Editor / Server-Driven UI for React

https://github.com/composify-js/composify
63•injung•17h ago•6 comments

Show HN: Spice Cayenne – SQL acceleration built on Vortex

https://spice.ai/blog/introducing-spice-cayenne-data-accelerator
26•lukekim•14h ago•3 comments

Show HN: MephistoMail – RAM-only ephemeral email with client-side privacy tools

https://www.mephistomail.site/
3•benmxrt•5h ago•0 comments

Show HN: A local-first memory store for LLM agents (SQLite)

https://github.com/CaviraOSS/OpenMemory
45•nullure•4d ago•16 comments

Show HN: Paper2Any – Open tool to generate editable PPTs from research papers

https://github.com/OpenDCAI/DataFlow-Agent
11•Mey0320•16h ago•2 comments

Show HN: I built a fast RSS reader in Zig

https://github.com/superstarryeyes/hys
89•superstarryeyes•2d ago•31 comments

Show HN: WebCraft: A C++ 23 async IO library

2•raoa32•6h ago•0 comments

Show HN: Daily Set Puzzle – I rebuilt it after setgame.com's SSL cert expired

https://www.anniehu.com/set/
7•anniegracehu•6h ago•2 comments

Show HN: TinyPDF – 3KB PDF library (70x smaller than jsPDF)

https://github.com/Lulzx/tinypdf
14•lulzx•14h ago•1 comments

Show HN: High-Performance Wavelet Matrix for Python, Implemented in Rust

https://pypi.org/project/wavelet-matrix/
90•math-hiyoko•1d ago•10 comments

Show HN: Postman-style TUI for API testing built with Rust and ratatui

https://github.com/pranav-cs-1/nexus
3•PranavVyas•7h ago•0 comments

Show HN: Sqlit – A lazygit-style TUI for SQL databases

https://github.com/Maxteabag/sqlit
180•MaxTeabag•3d ago•40 comments

Show HN: DocsRouter – The OpenRouter for OCR and Vision Models

https://docsrouter.com
10•misbahsy•1d ago•0 comments

Show HN: Interactive Common Lisp: An Enhanced REPL

https://github.com/atgreen/icl
101•atgreen•5d ago•6 comments

Show HN: Narrativee – Make sense of your data in minutes

https://narrativee.com
3•safoan_eth•13h ago•0 comments

Show HN: A pager

https://www.udp7777.com/
103•keepamovin•4d ago•43 comments

Show HN: Explore Prometheus /metrics endpoints from your terminal

https://github.com/brennerm/slashmetrics-cli
3•brennerm•14h ago•0 comments

Show HN: TheAuditor v2.0 – A “Flight Computer” for AI Coding Agents

https://github.com/TheAuditorTool/Auditor
38•ThailandJohn•2d ago•12 comments

Show HN: GitForms – Zero-cost contact forms using GitHub Issues as database

https://gitforms-landing.vercel.app/
39•lgreco•1d ago•28 comments

Show HN: Turn your startup logo into a holiday Google doodle

https://doodle.logic.inc/
3•sgk284•15h ago•1 comments

Show HN: Git rewind – your Git year in review

https://gitrewind.dev/
5•thijser•16h ago•0 comments

Show HN: Toad. A unified terminal UI for coding agents

https://github.com/batrachianai/toad
6•willm•16h ago•0 comments

Show HN: MiraTTS, a 48kHz Open-Source TTS at 100x Real-Time Speed

https://github.com/ysharma3501/MiraTTS
2•Yatharth3501•16h ago•0 comments