Is it possible to use the RPC's Label feature in it's current state over the deprecated Accounts feature?

0

I'm doing my bachelor project in web development using Bitcoin RPC. At the moment it uses the deprecated accounts feature, but i'd really like to upgrade to using the newer label feature instead. However is it currently useable on the master branch, or should i wait until v0.17 is fully released? (this is unfortunately after my hand-in date), so if that's the case, i guess i have to stick to using accounts?

Sources: https://github.com/bitcoin/bitcoin/pull/7729 https://github.com/bitcoin/bitcoin/pull/12953

Peter Dalby

Posted 2018-05-08T21:51:46.490

Reputation: 5

Answers

1

Yes, you can use the current Labels function as it is now.

Andrew Chow

Posted 2018-05-08T21:51:46.490

Reputation: 40 910

Thank you! Is there anywhere i can view which commands are available in the Labels function in it's current state, without compiling/building from source? It seems like the RPC documentation hasn't been updated yet.Peter Dalby 2018-05-09T06:31:46.170

Seems like these are available: imgur.com/a/hgSaKWS Do you know of anything else that i might have missed? I'll gladly update the RPC documentation with the info, just want to make sure i don't miss anything. :-) I also wonder if we'll see a comeback of the sendfrom function to use labels? Or will sendtoaddress still be recommended?Peter Dalby 2018-05-09T06:56:53.180

Also what about functions such as listtransactions, have they been updated to accept a label as a parameter, instead of an account?Peter Dalby 2018-05-09T08:03:22.193

There are documentation of the changes in https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes-pr12892.md. Please do not update any other RPC documentation until the version is actually released. Using labels is largely the same as using accounts in the past.

Andrew Chow 2018-05-09T16:06:38.570

Thanks again Andrew. Since SendToAddress debits the default user account/label, how are developers supposed to transfer money from registered wallet users account/label to the default one, with the removal of the move command? Are we supposed to SendToAddress to the default account/label, then do another SendToAddress afterwards to the users specified address? Seems a bit silly to have two blockchain transactions. From my understanding move was removed due to accounts not intended to be an accounting system, but a lot of people seemed to get the understanding that it was exactly that...Peter Dalby 2018-05-10T17:27:03.720

When using labels, don't think of them as accounts, and consider accounts to no longer exist. To change a label, use setlabel.Andrew Chow 2018-05-10T17:44:58.700

So i shouldn't assign a "label" to a new registered user, but instead have my own internal accounting system in a database linking addresses to specific users?Peter Dalby 2018-05-10T19:24:36.433

Yes. If you want some sort of accounting system, it has to be external to Bitcoin Core.Andrew Chow 2018-05-10T19:26:51.280

But this is also why i'm confused. What was the original intend behind the Account feature? From all the documentation i've read it seems like it was supposed to work as an accounting system, but it had some issues. I don't understand why Bitcoin shouldn't support an accounting system.Peter Dalby 2018-05-10T19:30:39.773

Note that Bitcoin does not have an accounting system; the accounts system is part of Bitcoin Core and is completely unrelated to Bitcoin itself. The accounting system was introduced in order to allow services to have an accounting system built into Bitcoin Core that they can use directly. It is being removed because it has many issues, causes a lot of user confusion, and is generally unintuitive to use. It also reacts poorly to some types of transactions and continuing to support it makes future changes to the wallet difficult.Andrew Chow 2018-05-10T19:42:09.933

Yeah my bad, i meant Bitcoin Core. So my next concern is why can't these issues be fixed, the user experience be made better, and the feature become more intuitive? It seems like a shame to remove it completely, since it enables developers to map users to specific addresses, without developing a big internal system of accounting. But i suppose this is what the bigger wallets have done nowadays. Unfortunately it's too late for me to switch to an internal accounting system by now, so i'll have to stick to accounts, knowing its weaknesses. Thanks for the answers and your contribution to Bitcoin!Peter Dalby 2018-05-10T19:57:06.607

Also which type of transactions does it react poorly to?Peter Dalby 2018-05-10T20:03:02.580

The accounts system needs to be removed in order to allow future changes to go through. It needs to be completely redesigned in order to keep it and that requires removing it and then building a new one from scratch. Also, the accounts system kind of goes against the goal of Bitcoin Core. It is not meant to be a direct drop in for a service to use solely as their backend (which was the idea at the time accounts were introduced). We are trying to move away from that model, and getting rid of the accounts system helps with that. IIRC accounts does not work too well with malleated transactions.Andrew Chow 2018-05-10T20:05:24.747

You can read https://github.com/bitcoin/bitcoin/issues/3816 for some of the discussion about removing accounts.

Andrew Chow 2018-05-10T20:07:13.240

I actually like the idea that the accounting system is a direct drop in service to use as a backend, since it enables even the newest developers to start experimenting with the blockchain and Bitcoin. I hope that someone decides to take up the task of creating and redesigning an accounting system that works well alongside Bitcoin. It's really unfortunate that the current one does not. When accounts were first introduced in RPC, was satoshi long gone by then, or did he invision opening this up to developers? :-) Again thanks Andrew for taking your time to answer all these questions.Peter Dalby 2018-05-15T08:28:00.787

I'm curious to know more about what made the consescus change regarding that accounts shouldn't be a drop in service for backends, since the original consensus was that it should indeed be a drop in service.Peter Dalby 2018-05-15T08:31:49.680