Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
accb1c5
Support data outputs in transaction construction.
evoskuil Aug 19, 2026
a9f1742
Implement psbt methods over wallet::psbt.
evoskuil Aug 19, 2026
0fa26f5
Add scriptPubKey to validateaddress.
evoskuil Aug 19, 2026
4028164
Add size_on_disk to getblockchaininfo.
evoskuil Aug 19, 2026
f0403ae
Add iswitness hint to decoderawtransaction.
evoskuil Aug 19, 2026
1b8a407
Add descriptor and segwit forms to decodescript.
evoskuil Aug 19, 2026
4899fe3
Add getblock verbosity 3 (prevout context).
evoskuil Aug 19, 2026
37fbc60
Compute getnetworkhashps over the nblocks window.
evoskuil Aug 19, 2026
47e03aa
Fill out getnetworkinfo services and network detail.
evoskuil Aug 19, 2026
f08b305
Update wip method list for psbt implementations.
evoskuil Aug 23, 2026
ab5be82
Implement waitforblock, waitforblockheight, waitfornewblock.
evoskuil Aug 23, 2026
d36b3ab
Implement submitblock and submitheader.
evoskuil Aug 23, 2026
d5907ad
Implement getnodeaddresses, getaddrmaninfo, ping, setnetworkactive.
evoskuil Aug 23, 2026
4c75816
Implement addnode add and onetry.
evoskuil Aug 23, 2026
068ebb1
Implement deriveaddresses and getdescriptorinfo.
evoskuil Aug 23, 2026
348435e
Serve per-method usage from help.
evoskuil Aug 23, 2026
ab048d4
Implement scanblocks over neutrino filters.
evoskuil Aug 23, 2026
71c22aa
Implement getdescriptoractivity.
evoskuil Aug 23, 2026
202ebea
Implement getopenrpcinfo from interface metadata.
evoskuil Aug 23, 2026
ef2b445
Infer decodescript descriptors from script patterns.
evoskuil Aug 23, 2026
361f0e3
Use "embedded" script terminology.
evoskuil Aug 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/bitcoin/server/interfaces/bitcoind_blockchain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ struct bitcoind_blockchain_methods
method<"getchainstates">{},
method<"getchaintips">{},
method<"getdeploymentinfo", optional<""_t>>{ "blockhash" },
method<"getdescriptoractivity">{ unimplemented },
method<"getdescriptoractivity", optional<empty::array>, optional<empty::array>, optional<false>>{ "blockhashes", "scanobjects", "include_spent" },
method<"getdifficulty">{},
method<"preciousblock">{ unimplemented },
method<"scanblocks">{ unimplemented },
method<"waitforblock">{ unimplemented },
method<"waitforblockheight">{ unimplemented },
method<"waitfornewblock">{ unimplemented },
method<"scanblocks", string_t, optional<empty::array>, optional<0.0>, optional<-1.0>, optional<"basic"_t>>{ "action", "scanobjects", "start_height", "stop_height", "filtertype" },
method<"waitforblock", string_t, optional<0.0>>{ "blockhash", "timeout" },
method<"waitforblockheight", number_t, optional<0.0>>{ "height", "timeout" },
method<"waitfornewblock", optional<0.0>>{ "timeout" },
method<"getmempoolancestors">{ unimplemented },
method<"getmempoolcluster">{ unimplemented },
method<"getmempooldescendants">{ unimplemented },
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/server/interfaces/bitcoind_control.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct bitcoind_control_methods
method<"help", optional<""_t>>{ "command" },
method<"stop">{ unimplemented },
method<"getmemoryinfo", optional<"stats"_t>>{ "mode" },
method<"getopenrpcinfo">{ unimplemented },
method<"getopenrpcinfo">{},
method<"getrpcinfo">{},
method<"logging", optional<empty::array>, optional<empty::array>>{ "include", "exclude" },
method<"uptime">{}
Expand Down
4 changes: 2 additions & 2 deletions include/bitcoin/server/interfaces/bitcoind_mining.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ struct bitcoind_mining_methods
{
method<"getnetworkhashps", optional<120.0>, optional<-1.0>>{ "nblocks", "height" },
method<"getmininginfo">{},
method<"submitblock">{ unimplemented },
method<"submitheader">{ unimplemented },
method<"submitblock", string_t, optional<""_t>>{ "hexdata", "dummy" },
method<"submitheader", string_t>{ "hexdata" },
method<"getblocktemplate">{ unimplemented },
method<"getprioritisedtransactions">{ unimplemented },
method<"prioritisetransaction">{ unimplemented }
Expand Down
10 changes: 5 additions & 5 deletions include/bitcoin/server/interfaces/bitcoind_network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ struct bitcoind_network_methods
method<"clearbanned">{ unimplemented },
method<"listbanned">{ unimplemented },
method<"setban">{ unimplemented },
method<"addnode">{ unimplemented },
method<"addnode", string_t, string_t, optional<false>>{ "node", "command", "v2transport" },
method<"disconnectnode">{ unimplemented },
method<"exportasmap">{ unimplemented },
method<"getaddednodeinfo">{ unimplemented },
method<"getaddrmaninfo">{ unimplemented },
method<"getaddrmaninfo">{},
method<"getconnectioncount">{},
method<"getnettotals">{},
method<"getnodeaddresses">{ unimplemented },
method<"getnodeaddresses", optional<1.0>, optional<""_t>>{ "count", "network" },
method<"getpeerinfo">{ unimplemented },
method<"ping">{ unimplemented },
method<"setnetworkactive">{ unimplemented }
method<"ping">{},
method<"setnetworkactive", boolean_t>{ "state" }
};

