mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-11 11:16:09 -05:00
![Sjors Provoost](/assets/img/avatar_default.png)
This makes it easier to handle descriptor strings manually. E.g. an RPC call that takes an array of descriptors can now use '["desc": ".../0h/..."]'. Both markers can still be parsed. The default for new descriptors is changed to h. In normalized form h is also used. For private keys the chosen marker is preserved in a round trip. The hdkeypath field in getaddressinfo is also impacted by this change.
19 lines
706 B
C++
19 lines
706 B
C++
// Copyright (c) 2019-2022 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_UTIL_BIP32_H
|
|
#define BITCOIN_UTIL_BIP32_H
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
/** Parse an HD keypaths like "m/7/0'/2000". */
|
|
[[nodiscard]] bool ParseHDKeypath(const std::string& keypath_str, std::vector<uint32_t>& keypath);
|
|
|
|
/** Write HD keypaths as strings */
|
|
std::string WriteHDKeypath(const std::vector<uint32_t>& keypath, bool apostrophe = false);
|
|
std::string FormatHDKeypath(const std::vector<uint32_t>& path, bool apostrophe = false);
|
|
|
|
#endif // BITCOIN_UTIL_BIP32_H
|