forked from domob1812/namecoin-core
-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Labels
Description
The Namecoin Core RPC API for name operations has a bunch of inconsistencies with what Bitcoin Core does. Some of these inconsistencies are due to Vince doing weird things, others are due to Namecoin Core adding some features before Bitcoin Core did so. Other parts of the API are confusing for historical reasons (though not specifically in conflict with Bitcoin Core).
Some notable examples of API issues:
- "Method naming: use consecutive lower-case names such as
getrawtransactionandsubmitblock."name_checkdb,name_firstupdate,name_history,name_list,name_new,name_pending,name_scan,name_show, andname_updatedon't follow this.
- Method naming: Bitcoin Core RPC methods tend to be named in imperative form, e.g.
abandontransaction.- I don't see any formal guideline in Bitcoin Core's developer notes for this, maybe we should ask them to document it?
- The
name_methods don't follow this. - Suggested new names:
registername(registration and pre-registration are more intuitive than firstupdate and new),getnamehistory(consistent withgetmempoolancestors),listnames(consistent withlisttransactions),preregistername(ibid),getmempoolname(consistent withgetmempoolentry),scannameset(consistent withscantxoutset),getname(consistent withgetrawtransaction/gettransaction), andupdatename.
- "Argument and field naming: ... use snake case
fee_delta(and not, e.g.feedeltaor camel casefeeDelta)."allowExisting,allowExpired,byHash,destAddress,minConf,maxConf,nameEncoding,sendCoins, andvalueEncodingdon't follow this.
- Bitcoin Core supports name-based arguments now.
optionsdoes the same thing, but worse.
- "Try to make the RPC response a JSON object."
name_checkdb,name_firstupdate,name_history,name_list,name_new,name_pending,name_scan,name_update, andqueuerawtransactiondon't follow this.
randargument- Should be renamed to
salt, since this value is typically not random anymore.
- Should be renamed to
allowExistingvsallow_activeallow_activeis probably more precise.
txargument- Should be renamed to
txid, sincetxcould be confused withrawtx
- Should be renamed to
Would there be any objections to updating the API to fix these issues (leaving the existing API methods in place to avoid disrupting consumers of the current API)?
Reactions are currently unavailable