template <typename... Args>
Expand Down
18 changes: 9 additions & 9 deletions include/bitcoin/server/interfaces/bitcoind_transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ struct bitcoind_transaction_methods
static constexpr std::tuple methods
{
method<"createrawtransaction", array_t, object_t, optional<0.0>, optional<false>>{ "inputs", "outputs", "locktime", "replaceable" },
method<"decoderawtransaction", string_t>{ "hexstring" },
method<"decoderawtransaction", string_t, nullable<boolean_t>>{ "hexstring", "iswitness" },
method<"getrawtransaction", string_t, optional<0.0>, optional<""_t>>{ "txid", "verbosity", "blockhash" },
method<"sendrawtransaction", string_t, optional<0.0>>{ "hexstring", "maxfeerate" },
method<"testmempoolaccept", array_t, optional<0.0>>{ "rawtxs", "maxfeerate" },
method<"analyzepsbt">{ unimplemented },
method<"combinepsbt">{ unimplemented },
method<"converttopsbt">{ unimplemented },
method<"createpsbt">{ unimplemented },
method<"decodepsbt">{ unimplemented },
method<"finalizepsbt">{ unimplemented },
method<"joinpsbts">{ unimplemented },
method<"analyzepsbt", string_t>{ "psbt" },
method<"combinepsbt", array_t>{ "txs" },
method<"converttopsbt", string_t, optional<false>, nullable<boolean_t>>{ "hexstring", "permitsigdata", "iswitness" },
method<"createpsbt", array_t, object_t, optional<0.0>, optional<false>>{ "inputs", "outputs", "locktime", "replaceable" },
method<"decodepsbt", string_t>{ "psbt" },
method<"finalizepsbt", string_t, optional<true>>{ "psbt", "extract" },
method<"joinpsbts", array_t>{ "txs" },
method<"descriptorprocesspsbt">{ unimplemented },
method<"utxoupdatepsbt">{ unimplemented },
method<"utxoupdatepsbt", string_t, optional<empty::array>>{ "psbt", "descriptors" },
method<"abortprivatebroadcast">{ unimplemented },
method<"getprivatebroadcastinfo">{ unimplemented },
method<"submitpackage">{ unimplemented }
Expand Down
4 changes: 2 additions & 2 deletions include/bitcoin/server/interfaces/bitcoind_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ struct bitcoind_utility_methods
method<"decodescript", string_t>{ "hex" },
method<"validateaddress", string_t>{ "address" },
method<"createmultisig", number_t, array_t, optional<"legacy"_t>>{ "nrequired", "keys", "address_type" },
method<"deriveaddresses">{ unimplemented },
method<"getdescriptorinfo">{ unimplemented },
method<"deriveaddresses", string_t, nullable<value_t>>{ "descriptor", "range" },
method<"getdescriptorinfo", string_t>{ "descriptor" },
method<"verifymessage", string_t, string_t, string_t>{ "address", "signature", "message" },
method<"getindexinfo", optional<""_t>>{ "index_name" },
method<"estimatesmartfee">{ unimplemented }
Expand Down
3 changes: 3 additions & 0 deletions include/bitcoin/server/protocols/protocol_bitcoind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ class BCS_API protocol_bitcoind
const system::chain::header& header) NOEXCEPT;
static void inject_tx_context(boost::json::object& out,
const node::query& query, const database::tx_link& link) NOEXCEPT;
static void inject_tx_prevouts(boost::json::object& out,
const node::query& query,
const system::chain::transaction& tx) NOEXCEPT;
static boost::json::object header_to_bitcoind(
const system::chain::header& header) NOEXCEPT;
static std::string chain_name(const node::query& query) NOEXCEPT;
Expand Down
41 changes: 35 additions & 6 deletions include/bitcoin/server/protocols/protocol_bitcoind_blockchain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ class BCS_API protocol_bitcoind_blockchain
const network::channel::ptr& channel,
const options_t& options) NOEXCEPT
: protocol_bitcoind_dispatch<rpc_interface>(session, channel, options),
network::tracker<protocol_bitcoind_blockchain>(session->log)
network::tracker<protocol_bitcoind_blockchain>(session->log),
wait_timer_(std::make_shared<network::deadline>(session->log,
channel->strand()))
{
}

