<!DOCTYPE html><htmllang=""><head><metacharSet="utf-8"/><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><title>bitcoin-s · Bitcoin implementation in Scala</title><metaname="viewport"content="width=device-width, initial-scale=1.0"/><metaname="generator"content="Docusaurus"/><metaname="description"content="Bitcoin implementation in Scala"/><metaproperty="og:title"content="bitcoin-s · Bitcoin implementation in Scala"/><metaproperty="og:type"content="website"/><metaproperty="og:url"content="https://bitcoin-s.org/"/><metaproperty="og:description"content="Bitcoin implementation in Scala"/><metaproperty="og:image"content="https://bitcoin-s.org/img/undraw_online.svg"/><metaname="twitter:card"content="summary"/><metaname="twitter:image"content="https://bitcoin-s.org/img/undraw_tweetstorm.svg"/><linkrel="shortcut icon"href="/img/favicon.ico"/><linkrel="stylesheet"href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><linkrel="stylesheet"href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><script>
</span></div></h2><div><span><p>Bitcoin-S allows you to interact with data structures found in the Bitcoin and Lightning protocols as first-class citizens of your app. Go back and forth between hex, byte and JVM representation trivially, letting our abstractions focus on what you want to build</p>
</span></div></div></div><divclass="blockElement alignCenter fourByGridBlock imageAlignTop"><divclass="blockImage"><imgsrc="/img/undraw_code_review_l1q9.svg"/></div><divclass="blockContent"><h2><div><span><p>Immutable data structures</p>
</span></div></h2><div><span><p>Code with confidence, knowing your data won't change under you. All data structures in Bitcoin-S are immutable. This eliminates a big range of bugs right away, and enable you to write concurrent code much easier</p>
</span></div></div></div><divclass="blockElement alignCenter fourByGridBlock imageAlignTop"><divclass="blockImage"><imgsrc="/img/undraw_mathematics_4otb.svg"/></div><divclass="blockContent"><h2><div><span><p>Algebraic data types</p>
</span></div></h2><div><span><p>Get the compiler to work for you, ensuring your logic covers all cases. Modelling your application with mathematically founded types enables greater confidence in the correctness of your code</p>
</span></div></h2><div><span><p>We provide solid APIs for constructing and signing transactions. From small-scale 1-in 2-out transactions, to custom logic powering exchange withdrawals, we've got you covered. Check out our <ahref="docs/core/txbuilder"><code>TxBuilder</code> example</a> to see how.</p>
</span></div></h2><div><span><p>Use our RPC clients for <code>bitcoind</code>/Bitcoin Core and Eclair, and get powerful static typing baked into your RPC calls. All returned values you get from <code>bitcoind</code> and Eclair are converted into native Bitcoin/Lightning data structures for you. Is that raw hex string you've been passing around a transaction or a Lightning invoice? With Bitcoin-S you get both confidence in your code <em>and</em> powerful methods available on your data</p>
</span></div></h2><div><span><p>Bitcoin-S is used in production today, facilitating transactions and systems handling millions of dollars each day. It has a very high degree of code coverage, with unit tests, property based tests and integration tests.</p>