Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitcoin RPC not compatible with JSON-RPC 1.0 #252

Open
vdoflip opened this issue Jul 28, 2023 · 8 comments
Open

Bitcoin RPC not compatible with JSON-RPC 1.0 #252

vdoflip opened this issue Jul 28, 2023 · 8 comments

Comments

@vdoflip
Copy link

vdoflip commented Jul 28, 2023

When calling Bitcoin RPC requests with 1.0 version, an error is returned:

> curl   -d '{"jsonrpc": "1.0",  "method":"getblockchaininfo","params":[],"id":1}' https://rpc-testnet.mydomain.xyz
/btc                                                   
{"jsonrpc":"2.0","id":1,"error":{"code":-32600,"message":"Unsupported JSON RPC version: 1.0"}}

This is problematic because many Bitcoin applications and protocols still use version 1.0 for legacy and compatibility reasons.
There should be an exception for Bitcoin upstreams, or an option to disable the check.

@splix
Copy link
Member

splix commented Jul 28, 2023

Oh, that's very unexpected. Do you have any numbers/stats/etc to find out how many outdated bitcoin nodes are here? To figure out if that makes sense to fix or better to wait until they upgrade

@vdoflip
Copy link
Author

vdoflip commented Jul 31, 2023

I don't have any numbers but I would expect a relatively high % of applications (not nodes) still using the 1.0 version of jsonrpc requests, even if the nodes are up to date.

To be clear, this is not an issue connecting to Bitcoin nodes (that works) it's an issue with clients connecting to Dshackle's endpoint.

@vdoflip
Copy link
Author

vdoflip commented Jul 31, 2023

The official RPC reference documentation still uses 1.0:

https://developer.bitcoin.org/reference/rpc/getbestblockhash.html

@splix
Copy link
Member

splix commented Jul 31, 2023

If that's the clients, what could possible prevent them from using the version 2.0? I mean, that's their intentional decision not a limitation of something, and they can use in the requests any version they wish. I guess it's not something that should be fixed on Dshackle side, b/c the same client may choose which version they want to use.

@vdoflip
Copy link
Author

vdoflip commented Jul 31, 2023

Full 2.0 support in Bitcoin is WIP ATM. In my opinion 1.0 should be supported in dshackle until it's deprecated:
bitcoin/bitcoin#27101

@splix
Copy link
Member

splix commented Jul 31, 2023

That would be a bit strange to support. I mean if everything works with v2.0, and for a client it's just a matter of decision, why wait for a deprecation which could never happen. "No deprecated" is not the same as "recommended".

@vdoflip
Copy link
Author

vdoflip commented Aug 1, 2023

Everything except projects that assume Bitcoin to be 1.0 and use it for legacy/compat reasons.
This makes dshackle more restrictive than the RPCs that it supports, just limited by a single line of code.

I will fork then, since I have no control over the clients I'm going to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants