Bitcoin Forum
September 06, 2024, 09:13:40 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do I import privkeys if my blockchain is pruned?  (Read 246 times)
ArthurY (OP)
Sr. Member
****
Offline Offline

Activity: 840
Merit: 254


I love BTC


View Profile
May 06, 2021, 05:22:56 PM
Merited by Jet Cash (2)
 #1

What should I do if I need import a new private keys in my new wallet but my blockchain is pruned?



Sophisticated Investor
BitMaxz
Legendary
*
Offline Offline

Activity: 3374
Merit: 3094


BTC price road to $80k


View Profile WWW
May 06, 2021, 05:34:46 PM
 #2

You can't able to import privkey if it was pruned mode you need to disable pruned mode before you can import it then after you import you can enable pruned mode again.

The only problem it won't show the latest data like transaction history or the current balance of that wallet.

If your purpose is to make a transaction right away Electrum is the best choice without downloading or -rescan the whole blockchain.

ArthurY (OP)
Sr. Member
****
Offline Offline

Activity: 840
Merit: 254


I love BTC


View Profile
May 06, 2021, 05:42:53 PM
 #3

You can't able to import privkey if it was pruned mode you need to disable pruned mode before you can import it then after you import you can enable pruned mode again.

The only problem it won't show the latest data like transaction history or the current balance of that wallet.

If your purpose is to make a transaction right away Electrum is the best choice without downloading or -rescan the whole blockchain.

If I will turn off prune mode then I import privkeys and then I would to load blockchain and rescan that. Would I see history and able to see balance of the wallet after whole that steps?


Sophisticated Investor
BitMaxz
Legendary
*
Offline Offline

Activity: 3374
Merit: 3094


BTC price road to $80k


View Profile WWW
May 06, 2021, 06:08:47 PM
 #4


If I will turn off prune mode then I import privkeys and then I would to load blockchain and rescan that. Would I see history and able to see balance of the wallet after whole that steps?

Yes, it should show your balance after fully synced.

Are you sure that the wallet has a balance? Use some block explorer like this http://blockchain.com/ to check if that wallet has a balance before you proceed running a full node with Bitcoin core and import the private key.

If you don't know the BTC address of that wallet you can use this tool https://coinb.in/#verify download the page then turn off the internet and paste the private key.

It will show you the address of your private key. Now after that go to blockchain.com or here https://blockchair.com/ and then paste the address to check if it has a balance.

LoyceV
Legendary
*
Offline Offline

Activity: 3430
Merit: 17328


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
May 06, 2021, 06:36:04 PM
Merited by LFC_Bitcoin (13), vapourminer (1)
 #5

What should I do if I need import a new private keys in my new wallet but my blockchain is pruned?
The trick is to import the address (watch-only) before it's funded. That way, your pruned Bitcoin Core keeps track of the balance already, and you can import the private key later. Use the option "false" for the rescan-flag when importing.

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4318

<insert witty quote here>


View Profile
May 06, 2021, 10:39:05 PM
Merited by vapourminer (1)
 #6

What should I do if I need import a new private keys in my new wallet but my blockchain is pruned?
You either don't import new private keys... or you don't run in pruned mode. Attempting to do both is going to cause issues.

If you import to a pruned wallet, you will need to either rescan (which will require redownloading and reprocessing the entire blockchain) or accept that your wallet may not show an accurate transaction history/balance for that particular address or addresses.

If you think you're going to be importing private keys often (multiple times), get more storage and don't run pruned... or use a different wallet like Electrum that will allow you to import keys without storage/rescan penalty.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2534
Merit: 6008


Self-proclaimed Genius


View Profile
May 07, 2021, 03:52:31 AM
Merited by LFC_Bitcoin (10), LoyceV (4), ABCbits (2), vapourminer (1), Greg Tonoski (1)
 #7

There's a command that specifically designed for nodes with pruned blockchain to work with importprivkey with false rescan flag.
But the required arguments defeat the purpose since you'll need the blockchain to get them :P
That is:
Code:
importprunedfunds "rawtransaction" "txoutproof"
Quote
importprunedfunds "rawtransaction" "txoutproof"

Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.

