Author

Topic: RPC question (Read 317 times)

dkb
newbie
Activity: 7
Merit: 3
November 10, 2017, 06: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 " 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!
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
November 10, 2017, 03:47:24 AM
#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 " 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
dkb
newbie
Activity: 7
Merit: 3
November 10, 2017, 03: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 " 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?
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
November 10, 2017, 01: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 " 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.
dkb
newbie
Activity: 7
Merit: 3
November 10, 2017, 01: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 " 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!
Jump to: