Running Bitcoind – BitcoinWiki

CryptoMods

Private subreddit for cryptocurrency moderators. "We are all in this together"
[link]

Quick question: can you send several inputs to 1 output address? (by createrawtransaction through Bitcoin-Qt commands)

Tried to find the answer in Google but it seems like no one asked such question before. Using this tutorial to do it https://www.reddit.com/Bitcoin/comments/2ee3khow_to_create_a_raw_transaction_using_multiple/ but it covers only transfering from 2 outputs to 2 addresses.
submitted by XfsMonsta to Bitcoin [link] [comments]

How do I get my zero confirmation balance with the Bitcoin-qt command line?

No matter what I try I can't seem to get the balance with zero confirmations. The default is 1 confirmation. This is from the documentation:
.>bitcoind help getbalance
getbalance [account] [minconf=1] If [account] is not specified, returns the server's total available balance. If [account] is specified, returns the balance in the account.
These do not work:
(my balance is not 0)
.>bitcoind getbalance '*' 0
0.00000000
.>bitcoind getbalance * 0
error: type mismatch
.>bitcoind getbalance "*" 0
error: type mismatch
.>bitcoind getbalance [*] 0
0.00000000
Any ideas? This is driving me nuts.
submitted by RockyMountainHigh to Bitcoin [link] [comments]

[Hiring] Write some Bitcoin-Qt commands templates to sign transaction on offline machine.

Its not necessary to have too much experience with Bash, but I prefer making these scripts in Bash.
Or I need any solution to make my Ubuntu machine to be able to sign transactions (but receiving commands to move funds from Web-server or from FTP)
Anyway even if you're newbie in Linux but have experience with Bitcoin-Qt I am still interested in your skills, because I believe I could show you how easy it is to send commands to Bitcoin-Qt in Ubuntu Terminal (I will give an access)
I think the price here will be depending on hourly basis, so think about what is your hourly rate or other measure of payment and I will be glad to pay you Bitcoins.
submitted by XfsMonsta to Jobs4Bitcoins [link] [comments]

Quick question: can you send several inputs to 1 output address? (by createrawtransaction through Bitcoin-Qt commands) /r/Bitcoin

Quick question: can you send several inputs to 1 output address? (by createrawtransaction through Bitcoin-Qt commands) /Bitcoin submitted by BitcoinAllBot to BitcoinAll [link] [comments]

Hash Time Locked Contract (HTLC) using bitcoin-qt

Is it possible to manually create a Hash Time Locked Contract using the bitcoin-qt command line?
I have dabbled with manually creating createrawtransaction/sendrawtransaction using the bitcoin-qt clients command line, and wanted to know how to manually create a Hash Time Locked Contract.
When I say "manually", I mean, really getting your hands dirty, like using notepad to construct the contract, putting the values into bitcoin-cli, to convert it into a hash, ready for it to be sent using sendrawtransaction.
submitted by h259474 to Bitcoin [link] [comments]

Hash Time Locked Contract (HTLC) using bitcoin-qt

Is it possible to manually create a Hash Time Locked Contract using the bitcoin-qt command line?
I have dabbled with manually creating createrawtransaction/sendrawtransaction using the bitcoin-qt clients command line, and wanted to know how to manually create a Hash Time Locked Contract.
When I say "manually", I mean, really getting your hands dirty, like using notepad to construct the contract, putting the values into bitcoin-cli, to convert it into a hash, ready for it to be sent using sendrawtransaction.
submitted by h259474 to BitcoinBeginners [link] [comments]

Learning-Bitcoin-from-the-Command-Line Guide - The best way to learn to learn deeply about bitcoin is to avoid GUIs (even bitcoin-qt), and instead learn it from the command line

Learning-Bitcoin-from-the-Command-Line Guide - The best way to learn to learn deeply about bitcoin is to avoid GUIs (even bitcoin-qt), and instead learn it from the command line submitted by parakite to Bitcoin [link] [comments]

Can anyone run RPC commands on my full node if I run bitcoind or bitcoin-qt connected to the internet?

Is RPC completely disabled if I don't include bitcoin.conf in my bitcoin directory, and if it's there, does bitcoind open ports automatically that allow anyone to RPC on my node?
submitted by sonkeypop to Bitcoin [link] [comments]

Can anyone run RPC commands on my full node if I run bitcoind or bitcoin-qt connected to the internet? /r/Bitcoin

Can anyone run RPC commands on my full node if I run bitcoind or bitcoin-qt connected to the internet? /Bitcoin submitted by HiIAMCaptainObvious to BitcoinAll [link] [comments]

I wrote a CLI for running interactive commands against Bitcoin-QT, if anyone is interested.

