Bitcoin Forum
May 25, 2024, 03:03:45 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Are there bitcoin command that add or revise account of specific address?  (Read 181 times)
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
April 20, 2018, 07:07:26 AM
 #1

So after make new address with bitcoin-cli getnewaddress,

can I add some account (text value like "testuser1") to that specific address.

and later change it?
starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
April 20, 2018, 08:32:49 AM
Merited by suchmoon (1)
 #2

Even if this feature will soon be deprecated, It is still possible using the setaccount method:

Code:
$ bitcoin-cli help setaccount
setaccount "address" "account"

DEPRECATED. Sets the account associated with the given address.

Arguments:
1. "address"         (string, required) The bitcoin address to be associated with an account.
2. "account"         (string, required) The account to assign the address to.

Examples:
> bitcoin-cli setaccount "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "tabby"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setaccount", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", "tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

Example:

Code:
$ bitcoin-cli getnewaddress "acc1"
35ro3v9uR3xQoBEx8bbQgjB1V3qMSPoSBP

$ bitcoin-cli getaccount "35ro3v9uR3xQoBEx8bbQgjB1V3qMSPoSBP"
acc1

$ bitcoin-cli setaccount "35ro3v9uR3xQoBEx8bbQgjB1V3qMSPoSBP" "acc2"

$ bitcoin-cli getaccount "35ro3v9uR3xQoBEx8bbQgjB1V3qMSPoSBP"
acc2

If you need this kind of feature, I would recommend using your own software handling all this with your custom features.

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
April 22, 2018, 03:55:58 AM
 #3


Code:
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setaccount", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", "tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
If you need this kind of feature, I would recommend using your own software handling all this with your custom features.
Thanks.
What is this curl? How to use and when to use?

And why I need my own software? I feel this is enough for even exchange, isn't it?

starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
April 22, 2018, 04:58:07 AM
 #4

What is this curl? How to use and when to use?

It is part of the help message.

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
Sir mikolo
Newbie
*
Offline Offline

Activity: 85
Merit: 0


View Profile
April 23, 2018, 01:59:36 PM
 #5

tthis is only working when the address was linked to an account? edit: or do i have to complete syncing the chain? atm listaddressgroupings returns an emty array even though I called getnewaddress several times
starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
April 23, 2018, 04:20:25 PM
 #6

tthis is only working when the address was linked to an account? edit: or do i have to complete syncing the chain? atm listaddressgroupings returns an emty array even though I called getnewaddress several times

Quote
$ bitcoin-cli help listaddressgroupings
listaddressgroupings

Lists groups of addresses which have had their common ownership
made public by common use as inputs or as the resulting change
in past transactions

The addresses must be part of inputs of transactions or of change in existing transactions. Creating addresses are not sufficient. You can read more about it on this stackexchange thread:

Quote
As you probably know, when you make a purchase, the bitcoind or bitcoin-qt client (which both use bitcoin-core) return your change by default to a new address. Well, if decide to use that address for another transaction, you have created a chain of "connectable" transactions. If you're not careful, there are various other ways that you can create connected transactions (like always using the same receiving address). However, if you already generate a new address to receive Bitcoins, this isn't a problem.

There are already numerous programs available that have the ability to scan the blockchain and list such connected transaction chains, which are definite proof that the addresses in question are or have been in the same wallet.

listaddressgroupings is a method that allow users to have the same ability to discern which groups of their addresses are connected on the public blockchain. It allows users to use the (relatively) new coin control functionality with greater awareness of potential privacy-revealing issues.

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!