void start() NOEXCEPT override;
void stopping(const code& ec) NOEXCEPT override;

protected:
/// Handlers.
Expand Down Expand Up @@ -109,19 +112,26 @@ class BCS_API protocol_bitcoind_blockchain
rpc_interface::get_deployment_info,
const std::string& blockhash) NOEXCEPT;
bool handle_get_descriptor_activity(const code& ec,
rpc_interface::get_descriptor_activity) NOEXCEPT;
rpc_interface::get_descriptor_activity,
const network::rpc::array_t& blockhashes,
const network::rpc::array_t& scanobjects,
bool include_spent) NOEXCEPT;
bool handle_get_difficulty(const code& ec,
rpc_interface::get_difficulty) NOEXCEPT;
bool handle_precious_block(const code& ec,
rpc_interface::precious_block) NOEXCEPT;
bool handle_scan_blocks(const code& ec,
rpc_interface::scan_blocks) NOEXCEPT;
rpc_interface::scan_blocks, const std::string& action,
const network::rpc::array_t& scanobjects, double start_height,
double stop_height, const std::string& filtertype) NOEXCEPT;
bool handle_wait_for_block(const code& ec,
rpc_interface::wait_for_block) NOEXCEPT;
rpc_interface::wait_for_block, const std::string& blockhash,
double timeout) NOEXCEPT;
bool handle_wait_for_block_height(const code& ec,
rpc_interface::wait_for_block_height) NOEXCEPT;
rpc_interface::wait_for_block_height, double height,
double timeout) NOEXCEPT;
bool handle_wait_for_new_block(const code& ec,
rpc_interface::wait_for_new_block) NOEXCEPT;
rpc_interface::wait_for_new_block, double timeout) NOEXCEPT;
bool handle_get_mempool_ancestors(const code& ec,
rpc_interface::get_mempool_ancestors) NOEXCEPT;
bool handle_get_mempool_cluster(const code& ec,
Expand All @@ -138,6 +148,25 @@ class BCS_API protocol_bitcoind_blockchain
rpc_interface::get_tx_spending_prevout) NOEXCEPT;
bool handle_import_mempool(const code& ec,
rpc_interface::import_mempool) NOEXCEPT;

/// Chase events (block wait long polling).
bool handle_chase(const code& ec, node::chase event_,
node::event_value value) NOEXCEPT;

private:
enum class wait : uint8_t { none, new_block, block, height };

void arm_wait(double timeout) NOEXCEPT;
void do_wait_event() NOEXCEPT;
void handle_wait_timeout(const code& ec) NOEXCEPT;
bool wait_done() const NOEXCEPT;
void send_tip() NOEXCEPT;