I did this to get a better understanding of bitcoin, as well as learn some coding. I'm not sure if something like this exists. I've never worked with curses before, so this was a good learning experience for me.
It runs the commands against the server with curl, as I couldn't quickly figure out the jsonrpc python library, and the curl was working. This would be an easy replacement, if the need arises, but it works as is.
I put in a whole bunch of features, including history, storing command output in buffers to use in subsequent commands, command abbreviations, and a whole lot more.
You can do something like:
> store getaccount 
# gets account associated with address and stores it to clipboard (CB) > getbalance CB # replaces CB with account from previous command
I didn't set out to write something for the community, but if there is any interest, I can put some more work into it and make it friendlier. This means there's no real documentation. But I would imagine that most people wouldn't run a bitcoin script without going through the code somewhat anyway.
There are basic instructions for how to get started at the top of the file.
This is still, very much, a work in progress. If you have any questions, comments, critiques, etc, let me know.
http://pastie.org/5562643
EDIT: it does seem that there is some interest in this. I'll try to formalize it a bit and document it. Feel free to make any suggestions and I'll take them into account.
submitted by althepal to Bitcoin [link] [comments]

I start bitcoin-qt from the command line, and when I exit the qt gui, I often have to ctrl-c to fully close the program

Does that happen to anyone else?
submitted by lemkenski to Bitcoin [link] [comments]

Quick question, starting bitcoin core qt in command mode? /r/Bitcoin

Quick question, starting bitcoin core qt in command mode? /Bitcoin submitted by BitcoinAllBot to BitcoinAll [link] [comments]

What’s the difference between Bitcoin-Qt and Bitcoin Core?

submitted by jefferson_willson_ to Bitcoin [link] [comments]

Power of the Command Line (bitcoin-cli, hwi, electrum, trezorctl)

I think some of the console tools available with HW wallets today are greatly under utilized. Here's a quick write-up on how to create and sign a TXN very similar to 43d27...1fc06 found on the SLIP-14 wallet. I'll be using TrezorCTL, Electrum, and HWI for the signing. I won't go much into the setup or install, but feel free to ask if you have questions about it. Note, you don't have to use all three of these. Any one will produce a valid signed TXN for broadcast. I just showed how to do it three ways. Whats more some of the Electrum and HWI steps are interchangeable.
ColdCard also has a utility called ckcc that will do the sign operation instead of HWI, but in many ways they are interchangeable. KeepKey and Ledger both have libraries for scripted signing but no one-shot, one-line console apps that I know of. But HWI and Electrum of course work on all four.

TrezorCTL

This is the what most would think of to use to craft and sign TXNs, and is definitely very simple. The signing uses a script called build_tx.py to create a JSON file that is then used by the btc sign-tx command. The whole process is basically:
  1. tools/build_tx.py | trezorctl btc sign-tx -
This just means, take the output of build_tx and sign it. To copy 43d27...1fc06, I wrote a small script to feed build_tx, so my process looks like:
  1. ~/input.sh | tools/build_tx.py | trezorctl btc sign-tx -
But it's all very simple. Note... I used TrezorCTL v0.12.2 but build_tx.py version 0.13.0 1.

input.sh

```

!/bin/bash

secho() { sleep 1; echo $*}
secho "Testnet" # coin name secho "tbtc1.trezor.io" # blockbook server and outpoint (below) secho "e294c4c172c3d87991b0369e45d6af8584be92914d01e3060fad1ed31d12ff00:0" secho "m/84'/1'/0'/0/0" # prev_out derivation to signing key secho "4294967293" # Sequence for RBF; hex(-3) secho "segwit" # Signature type on prev_out to use secho "" # NACK to progress to outs secho "2MsiAgG5LVDmnmJUPnYaCeQnARWGbGSVnr3" # out[0].addr secho "10000000" # out[1].amt secho "tb1q9l0rk0gkgn73d0gc57qn3t3cwvucaj3h8wtrlu" # out[1].addr secho "20000000" # out[1].amt secho "tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x" # out[2].addr secho "99999694" # out[2].amt secho "" # NACK to progress to change secho "" # NACK to skip change secho "2" # txn.version secho "0" # txn.locktime ```

Electrum

Electrum is one of the better GUI wallets available, but it also has a pretty good console interface. Like before you need your Trezor with the SLIP-14 wallet loaded and paired to Electrum. I'll assume Electrum is up and running with the Trezor wallet loaded to make things simple.
Like with TrezorCTL, Electrum feeds on a JSON file, but unlike TrezorCTL it needs that JSON squished into the command line. This is a simple sed command, but I won't bore you with the details, but just assume that's done. So the process in Electrum (v4.0.3) looks like:
  1. electrum serialize (create psbt to sign)
  2. electrum --wallet signtransaction (sign said psbt)
Still pretty simple right! Below is the JSON I smushed for #1

txn.json

{ "inputs": [{ "prevout_hash":"e294c4c172c3d87991b0369e45d6af8584be92914d01e3060fad1ed31d12ff00", "prevout_n": 0, "value_sats": 129999867 }], "outputs": [{ "address": "2MsiAgG5LVDmnmJUPnYaCeQnARWGbGSVnr3", "value_sats": 10000000 },{ "address": "tb1q9l0rk0gkgn73d0gc57qn3t3cwvucaj3h8wtrlu", "value_sats": 20000000 },{ "address": "tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x", "value_sats": 99999694 }]}

HWI

