I’m utilizing bash, and needed to take away each the areas in addition to the only quotes.
bitcoin-cli -datadir="$DATADIR" createwallet "$WALLETNAME" true true "" false true
grep "^importdescriptors" < bitcoin-core.txt |
minimize -d ' ' -f 2- | sed 's/ //g' | minimize -d "'" -f 2- | minimize -d "'" -f 1 |
bitcoin-cli -datadir="$DATADIR" -rpcwallet="$WALLETNAME" -stdin importdescriptors
The place bitcoin-core.txt is a file {that a} coldcard would possibly output from the “Superior/Instruments” menu below “Export Pockets”, “Bitcoin Core”.
# Bitcoin Core Pockets Import File
https://github.com/Coldcard/firmware/blob/grasp/docs/bitcoin-core-usage.md
## For pockets with grasp key fingerprint: X0000001
Pockets operates on blockchain: Bitcoin
## Bitcoin Core RPC
The next command will be entered after opening Window -> Console
in Bitcoin Core, or utilizing bitcoin-cli:
importdescriptors '[{"active": true, "timestamp": "now", "range": [0, 100], "inner": false, "desc": "wpkh([x0000001/84h/0h/0h]xpubGoesHere/0/*)#abcdefgh"}, {"energetic": true, "timestamp": "now", "vary": [0, 100], "inner": true, "desc": "wpkh([x0000001/84h/0h/0h]xpubGoesHere/1/*)#12345678"}]'
> **NOTE** In case your UTXO was created earlier than producing `importdescriptors` command, it's best to regulate the worth of `timestamp` earlier than executing command in bitcoin core.
By default it's set to `now` that means don't rescan the blockchain. If approximate time of UTXO creation is understood - regulate `timestamp` from `now` to UNIX epoch time.
0 will be specified to scan your entire blockchain. Alternatively `rescanblockchain` command can be utilized after executing importdescriptors command.
### Bitcoin Core earlier than v0.21.0
This command can be utilized on older variations, however it's not as sturdy
and "importdescriptors" must be prefered if attainable:
importmulti '[{"range": [0, 1000], "timestamp": "now", "keypool": true, "watchonly": true, "desc": "wpkh([x0000001/84h/0h/0h]xpubGoesHere/0/*)#abcdefgh", "inner": false}, {"vary": [0, 1000], "timestamp": "now", "keypool": true, "watchonly": true, "desc": "wpkh([x0000001/84h/0h/0h]xpubGoesHere/1/*)#12345678", "inner": true}]'
