Post
Topic
Board Bahasa Indonesia (Indonesian)
Merits 2 from 2 users
Re: BITCOIN CORE
by
punk.zink
on 29/05/2024, 07:20:39 UTC
⭐ Merited by ABCbits (1) ,Husna QA (1)
Ini yang paham bahasa pemrograman C++ mungkin bisa ikut berkontribusi atau mencoba test beberapa Covered new code yang terdapat di sini:
https://corecheck.dev/bitcoin/bitcoin/pulls/29130, contoh wallet.cpp

Nampak pada code di atas, dibawah "gethdkeys" tercantum "\nList all BIP 32 HD keys in the wallet and which descriptors use them.\n"

Currently, specified HD keys must already exist in the wallet. To make it easier for the user to know, gethdkeys is also added to list out the HD keys in use by all of the descriptors in the wallet. This will include all HD keys, whether we have the private key, for it, which descriptors use it and their activeness, and optionally the extended private key. In this way, users with more complex wallets will be still be able to get HD keys from their wallet for use in other scenarios, and if they want to use createwalletdescriptor, they can easily get the keys that they can specify to it.

PR #29130 sudah di merge ke repository master:bitcoin, dan untuk fungsi gethdkeys baru akan bisa dirasakan pada saat muncul update lagi dari client Bitcoin Core karena untuk saat ini pada Client 0.27 kalo dicoba untuk menggunakan parameter tersebut, hasilnya adalah "Method not found (code -32601)"





Sementara kalo saya coba menggunakan Node Testnet4 yang memang saya build menggunakan code Bitcoin terbaru, fungsi dari gethdkeys sudah bisa digunakan sebagaimana mestinya
Code:
./bitcoin-cli -testnet4 -rpcuser=punk -rpcpassword=punk help gethdkeys


gethdkeys ( {"active_only":bool,"private":bool,...} )

List all BIP 32 HD keys in the wallet and which descriptors use them.

Arguments:
1. options    (json object, optional) Options object that can be used to pass named arguments, listed below.

Named Arguments:
active_only    (boolean, optional, default=false) Show the keys for only active descriptors
private        (boolean, optional, default=false) Show private keys

Code:
./bitcoin-cli -testnet4 -rpcuser=punk -rpcpassword=punk -rpcwallet="punk-wallet" gethdkeys

Result:
[
  {
    "xpub": "tpubD6NzVbkrYhZ4YY1DFwU7yTeiu4nFMUz3sy1T4ccapZFt6Aiwn4PQBSBLoesq1pZRqP6DJJPkcEzcpmm7ZQULvDHpnFFi6KZqtsC3Yqjqnhh",
    "has_private": true,
    "descriptors": [
      {
        "desc": "pkh([75756328/44h/1h/0h]tpubDCbHnuM8SU5FyRwKJe42B9R7vC47fk2pstB2DYkwe3SAfdvGAkKwKFixjdGsbmP9DJkWska8LdzM13nhC4ZnBLzmgzqqBhHhvdvjNsGf1gb/0/*)#t3t3k0ad",
        "active": true
      },
...
]

Fungsinya sih mirip-mirip dengan argument listdescriptors yang jika ditambahkan dengan boolean argument private=true, maka akan memberikan informasi BIP32 Root Key. Hanya saja pada fungsi gethdkeys informasinya lebih spesifik, dimana juga dicantumkan extended public key dari BIP32 Root Key tersebut. Namun untuk masing-masing "purpose path level" (contoh BIP44 path) hanya ditampilkan informasi dari "Account Extended Public Key", dan tidak ada informasi untuk masing-masing Account XPRV.