HWI is an unsung hero in my book. It's a very small clean and simple interface between HW wallets and Bitcoin Core. It currently supports a good range of HW wallets. It keeps itself narrowly focused on TXN signing and offloads most everything else to Bitcoin Core. Again, I'll assume you've imported your Trezor keypool into Core and done the requisite IBD and rescan. And if you don't have the RPC enabled, you can always clone these commands into the QT-console.
To sign our TXN in HWI (v1.1.2), we will first need to craft (and finalize) it in Bitcoin Core (0.21.1). Like in Electrum, we will have to use simple sed to smush some JSON into command arguments, but I'll assume you have that covered. It will take an inputs.json and an outputs.json named separately.
  1. bitcoin-cli createpsbt (create psbt)
  2. bitcoin-cli -rpcwallet= walletprocesspsbt (process psbt)
  3. hwi -f signtx (sign psbt)
  4. bitcoin-cli -rpcwallet= finalizepsbt (get a signed TXN from psbt)
A little more involved, but still nothing too bad. Plus this gives you the full power of Bitcoin Core including integrations with LND (lightning).

inputs.json

[{ "txid": "e294c4c172c3d87991b0369e45d6af8584be92914d01e3060fad1ed31d12ff00", "vout": 0 }]

outputs.json

[{ "2MsiAgG5LVDmnmJUPnYaCeQnARWGbGSVnr3": 0.10000000 },{ "tb1q9l0rk0gkgn73d0gc57qn3t3cwvucaj3h8wtrlu": 0.20000000 },{ "tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x": 0.99999694 }]

Conclusion

This may all seem like very low level coding, but is surprisingly simple once you get a knack for it. Whats more, all these platforms support testnet which allows you to practice with valueless coins until you get the hang of it. And, like many things in bitcoin, this is all (mostly) python, which is one of the easier languages to learn.
Enjoy
Footnotes
1 - https://github.com/trezotrezor-firmware/issues/1296
submitted by brianddk to Bitcoin [link] [comments]

Gridcoin 5.0.0.0-Mandatory "Fern" Release

https://github.com/gridcoin-community/Gridcoin-Research/releases/tag/5.0.0.0
Finally! After over ten months of development and testing, "Fern" has arrived! This is a whopper. 240 pull requests merged. Essentially a complete rewrite that was started with the scraper (the "neural net" rewrite) in "Denise" has now been completed. Practically the ENTIRE Gridcoin specific codebase resting on top of the vanilla Bitcoin/Peercoin/Blackcoin vanilla PoS code has been rewritten. This removes the team requirement at last (see below), although there are many other important improvements besides that.
Fern was a monumental undertaking. We had to encode all of the old rules active for the v10 block protocol in new code and ensure that the new code was 100% compatible. This had to be done in such a way as to clear out all of the old spaghetti and ring-fence it with tightly controlled class implementations. We then wrote an entirely new, simplified ruleset for research rewards and reengineered contracts (which includes beacon management, polls, and voting) using properly classed code. The fundamentals of Gridcoin with this release are now on a very sound and maintainable footing, and the developers believe the codebase as updated here will serve as the fundamental basis for Gridcoin's future roadmap.
We have been testing this for MONTHS on testnet in various stages. The v10 (legacy) compatibility code has been running on testnet continuously as it was developed to ensure compatibility with existing nodes. During the last few months, we have done two private testnet forks and then the full public testnet testing for v11 code (the new protocol which is what Fern implements). The developers have also been running non-staking "sentinel" nodes on mainnet with this code to verify that the consensus rules are problem-free for the legacy compatibility code on the broader mainnet. We believe this amount of testing is going to result in a smooth rollout.
Given the amount of changes in Fern, I am presenting TWO changelogs below. One is high level, which summarizes the most significant changes in the protocol. The second changelog is the detailed one in the usual format, and gives you an inkling of the size of this release.

Highlights

Protocol

Note that the protocol changes will not become active until we cross the hard-fork transition height to v11, which has been set at 2053000. Given current average block spacing, this should happen around October 4, about one month from now.
Note that to get all of the beacons in the network on the new protocol, we are requiring ALL beacons to be validated. A two week (14 day) grace period is provided by the code, starting at the time of the transition height, for people currently holding a beacon to validate the beacon and prevent it from expiring. That means that EVERY CRUNCHER must advertise and validate their beacon AFTER the v11 transition (around Oct 4th) and BEFORE October 18th (or more precisely, 14 days from the actual date of the v11 transition). If you do not advertise and validate your beacon by this time, your beacon will expire and you will stop earning research rewards until you advertise and validate a new beacon. This process has been made much easier by a brand new beacon "wizard" that helps manage beacon advertisements and renewals. Once a beacon has been validated and is a v11 protocol beacon, the normal 180 day expiration rules apply. Note, however, that the 180 day expiration on research rewards has been removed with the Fern update. This means that while your beacon might expire after 180 days, your earned research rewards will be retained and can be claimed by advertising a beacon with the same CPID and going through the validation process again. In other words, you do not lose any earned research rewards if you do not stake a block within 180 days and keep your beacon up-to-date.
The transition height is also when the team requirement will be relaxed for the network.

GUI

Besides the beacon wizard, there are a number of improvements to the GUI, including new UI transaction types (and icons) for staking the superblock, sidestake sends, beacon advertisement, voting, poll creation, and transactions with a message. The main screen has been revamped with a better summary section, and better status icons. Several changes under the hood have improved GUI performance. And finally, the diagnostics have been revamped.

