Bitcoin Forum
September 26, 2025, 06:32:15 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / Re: I loss privkey, but I have address, xpriv and hdseed ... on: May 13, 2021, 06:41:06 AM
Thank you for that answer.

The fact is that I had a lot of feedback telling me that the berkeley db version was essential for a good reading of the wallet (4.8 required).
I suspected for a long time that there is no private key but I signed up and asked for help here to make sure I didn't forget anything in the way.
2  Bitcoin / Bitcoin Technical Support / Re: I loss privkey, but I have address, xpriv and hdseed ... on: May 12, 2021, 05:39:59 PM
# To be sure that my compilations are good:
 - I apply: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md
 - I verify dependencies with: https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md
 - I compile with make check and all tests are good.
 - I check my node on https://bitnodes.io/

# To be clear, all my tests are done on aws instances (t3a.2xlarge)

# This is my procedure to compile node
Code:
# Basic
sudo -s
passwd ubuntuµ
apt update
apt upgrade

# Dependencies
apt install -y libboost-all-dev libzmq3-dev libminiupnpc-dev curl git build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 software-properties-common libssl-dev libevent-dev libsqlite3-dev libnatpmp-dev

# SSH conf (put file by sftp)
sed -i 's/^PasswordAuthentication no*$/PasswordAuthentication yes/' /etc/ssh/sshd_config
service ssh reload

# Create specific user for bitcoind
adduser satoshi
su satoshi
cd ~
# Get bitcoin source and prepare compilation
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
git checkout -b 0.21
# To compile db4 lib for bitcoin's compilation.
# It's this version who'll used independent of OS library version.
./contrib/install_db4.sh `pwd`
export BDB_PREFIX='/home/satoshi/bitcoin/db4'
./autogen.sh
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --without-gui

# Compile with check
make check

# exit satoshi, comeback to root
exit
cd /home/satoshi/bitcoin
make install

maybe i am doing some things wrong?
3  Bitcoin / Bitcoin Technical Support / Re: I loss privkey, but I have address, xpriv and hdseed ... on: May 12, 2021, 05:29:23 PM
thank you for your answers (I do not have enough merit point to add to you but I will think about it in the future).

I'm trying:
- importwallet (bitcoin-cli importwallet ascii_file) + rescan -> no success.
- loadwallet (bitcoin-cli loadwallet wallet.dat) + rescan -> no success.
- import seed (bitcoin-cli sethdseed true "wifkey") + rescan -> no success.
- I generate more 4 000 000 address from xpriv with a lot of path -> no success.
- I try a lot of tools (known and unknown tool in github) to extract keys from wallet.dat (from VM without network access) -> no success

I'm trying importwallet, loadwallet, import seed with lot of version
- precompiled bitcoin binaries (from bitcoin.org)  -> no success.
- compile 0.21 with bdb 4.8 -> no success.
- compile 0.21 with bdb 5.3 -> no success.
- compile 0.18 with bdb 4.8 -> no success.
- compile 0.18 with bdb 5.3 -> no success.
- test all of this with debian 10, ubuntu 20.04 LTS, ubuntu 18.04 LTS, ubunutu 16.04 LTS -> no success

I think it's just a watch only wallet without the private key that holds the funds.
I would just like to be sure that I tested everything.
How can I be sure (prove?) that there is no privatekey associated with the address holding the funds in the files I have?

My last attempt to date:

getblockchaininfo:
Code:
$ bitcoin-cli getblockchaininfo
{
  "chain": "main",
  "blocks": 683301,
  "headers": 683301,
  "bestblockhash": "00000000000000000007ee873edad4ffa6148e80b1c764a97a216302bc9d4d7e",
  "difficulty": 20608845737768.16,
  "mediantime": 1620836374,
  "verificationprogress": 0.9999976376076224,
  "initialblockdownload": false,
  "chainwork": "00000000000000000000000000000000000000001d5069c69e80af0e88e54390",
  "size_on_disk": 391466597573,
  "pruned": false,
  "softforks": {
    "bip34": {
      "type": "buried",
      "active": true,
      "height": 227931
    },
    "bip66": {
      "type": "buried",
      "active": true,
      "height": 363725
    },
    "bip65": {
      "type": "buried",
      "active": true,
      "height": 388381
    },
    "csv": {
      "type": "buried",
      "active": true,
      "height": 419328
    },
    "segwit": {
      "type": "buried",
      "active": true,
      "height": 481824
    },
    "taproot": {
      "type": "bip9",
      "bip9": {
        "status": "started",
        "bit": 2,
        "start_time": 1619222400,
        "timeout": 1628640000,
        "since": 681408,
        "statistics": {
          "period": 2016,
          "threshold": 1815,
          "elapsed": 1894,
          "count": 763,
          "possible": false
        },
        "min_activation_height": 709632
      },
      "active": false
    }
  },
  "warnings": ""
}

sethdseed:
Code:
bitcoin-cli sethdseed true "wifkey from walletdump where hdseed=1"
error code: -5
error message:
Already have this key (either as an HD seed or as a loose private key)

