mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-24 15:02:17 +01:00
31 lines
1.3 KiB
Markdown
31 lines
1.3 KiB
Markdown
---
|
|
id: rpc-clients-intro
|
|
title: Introduction
|
|
---
|
|
|
|
When working with Bitcoin applications, a common task to
|
|
accomplish is connecting to a service like Bitcoin Core,
|
|
and use that for tasks like generating addresses,
|
|
verifying payments and
|
|
monitoring the blockchain. This typically happens through
|
|
tools like `bitcoin-cli`, or the Bitcoin Core HTTP RPC
|
|
server interface. One big drawback to this, is that you
|
|
lose all type-safety in your application. Even if you
|
|
have a custom type that represents a Bitcoin transaction,
|
|
how do you get that to play nicely with the result that
|
|
Bitcoin Core gives you after signing a transaction? A
|
|
random hexadecimal string in a HTTP response could be
|
|
anything from a public key, a transaction or a block
|
|
header.
|
|
|
|
We've done all the mundane work of wiring requests and
|
|
responses from Bitcoin Core to the powerful and safe types
|
|
found in Bitcoin-S. We've also written a bunch of tests,
|
|
that verify that all of this actually work.
|
|
You'll know for sure that you're sending
|
|
a valid public key to `importmulti`, and you when doing
|
|
RPC calls like `getblockheader` we'll even parse the
|
|
hexadecimal string into a complete header that you can
|
|
interact with without goofing around with bits and bytes.
|
|
|
|
We currently have RPC clients for Bitcoin Core and Eclair.
|