Blockchain

The wallet sync speed has been DRASTICALLY improved. A decent machine with a good network connection should be able to sync the entire mainnet blockchain in less than 4 hours. A fast machine with a really fast network connection and a good SSD can do it in about 2.5 hours. One of our goals was to reduce or eliminate the reliance on snapshots for mainnet, and I think we have accomplished that goal with the new sync speed. We have also streamlined the in-memory structures for the blockchain which shaves some memory use.
There are so many goodies here it is hard to summarize them all.
I would like to thank all of the contributors to this release, but especially thank @cyrossignol, whose incredible contributions formed the backbone of this release. I would also like to pay special thanks to @barton2526, @caraka, and @Quezacoatl1, who tirelessly helped during the testing and polishing phase on testnet with testing and repeated builds for all architectures.
The developers are proud to present this release to the community and we believe this represents the starting point for a true renaissance for Gridcoin!

Summary Changelog

Accrual

Changed

Most significantly, nodes calculate research rewards directly from the magnitudes in EACH superblock between stakes instead of using a two- or three- point average based on a CPID's current magnitude and the magnitude for the CPID when it last staked. For those long-timers in the community, this has been referred to as "Superblock Windows," and was first done in proof-of-concept form by @denravonska.

Removed

Beacons

Added

Changed

Removed

Unaltered

As a reminder:

Superblocks

Added

Changed

Removed

Voting

Added

Changed

Removed

Detailed Changelog

[5.0.0.0] 2020-09-03, mandatory, "Fern"

Added

Changed

Removed

Fixed

submitted by jamescowens to gridcoin [link] [comments]

Bitcoin-qt datadir alternative storage location

I tried asking this in the bitcoincore sub yesterday, but it only has a handful of members and got no answers, so i now try here.
When bitcoin-qt is first started, it asks for the location of datadir. If it is set to a custom location, it remembers it on subsequent launches. Where is this location stored, as no bitcoin.conf is generated in the default location, and i have not seen any other documentation to specify datadir except command line option and bitcoin.conf file?
submitted by varikonniemi to Bitcoin [link] [comments]

PSA: Enable Tor as a simple way to make your node reachable.

Become one of the 10% of node operators that receive incoming connections.
Installing bitcoin core is easy, and with pruning it really isn't the space sink it is characterized as. Even a modest computer can complete the initial block download (IBD) and become a full node. But what some users (90%) find a bit more challenging, is how to become a listening node. Listening nodes are an important part of the network, and are simple enough to enable. I can think of 4 ways to do it:
  1. Operate on an OS and Network that support uPnP, allowing bitcoin to open the ports for you.
  2. Subscribe to a VPN that allows you to open ports through their service.
  3. Manually configure your OS and network to forward port 8333 and 18333.
  4. Run Tor and direct bitcoin to listen through it.
I'll discuss #4. Obviously #1 or #2 are easier, but require a VPN subscription or uPnP enabled HW. And if you live in a dorm or don't control the network, Tor may be the only free option available.
As a bit of background, bitcoin supports three networks that your node can listen on:
Obviously, the more you enable, the better, but here are the basic steps for Tor in broad strokes. If you have any questions post them here and I'll see if we can't help you out:
  1. Download, verify1 and install Gpg4win
  2. Download, verify2, install, and launch Tor Browser
  3. Download, verify3, install, and launch Bitcoin Core
  4. Launch and Admin command console in the directory containing tor.exe
  5. Install the Tor service: tor.exe --service install
  6. CD to service dir: cd %windir%\ServiceProfiles\LocalService\AppData\Roaming\tor
  7. Create and edit a file called torrc with the contents suggested below
  8. Restart tor: tor.exe --service stop && tor.exe --service start
  9. Record the hostname: type .\HiddenService\hostname as
  10. Add the bitcoin.conf options suggested below
  11. Restart the bitcoin-qt program
  12. (Optional) Activate the bitnodes crawler at https://bitnodes.io/nodes/-8333/
It may take a while for your node to show up on bitnodes. I've found the check button sometimes has trouble with onions. Of course you don't need to do it, but it can provide a simple way to check status once your on the list.

torrc file: (replace c:\windows with the proper path as needed)

```

Change to C:\Windows\ServiceProfiles\LocalService\AppData\Roaming

Log notice file \tor\service.log

Bridges may be needed if the Gov't shuts down Tor exit nodes. Get Bridges by

emailing [email protected] from Gmail (only) and uncomment as follows:

Bridge obfs4 : cert= iat-mode=

HiddenServiceDir \tor\HiddenService HiddenServiceVersion 2 HiddenServicePort 8333 127.0.0.1:8333 HiddenServicePort 18333 127.0.0.1:18333 ```

bitcoin.conf file: (entries to be ADDED)