rescan:
Code:
$ bitcoin-cli stop
Bitcoin Core stopping
$ bitcoind --rescan
Bitcoin Core starting

getbalances:
Code:
$ bitcoin-cli getbalances
{
  "mine": {
    "trusted": 0.00000000,
    "untrusted_pending": 0.00000000,
    "immature": 0.00000000,
    "used": 0.00000000
  },
  "watchonly": {
    "trusted": [a lot of bitcoin here],
    "untrusted_pending": 0.00000000,
    "immature": 0.00000000
  }
}
4  Bitcoin / Bitcoin Technical Support / Re: I loss privkey, but I have address, xpriv and hdseed ... on: May 11, 2021, 11:51:02 PM
have you a doc or a command for thath? I'm trying since a lot of time but without success ...
5  Bitcoin / Bitcoin Technical Support / Re: I loss privkey, but I have address, xpriv and hdseed ... on: May 11, 2021, 09:49:06 PM
thx for information.
is there a way to generate all of this easily?
6  Bitcoin / Bitcoin Technical Support / Re: I loss privkey, but I have address, xpriv and hdseed ... on: May 11, 2021, 08:42:04 PM
NotATether is right. I have an dumpwallet from bitcoin core 0.21
In this file hdkeypath is m/0'/0'/X' et m/0'/1'/X'
I don't know how to derive the key from a path.

I'm trying to use electrum (4.1.2) and by default it derives 10 keys (without possibility of specifying path).
from the console (python) I can derive more key but I failed to specify the path I want.
7  Bitcoin / Bitcoin Technical Support / I loss privkey, but I have address, xpriv and hdseed ... on: May 11, 2021, 05:02:02 PM
Hello,
All is in title.

I loss privkey from an funded P2PKH address.
I have xpriv (I can calculate xpub if necessary).
I have hdseed (priv and pub).

Is it possible to bruteforce hdpath and generate couple (pub, priv) as long as my target isn't found?
if it's possible, how ?

[sorry for my english, it's not my native language]
8  Local / Développement et technique / Tentative de récupération de bitcoin. on: May 11, 2021, 10:58:14 AM
Bonjour,
J'ai en ma possession un fichier ascii semblant être un dumpwallet fait depuis 0.21
J'ai également en ma possession un wallet.dat (dont devrait être issu le fichier ascii).
J'ai fais un backup de ces deux fichiers, et toutes les manipulations qui suivent sont sur des copies des fichiers originaux.

J'ai dans un premier temps naïvement remplacé le wallet.dat d'une installation pruned de bitcoin core
Ce dernier me montre l'ensemble des BTC disponible en watch only (j'en déduis donc qu'il n'y a pas de privkey)

J'ai ensuite loué un vps, installé un fullnode 0.21 et j'ai tenté un loadwallet.
un getbalance me sort 0. mais un getbalances me montre bien ce que j'aimerai récupérer.
un listunspent me sort bien mes utxo avec des txid, l'adresse utile, un scriptPubKey (qu'est-ce ?), mais les spendable sont à 0 (le safe est à true, j'ignore aussi ce qu'il signifie pour l'instant). je me dis que c'est mort de chez mort et qu'il n'y a pas de clef privée dans ce wallet.dat

J'ai ensuite tenté un importwallet du fichier ascii.
Ce fichier contient en commentaire une xpriv et la première ligne est une hdseed.
S'en suis pleins d'autres lignes sont des
Code:
reserve = 1
dont le path de dérivation semble être
Code:
m/0'/0'/X
ou
Code:
m/0'/1'/X
(pour les adresses de change je suppose)
J'ai vérifié, l'adresse contenant les fonds n'est pas dans le fichier ascii.

Je me demande dans quelle mesure je peux la regénérer (disposant de la xpriv, de la seed et sans doute d'un path dont il faudrait bruteforcer le dernier param). J'ai tenté ma chance avec electrum mais en vain (je dois pas être assez doué).

le fait que j'ai une hdseed me laisse penser qu'on est sur du BIP32.
Je sèche pour la suite. Peut être quelque chose avec sethdseed  ?
Avez-vous une idée pour que je puisse continuer mes investigations ?

PS: si vous avez un moyen de générer en python (via electrum, une lib ou autre), des dérivations depuis une xpriv et/ou une hdseed avec un path, je suis preneur.

Merci d'avoir pris le temps de me lire,

EDIT://
En demandant conseil, on m'a harcelé avec des versions de bitcoin (0.18, 0.21 ...) et de dbd (4.8 et 5.3) et aussi sur le fait de compiler ou non les sources de bitcoin-core, j'ai fais pleins de tests dans tous les sens (bien que je doute de l'utilité vu que le wallet est bien lisible). J'ai aussi testé des export d'info depuis des outils comme pywallet mais chaque fois le parsing du wallet me sort une erreur (qu'importe l'outil).

EDIT 2://
avec bx, j'ai réussi à recalculer la xpub.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!