Bitcoin Forum
May 06, 2024, 01:09:49 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: RPC question  (Read 313 times)
dkb (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 3


View Profile
November 10, 2017, 06:39:45 AM
 #1

Hello,
I want to make a platform for a coin and have already the wallet for it and it connected to my website (with rpc).
I would like users to enter their private keys and then be able to send and receive money.
When they do it, I would use the "importprivkey <key>" command.
But with that command, their address/coins also would be saved in my wallet.
How can I remove their address after it from my wallet?
Also what's the difference between accounts and addresses in the wallet (it's in the wallet under "debug window" -> command "help")?

Last question: Is there a developer channel like slack channel or telegram group where I could get help from?

Thank you for answers!
1714957789
Hero Member
*
Offline Offline

Posts: 1714957789

View Profile Personal Message (Offline)

Ignore
1714957789
Reply with quote  #2

1714957789
Report to moderator
1714957789
Hero Member
*
Offline Offline

Posts: 1714957789

View Profile Personal Message (Offline)

Ignore
1714957789
Reply with quote  #2

1714957789
Report to moderator
1714957789
Hero Member
*
Offline Offline

Posts: 1714957789

View Profile Personal Message (Offline)

Ignore
1714957789
Reply with quote  #2

1714957789
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
November 10, 2017, 06:44:43 AM
 #2

Hello,
I want to make a platform for a coin and have already the wallet for it and it connected to my website (with rpc).
I would like users to enter their private keys and then be able to send and receive money.
When they do it, I would use the "importprivkey <key>" command.
But with that command, their address/coins also would be saved in my wallet.
How can I remove their address after it from my wallet?
Also what's the difference between accounts and addresses in the wallet (it's in the wallet under "debug window" -> command "help")?

Last question: Is there a developer channel like slack channel or telegram group where I could get help from?

Thank you for answers!

I don't think there is a way to delete private keys using the standard json-rpc commands... At least, i have never read about such a feature.
You used to be able to shut down your daemon, edit your wallet.dat with pywallet and then restart the deamon, but i haven't run pywallet in a long time, i have no idear if it would still work, but even if it did it wouldn't solve your problem.
Also, do realise that when you import a private key, the standard bitcoin daemon will need to rescan the blockchain in order to calculate the balance, unless you run a patched daemon like bitcore and enable all those indexes.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
dkb (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 3


View Profile
November 10, 2017, 08:04:40 AM
 #3

Hello,
I want to make a platform for a coin and have already the wallet for it and it connected to my website (with rpc).
I would like users to enter their private keys and then be able to send and receive money.
When they do it, I would use the "importprivkey <key>" command.
But with that command, their address/coins also would be saved in my wallet.
How can I remove their address after it from my wallet?
Also what's the difference between accounts and addresses in the wallet (it's in the wallet under "debug window" -> command "help")?

Last question: Is there a developer channel like slack channel or telegram group where I could get help from?

Thank you for answers!

I don't think there is a way to delete private keys using the standard json-rpc commands... At least, i have never read about such a feature.
You used to be able to shut down your daemon, edit your wallet.dat with pywallet and then restart the deamon, but i haven't run pywallet in a long time, i have no idear if it would still work, but even if it did it wouldn't solve your problem.
Also, do realise that when you import a private key, the standard bitcoin daemon will need to rescan the blockchain in order to calculate the balance, unless you run a patched daemon like bitcore and enable all those indexes.
Thank you!
Is there a way to run the user input only one time? For example, when you go to MyEtherWallet and enter your Privatekey, it shows your balance etc. for one time. But when you reload the page, it's gone. I don't think that they save my privatekey anywhere (except in a local cookie). How could I do this the same?
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
November 10, 2017, 08:47:24 AM
Merited by ABCbits (2)
 #4

Hello,
I want to make a platform for a coin and have already the wallet for it and it connected to my website (with rpc).
I would like users to enter their private keys and then be able to send and receive money.
When they do it, I would use the "importprivkey <key>" command.
But with that command, their address/coins also would be saved in my wallet.
How can I remove their address after it from my wallet?
Also what's the difference between accounts and addresses in the wallet (it's in the wallet under "debug window" -> command "help")?

Last question: Is there a developer channel like slack channel or telegram group where I could get help from?

