Bitcoin-ABC / Bitcoin-ABC/bitcoin-abc

Does importprivkey add the wrong private key?

Open
#330 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.3k
Forks
788
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue
Does importprivkey add the wrong private key?

1. Generate a address through **getnewaddress**;
2. Dump a private key (**WIF**) for this address through **dumpprivkey** (valid correct WIF, **checked**);
3. Turn off Bitcoin ABC;
4. Rename **wallet.dat** to **wallet_dump.dat**;
5. Turn on Bitcoin ABC;
6. Import a private key (**WIF**) through **importprivkey**.

### Expected behaviour
Same private key imported. Same address added (generated).

### Actual behaviour
Another private key imported or another address added (generated).

### What version of bitcoin-abc are you using?
v0.19.6.0-610f36bf9

### Any extra information that might be useful in the debugging process.
https://github.com/Bitcoin-ABC/bitcoin-abc/issues/302

Contributor guide

Open the contributing guide

Research direction

Start with the getnewaddress, dumpprivkey, and importprivkey RPC sequence described above, using wallet.dat and wallet_dump.dat to reproduce it on v0.19.6.0-610f36bf9. Compare the imported WIF and resulting address with the dumped key, and review linked issue #302 for related context. Done means the mismatch is reproduced and its behavior is narrowed to a specific wallet operation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.