```

Change to what you recorded earlier

onion=127.0.0.1:9050 listen=1 externalip= discover=1 ```
Footnotes:
  • 1 Cert: {Subject: Intevation GmbH; SHA1: c13a65963ad53e78694dd223d518007791a05fe4}
  • 2 PGP Signing Key: 0xEF6E286DDA85EA2A4BA7DE684E2C6E8793298290
  • 3 PGP Signing Key: 0x01EA5486DE18A882D4C2684590C8019E36C2E964
submitted by brianddk to Bitcoin [link] [comments]

Windows / Linux Guide to using Trezor with Bitcoin Core (HWI)

This is a guide to using your Trezor with Bitcoin Core. It may seem like more trouble than it's worth but many applications use Bitcoin Core as a wallet such as LND, EPS, and JoinMarket. Learning how to integrate your Trezor into a Bitcoin Core install is rather useful in many unexpected ways. I did this all through the QT interfaces, but it's simple to script. There is a much simpler guide available from the HWI github, and the smallest Linux TLDR is here
Unfortunately, I don't have access to a Coldcard or Ledger. I'm not sure how the setpin or -stdinpass parameters are handled on that HW.

( A ) Install TrezorCTL, HWI, and build GUI

You only need to set the wallet up once, but may repeat to upgrade

( A.I ) Download extract and install HWI

  1. Download and isntall Python
  2. Download https://github.com/bitcoin-core/HWI/archive/1.1.2.zip
  3. Extract it to a working folder (assumes C:\User\Reddit\src\HWI)
  4. Change Directory (cd) to working folder cd "C:\User\Reddit\src\HWI"
  5. Setup venv python -m venv .venv
  6. Enter venv .venv\Scripts\activate.bat 1
  7. Install dependencies python -m pip install -U setuptools pip wheel
  8. Install TrezorCTL python -m pip install trezor[hidapi]
  9. Install HWI python -m pip install hwi pyside2
  10. Download github.com/libusb/libusb/releases/download/v1.0.23/libusb-1.0.23.7z
  11. Extract MS64\dll\libusb-1.0.dll from the archive
  12. Copy to pywin copy libusb-1.0.dll .venv\Lib\site-packages\pywin32_system32\

( A.II ) Build the QT UI files

  1. Download and install MSYS2
  2. Launch a mingw64.exe shell
  3. CD to working folder cd "C:\User\Reddit\src\HWI"
  4. Enter venv source .venv/Scripts/activate 1
  5. Run UI build bash contrib/generate-ui.sh

( B ) Create a Trezor wallet in Bitcoin Core (testnet)

You only need to set the wallet up once, no private key data is stored, only xpub data

( B.I ) Retrieve keypool from HWI-QT

  1. Launch hwi-qt.exe --testnet (assuming testnet)
  2. Click Set passphrase (if needed) to cache your passphrase then click Refresh
  3. Select you trezor from the list then click Set Pin (if needed)
  4. Ensure your Trezor in the dropdown has a fingerprint
  5. Select Change keypool options and choose P2WPKH
  6. Copy all the text from the Keypool textbox