// These are protected by strand.
wait wait_{ wait::none };
size_t wait_height_{};
system::hash_digest wait_hash_{};
network::deadline::ptr wait_timer_;
};

} // namespace server
Expand Down
12 changes: 10 additions & 2 deletions include/bitcoin/server/protocols/protocol_bitcoind_mining.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,23 @@ class BCS_API protocol_bitcoind_mining
bool handle_get_mining_info(const code& ec,
rpc_interface::get_mining_info) NOEXCEPT;
bool handle_submit_block(const code& ec,
rpc_interface::submit_block) NOEXCEPT;
rpc_interface::submit_block, const std::string& hexdata,
const std::string& dummy) NOEXCEPT;
bool handle_submit_header(const code& ec,
rpc_interface::submit_header) NOEXCEPT;
rpc_interface::submit_header, const std::string& hexdata) NOEXCEPT;
bool handle_get_block_template(const code& ec,
rpc_interface::get_block_template) NOEXCEPT;
bool handle_get_prioritised_transactions(const code& ec,
rpc_interface::get_prioritised_transactions) NOEXCEPT;
bool handle_prioritise_transaction(const code& ec,
rpc_interface::prioritise_transaction) NOEXCEPT;

private:
/// Organize completions (bounced to the channel strand).
void handle_organize_block(const code& ec, size_t height) NOEXCEPT;
void handle_organize_header(const code& ec, size_t height) NOEXCEPT;
void do_submit_block(const code& ec) NOEXCEPT;
void do_submit_header(const code& ec) NOEXCEPT;
};

} // namespace server
Expand Down
30 changes: 23 additions & 7 deletions include/bitcoin/server/protocols/protocol_bitcoind_network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class BCS_API protocol_bitcoind_network
bool handle_set_ban(const code& ec,
rpc_interface::set_ban) NOEXCEPT;
bool handle_add_node(const code& ec,
rpc_interface::add_node) NOEXCEPT;
rpc_interface::add_node, const std::string& node,
const std::string& command, bool v2transport) NOEXCEPT;
bool handle_disconnect_node(const code& ec,
rpc_interface::disconnect_node) NOEXCEPT;
bool handle_export_asmap(const code& ec,
Expand All @@ -73,18 +74,33 @@ class BCS_API protocol_bitcoind_network
rpc_interface::get_added_node_info) NOEXCEPT;
bool handle_get_addrman_info(const code& ec,
rpc_interface::get_addrman_info) NOEXCEPT;
bool handle_get_node_addresses(const code& ec,
rpc_interface::get_node_addresses, double count,
const std::string& network) NOEXCEPT;
bool handle_ping(const code& ec, rpc_interface::ping) NOEXCEPT;
bool handle_set_network_active(const code& ec,
rpc_interface::set_network_active, bool state) NOEXCEPT;
bool handle_get_connection_count(const code& ec,
rpc_interface::get_connection_count) NOEXCEPT;
bool handle_get_net_totals(const code& ec,
rpc_interface::get_net_totals) NOEXCEPT;
bool handle_get_node_addresses(const code& ec,
rpc_interface::get_node_addresses) NOEXCEPT;
bool handle_get_peer_info(const code& ec,
rpc_interface::get_peer_info) NOEXCEPT;
bool handle_ping(const code& ec,
rpc_interface::ping) NOEXCEPT;
bool handle_set_network_active(const code& ec,
rpc_interface::set_network_active) NOEXCEPT;

private:
/// Address fetch completions (bounced to the channel strand).
void handle_fetch_nodes(const code& ec,
const network::address_cptr& message) NOEXCEPT;
void handle_fetch_info(const code& ec,
const network::address_cptr& message) NOEXCEPT;
void do_send_nodes(const code& ec,
const network::address_cptr& message) NOEXCEPT;
void do_send_info(const code& ec,
const network::address_cptr& message) NOEXCEPT;

