<div dir="ltr"><div>> The RPC interface in Bitcoin Core, and others, is not great for this<br>
> because it exposes a lot of functionality that isn't necessary and<br>
> introduces risks. </div><div><br></div><div>This is actually somewhat my point. If the RPC interface was good for this and <i>didn't</i> introduce risks, we could just use that and be done with it. But I'm finding there are many use cases that you want to have low cost ways to serve peer services to people whom you have given explicit permission, but they shouldn't have full ability to administrate the node.</div><div><br></div><div>Perhaps I wasn't explicit in my previous note but what I mean is that there seems to be a demand for something <i>in between</i> a peer interface, and an owner interface. I have little opinion as to whether this belongs in core or not, I think there are much more experienced folks who can weight in on that, but without something like this, you cannot limit your exposure for serving something like bip157 filters without removing your own ability to make use of some of those same services.</div><div><br></div><div>Keagan<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 8, 2020 at 1:51 PM Braydon Fuller <<a href="mailto:braydon@purse.io">braydon@purse.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5/6/20 9:07 PM, Keagan McClelland wrote:<br>
<br>
> I think that one of the solutions here is to have light clients choose<br>
> their full node tethers explicitly. Even if you think it is unrealistic to<br>
> have everyone run their own node (fwiw, I don’t), there is still a trust<br>
> model where you can pick your trusted source.<br>
><br>
> This way you could have many light clients working off of a family node,<br>
> and the peer services could be limited to some sort of “authenticated”<br>
> peers. Perhaps this is better accomplished over the RPC interface in Core,<br>
> but the idea is to have some sort of peer service model between “full<br>
> public” and “owner only”. This limits the amount of costs that can be<br>
> properly externalized, without exposing risk of consensus capture by<br>
> economically weighty institutions.<br>
<br>
The RPC interface in Bitcoin Core, and others, is not great for this<br>
because it exposes a lot of functionality that isn't necessary and<br>
introduces risks. For example the `gettxoutsetinfo` can start a very<br>
intensive CPU and disk I/O task. There are several others, for example:<br>
`stop`, `addnode`, `clearbanned`, `setban`, and etc. Furthermore reading<br>
full raw blocks isn't very efficient with JSON. Electrum servers (e.g<br>
electrs) for example read blocks from disk instead and use the RPC<br>
interface to sync headers. Though, Electrum servers also have a risk of<br>
DoS with addresses that have many transactions, see the `--txid-limit`<br>
option [2].<br>
<br>
[1]:<br>
<a href="https://github.com/bitcoin/bitcoin/blob/5b24f6084ede92d0f493ff416b4726245140b2c1/src/rpc/blockchain.cpp#L954-L956" rel="noreferrer" target="_blank">https://github.com/bitcoin/bitcoin/blob/5b24f6084ede92d0f493ff416b4726245140b2c1/src/rpc/blockchain.cpp#L954-L956</a><br>
[2]:<br>
<a href="https://github.com/romanz/electrs/blob/f0a7a325af495ecbc152c0866550dc300011779b/src/query.rs#L284-L289" rel="noreferrer" target="_blank">https://github.com/romanz/electrs/blob/f0a7a325af495ecbc152c0866550dc300011779b/src/query.rs#L284-L289</a><br>
<br>
<br>
</blockquote></div>