( B.II ) Create the wallet in Bitcoin QT

  1. Launch Bitcoin Core (testnet) (non-pruned) 2
  2. Select Console from the Window menu
  3. Create a wallet createwallet "hwi" true
  4. Ensure that hwi is selected in the console wallet dropdown
  5. Verify walletname using the getwalletinfo command
  6. Import keypool importmulti '' (note ' caging)
  7. Rescan if TXNs are missing rescanblockchain 3

( C.I ) Grab Tesnet coins

  1. Select the Receive tab in Bitcoin Core (testnet)
  2. Ensure that the Wallet dropdown has hwi selected
  3. Select Create new receiving address and copy address
  4. Google "bitcoin testnet faucet" and visit a few sites
  5. Answer captcha and input your addressed copied from C.I.3

( D ) Spending funds with HWI

This is how you can spend funds in your Trezor using Bitcoin Core (testnet)

( D.I ) Create an unsigned PSBT

  1. Select the Send tab in Bitcoin Core (testnet)
  2. Ensure that the Wallet dropdown has hwi selected
  3. Verify your balance in Watch-only balance
  4. Rescan if balance is wrong (see B.II.7) 3
  5. Craft your TXN as usual, then click Create Unsigned
  6. Copy the PSBT to your clipboard when prompted

( D.II ) Sign your PSBT

  1. In HWI-QT click Sign PSBT
  2. Paste what you copied in D.I.6 in PSBT to Sign field
  3. Click Sign PSBT
  4. Copy the text for PSBT Result

( D.III ) Broadcast your TXN

  1. Select the Console window in Bitcoin Core (testnet)
  2. Ensure that the Wallet dropdown has hwi selected
  3. Finalize PSBT: finalizepsbt
  4. Copy the signed TXN hex from the hex field returned
  5. Broadcast TXN: sendrawtransaction

Final Thoughts

I did this all through the GUI interfaces for the benefit of the Windows users. Windows console is fine, but the quote escaping in windows console is nightmarish. Powershell would be good, but that throws this on a whole another level for most Windows folks.
There is also the need to use HWI-QT due to a bug in blank passphrases on the commandline. You can work around it by toggling passphrase off or on, but again, it's more than I wanted to spell out.
Footnotes:
  • 1. - Later version of python put the activate script under 'bin' instead of 'Script'
  • 2. - You can run pruned, but you need to have a fresh wallet
  • 3. - Rescan is automatic on 'importmulti' but I was pruned so it was wierd
submitted by brianddk to Bitcoin [link] [comments]

how to dump priv key

i created an address in bitcoin core and imported it watching only on electrum. And i dont know how to dumpprivkey for my wallet that i imported there to create from watching only to standart. Also i can't open the wallet on bitcoin core cause it says Prune:error: you need to reindex...
submitted by Snizaars to Electrum [link] [comments]

Power of the Command Line (bitcoin-cli, hwi, electrum, trezorctl)

I think some of the console tools available with HW wallets today are greatly under utilized. Here's a quick write-up on how to create and sign a TXN very similar to 43d27...1fc06 found on the SLIP-14 wallet. I'll be using TrezorCTL, Electrum, and HWI for the signing. I won't go much into the setup or install, but feel free to ask if you have questions about it. Note, you don't have to use all three of these. Any one will produce a valid signed TXN for broadcast. I just showed how to do it three ways. Whats more some of the Electrum and HWI steps are interchangeable.

TrezorCTL

This is the what most would think of to use to craft and sign TXNs, and is definitely very simple. The signing uses a script called build_tx.py to create a JSON file that is then used by the btc sign-tx command. The whole process is basically:
  1. tools/build_tx.py | trezorctl btc sign-tx -
This just means, take the output of build_tx and sign it. To copy 43d27...1fc06, I wrote a small script to feed build_tx, so my process looks like:
  1. ~/input.sh | tools/build_tx.py | trezorctl btc sign-tx -
But it's all very simple. Note... I used TrezorCTL v0.12.2 but build_tx.py version 0.13.0 1.

input.sh

```

!/bin/bash

secho() { sleep 1; echo $*}
secho "Testnet" # coin name secho "tbtc1.trezor.io" # blockbook server and outpoint (below) secho "e294c4c172c3d87991b0369e45d6af8584be92914d01e3060fad1ed31d12ff00:0" secho "m/84'/1'/0'/0/0" # prev_out derivation to signing key secho "4294967293" # Sequence for RBF; hex(-3) secho "segwit" # Signature type on prev_out to use secho "" # NACK to progress to outs secho "2MsiAgG5LVDmnmJUPnYaCeQnARWGbGSVnr3" # out[0].addr secho "10000000" # out[1].amt secho "tb1q9l0rk0gkgn73d0gc57qn3t3cwvucaj3h8wtrlu" # out[1].addr secho "20000000" # out[1].amt secho "tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x" # out[2].addr secho "99999694" # out[2].amt secho "" # NACK to progress to change secho "" # NACK to skip change secho "2" # txn.version secho "0" # txn.locktime ```

Electrum

Electrum is one of the better GUI wallets available, but it also has a pretty good console interface. Like before you need your Trezor with the SLIP-14 wallet loaded and paired to Electrum. I'll assume Electrum is up and running with the Trezor wallet loaded to make things simple.
Like with TrezorCTL, Electrum feeds on a JSON file, but unlike TrezorCTL it needs that JSON squished into the command line. This is a simple sed command, but I won't bore you with the details, but just assume that's done. So the process in Electrum (v4.0.3) looks like:
  1. electrum serialize (create psbt to sign)
  2. electrum --wallet signtransaction (sign said psbt)
Still pretty simple right! Below is the JSON I smushed for #1

txn.json

{ "inputs": [{ "prevout_hash":"e294c4c172c3d87991b0369e45d6af8584be92914d01e3060fad1ed31d12ff00", "prevout_n": 0, "value_sats": 129999867 }], "outputs": [{ "address": "2MsiAgG5LVDmnmJUPnYaCeQnARWGbGSVnr3", "value_sats": 10000000 },{ "address": "tb1q9l0rk0gkgn73d0gc57qn3t3cwvucaj3h8wtrlu", "value_sats": 20000000 },{ "address": "tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x", "value_sats": 99999694 }]}

HWI

HWI is an unsung hero in my book. It's a very small clean and simple interface between HW wallets and Bitcoin Core. It currently supports a good range of HW wallets. It keeps itself narrowly focused on TXN signing and offloads most everything else to Bitcoin Core. Again, I'll assume you've imported your Trezor keypool into Core and done the requisite IBD and rescan. And if you don't have the RPC enabled, you can always clone these commands into the QT-console.
To sign our TXN in HWI (v1.1.2), we will first need to craft (and finalize) it in Bitcoin Core (0.21.1). Like in Electrum, we will have to use simple sed to smush some JSON into command arguments, but I'll assume you have that covered. It will take an inputs.json and an outputs.json named separately.
  1. bitcoin-cli createpsbt (create psbt)
  2. bitcoin-cli -rpcwallet= walletprocesspsbt (process psbt)
  3. hwi -f signtx (sign psbt)
  4. bitcoin-cli -rpcwallet= finalizepsbt (get a signed TXN from psbt)
A little more involved, but still nothing too bad. Plus this gives you the full power of Bitcoin Core including integrations with LND (lightning).

inputs.json

[{ "txid": "e294c4c172c3d87991b0369e45d6af8584be92914d01e3060fad1ed31d12ff00", "vout": 0 }]

outputs.json

[{ "2MsiAgG5LVDmnmJUPnYaCeQnARWGbGSVnr3": 0.10000000 },{ "tb1q9l0rk0gkgn73d0gc57qn3t3cwvucaj3h8wtrlu": 0.20000000 },{ "tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x": 0.99999694 }]

Conclusion

This may all seem like very low level coding, but is surprisingly simple once you get a knack for it. Whats more, all these platforms support testnet which allows you to practice with valueless coins until you get the hang of it. And, like many things in bitcoin, this is all (mostly) python, which is one of the easier languages to learn.
Enjoy
Footnotes
1 - https://github.com/trezotrezor-firmware/issues/1296
submitted by brianddk to TREZOR [link] [comments]

BCH Unlimited Ubuntu PPA repo updated to version 1.9.0

The BCH Unlimited Ubuntu PPA repository has been updated to serve version 1.9.0 is available at:
 
https://launchpad.net/~bitcoin-unlimited/+archive/ubuntu/bucash
 
This release is compatible the Bitcoin Cash protocol. To update already installed packages:
 
sudo apt update sudo apt upgrade 
 
To install
 
sudo add-apt-repository ppa:bitcoin-unlimited/bucash sudo apt-get update sudo apt install bitcoind bitcoin-qt 
 
starting from this update the repository is serving also ElectrsCash(**) v2.0.0, for now just for the amd64 architecture. To install it just execute this command:
sudo apt install electrscash 
 
See the official announcement and the release notes for more details:
https://old.reddit.com/btc/comments/ih2eyt/bch_unlimited_190_has_just_been_released/
https://github.com/BitcoinUnlimited/BitcoinUnlimited/blob/release/doc/release-notes/release-notes-1.9.0.md
 
Known issues:
On Ubuntu 18.04 (bionic) you'll probably get an error while trying to install bitcoind. The error message is the following:
The following packages have unmet dependencies. bitcoind : Depends: libgcc-s1 (>= 3.4) but it is not installable E: Unable to correct problems, you have held broken packages. Package libgcc-s1 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source 
To solve the problem please do:
sudo add-apt-repository ppa:ubuntu-toolchain-test sudo apt update sudo apt dist-upgrade sudo apt install bitcoind 
 
(**) ElectrsCash is an efficient re-implementation of Electrum Server written in Rust.
submitted by s1ckpig to btc [link] [comments]

Windows Guide to using Trezor with Bitcoin Core (HWI)

This is a guide to using your Trezor with Bitcoin Core. It may seem like more trouble than it's worth but many applications use Bitcoin Core as a wallet such as LND, EPS, and JoinMarket. Learning how to integrate your Trezor into a Bitcoin Core install is rather useful in many unexpected ways. I did this all through the QT interfaces, but it's simple to script. There is a much simpler guide available from the HWI github, and the smallest TLDR is here

( A ) Install TrezorCTL, HWI, and build GUI

You only need to set the wallet up once, but may repeat to upgrade

( A.I ) Download extract and install HWI

  1. Download and isntall Python
  2. Download https://github.com/bitcoin-core/HWI/archive/1.1.2.zip
  3. Extract it to a working folder (assumes C:\User\Reddit\src\HWI)
  4. Change Directory (cd) to working folder cd "C:\User\Reddit\src\HWI"
  5. Setup venv python -m venv .venv
  6. Enter venv .venv\Scripts\activate.bat 1
  7. Install dependencies python -m pip install -U setuptools pip wheel
  8. Install TrezorCTL python -m pip install trezor[hidapi]
  9. Install HWI python -m pip install hwi pyside2
  10. Download github.com/libusb/libusb/releases/download/v1.0.23/libusb-1.0.23.7z
  11. Extract MS64\dll\libusb-1.0.dll from the archive
  12. Copy to pywin copy libusb-1.0.dll .venv\Lib\site-packages\pywin32_system32\

( A.II ) Build the QT UI files

  1. Download and install MSYS2
  2. Launch a mingw64.exe
  3. CD to working folder cd "C:\User\Reddit\src\HWI"
  4. Enter venv source .venv/Scripts/activate 1
  5. Run UI build bash contrib/generate-ui.sh

( B ) Create a Trezor wallet in Bitcoin Core (testnet)

You only need to set the wallet up once, no private key data is stored, only xpub data

( B.I ) Retrieve keypool from HWI-QT

  1. Launch hwi-qt.exe --testnet (assuming testnet)
  2. Click Set passphrase (if needed) to cache your passphrase then click Refresh
  3. Select you trezor from the list then click Set Pin (if needed)
  4. Ensure your Trezor in the dropdown has a fingerprint
  5. Select Change keypool options and choose P2WPKH
  6. Copy all the text from the Keypool textbox

( B.II ) Create the wallet in Bitcoin QT

  1. Launch Bitcoin Core (testnet) (non-pruned) 2
  2. Select Console from the Window menu
  3. Create a wallet createwallet "hwi" true
  4. Ensure that hwi is selected in the console wallet dropdown
  5. Verify walletname using the getwalletinfo command
  6. Import keypool importmulti '' (note ' caging)
  7. Rescan if TXNs are missing rescanblockchain 3

( C.I ) Grab Tesnet coins

  1. Select the Receive tab in Bitcoin Core (testnet)
  2. Ensure that the Wallet dropdown has hwi selected
  3. Select Create new receiving address and copy address
  4. Google "bitcoin testnet faucet" and visit a few sites
  5. Answer captcha and input your addressed copied from C.I.3

( D ) Spending funds with HWI

This is how you can spend funds in your Trezor using Bitcoin Core (testnet)

( D.I ) Create an unsigned PSBT

  1. Select the Send tab in Bitcoin Core (testnet)
  2. Ensure that the Wallet dropdown has hwi selected
  3. Verify your balance in Watch-only balance
  4. Rescan if balance is wrong (see B.II.7) 3
  5. Craft your TXN as usual, then click Create Unsigned
  6. Copy the PSBT to your clipboard when prompted

( D.II ) Sign your PSBT

  1. In HWI-QT click Sign PSBT
  2. Paste what you copied in D.I.6 in PSBT to Sign field
  3. Click Sign PSBT
  4. Copy the text for PSBT Result

( D.III ) Broadcast your TXN

  1. Select the Console window in Bitcoin Core (testnet)
  2. Ensure that the Wallet dropdown has hwi selected
  3. Finalize PSBT: finalizepsbt
  4. Copy the signed TXN hex from the hex field returned
  5. Broadcast TXN: sendrawtransaction

Final Thoughts

I did this all through the GUI interfaces for the benefit of the Windows users. Windows console is fine, but the quote escaping in windows console is nightmarish. Powershell would be good, but that throws this on a whole another level for most Windows folks.
There is also the need to use HWI-QT due to a bug in blank passphrases on the commandline. You can work around it by toggling passphrase off or on, but again, it's more than I wanted to spell out.
Footnotes:
  • 1. - Later version of python put the activate script under 'bin' instead of 'Script'
  • 2. - You can run pruned, but you need to have a fresh wallet
  • 3. - Rescan is automatic on 'importmulti' but I was pruned so it was wierd
submitted by brianddk to TREZOR [link] [comments]

Ubuntu -1 Setting up Bitcoin Learning Bitcoin 4 - Bitcoin Command Line Helper - Part 1 bitcoin-cli and bitcoind - Breaking Down Bitcoin Ep. 2 Programming Bitcoin - YouTube building qt project from cmd

Bitcoin software has both a graphical interface called bitcoin-qt and a console interface, bitcoind. If the first is convenient for human use, then without a text it is quite difficult to make an online store or any other service that accepts bitcoins as a payment. About it and speech will go. To work you need to run one instance of bitcoin as a daemon, so he worked as a full-fledged host on ... bitcoin-qt command line arguments. GitHub Gist: instantly share code, notes, and snippets. Skip to content. All gists Back to GitHub Sign in Sign up Sign in Sign up {{ message }} Instantly share code, notes, and snippets. donpdonp / gist:4997294. Created Feb 20, 2013. Star 3 Fork 2 Star Code Revisions 1 Stars 3 Forks 2. Embed. What would you like to do? Embed Embed this gist in your website ... In this article we will explore using a fully synced Bitcoin Core node to run commands in the bitcoin-qt console. If you don’t yet have Bitcoin Core installed on your computer, you can download ... ./bitcoin-qt Command-line arguments . These commands are accurate as of Bitcoin Core version v0.14.0. Command Description -? Print this help message and exit -version : Print version and exit -alertnotify=<cmd> Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) -blocknotify=<cmd> Execute command when the best block changes (%s in ... bitcoin-qt provides a combination full Bitcoin peer and wallet frontend. From the Help menu, you can access a console where you can enter the RPC commands used throughout this document. bitcoind is more useful for programming: it provides a full peer which you can interact with through RPCs to port 8332 (or 18332 for testnet).

[index] [39554] [4329] [5575] [45093] [35656] [42087] [24682] [26634] [33295] [49454]

Ubuntu -1 Setting up Bitcoin

New RPC commands: - getblockchaininfo - getblockcount - getpeerinfo - getconnectioncount - stop Linux terminal new stuff: watch * All other commands have been covered in previous videos www ... How to embed Bitcoin payment donation button on a website - Duration: 8:21. BTCPay Server 2,692 views. 8:21. JAVA - How To Design Login And Register Form In Java Netbeans - Duration: 44:14. ... Ubuntu -1 Setting up Bitcoin Commands, sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install bitcoin-qt sudo apt-get install bitcoind sudo blkid sudo nano /etc/fstab ... Learning Bitcoin 4 - Bitcoin Command Line Helper - Part 1. Learning Bitcoin 4 - Bitcoin Command Line Helper - Part 1 ... JSON RPC Calls with Bitcoin qt (4 of 6) - Duration: 4:25. Lars Holdgaard ... We cover chapter 3 of Andreas Antonopoulos' book Mastering Bitcoin. Featured are examples of bitcoin-cli commands, and simple Python scripts to interact with the bitcoin blockchain. Referenced links:

#