// These are protected by strand.
size_t node_count_{};
std::string node_network_{};
};

} // namespace server
Expand Down
33 changes: 23 additions & 10 deletions include/bitcoin/server/protocols/protocol_bitcoind_transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class BCS_API protocol_bitcoind_transaction
const network::rpc::object_t& outputs, double locktime,
bool replaceable) NOEXCEPT;
bool handle_decode_raw_transaction(const code& ec,
rpc_interface::decode_raw_transaction,
const std::string& hexstring) NOEXCEPT;
rpc_interface::decode_raw_transaction, const std::string& hexstring,
const std::optional<bool>& iswitness) NOEXCEPT;
bool handle_get_raw_transaction(const code& ec,
rpc_interface::get_raw_transaction, const std::string& txid,
double verbose, const std::string& blockhash) NOEXCEPT;
Expand All @@ -73,23 +73,36 @@ class BCS_API protocol_bitcoind_transaction
rpc_interface::test_mempool_accept,
const network::rpc::array_t& rawtxs, double maxfeerate) NOEXCEPT;
bool handle_analyze_psbt(const code& ec,
rpc_interface::analyze_psbt) NOEXCEPT;
rpc_interface::analyze_psbt, const std::string& psbt) NOEXCEPT;
bool handle_combine_psbt(const code& ec,
rpc_interface::combine_psbt) NOEXCEPT;
rpc_interface::combine_psbt,
const network::rpc::array_t& txs) NOEXCEPT;
bool handle_convert_to_psbt(const code& ec,
rpc_interface::convert_to_psbt) NOEXCEPT;
rpc_interface::convert_to_psbt, const std::string& hexstring,
bool permitsigdata, const std::optional<bool>& iswitness) NOEXCEPT;
bool handle_create_psbt(const code& ec,
rpc_interface::create_psbt) NOEXCEPT;
rpc_interface::create_psbt, const network::rpc::array_t& inputs,
const network::rpc::object_t& outputs, double locktime,
bool replaceable) NOEXCEPT;
bool handle_decode_psbt(const code& ec,
rpc_interface::decode_psbt) NOEXCEPT;
rpc_interface::decode_psbt, const std::string& psbt) NOEXCEPT;
bool handle_finalize_psbt(const code& ec,
rpc_interface::finalize_psbt) NOEXCEPT;
rpc_interface::finalize_psbt, const std::string& psbt,
bool extract) NOEXCEPT;
bool handle_join_psbts(const code& ec,
rpc_interface::join_psbts) NOEXCEPT;
rpc_interface::join_psbts,
const network::rpc::array_t& txs) NOEXCEPT;
bool handle_descriptor_process_psbt(const code& ec,
rpc_interface::descriptor_process_psbt) NOEXCEPT;
bool handle_utxo_update_psbt(const code& ec,
rpc_interface::utxo_update_psbt) NOEXCEPT;
rpc_interface::utxo_update_psbt, const std::string& psbt,
const network::rpc::array_t& descriptors) NOEXCEPT;

/// Shared transaction construction (createrawtransaction, createpsbt).
code build_transaction(system::chain::transaction& out,
const network::rpc::array_t& inputs,
const network::rpc::object_t& outputs, double locktime,
bool replaceable) const NOEXCEPT;
bool handle_abort_private_broadcast(const code& ec,
rpc_interface::abort_private_broadcast) NOEXCEPT;
bool handle_get_private_broadcast_info(const code& ec,
Expand Down
10 changes: 8 additions & 2 deletions include/bitcoin/server/protocols/protocol_bitcoind_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,22 @@ class BCS_API protocol_bitcoind_utility
const network::rpc::array_t& keys,
const std::string& address_type) NOEXCEPT;
bool handle_derive_addresses(const code& ec,
rpc_interface::derive_addresses) NOEXCEPT;
rpc_interface::derive_addresses, const std::string& expression,
const std::optional<network::rpc::value_t>& range) NOEXCEPT;
bool handle_get_descriptor_info(const code& ec,
rpc_interface::get_descriptor_info) NOEXCEPT;
rpc_interface::get_descriptor_info,
const std::string& expression) NOEXCEPT;
bool handle_verify_message(const code& ec,
rpc_interface::verify_message, const std::string& address,
const std::string& signature, const std::string& message) NOEXCEPT;
bool handle_get_index_info(const code& ec,
rpc_interface::get_index_info, const std::string& index_name) NOEXCEPT;
bool handle_estimate_smart_fee(const code& ec,
rpc_interface::estimate_smart_fee) NOEXCEPT;

/// The address of a singular output script (empty if unaddressable).
std::string to_address(
const system::chain::script& script) const NOEXCEPT;
};

} // namespace server
Expand Down
Loading
Loading