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
20•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•2h 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•21m 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•1h 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•17m 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 harder. As it might require the Bitcoin Script interpreter (with symbolic execution for things like signature), I left it as a near future work.
wslh•48m 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•8m 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, as it's directly related to money! Lack of expressiveness also does discourage the possible smart contract application on 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 static anaylzer.

Beginning January 2026, all ACM publications will be made open access

https://dl.acm.org/openaccess
1494•Kerrick•13h ago•160 comments

1.5 TB of VRAM on Mac Studio – RDMA over Thunderbolt 5

https://www.jeffgeerling.com/blog/2025/15-tb-vram-on-mac-studio-rdma-over-thunderbolt-5
269•rbanffy•6h ago•95 comments

History LLMs: Models trained exclusively on pre-1913 texts

https://github.com/DGoettlich/history-llms
321•iamwil•6h ago•111 comments

We pwned X, Vercel, Cursor, and Discord through a supply-chain attack

https://gist.github.com/hackermondev/5e2cdc32849405fff6b46957747a2d28
700•hackermondev•9h ago•285 comments

Texas is suing all of the big TV makers for spying on what you watch

https://www.theverge.com/news/845400/texas-tv-makers-lawsuit-samsung-sony-lg-hisense-tcl-spying
629•tortilla•2d ago•314 comments

GPT-5.2-Codex

https://openai.com/index/introducing-gpt-5-2-codex/
423•meetpateltech•10h ago•224 comments

Noclip.website – A digital museum of video game levels

https://noclip.website/
56•ivmoreau•2h ago•6 comments

How China built its ‘Manhattan Project’ to rival the West in AI chips

https://www.japantimes.co.jp/business/2025/12/18/tech/china-west-ai-chips/
271•artninja1988•9h ago•276 comments

Skills for organizations, partners, the ecosystem

https://claude.com/blog/organization-skills-and-directory
247•adocomplete•11h ago•141 comments

Telegraph chess: A 19th century tech marvel

https://spectrum.ieee.org/telegraph-chess
16•sohkamyung•6d ago•1 comments

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

https://jgthms.com/picknplace.js/
198•bbx•2d ago•89 comments

Lite^3, a JSON-Compatible Zero-Copy Serialization Format

https://github.com/fastserial/lite3
10•cryptonector•6d ago•3 comments

Great ideas in theoretical computer science

https://www.cs251.com/
67•sebg•6h ago•13 comments

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

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

FunctionGemma 270M Model

https://blog.google/technology/developers/functiongemma/
176•mariobm•10h ago•48 comments

T5Gemma 2: The next generation of encoder-decoder models

https://blog.google/technology/developers/t5gemma-2/
115•milomg•9h ago•21 comments

The Code That Revolutionized Orbital Simulation [video]

https://www.youtube.com/watch?v=nCg3aXn5F3M
25•surprisetalk•4d ago•2 comments

Firefox will have an option to disable all AI features

https://mastodon.social/@firefoxwebdevs/115740500373677782
326•twapi•10h ago•283 comments

Meta Segment Anything Model Audio

https://ai.meta.com/samaudio/
180•megaman821•2d ago•24 comments

Oliver Sacks put himself into his case studies – what was the cost?

https://www.newyorker.com/magazine/2025/12/15/oliver-sacks-put-himself-into-his-case-studies-what...
31•barry-cotter•8h ago•69 comments

I've been writing ring buffers wrong all these years (2016)

https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/
87•flaghacker•2d ago•32 comments

Delty (YC X25) Is Hiring an ML Engineer

https://www.ycombinator.com/companies/delty/jobs/MDeC49o-machine-learning-engineer
1•lalitkundu•7h ago

Two kinds of vibe coding

https://davidbau.com/archives/2025/12/16/vibe_coding.html
55•jxmorris12•7h ago•48 comments

How to hack Discord, Vercel and more with one easy trick

https://kibty.town/blog/mintlify/
131•todsacerdoti•9h ago•30 comments

Your job is to deliver code you have proven to work

https://simonwillison.net/2025/Dec/18/code-proven-to-work/
683•simonw•14h ago•553 comments

The Scottish Highlands, the Appalachians, Atlas are the same mountain range

https://vividmaps.com/central-pangean-mountains/
113•lifeisstillgood•9h ago•28 comments

Using TypeScript to obtain one of the rarest license plates

https://www.jack.bio/blog/licenseplate
156•lafond•13h ago•158 comments

Show HN: Learning a Language Using Only Words You Know

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

How did IRC ping timeouts end up in a lawsuit?

https://mjg59.dreamwidth.org/73777.html
143•dvaun•1d ago•18 comments

Please just try HTMX

http://pleasejusttryhtmx.com/
486•iNic•14h ago•400 comments