Thank you for answers!

I don't think there is a way to delete private keys using the standard json-rpc commands... At least, i have never read about such a feature.
You used to be able to shut down your daemon, edit your wallet.dat with pywallet and then restart the deamon, but i haven't run pywallet in a long time, i have no idear if it would still work, but even if it did it wouldn't solve your problem.
Also, do realise that when you import a private key, the standard bitcoin daemon will need to rescan the blockchain in order to calculate the balance, unless you run a patched daemon like bitcore and enable all those indexes.



Thank you!
Is there a way to run the user input only one time? For example, when you go to MyEtherWallet and enter your Privatekey, it shows your balance etc. for one time. But when you reload the page, it's gone. I don't think that they save my privatekey anywhere (except in a local cookie). How could I do this the same?

you can run a patched bitcoin core that has an address index and transaction index option that can be set in bitcoin.conf

For example,
https://github.com/bitpay/bitcore-node/

IIRC, it's forked from core 0.12, which is outdated, but should still be usable.

If you run this version, you should be able to set following parameters in your bitcoin.conf:
txindex=1
addressindex=1
timestampindex=1
spentindex=1

If you have these indexes, you should be able to immediately see address's balances without the need for reindexing.
With these options activated, you should also be able to create raw, unsigned transactions using any unspent output(s) from the UTXO set, then in a second step use the private key to sign them without having to import the private key, and in a thirth step broadcast the signed transactions. Working this way should let you run your service without importing any private keys into your wallet, so you wouldn't have to clean up your wallet afterwards.

Sidenote: i haven't tested these steps out lately, this comes purely from memory... It's always possible i made a mistake, or forgot some steps! I'd advise you to test this out on the test network, whose blockchain is a lot smaller, and a tBTC has no monetary value, which is also a big plus when you're fooling around with json-rpc querys

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
dkb (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 3


View Profile
November 10, 2017, 11:11:24 AM
 #5

Hello,
I want to make a platform for a coin and have already the wallet for it and it connected to my website (with rpc).
I would like users to enter their private keys and then be able to send and receive money.
When they do it, I would use the "importprivkey <key>" command.
But with that command, their address/coins also would be saved in my wallet.
How can I remove their address after it from my wallet?
Also what's the difference between accounts and addresses in the wallet (it's in the wallet under "debug window" -> command "help")?

Last question: Is there a developer channel like slack channel or telegram group where I could get help from?

Thank you for answers!

I don't think there is a way to delete private keys using the standard json-rpc commands... At least, i have never read about such a feature.
You used to be able to shut down your daemon, edit your wallet.dat with pywallet and then restart the deamon, but i haven't run pywallet in a long time, i have no idear if it would still work, but even if it did it wouldn't solve your problem.
Also, do realise that when you import a private key, the standard bitcoin daemon will need to rescan the blockchain in order to calculate the balance, unless you run a patched daemon like bitcore and enable all those indexes.



Thank you!
Is there a way to run the user input only one time? For example, when you go to MyEtherWallet and enter your Privatekey, it shows your balance etc. for one time. But when you reload the page, it's gone. I don't think that they save my privatekey anywhere (except in a local cookie). How could I do this the same?

you can run a patched bitcoin core that has an address index and transaction index option that can be set in bitcoin.conf

For example,
https://github.com/bitpay/bitcore-node/

IIRC, it's forked from core 0.12, which is outdated, but should still be usable.

If you run this version, you should be able to set following parameters in your bitcoin.conf:
txindex=1
addressindex=1
timestampindex=1
spentindex=1

If you have these indexes, you should be able to immediately see address's balances without the need for reindexing.
With these options activated, you should also be able to create raw, unsigned transactions using any unspent output(s) from the UTXO set, then in a second step use the private key to sign them without having to import the private key, and in a thirth step broadcast the signed transactions. Working this way should let you run your service without importing any private keys into your wallet, so you wouldn't have to clean up your wallet afterwards.

Sidenote: i haven't tested these steps out lately, this comes purely from memory... It's always possible i made a mistake, or forgot some steps! I'd advise you to test this out on the test network, whose blockchain is a lot smaller, and a tBTC has no monetary value, which is also a big plus when you're fooling around with json-rpc querys

Thank you very much! Seems, that this answer will solve my problem!
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!