Arguments:
1. rawtransaction    (string, required) A raw transaction in hex funding an already-existing address in wallet
2. txoutproof        (string, required) The hex output from gettxoutproof that contains the transaction
To get the rawtransaction, use this online tool: https://chainquery.com/bitcoin-cli/getrawtransaction
To get the txoutproof, you need to ask someone with "-txindex" to use the command:
Code:
gettxoutproof "[\"TXID\"]"
TXID of the transaction that you want to import through importpunedfunds, you can include many as long as they all belong to the same block.

Use that complicated method to import the imported addresses' transactions to your wallet or disable pruning to use rescan.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Greg Tonoski
Member
**
Offline Offline

Activity: 122
Merit: 72


View Profile
August 14, 2024, 09:42:46 AM
 #8

There is the public server which can be used for the gettxoutproof RPC: https://bitcoinexplorer.org/rpc-terminal.
OcTradism
Hero Member
*****
Offline Offline

Activity: 1862
Merit: 848



View Profile WWW
August 15, 2024, 03:40:15 AM
Merited by vapourminer (1)
 #9

What should I do if I need import a new private keys in my new wallet but my blockchain is pruned?
Private key is private key and you can import it to a Bitcoin full node or Bitcoin prune node wallet or with even SPV wallet too.

Full node, Prune node or SPV, it is only about how small or less, full or part of Bitcoin blockchain stored on your node and device to verify past Bitcoin blocks and UTXOs. If you don't have a Bitcoin full node, you will have to connect your wallet to servers and nodes that are not belong to you and rely on their operations to get blockchain data.

https://developer.bitcoin.org/reference/rpc/importprivkey.html

There is the public server which can be used for the gettxoutproof RPC: https://bitcoinexplorer.org/rpc-terminal.
https://developer.bitcoin.org/reference/rpc/gettxoutproof.html

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
nc50lc
Legendary
*
Offline Offline

Activity: 2534
Merit: 6008


Self-proclaimed Genius


View Profile
August 15, 2024, 06:24:08 AM
Last edit: August 16, 2024, 04:02:40 AM by nc50lc
Merited by LoyceV (2), ABCbits (2)
 #10

What should I do if I need import a new private keys in my new wallet but my blockchain is pruned?
Private key is private key and you can import it to a Bitcoin full node or Bitcoin prune node wallet or with even SPV wallet too.
The issue was: it is pointless if he can't rescan for older transactions due to having a pruned blockchain.
It can be imported without triggering a rescan yes, but it wont be able to scan for transactions inside the already deleted blocks.
Check his second reply to see that his goal isn't just to import the private key.

Note: I used "was" because it may be solved already because there's no reply since OP posted that in 2021.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Greg Tonoski
Member
**
Offline Offline

Activity: 122
Merit: 72


View Profile
August 15, 2024, 06:53:32 PM
Merited by vapourminer (1), ABCbits (1), nc50lc (1)
 #11

There's a command that specifically designed for nodes with pruned blockchain to work with importprivkey with false rescan flag.
But the required arguments defeat the purpose since you'll need the blockchain to get them Tongue
That is:
Code:
importprunedfunds "rawtransaction" "txoutproof"

There is the Bitcoin Knots 27.1 with a patch that makes txoutproof argument optional instead of required: https://github.com/GregTonoski/bitcoin/releases/tag/v27.1.importprunedfunds-bypass.
Greg Tonoski
Member
**
Offline Offline

Activity: 122
Merit: 72


View Profile
August 19, 2024, 09:11:11 AM
 #12

There is the public server which can be used for the gettxoutproof RPC: https://bitcoinexplorer.org/rpc-terminal.

The gettxoutproof RPC result could also be obtained from: https://blockstream.info/api/tx/86639c0c9bdb83f467f2c07910367929171196c8907743a5915d555de5bc27eb/merkleblock-proof (replace 86639c0c9bdb83f467f2c07910367929171196c8907743a5915d555de5bc27eb with your txid in the URL).
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!