Some RPC commands like listunspent talks about "unsafe" funds and others like getbalances about "untrust" If there isn't diff between them would be good rename it with an unique name
-
mrbianchi commented at 3:02 PM on April 13, 2020: none
- mrbianchi added the label Bug on Apr 13, 2020
-
kouloumos commented at 4:59 PM on August 2, 2022: contributor
Although the definition of an untrusted UTXO and an unsafe UTXO is the same, it seems that the context in which they are used is different thus different wording might make sense.
There is a relevant discussion in #9830, where "safe" was chosen over "trust". Maybe that discussion just didn't happen on the introduction of the other RPC commands and the internal name was used instead.
Still, If changing keys of RPC results is not considered a breaking change, it might make sense to change everything to "safe".
References in the codebase
- RPC commands using "safe/unsafe"
listunspenthttps://github.com/bitcoin/bitcoin/blob/0043ec4e1310e860150e5789064789377e5a6273/src/wallet/rpc/coins.cpp#L514-L515fundrawtransactionhttps://github.com/bitcoin/bitcoin/blob/0043ec4e1310e860150e5789064789377e5a6273/src/wallet/rpc/spend.cpp#L745-L747sendhttps://github.com/bitcoin/bitcoin/blob/0043ec4e1310e860150e5789064789377e5a6273/src/wallet/rpc/spend.cpp#L1141walletcreatefundedpsbthttps://github.com/bitcoin/bitcoin/blob/0043ec4e1310e860150e5789064789377e5a6273/src/wallet/rpc/spend.cpp#L1582
- RPC commands using "trusted/untrusted"
getbalanceshttps://github.com/bitcoin/bitcoin/blob/0043ec4e1310e860150e5789064789377e5a6273/src/wallet/rpc/coins.cpp#L443-L444listtransactions,listsinceblock,gettransactionhttps://github.com/bitcoin/bitcoin/blob/0043ec4e1310e860150e5789064789377e5a6273/src/wallet/rpc/transactions.cpp#L401-L402
- RPC commands using "safe/unsafe"
-
willcl-ark commented at 9:01 PM on March 13, 2023: member
I think a breaking change to the RPC argument keys, seeing as we accept named arguments via rpc, would likely not be considered worth it just to harmonise vocabulary. @achow101 I'd be curious of your thoughts here? If we aren't going to change this then perhaps we can close the issue.
-
ryanofsky commented at 12:54 PM on March 14, 2023: contributor
If we aren't going to change this then perhaps we can close the issue.
Even if not going to change RPC return values, information here shouldn't go to waste. It would be good to keep this open until:
1-Inconsistent names are fixed in the C++ code that this references 2-RPC documentation calls out fields with inconsistent names
Also, it should not be a breaking change to rename RPC parameters, because it is easy to add aliases for old names. But it would be a breaking change to rename RPC return values, so that would probably not be worth doing.
-
willcl-ark commented at 2:16 PM on October 21, 2025: member
This issue hasn’t attracted much interest from other contributors in quite some time.
Given that, it doesn’t seem important enough to keep open indefinitely. I’m going to close it for now due to lack of activity, but pull requests or renewed discussion are always welcome.
Comment here if you think this should be re-opened.
- willcl-ark closed this on Oct 21, 2025