text:
Problem with the first Initialization of my LN node, dial tcp my-external-ip:9735: connect: connection timed out
Background
I was following 402 Payment Required's LN video and everything was good until the moment of the first Initialization of my LN node. I got an error: dial tcp my-external-ip:9735: connect: connection timed out.
I was starting the Initialization by the following way
lnd --externalip=X.X.X.X

And I've my lnd configuration file with the following attributes
alias=
debuglevel=debug
bitcoin.active=1
bitcoin.mainnet=1
bitcoin.node=bitcoind

I created the file (before) I started the Initialization.
Your environment
version of lnd: I don't know, I guess it's the latest version.
which operating system (uname -a on *Nix): Ubuntu 18.04
version of btcd, bitcoind, or other backend: bitcoind 0.19.1
any other relevant environment details: My Ubuntu is running on a VM machine
with a (bridged) internet connection
Steps to reproduce
I don't know how to reproduce the problem but here is a log with my issue
2020-08-14 20:33:16.008 [INF] BTCN: Server listening on [::]:9735
2020-08-14 20:33:16.009 [INF] SRVR: Initializing peer network bootstrappers!
2020-08-14 20:33:16.009 [INF] SRVR: Creating DNS peer bootstrapper with seeds: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:33:16.010 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-08-14 20:33:16.022 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:33:16.426 [INF] DISC: Obtained 1 addrs to bootstrap network with
2020-08-14 20:33:19.428 [DBG] SRVR: Waiting 2s before trying to locate bootstrap peers (attempt #1)
2020-08-14 20:33:21.428 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:33:21.463 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-08-14 20:33:21.464 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found
2020-08-14 20:33:21.464 [DBG] SRVR: Waiting 4s before trying to locate bootstrap peers (attempt #2)
2020-08-14 20:33:25.464 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:33:25.504 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-08-14 20:33:25.504 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found
2020-08-14 20:33:25.504 [DBG] SRVR: Waiting 8s before trying to locate bootstrap peers (attempt #3)
2020-08-14 20:33:33.504 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed:
[[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:33:33.539 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-08-14 20:33:33.539 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found
2020-08-14 20:33:33.539 [DBG] SRVR: Waiting 16s before trying to locate bootstrap peers (attempt #4)
2020-08-14 20:33:49.540 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-08-14 20:33:49.540 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:33:49.578 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found
2020-08-14 20:33:49.578 [DBG] SRVR: Waiting 32s before trying to locate bootstrap peers (attempt #5)
2020-08-14 20:34:21.579 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-08-14 20:34:21.580 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:34:21.735 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found
2020-08-14 20:34:21.735 [DBG] SRVR: Waiting 1m0s before trying to locate bootstrap peers (attempt #6)
2020-08-14 20:35:21.736 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-08-14 20:35:21.736 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:35:22.280 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found
2020-08-14 20:35:22.280 [DBG] SRVR: Waiting 1m0s before trying to locate bootstrap peers (attempt #7)
2020-08-14 20:35:27.316 [ERR] SRVR: Unable to connect to @my-external-ip:9735: dial tcp my-external-ip:9735: connect: connection timed out
2020-08-14 20:36:22.280 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed:
[[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:36:22.347 [INF] CRTR: Pruning channel graph using block 0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57 (height=643720)
2020-08-14 20:36:22.349 [INF] CRTR: Block 0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57 (height=643720) closed 0 channels
2020-08-14 20:36:22.461 [DBG] NTFN: Filtering 3178 txns for 0 spend requests at height 643720
2020-08-14 20:36:22.523 [INF] NTFN: New block: height=643720, sha=0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57
2020-08-14 20:36:22.523 [DBG] SWPR: New block: height=643720, sha=0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57
2020-08-14 20:36:22.523 [INF] UTXN: Attempting to graduate height=643720: num_kids=0, num_babies=0
2020-08-14 20:36:22.524 [DBG] DISC: New block: height=643720, hash=0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57
2020-08-14 20:36:22.757 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-08-14 20:36:22.758 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found
2020-08-14 20:36:22.758 [DBG] SRVR: Waiting 1m0s before trying to locate bootstrap peers (attempt #8)

I tried dig nodes.lightning.directory and got the following output
; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> nodes.lightning.directory
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48349
;; flags: qr rd ra; QUERY: 1, ANSWER: 25, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;nodes.lightning.directory. IN A
;; ANSWER SECTION:
nodes.lightning.directory. 60 IN A 93.46.54.4
nodes.lightning.directory. 60 IN A 82.1.254.100
nodes.lightning.directory. 60 IN A 83.162.151.227
nodes.lightning.directory. 60 IN A 163.158.202.112
nodes.lightning.directory. 60 IN A 212.47.254.6
nodes.lightning.directory. 60 IN A 3.12.163.140
nodes.lightning.directory. 60 IN A 178.128.165.102
nodes.lightning.directory. 60 IN A 51.83.41.129
nodes.lightning.directory. 60 IN A 193.194.163.53
nodes.lightning.directory. 60 IN A 35.229.93.213
nodes.lightning.directory. 60 IN A 52.38.99.14
nodes.lightning.directory. 60 IN A 3.16.193.211
nodes.lightning.directory. 60 IN A 73.147.115.80
nodes.lightning.directory. 60 IN A 176.122.101.230
nodes.lightning.directory. 60 IN A 173.249.48.168
nodes.lightning.directory. 60 IN A 18.223.138.245
nodes.lightning.directory. 60 IN A 203.118.186.226
nodes.lightning.directory. 60 IN A 104.248.111.88
nodes.lightning.directory. 60 IN A 46.59.13.35
nodes.lightning.directory. 60 IN A 185.228.141.6
nodes.lightning.directory. 60 IN A 98.210.161.137
nodes.lightning.directory. 60 IN A 86.176.78.2
nodes.lightning.directory. 60 IN A 152.32.173.177
nodes.lightning.directory. 60 IN A 176.74.136.237
nodes.lightning.directory. 60 IN A 45.77.156.146
;; Query time: 154 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Fri Aug 14 23:13:30 EET 2020
;; MSG SIZE rcvd: 454

Expected behavior
I expected the Initialization would work normally without any issues.
Actual behavior
The first Initialization of the LN node didn't happen, stuck in the loop of trying to locate bootstrap peers

I'm no expert on Lightning but your log suggests it is trying to obtain a list of lightning peers from lseed.bitcoinstats.com
2020-08-14 20:34:21.580 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]]
2020-08-14 20:34:21.735 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found

I tried this:
$ ping -c 10 bitcoinstats.com
PING bitcoinstats.com(2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636)) 56 data bytes
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=1 ttl=57 time=8.04 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=2 ttl=57 time=7.81 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=3 ttl=57 time=8.62 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=4 ttl=57 time=8.53 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=5 ttl=57 time=8.45 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=6 ttl=57 time=8.63 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=7 ttl=57 time=7.99 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=8 ttl=57 time=8.49 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=9 ttl=57 time=8.31 ms
64 bytes from 2606:4700:3035::ac43:8636 (2606:4700:3035::ac43:8636): icmp_seq=10 ttl=57 time=8.82 ms

--- bitcoinstats.com ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9007ms
rtt min/avg/max/mdev = 7.817/8.373/8.825/0.310 ms

So the parent organisation seems to be operational and hasn't completely blocked ICMP.
$ ping -c 10 lseed.bitcoinstats.com
ping: lseed.bitcoinstats.com: Temporary failure in name resolution

$ ping -c 10 nodes.lightning.directory
ping: nodes.lightning.directory: Temporary failure in name resolution

Which suggests there is a DNS resolution problem with the service(s) your lightning node is configured to use for peer discovery. It may be an intermittent problem.

The problem may be at their end.

You might need to rebuild using the latest source in order to pick up some other bootstrap peer service which has replaced the one your lnd node is using.

You might need to manually specify an initial peer, one that is known to be working.

References (old but may shed some light on this):

https://github.com/lightningnetwork/lnd/issues/1434
https://github.com/lightningnetwork/lnd/issues/1860


text:
Transaction confirmed by network but never showed up in bitcoin-qt
I've sent a large amount of coins to 1K7SzBTPGyyEtWsudwHpjg31LjrPf17qr4 but my bitcoin-qt client (V. 4.7.4) doesn't show any balance.
1) Under the "Receive coins" tab it shows the same address
2) The client is synced and up to date
3) Under the "Overview" tab it shows 0.00BTC for both "Balance" and "Unconfirmed"
4) Under the "Transactions" tab it shows no transactions
4) http://blockchain.info shows 278 Confirmations.
Any ideas? I am getting real worried now.

Launch the client from the command line with -rescan and it will recompute the balances for all addresses in your wallet.
For Windows:
C:\> Bitcoin-Qt -rescan

1) Shut down app
2) Start it in the command prompt as follows: bitcoin-qt -rescan
3) Wait for the process to finish as this may take a while

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
I accidentally sent BTC to Bitcoin Core watch-only wallet with private keys disabled
I think I already know the answer to this, but I just want to know for sure whether my funds are lost. I have Specter desktop connected to my Bitcoin Core. But because I also sometimes use the Core wallet as a hot wallet, I accidentally generated the address in the core wallet that is linked to my specter wallet, but the core wallet is a watch-only wallet with the priv keys disabled and then I sent funds to this address and not the address generated by Specter or my default Core hot wallet. But because this is watch-only my Core wallet does not have the priv keys. I doubt that but is there any way for the wallet to know it generated this key by enabling priv key?

The Bitcoin would then be whatever addresses your watch only wallet is watching. Bitcoin Core won't just generate a keypair and throw away the private key, that would result in fund loss. In a wallet with private keys disabled, it will only use what has been imported into it in order to create addresses. If nothing has been imported into it, then it won't be able to make new addresses at all.
If the watch only wallet was created by Specter and it imported keys into that wallet, then you should expect to see your Bitcoin in Specter as well.

Hello Andrew, thanks very much for you response. This is also what I thought, the only reason I asked the question is because, i do not see the address and balance in the specter wallet or in bitcoin core, although core says this is one of the receiving addresses. The other detail that I forgot to write in the OP, is that i imported a trezor nested segwit wallet, but since i generated this address in core with the default setting as bech32, so this is why I think i am not seeing the funds. I already tried importing the native seg from the trezor to specter to try and see it but i still don't.

If you open the RPC console and do getaddressinfo <address> where <address> is the address in question, you will get a bit more information about the address. You should see a field named desc. In the string for that field, you should see something that looks like this: [e5dbc9cb/84h/0h/0h/0/0]. You can then look at the keys for each device in specter. You should see a similar string in the key. The device and key that address came from will have a string that is a prefix to the one getaddressinfo returned. For example, I see [e5dbc9cb/84h/0h/0h].

when I do this desc does no come up, but it does for other transactions in the wallet. Does this mean the address i used is from some other wallet, possibly an attackers?

Do you see "ismine": true? Are you sure you have the right wallet selected?

ismine says false, but so do the other transactions, im very confident it is the right wallet because the payment request in core is that wallet and its the same wallet in the console

What version of Bitcoin Core?

"subversion": "/Satoshi:0.20.0/",

What about addresses that are definitely in your Specter wallet?

are you asking if they say ismine: true, because they say false but i get the full information like desc and all the other stuff, if i getaddressinfo with an address that is in the specter wallet, with the address in question much less info comes up but it shows that it is labeled

In that case, the address probably isn't part of your Specter wallet, or it wasn't imported in the typical way. In that case, it will be fairly difficult to identify where that address came from and where the private key for it is.

The only thing I can think of is because I generated at bech32 address for an imported nested wallet, and perhaps that messed up the way it is imported and means i cannot find it. Either way, it doesnt seem like I can do much about it now, I thank for you taking the time to help though, it is much appreciated.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How start make a application with php
I'm new with bitcoin, and I would like create a application that have wallets and transactions, but I dont know how start, I was reading the api blockchain.info and is interested use the module that they facilitate you. But this modules is with nodejs, and I want make my application with php (laravel).
My question is, Can i use blockchain api with php?, Is mandatory install the module of blockchain?.
I have bitcoin-core installed, but nevertheless I have not used any of the 3 commands such as bitcoind, bitcoin-cli and bitcoint-qt, I would also like to know what it is for?,
if this is combined with blockchain-wallet-service?, or How I can star using bitcoin-core to start with php?.

To get started I'd recommend you familiarize yourself with the JSON-RPC API that is built-in with bitcoin-core (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)).
Once you have installed bitcoin you need to configure it. You do this by creating a bitcoin.conf file and setting our options inside of it.
Create a new file in your text editor and make sure you have a RPC username/password and activate the daemon by setting it to 1.
rpcuser=someusername
rpcpassword=somepassword
daemon=1

Save your text file as bitcoin.conf in your /bitcoin directory. You may need to do sudo apt-get update first. Bitcoin will be installed in ~/.bitcoin
You should now be able to execute bitcoind and let it sync with the network. Navigate to your bitcoin directory and type in bitcoind in your shell.
bitcoind

Give it a few minutes to start syncing but you can verify the status of your node by typing
bitcoin-cli getblockchaininfo

Now you need to wait for the syncing to finish.
If you check the bitcoin wiki JSON-RPC page you will see references for many different languages. The library recommended for PHP is the EasyBitcoinPHPLibarary. The easiest way to get the library is to visit the GitHub page (https://github.com/aceat64/EasyBitcoin-PHP)
The easybitcoin library makes cURL requests to bitcoind's JSON-RPC 8332 port.
Copy the contents of the easybitcoin.php and save it as a new php file called easybitcoin.php. Make sure you place this file in your web server directory as you will need to require(); it in you PHP code.
Now you can start making calls to your bitcoind server through PHP, for example to get the balance of your node...
<?php
require("easybitcoin.php");
$bitcoin = new Bitcoin("someusername", "somepassword");
$balance = $bitcoin->getbalance();
print_r($balance);
?>

You can also create new addresses, by changing getbalance() in the above example to getnewaddress();. If you want to add a label for this new address just include it in the parenthesis.
$info = $bitcoin->getnewaddress("Nakamoto");

You will see a brand new bitcoin address that has been added to your node and can start accepting transactions.

Thanks to answer my question, i have other quest, when i download bitcoin-core i need install to 6gb or 300 gb in my desktop? or I need only the commands bitcoin-cli, bitcont-qt and bitcoind?, and if i need create my app i need install bitcoin in my server or in my local, to call the api?.

Typically home computers and routers are not set up to be accessed by the web. Your question asked how make an application with PHPusing bitcoin-core which implies you are working on a web server. In such case you will need to install and run bitcoin on a web server. bitcoin-cli, bitcoin-qt and bitcoind are all included with a bitcoin installation. The size varies, but you can elect to run a prune node which closer to 6GB than 300GB.

so do I have to download the full bitcore package to work? Or can I work directly with bitcoind, bitcoin-cli to develop, without the need to download the rest?

A pruned node downloads everything in order to validate properly, but it purges old blocks after validation so that the disk space used is limited.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Where are getnetworkinfo localservicesnames explained?
Bitcoin-cli getnetworkinfo returns a list of human readable localservicesnames. Where can one find more info about them?

Hmm, the wiki lacks some of them. Updating it and will post an answer :)

You can find a list of the assigned (through the BIP process) service flags in the wiki protocol documentation.
The service flags supported by the reference client are defined in src/protocol.h .


text:
Implement HD Walet Full Node
I have set up a full node on my server. Now, I want to make use of HD wallet methods?
How I generate an address for admin - Master address
How I generate addresses for customers - Child address
When I receive the deposit on child address, how it can be viewed on Master Address?
Do I need to transfer to the master address?
As I want to move all amount to my Cold wallet address so to do so I need to have a balance on my master address?
Please help

you should add some more information. which software are you running? have you read the the documentation to this software? And as you have many questions you should consider splitting them to single requests so it can beanswered individually and may help people with the exact same question.

I downloaded latest version of bitcoin-core from here https://bitcoin.org/en/download
Yes i have gone through the RPC command https://bitcoin.org/en/developer-reference#rpcs
As i am very new to this, i need help in setting up HD wallet.
How I generate an address for admin - Master address?
How I generate addresses for customers - Child address?
When I receive the deposit on child address, how it can be viewed on Master Address?
Do I need to transfer to the master address?
As I want to move all amount to my Cold wallet address so to do I need to have a balance on my master address?

as already told, it seems you mix up some topics and put several questions under one topic. the goal of this page is to produce a knowledge base to find answers on special questions which is impossible if we answer your 5 questions in one post.

Sorry, but I am not following you. All questions are related to the HD wallet only? Do u want me to post a separate question for each? Please suggest?

some of your questions are related to hd wallets some related to general handling, some to security aspects. but at all, these are 5 seperate questions... and most basic ones discussed several times here and elsewhere. make sure you`ve done basic research before please. Your questions look like you do not have a basic understanding of (hd) wallets and address generation. And most of your questions are related to a single api call - if you have questions to one, here you´ll get the answer, but don´t expect us to do the research for you.

Hi @Michael I already running a private node and have implemented all API in several of my projects. But I am not aware of the HD wallet, the only thing I know is a theory that addresses are generated from master address and can be recovered from master seed.I need help to get the methods that I can use to implement an HD wallet. If there is any documentation available let me know.My friend i am not expecting research from you, just need a guide/help which i can follow for my implementation.

realy? no information about HD wallets in the whole internet? https://bitcoin.org/en/developer-reference#type-2-hierarchical-deterministic-hd-wallets https://bitcoin.org/en/wallets-guide#wallet-programs https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki ...

@Michael these I have already looked at. Anyways Thanks for your help.


text:
How exactly do ordinals and inscriptions work, technically?
Looking for a technical explanation for how ordinals and inscriptions work and how they differ from one another.

I removed the question about fungibility since another question already covers this and questions here work best when they keep to a single topic.

The idea that ordinals work is opinionated and has not been subject to the test of time.

inscriptions are the data (the JPEG for example) being inscribed into the witness section of a block. Once this data/inscription is burnt into the block via multiple confirmations of that block, it never moves again. It stays fixed in the same block number within the same witness section of that confirmed block,
Ordinals are the satoshis associated with this inscription event/burning of data into a block. They are often 10000 satoshis (called an envelope) that are leftover change. People use custom tracking software to track these satoshis after the inscription event so that people can trade them to each other as some kind of weird association game.
You can think of these 10000 satoshis/ordinals as a receipt.
People often trade these receipts thinking that the jpeg/inscription data moves with them. But that's not the case.
All that is really moving is the satoshis/receipt when ordinals are traded.

So in order for this game to work... the 10000 sats cannot be merged with other sats? (? because if it was merged with more sats you would have more than 1 copy ?! -- but then how to pay miner fee?) , and the tracking software needs to trace back all of its transactions/trades until it finds the data/inscription?


text:
Initial blockchain sync stuck on block 237158
Stuck on block 237158. Rebooting doesn't work.
Do I need to start from scratch?
admin@raspberry2bit:~ $ sudo tail -f /mnt/ext/bitcoin/debug.log
2020-10-26T08:48:30Z Loading addresses from DNS seed dnsseed.bitcoin.dashjr.org
2020-10-26T08:48:30Z Loading addresses from DNS seed seed.btc.petertodd.org
2020-10-26T08:48:30Z Loading addresses from DNS seed seed.bitcoin.sipa.be
2020-10-26T08:48:41Z Loading addresses from DNS seed dnsseed.bluematt.me
2020-10-26T08:48:41Z Loading addresses from DNS seed dnsseed.emzy.de
2020-10-26T08:48:41Z Loading addresses from DNS seed seed.bitcoinstats.com
2020-10-26T08:48:52Z Loading addresses from DNS seed seed.bitcoin.jonasschnelli.ch
2020-10-26T08:48:52Z Loading addresses from DNS seed seed.bitcoin.sprovoost.nl
2020-10-26T08:48:52Z 0 addresses found from DNS seeds
2020-10-26T08:48:52Z dnsseed thread exit

admin@raspberry2bit:~ $ systemctl status bitcoind.service
● bitcoind.service - Bitcoin daemon
   Loaded: loaded (/etc/systemd/system/bitcoind.service; enabled; vendor preset:
   Active: active (running) since Mon 2020-10-26 16:47:23 CST; 21min ago
  Process: 672 ExecStart=/usr/local/bin/bitcoind -daemon -pid=/run/bitcoind/bitco
 Main PID: 680 (bitcoind)
    Tasks: 18 (limit: 4915)
   CGroup: /system.slice/bitcoind.service
           └─680 /usr/local/bin/bitcoind -daemon -pid=/run/bitcoind/bitcoind.pid

admin@raspberry2bit:~ $ bitcoin-cli getblockchaininfo
{
  "chain": "main",
  "blocks": 237158,
  "headers": 654013,
  "bestblockhash": "00000000000000fdd7d1d53f13da7654e80a645a7ea09a5763b62ff6355fe61b",
  "difficulty": 11187257.46136079,
  "mediantime": 1369114906,
  "verificationprogress": 0.03152660781442522,
  "initialblockdownload": true,
  "chainwork": "000000000000000000000000000000000000000000000043f4c527c060c0911f",

Does this answer your question? bitcoind in testnet is not synchronizing ... your log message  "0 addresses found from DNS seeds" is what you need to fix


text:
What happens to a coinbase transaction when no address is given?
The transaction block
This coin base transaction has no valid address for reward. Did we lose that reward bitcoin forever?

related: https://bitcoin.stackexchange.com/q/67009/5406, https://bitcoin.stackexchange.com/q/89039/5406, https://bitcoin.stackexchange.com/q/38994/5406

In the event that the Coinbase transaction produces outputs that total less than the eligible block reward, any unclaimed coins are permanently lost.
In this specific case, the entire block reward of 12.5 BTC was permanently lost.
There have been other instances where miners only partially claimed the full amount they were able to claim, also leading to a permanent loss.
Note that in scenarios like this, it leads to a reduction of the total supply of bitcoin. There are other types of losses, such as sending coins to an address with no known private key, which don't reduce the total supply.


text:
How to transfer a Bitcoin-core wallet to new computer
what is the best way to transfer my Bitcoincore wallet? it has a wallet.dat backup file but what do i do with it? do i simply download the app on the ne PC and copy that file onto it?

This question is similar to: Restore encrypted wallet. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.


text:
How to restore access to wallet from 12 words
1E1wEgVdb6FafvNzW7WfQKyBHu9Xk4dsio and there are 12 words. But I don't know where to look for this wallet. The wallet is more than 10 years old. I will be grateful for any help. I don't really understand this.

You need to know the name of the wallet software that was used and then use the appropriate recovery process for that software.
For example, for the  wallet software named Electrum see  Restoring your standard wallet from seed which says

Begin by creating a new wallet file as per this guide.

Click on next to see the wallet type selection window:

As you can see Electrum supports different types of wallets. You need to select the same type of wallet that you are restoring which in this case is the “Standard wallet”
In the next step electrum asks you to choose where the wallet secret will come from
Choose “I already have a seed”

Then enter your seed words:
Once you’ve entered valid seed words the next button will become enabled and you’ll be able to proceed to the next step.
Note: If the seed words are from another wallet, like the blockchain.info wallet, Bither or Mycelium, then you have to press options and check bip39.
If the seed words are from Bither wallet then make sure you replace the hyphens in the seed phrase with spaces. It should display ‘BIP39 checksum OK” next to the options button when you’ve entered a valid bip39 seed mnemonic.
If the originating wallet is MultibitHD, Bread Wallet or Bitcoin Wallet for Android by A. Schildbach then follow the guide here instead.

If your seed words are from a bip39 wallet (i.e. not Electrum) you will be shown this window below. Choose the legacy p2pkh option if the addresses in the originating wallet begin with ‘1’, p2sh-segwit if they begin with ‘3’ and native segwit if they begin with ‘bc1’:
Note that last digit in the derivation path denotes the HD account number. If the recovered wallet does not reflect all your funds repeat the restoration process with a new wallet file and increment the last number. Do this again and again until you have recovered all HD accounts. For example: m/44’/0’/1′ to restore the second HD account, m/44’/0’/2′ for the third HD acccount etc. Note also that the single quotes in the derivation path are not optional.

Electrum now asks you to enter a password to protect your wallet file. This is optional but strongly recommended:

Finally it generates your addresses and displays the electrum window:


text:
What is the difference between the two types of Blockchain.com wallet?
Really new to cryptocurency so bear with me.
I am currently using Bockchain to store the Bitcoin. But, what is the difference between "My Bitcoin Trading wallet" and "My Bitcoin Wallet"?
Also, what software do I use to start mining coins like Bitcoin or Ether?

https://support.blockchain.com/hc/en-us/articles/360051018031-Technical-differences-between-the-Wallet-and-Trading-Wallet

"Bitcoin Wallet" wallet on Blockchain.com is a "non-custodial" wallet -- this is probably what you want, and it'll let you send and receive Bitcoin to and from a wallet with a key that you own. You can import this key into other wallet software if you ever need to.
"Bitcoin Trading" wallet on Blockchain.com is a "custodial" wallet -- meaning it's a balance held on Blockchain.com, similar to a balance you might hold on any other exchange. If you want to buy or sell Bitcoin using Blockchain.com then you'll need to sign up for this, and it'll require you to upload identity verification documents.
To start mining Bitcoin you will need to purchase an ASIC. To mine Ethereum you'll need at least a recent high-end GPU, software such as Ethminer (https://github.com/ethereum-mining/ethminer/releases), and to join a mining pool.


text:
GetBlockChecked always returning genesis block?
currently I'm exploring Bitcoin source code and I tried to add custom function getblockvalue inside of blockchain.cpp.
Purpose of function is to return sum of all transaction outputs inside of a block based on given height as an argument.
static UniValue getblockvalue(const JSONRPCRequest& request)
{
    int blockHeight = request.params[0].get_int();
    if (blockHeight < 0 || blockHeight > ::ChainActive().Height())
    {
        throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
    }

    CBlockIndex* pBlockIndex = ::ChainActive()[blockHeight];
    if(pBlockIndex == nullptr)
    {
        throw JSONRPCError(RPC_INVALID_PARAMETER, "Block index is NULL");

    }
    const CBlock block = GetBlockChecked(pBlockIndex);
    UniValue resultObject(UniValue::VOBJ);
    double blockValue = 0;
    int numberOfTransactions = 0;

    for(const auto &transaction : block.vtx)
    {
        for (unsigned int i = 0; i < transaction->vout.size(); ++i)
        {
            blockValue+= transaction->vout[i].nValue;
        }
        ++numberOfTransactions;
    }

    resultObject.pushKV("blockHeight",          (int)blockHeight);
    resultObject.pushKV("numberOfTransactions", (int)numberOfTransactions);
    resultObject.pushKV("blockValue",           ValueFromAmount(blockValue));

    return resultObject;
}

I did all necessary changes: I added argument to vRPCConvertParams[] and extended CRPCCommand commands[].
So, I tried calling bitcoin-cli -testnet getblockvalue 25; result is:
{
"blockHeight" : 25,
"numberOfTransactions" : 1,
"blockValue" : 50.00000000
}

The result is the same for every given block height. It always gives me information about genesis block. Can you help me what did I do wrong here?

What makes you think it is always returning the genesis block? Did you try a recent block?

I tried a lot of random numbers. I'm not sure it does, but its odd to me that every block has the same result of a function? To be honest I tried number "999999" as block height and it gave me result: numberOfTransactions 2, and blockValue: 3.1264. And i thought that is a part of an error, because seeing only 2 transactions inside of a block, is to small... is it?

@AndrewChow you were right, code is ok. Thank  you a lot. Since you are moderator, should i just delete my question since has no point?

Misconceptions should be addressed in the answer to a question, and self-answers are welcome. You could therefore submit an answer to explain what you found out, if you think it would be interesting to future readers.

Ok, so the code is just fine as Andrew assumed.
It was odd to me that first several blocks are the same. They all have one transaction and the same output value of 50BTC, but according to site https://blockstream.info/testnet/, where you just type a block height in search bar and you can see all transactions inside of resulting block, this is correct.


text:
Unable to make custom Bitcoin command
I'm writing a thesis on Bitcoin system and as a part of my assignment i have to explore Bitcoin-core source code.
I 've downloaded the code, compiled it and manage to run it.
However, I wanted to make a trivial change to the code and add some simple custom command as part of blockchain.cpp.
Problem is that my changes are not visible after i run make and when I run bitcoin-cli -testnet .
I always get:
error code: -32601
error message:
Method not found
Also, i tried commenting out one already functional method and tried to run bitcoin-cli and calling that function and it runs successfully.
NOTE: command "make" runs smoothly and it does detect errors if there are any.
Can someone explain me what is a proper way to make change to bitcoin-core? I am not planning to push any of those changes to master branch, I'm just interested in experimenting with code.
Thanks in advance :)

To add a new RPC, you need to write the function the implements it's action, add the function to the dispatch table, and update bitcoin-cli's type conversion table.
At the bottom of the RPC file you added your function to (in this case, src/rpc/blockchain.cpp, you will see a table that has all of the RPCs in that file as well as some extra information about them like category, name, and argument names. Add your new RPC to that table.
Next, if your command has any arguments which are not strings, open src/rpc/client.cpp and add those arguments to the vRPCConvertParams list there. In that list, you give it the RPC name, the index of the argument that needs to be converted, and the name of that argument.

Hello, first of all, thank you for your answer. Second of all i think i did all you mentioned. To be more specific, i followed the steps on this link:
https://technology.finra.org/code/compile-run-customize-your-own-bitcoin-client.html

To be more precise, I added function with randomName to blockchain.cpp, i added it to vector command[] at the bottom of the file and i added it into client.cpp
It seems to me, when i call "make" upon repo bitcoin-master, changes are visible (because i had some errors), but when i call bitcoin-cli -testnet methodName, function is invisible.
Thats why i tried to comment out, for example, funcion "getblockhash" from blockchain.cpp and from client.cpp just to see are my changes visible. Command make was successful, but i was still able to call bitcoin-cli -testnet getblockhash

Did you restart bitcoind after recompiling? The commands are part of bitcoind, not bitcoin-cli. bitcoin-cli is merely a way to access the RPC interface of bitcoind via the command line. It doesn't actually have the command implemented in it.

Thank you a lot Andrew for your support, but..
After my change, i enter:
bitcoind -testnet --daemon
which results with:
Bitcoin Core starting
When i make a change in the middle of running BitcoinCore, firstly i type:
bitcoin-cli -testnet stop
Which results:
Bitcoin Core stopping
And then type command for starting bitcoin again
Am i doing something wrong?

Hm, the secret is in calling sudo make install, not make Now my changes are visible by bitcoin-cli Thank you Andrew Chow for your support, but do you know maybe the difference between make and make install?

make compiles it. make install compiles and then copies the compiled binaries to an installation location. If you were not directly using the binaries by specifying a path to them (i.e. src/bitcoind and src/bitcoin-cli), then your system will try to find them by looking them up in the PATH. make install copies the binaries to a location that is in the PATH.


text:
Import bitcoin address only with public key

I want to import a none spendable paper wallet. This was possible in the past. But now I am only allowed to import an adress with the private key. So this address won´t be none spendable. Was there an update which changed this?

If you are looking for watch only wallet, the Sentinel or BLuewallet watch-only would be the best option.
https://samouraiwallet.com/sentinel
https://bluewallet.io/watch-only/
They do import wallets based on the xpub(ypub/zpub). Blockchain.info in general is a very weak implementation with engineering flaws.


text:
How are the prefixes for EXT_PUBLIC_KEY and EXT_PRIVATE_KEY derived?
I want to know how the prefixes for EXT_PUBLIC_KEY and EXT_PRIVATE_KEY are derived. For example in bitcoin you have:
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,0);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,128);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};

And I another cryptocurrency has:
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,25);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SECRET_KEY]     = std::vector<unsigned char>(1,153); // 25 + 128
base58Prefixes[SECRET_KEY_OLD] = std::vector<unsigned char>(1,151);
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x1E)(0x56)(0x2D)(0x9A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = list_of(0x1E)(0x56)(0x31)(0xBC).convert_to_container<std::vector<unsigned char> >();

Im trying to make a server that generates addresses from the Extended public key without exposing the private key on the latter cryptocurrency but I've been running into some problems. I want to understand how the EXT_PUBLIC_KEY is derived as for the development and how it is used  to generate addresses. I'm trying to implement it into pywallet (https://github.com/ranaroussi/pywallet) but it seems to not support this kind of EXT_PUBLIC_KEY

Are you asking about the prefixes or the actual keys themselves? The code you posted is related to the prefixes and not at all anything to do with key derivation.

Sorry, the question has been edited. I was asking about the prefixes


text:
Why listdescriptors yields different xpub keys for a brand new wallet in bitcoin core
I noticed that if I listdescriptors true immediately after creating a brand new wallet, it would list 8 descriptors that all use the same xprv key.
However, listdescriptors false would list 8 xpub keys, and they are not all the same key. Note in the example below how public keys start with:

xpub6ChP1W
xpub6CyAaD
xpub6Cc74F
xpub6BmTmL

Why are they different?
Example
Public (API parameter "private": false):

Key                                                        Active   Internal
pkh(    [ab7bc48f/44'/0'/0']xpub6ChP1W.../0/*)  #ma29dzhm     +         -
pkh(    [ab7bc48f/44'/0'/0']xpub6ChP1W.../1/*)  #2f0ysh8r     +         +
sh(wpkh([ab7bc48f/49'/0'/0']xpub6CyAaD.../0/*)) #zwwuauzd     +         -
sh(wpkh([ab7bc48f/49'/0'/0']xpub6CyAaD.../1/*)) #h0q29rhj     +         +
tr(     [ab7bc48f/86'/0'/0']xpub6Cc74F.../0/*)  #l6jyecux     +         -
tr(     [ab7bc48f/86'/0'/0']xpub6Cc74F.../1/*)  #wwh9ydv7     +         +
wpkh(   [ab7bc48f/84'/0'/0']xpub6BmTmL.../0/*)  #80mc28c3     +         -
wpkh(   [ab7bc48f/84'/0'/0']xpub6BmTmL.../1/*)  #km7ehjgf     +         +

Private (API parameter "private": true):

Key                                                Active   Internal
pkh(    xprv9s21Zr.../44'/0'/0'/0/*)  #5l2phqsm      +         -
pkh(    xprv9s21Zr.../44'/0'/0'/1/*)  #9t0q24qr      +         +
sh(wpkh(xprv9s21Zr.../49'/0'/0'/0/*)) #r78qs2yd      +         -
sh(wpkh(xprv9s21Zr.../49'/0'/0'/1/*)) #9a09t80e      +         +
tr(     xprv9s21Zr.../86'/0'/0'/0/*)  #02tnkr5v      +         -
tr(     xprv9s21Zr.../86'/0'/0'/1/*)  #77wjtky5      +         +
wpkh(   xprv9s21Zr.../84'/0'/0'/0/*)  #93lra6e7      +         -
wpkh(   xprv9s21Zr.../84'/0'/0'/1/*)  #596zq0fx      +         +

Backing Up Descriptors
My understanding was that having saved the xprv key only, I'd be able to fully recreate a similar wallet on a different node - because I could derive xpub from xprv. But now I got confused - how would I derive those xpubs, and why there are more than one.

Non-private descriptors are "normalized" before being listed. This process includes deriving the keys it contains to the last hardened step.
All the xpubs in your example are derived from the same master extended key, ab7bc48f, but at different paths. You'll notice these derivation paths are the same as those used in the private version of the descriptor. Except in the private descriptors there is no need to derive at the last hardened step since you have access to the master xpriv already.


text:
listdescriptors true fails after importing a 2-of-3 multisig descriptor (prv, pub, pub)
By deafult, in a newly created descriptor wallet that is not watch-only and not empty, listdescriptors true works and gives output.
However, here is a scenario that breaks it:

Get a new address in the descriptor wallet.
Retrieve its public address (pub1)
Create a multisig address with using this public address (pub1) and two others (pub2, pub3)
Import the following descriptor into the wallet: sh(multi(priv1,pub2,pub3); I retrieved priv1 from listdescriptors true.
Now, if I try listdescriptors true again, an error is returned:

"error": {
  "code": -4,
  "message": "Can't get descriptor string."
}

Is this expected as a result of how I imported a descriptor that mixes xprv and pubkeys, or is it a bug?

Note: when importing such a descriptor, I got a warning:
{"success": true, "warnings": ["Not all private keys provided. Some wallet functionality may return unexpected errors"]}


text:
Where to find old versions of bitcoin
Where to find old versions of bitcoin-qt from 2011-2012 for download? I cannot find anything on the source code repository and all links I've found on forums are dead.
Is anyone able to assist finding the very old windows bitcoin-qt downloads?

Preemptively, you don't need an old version of the software to open an old wallet; it would be unwise to use any of the extremely old Bitcoin versions.

I want to analyse see how the random seed was generated in old versions, mainly the UI part, I don't plan on opening any wallets or doing any transactions.

@rolls Perhaps it is more interesting to ask directly how keys were generated in old versions of Bitcoin-Qt? A good answer would include references to source code to support its claims.

I want the actual release so I can see the UI for generating and saving the random seed. So I can assist with the off chance it is recoverable. I can't find any examples of what the random seed data (from moving your mouse) looked like.

Before Bitcoin Core 0.13 there was no concept of a "random seed", as wallets weren't deterministic. Keys were just generated randomly, each individually, and added to a keypool. In old versions, OpenSSL's random number generator was used. You need to look at the source code for this, I don't think you can easily derive this from looking at the binary.

That is what I suspected. Thanks.

You can find source code (and sometimes pre-built executables for some platforms) for obsolete versions of Bitcoin core (previously just known as bitcoin-qt or bitcoin) at these locations:

From version
To version
Repository

-
0.1.0
zorinaq.com currently has source for v0.1.0

0.1.x
0.10.x
the Internet Archive, also known as The Wayback Machine, has source code for many versions (e.g. 0.8.4) that used to be stored at Sourceforge but which are no longer available there.

0.10.0
current
GitHub has source code for releases from at least v0.10.0 to the current version (28.0 at time of writing)

As people have commented: if you want to open an ancient wallet file, you don't need an old version of Bitcoin, the current version should be able to open old wallets.
To compile older versions on modern operating systems requires extra work. This is at least partly due to changes in shared libraries etc. See AChow's notes on Building Old Bitcoin Core Releases

Biggest question was to see how the entropy for the key was generated. The wallet is long gone afaik now. However I have the hard drive that it was on., I can recover some files but not the wallet.dat. If I could figure or how the entropy was generated maybe there are some temp files still available. I have they password the file was encrypted with and the address, then finally a hard drive that was likely formatted or had appdata cleared.

You can find the first release of bitcoin on this old bitcointalk thread offered by Hal Finney himself https://bitcointalk.org/index.php?topic=68121.0
For the more recent version, circa 2009 you can dig the official github repo releases https://github.com/bitcoin/bitcoin/releases

The releases on github do not have binaries.

These must be compiled, compiling qt on windows is not trivial even for a developer unfamiliar with it.

@rolls: Do you need to compile? Can't  source inspection be used to "see how the random seed was generated "?

The source code is happily all in the same source tree for every version since 0.1. None of the versions you're talking about used HD seeds though, they used raw private keys.

I want to see how the random seed was displayed, if there was a prompt to back it up and if so what the random data looked like, eg how many bytes, base64 etc. I remember being prompted to move a mouse around the screen to generate seed data.

You say they used raw private keys, how were the private keys generated then? They must have had a random seed from somewhere, from memory you generated the seed data from moving your mouse around the screen.

@rollsch Moving the mouse feeds entropy to the internal random number generator (which in very early Bitcoin versions used OpenSSL's code, which on itself gathers entropy from multiple sources, including hardware, OS, ...). Then that random number generator was used to generate private keys directly. There was no explicit "seed" involved.

It woud be great to see the how this entropy looked so I could search memdumps etc for it as I have all the other information (pc, os, hard drive etc)

I have a copy of the Windows 32-bit version 0.4.0 of the Bitcoin client (from 2011), install .exe file.  If you want a copy, let me know.

Thanks but I would need to ensure I trust the source of the file.


text:
Bitcoin Wallet Crash Report
I was into bitcoin back when it started years ago, but over the years I got busy with other things and forgot about it until all the recent news. I was able to locate two emails from 2011 notifying me of Bitcoin wallet crash report. I think that was about the time I also switched phones from android to apple.
The below info is what's in the email sent to me. Will I be able to retrieve my wallet info from the information in this email? If so, please explain how I can access this wallet again. Information listed as (XXXXX) is identifying information I have left out of the email chain log. Thank you in advance for your assistance.
Date: Thu Nov 10 10:13:26 CST 2011
Version: 1.39 (55)
Package: de.schildbach.wallet
Phone Model: LG-P509
Android Version: 2.2.2
Board: thunderg
Brand: LGE
Device: thunderg
Display: FRG83G
Finger Print: LGE/thunderg/thunderg/(XXXXX):user/release-keys
Host: android-buildserver
ID: FRG83G
Model: LG-P509
Product: thunderg
Tags: release-keys
Time: (XXXXX)
Type: user
User: (XXXXX)
Configuration: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=1 layout=18 uiMode=17 seq=25}
ScreenLayout: size 2 long 16
DisplayMetrics: DisplayMetrics{density=1.0, width=320, height=480, scaledDensity=1.0, xdpi=159.37254, ydpi=160.42105}
Databases: address_book webview.db webviewCache.db

=== collected at exception time ===

Total Internal memory: 209190912
Available Internal memory: 27512832

java.lang.NullPointerException
at android.widget.TextView.onTouchEvent(TextView.java:6831)
(XXXXX)

Contents of FilesDir /data/data/de.schildbach.wallet/files:
2011-11-10 10:13:26  files  [0]

2011-11-09 10:56:28  wallet (XXXXX)
2011-11-10 10:13:26  key-backup-(XXXXX)
2011-11-09 12:47:42  key-backup-(XXXXX)
2011-11-10 10:13:26  key-backup-(XXXXX)
2011-11-10 10:13:26  key-backup-(XXXXX)

Contents of CacheDir /data/data/de.schildbach.wallet/cache:
(XXXXX)

Before doing anything I would make some extra copies of those files onto some other media.
I think you should probably be able to download the latest version of the "Bitcoin Wallet" for Android (less ambiguously known as the Schildbach wallet) onto a new Android device, copy the backup file to the device, and then use the wallet's features to recover from those backup files. Menu, Safety, Restore, specify file. You might need to know the password you chose.
If a password was set, the files will be encrypted. There are programs that can help to find a password if you have some ideas about the password. One is btcrecover:

Bitcoin wallet password recovery support for
[...]

Bitcoin Wallet for Android/BlackBerry spending PINs and encrypted backups

Thank you for your assistance. Greatly Appreciated


text:
What is scriptpubkey for in the coinbase transaction ? (and more..)
I'm about to mine and I reached a part when I want to generate the coinbase transaction.
I won't complicate things by putting in the new block transactions and getting the fees for them.
All that matters is to mine a block (seems that the coinbase transaction is counted as 1 transaction for the whole block? True?)
Take a look at this PHP function and check the comments (let me know if I'm wrong somewhere)
function coinbase_gen($block_height){         //(decimal)$block_height would be the last official block number +1
$ver='01000000';                             // seems that this version won't change anytime soon?
$i_count='01';                              // In that situation it is always 01?
$txid='0000000000000000000000000000000000000000000000000000000000000000';   //always as well
$vout='ffffffff';                          // always?

$coin_nextbytes=dechex(strlen($block_height)/2);

$block_height=SwapEndianess(dechex($block_height)); //reassign the height to VarInt
$sig=$coin_nextbytes.$block_height."f48616f4254432f53756e204368756e2059753a205a6875616e67205975616e2c2077696c6c20796f75206d61727279206d653f2f06fcc9cacc19c5f278560300";
$sig_size=dechex(strlen($sig)/2);

$sequence='ffffffff';                 // Some people put 0000000 in here.. Why?
$o_count='01';
$o_value='40be402500000000';          //6.25 BTC !!!
$pubkeysize='19';
$script_pubkey='76a914bfd3ebb5485b49a6cf1657824623ead693b5a45888ac'; //Please answer..
$locktime='00000000'; // Seems good
return $ver.$i_count.$txid.$vout.$sig_size.$sig.$sequence.$o_count.$o_value.$pubkeysize.$script_pubkey.$locktime;
}
coinbase_gen((int)$last_blockn); // just example how I'll generate it.

As you can see I have many questions in the code, but I need to know about that $script_pubkey. Some blog posted it as example to mine,but I feel that any bitcoin mined will reward $script_pubkey which is somebodies wallet public key (encrypted) ? OR this does not matter for the coinbase transaction and when I submit the block with bitcoind RPC it will make sure that it will go to my wallet?
This is important to know. Thanks.

Rolled back to last revision as the question doesn't make much sense without the code, especially if you leave in phrases like "Take a look at this PHP function".

The mined Bitcoin "goes" to the scriptPubKey(s) in the coinbase transaction.
Bitcoin operates on spending transaction outputs. Submitting a block does not magically cause a transaction output to appear, you need to specifically create them. This is done through the coinbase transaction (and is really the purpose of it). The only different between a coinbase transaction is that it doesn't have any real inputs. But just like with normal transactions, coinbase transactions can create any number of transaction outputs as it wants, and these just need to follow the rules for output validity.
Thus for a miner to be paid, they need to make sure that the coinbase transaction has transaction outputs that they can spend, and that the amounts for those outputs are what they want to be paid. This means that if you want to collect transaction fees, you need to set the amount to also include the transaction fees of the block, otherwise that Bitcoin will be gone forever. The rule for output amounts in a coinbase transaction is that they must not be greater than the block subsidy + transaction fees for that block.


text:
Sign unsigned transaction with TrustWalletCore Swift
I'm trying to understand how we can sign unsigned transaction in hex format.
We use TrustWalletCore, I receive an unsigned tx in hex format, then we decode it to data with
let dataToSign = Data(hex: unsignedTxHex)

then sign it with wallet core method:
`coinPrivateKey`.sign(digest: dataToSign, curve: .secp256k1)

and I tried:
`coinPrivateKey`.signAsDER(digest: dataToSign)

then covert it to hex again:
let signedStr = signedData?.toHexString()

And I tried to decode it using this service
And receive error:
"error": "Cannot read slice out of bounds"
How I can resolve this problem? Thanks a lot for your comments and answers


text:
What happens if HTLC value is below dust limit
What happens if the HTLC value is less than the dust limit?
Logic tells me that you cannot create an HTLC output because the transaction would be rarely propagated.
How do you make multi-hop payments of small value then?

Any output in a commitment transaction, not only HTLCs, may have a value below the dust limit. Any output whose value would be below the dust limit does not get created in the commitment transaction. This has the effect of adding the output's value to transaction fees. As HTLCs get resolved in a second-stage transaction, the output must not be created if any output of any second-stage transaction would be below the dust limit. See the "Trimmed Outputs" section of BOLT #3.
Payments below dust cannot be enforced onchain. Note however it's the case for any uneconomical output. An HTLC output whose value is above dust but below what it would cost in transaction fees to claim onchain is likewise unenforceable.

How can I do 10sat payments through the LN then?

@polespinasa as a user you wouldn't see a difference. Under the hood, as described in my answer, each hop would add it to fees instead of creating an HTLC in their commitment transaction pair.


text:
What is the meaning of BTC Transaction?
I'm studying BTC Transaction
What is the BTC transaction below mean?
Input(1)

bc1asd~ : 0.00741579 BTC

Output(2)

1ASDAC~ : 0.00678954 BTC

Binance(bc1q~~~5d24) : 0.0003 BTC

What is 0.0003 BTC?
A transfer fee? or change?
And, Is it a transaction from one Binance wallet to another?
please let me know
please...

There are no transfer fees in Bitcoin, Only transaction fees. The transaction fees are not shown as outputs but are sum of outputs minus sum of inputs.
It is often impossible to distinguish change from payment. This is deliberate.
It is usually impossible to know what person or organisation controls the keys for an address, if they care about their privacy.

most this is self explanatory - input1 is wallet the coins cam from and the 2 outputs are the walletrs the coins are going to. - No they dont have be binance wallets as far as I know. 0.0003 BTC is the value of ur cash in bitcoins - everytime there is movemet of coins on the chain it is known as a transaction. The fees are what the miners make for doing the calculations and making sure everything goes where we have asked it to go


text:
Are my funds now lost for ever?
I wanted to as much my funds in BITCOINS to be exchangeed and transfared to my SKRILL ACCOUNT in €.
So in the ATOMIC cryptowallet I choose the lowest fee for this transaction. I sent BTC to the exchanger on 31st of January 2024 around 11 o'cock in the afternoon and today is 4th of February 2024 and my transaction has still STATUS PENDING.
ARE MY FUNDS LOST FORBEVER? BUT WHY THEN ATOMIC WALLET OFFERS SO LOW FEES?
OR IF MY FUNDS ARW NOT LOST, HOW LONG I WILL HAVE TO WAIT UNTIL MY FUNDS WILL BE IN MY SKRILL ACCOUNT OT BACK TO MY ATOMIC CRYPTOWALLET?
MY HASH: b6a37f8459f0e76f8fb5fb7f63c51048dae65b7b847f3c7ce63dcb27746d94f4

Are my funds now lost for ever?

No, funds sent in transactions that are not yet confirmed are still under the control of the sender. No one else has control over them.
See information about your transaction at a blockchain explorer

Your transaction fee:  1 satoshi per byte
Recommended fee:      52 satoshi per byte

Transaction status:           Waiting for confirmations 0 of 6
Est. time to 1 confirmation:  in 1 day

That particular explorer's estimate seems optimistic.
See https://bitcoinfees.net/

Remember, the transaction-fee you offer is effectively your bid in an auction of space in the next block of the blockchain. Your low-bid transaction will wait until miners run out of transactions with higher bids. That might take months with a very very low bid
The appropriate actions available are described in Why is my transaction not getting confirmed and what can I do about it?


text:
Are there limits to number of attempts at entering a passphrase in bitcoin qt
I have 2 wallet.dat backups from 2013
I am having trouble with accessing due to incorrect passphrase
Is there a limit to the number of attempts I can try to get the passphrase.

Welcome to bitcoin.stackexchange.com. This site works best when you ask one question at a time. Which question is most important to you right now?

I have edited your question to focus on what I believe is the part that is mainly holding you back currently. You can use the "Edited" link to undo my changes if you feel they are unhelpful. Interested readers can use the question history to see the original question in full.

I am confident there is no limit to the number of attempts at entering the passphrase.

This is because the authors know that any such limit can be bypassed by, for example, installing on a VM and restoring an initial snapshot when the limit is reached. You could also divide the work between multiple parallel VMs. Therefore I expect authors are more likely to introduce rate limiting rather than waste effort implementing an upper bound to the number of attempts.
There are tools like BTCrecover and PyWallet which may help but which are not especially user friendly for novices.
Offering money to strangers is a certain way of being overwhelmed by offers from confidence tricksters and thieves.

You can recover your wallet password using hashcat.
hashcat allow you to try thousands of password on the wallet's hash. Once you find the correct password, you can use it on your wallet.dat.


text:
Is it possible to run scrypt hashing on the antminer S9 i just bought two to mine dogecoin?
its the ANTMINERS9 mining hardware- ASIC power use 1600w processing speed 13500[GH/s] Hash Algorithm Script,X11,SHA-256, SHA-256D


text:
Need help for understanding tainted funds
I recently sent Sats to my wallet at a major exchange, and they blocked my account saying the money is tainted. I don’t understand this at all since I accumulated the money through different legal dev projects over time.
Is there any tool or way I could verify the taint on my own?
Any advice or insights would be greatly appreciated. Thanks in advance!

Does this answer your question? Procedure for calculating taint?


text:
What shape of merkle tree does the Bitcoin client build?
The Bitcoin client builds a merkle tree to represent the transactions, then includes the root of that tree in the block header.

But usually, the number of transactions is not a power of two. When that happens, how does the Bitcoin client represent the transactions in the tree?
If I wrote a custom mining client, which built a tree with a different "shape," (example below) what would happen?

When the number of transactions is not a power of two, how does the Bitcoin client represent the transactions?
Each time around, it hashes each transaction with the one next to it, until there's only one left.

If there's an odd number of transactions, the last one is hashed again.

In this example, we start out with 11, then 6, then 3, then 2, then 1.

What would happen if you made a differently-shaped merkle-tree?
When sending blocks around, there's no way to specify the shape of the merkle tree. If it's different, the standard client will just reject it.

Small correction: when there are an odd number of elements in a level, the last one is hashed after appending it to itself. So usually hash6 of one level is H(hash12+hash13) of the level below, but it can be H(hash12+hash12) if hash12 is the last one.

@PieterWuille Huh. I hadn't noticed that. +1

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
How to quickly get the target of the next block to be mined from bitcoin-core over RPC?
The target for the next block is available in getblocktemplate but I can not figure out if there is a way to get the target without also getting all of the pending transactions, which can take a very long time and generate lots of data.
You could also use getbestblock to get the top block and then use getblockheader to get the previous 2016 blocks and then do the math based on the times, but again this is very slow and data heavy.
Is there a fast way to determine the target for the next block from bitcoin-core over RPC?

You can now get the target for the next block without all the transactions using this command...
bitcoin-cli getblocktemplate "{\"rules\":[\"segwit\"]}"

...which returns this relatively short datastructure that contains the target...
{
  "capabilities": [
    "proposal"
  ],
  "version": 536870912,
  "rules": [
    "csv",
    "!segwit",
    "taproot"
  ],
  "vbavailable": {
  },
  "vbrequired": 0,
  "previousblockhash": "0000000000000000000204567a1893c68560ac05decc823e264ee90ccc122e07",
  "transactions": [
  ],
  "coinbaseaux": {
  },
  "coinbasevalue": 625000000,
  "longpollid": "0000000000000000000204567a1893c68560ac05decc823e264ee90ccc122e07434",
  "target": "0000000000000000000838300000000000000000000000000000000000000000",
  "mintime": 1670613493,
  "mutable": [
    "time",
    "transactions",
    "prevblock"
  ],
  "noncerange": "00000000ffffffff",
  "sigoplimit": 80000,
  "sizelimit": 4000000,
  "weightlimit": 4000000,
  "curtime": 1670616125,
  "bits": "17083830",
  "height": 766672,
  "default_witness_commitment": "6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9"
}

Is there a fast way to determine the target for the next block from bitcoin-core over RPC?

Not really, there's no special RPC command to have the future target.
The target is the number you need to get below to mine a block. The target adjusts every 2016 blocks. That's very important to take into account.
First, you have to get the last target block information by doing a getblockchaininfo RPC command. Then you will be able to access to 3 interesting JSON fields which are the best block height (blocks), the best block hash (bestblockhash) and the current difficulty (difficulty).
Secondly, you must calculate a modular operation which is :

There are 2 choices :

If the result is different from 0, you will be able to use the same target for the next block ! You'll notice there's no field called "target" in JSON-RPC, so in this step you have to do :

target = targetmax / difficulty
where targetmax = 0xffff0000000000000000000000000000000000000000000000000000
and represents a fix number from the genesis block

If the result is 0, you shall calculate the new target thanks to the difficulty field : work out the ratio of the actual time against the expected time. Note : blocks represent the number of blocks in the blockchain not the last block height. The lastBlockHeight = blocks - 1

There's a code for the second choice. This is available : https://learnmeabitcoin.com/technical/target#code.
I think the second step is a little bit complicated. Note that the first step is most often called (the easier) and that the second will be used sometimes.
Tell me if you see a mistake by posting a comment, Loopite.

Yes, trivial when there is not a difficulty adjustment but looking for a general solution that does not require reading the previous 2016 block headers. Obviously Bitcoin core knows this number (it needs it to verify the next block) but sadly does not seem to make it available efficiently. Thanks!

You can easly calculate that from the difficulty
So just with the RPC call getdifficulty calculate this:
target = targetmax / difficulty

Where targetmax = 26959535291011309493156476344723991336010898738574164086137773096960
target max is a fix number from the genesis block
If the hash value (Converted to decimal) is lower then this value, it's a valid Block

That reports the difficulty of the last block, not the next block.


text:
Using PRNG to get better mining results
When miners have a block to mine, this is comparable to finding an effectively (impossible to guess) random number in a set from 0 to n. From what I once read, since the number is random, it makes no sense to start searching from the middle of the set, or from the end - every place we choose is equally good. So we start searching the set sequentially, we check the number 1,2,3,... and so on. Because the solution can be a number 1 as well as n.
But it looks like from game theory point of view, another strategy should be more profitable. If everyone starts searching the set simultaneously in the order of numbers/blocks, and the solution sometimes ends up at the end of the set, then when we, as the only ones, search from the end - we will gain a significant advantage. Each time the solution is in the end of the set, we would be the first to find a solution, because all the rest will search from the beginning of the set.
But, if that were true, it would quickly become reality that half of the miners searched the set from one edge and half from the other - and finally we do not gain an advantage (because other miners also want to earn as much as possible). Then we can gain an advantage by attacking the middle of the set, with some frequency.
Finally, is there any strategy for searching a set of solutions that will give us the maximum benefit, or at least won't put us in a worse position? It seems to me that blocks should be searched, by generating them completely randomly. Not because block 12345 is more likely than block 1, but because we have competition in mining blocks, and if everyone started their search from the beginning of the set, it would be easy to gain an advantage here. If everyone were to use a pseudo-random number generator to select blocks, it would be impossible to come up with a strategy that would benefit anyone.
So question is - do miners always search the space of blocks in the same order? Am I right that a miner who selects blocks at random will have an advantage over those who do it according to the "one by one" scheme? Or maybe a random block search in proof of work already takes place? Does the speed of PRNGs used matter in the mining process?

So question is - do miners always search the space of blocks in the same order?

This is your misunderstanding. No two miners search the same space at all, ever. Since the block candidates miners work on include a payout to themselves, and that payout address is different for every miner, they are all searching independent parts of the block space.
If this weren't the case, the fastest miner would always win. This isn't the case: on average, mining profitability is roughly proportional to hashrate, even at fairly low hashrates. And this is independent of the order they choose to search in.

Am I right that a miner who selects blocks at random will have an advantage over those who do it according to the "one by one" scheme?

It makes no difference.

Exactly, I felt that I did not understand something here. You're right that if this weren't the case (all of them searching independent parts of the block space), the fastest miner would always win, and yet this is not true, we see that. So now it is clear that it makes no difference how they are searching, because every block has an equal chance of being an answear.

This is true for solo miners, but in a mining pool the payout address might be the same for many miners. Can you clarify what prevents the fastest miner to win every time in this case?

@VojtěchStrnad In a pool, the pool just assigns different ranges to different workers. No two miners ever try the same hash, ever - anything else would just be grossly wasteful.

@user253751: the coinbase transaction contains, in addition to the 'payout', a dummy input which is used for data that extends the nonce, called extranonce. At current difficulty, even a solo miner must try millions of extranonces to find a winning block; pool members are given different ranges of extranonce to try. See https://bitcoin.stackexchange.com/questions/37279/work-distribution-in-a-mining-pool and https://bitcoin.stackexchange.com/questions/41989/question-about-getblocktemplate .


text:
Can anyone use your private key if its encrypted on bitcoin core?
I bought cold storage coins with private keys engraved. After I import and encrypt the wallet in bitcoin core, can just the private keys be used to access the wallet or would you also need the passphrash i encrypted it with?
In other words, can the manufacture access my wallet with the private keys if i encrypt the wallet on bitcoin core?

If you trust someone else to provide a private key for you, it doesn't matter if you encrypt your wallet. They will forever be able to control and spend your money at their leisure with no regard to any password you add.

Can the manufacture access my wallet with the private keys if i encrypt the wallet on bitcoin core?

THEY CAN SPEND MONEY YOU THINK IS IN YOUR WALLET.

This question sounds like a misunderstanding of what a wallet is.
A Bitcoin wallet does not ever contain money.
The only important information in a Bitcoin wallet is a secret number called the "private key".
Anyone who knows this private key has control over money sent to addresses that were created from that private key (including modern hierarchical deterministic HD wallets that contain many private keys derived from one common secret number).
So any changes of passwords or encryption applied to your wallet has no effect whatsoever on the ability of other people to spend your money - if they already know the secret number.
The safest thing to do is to sweep (not import) that secret number (private-key) into a new wallet - this transfers money to the control of a new and different secret number that no one else knows.
Before deleting anything, make backups, test recovering from backups. Write your recovery-phrase or private key down somewhere very very safe - somewhere you can go and get beck if you lose your phone, if your PC is stolen or if your house is burned down.


text:
How to get _integer_ satoshi values from JSON RPC?
It seems that RPC calls for getting JSON information on blocks return "value" fields in bitcoins, not in satoshis.
This means that there is a conversion from integer to float somewhere, which is disturbing since it may introduce rounding errors (see context below).
Is there any way to get the integer satoshi amounts directly in the JSON?
Otherwise, is it completely safe to just multiply the float value by 10^8 and take the integer part?
Is there a better way to directly obtain the integer satoshi value?
Thanks!

Let me give some context.
A typical concern is that, for instance, most systems have no float of value (exactly) 0.1; they generally have a (tiny) difference.
On my machine, I obtain:
python3.6 -c 'print("%.20f"%0.1)'
0.10000000000000000555

python3.6 -c 'print(0.1+0.1+0.1==0.3)'
False

This is generally safe, but in my context this raises messy issues, so dealing only with integers is appealing.

Here is a related discussion, but it seems that no consensus was reached at that time: https://github.com/bitcoin/bitcoin/issues/3249

bitcoind internally treats all amounts as an integer and only displays the value as a decimal for the RPC. Formatting for display does not introduce any floating point precision issues as it still just does integer conversion with some string formatting to make it look like a decimal. So it is perfectly safe to multiply by 100000000 to get an integer amount of satoshis.

Thank you! However, it seems to me that RPC values come from the AmountFromValue() function, that makes a conversion to double and a division. I still think that multiplying by 100000000 works, but I am curious of your claim about string formatting. May you please elaborate?

The functions to look at are FormatMoney, ParseMoney, and AmountFromValue. None of these functions use floats or doubles. FormatMoney is how the RPC converts integer amounts to decimal amounts for display. It does integer division and modulo, then string formatting to make it look like a decimal.

Right, I was looking at an old version of the code, with double conversions and divisions, but in modern implementations I find what you describe. Thanks!

Let me add that, if the "value" v is stored as a float (which we should never do), taking int(v100000000) is incorrect; one should take int(round(v100000000)). Both give the correct value if v=0.1, but int(4.35100000000) gives 434999999 (incorrect) whereas int(round(4.35100000000)) gives 435000000 (correct), at least in my settings.

Why do we use decimal values for the RPC? Why not just follow with the amount in satoshis?


text:
Security issues and theft of money from the wallet
A transaction was sent from my node night
CTransaction(hash=27aac94405, ver=2, vin.size=7, vout.size=1, nLockTime=762357)
    CTxIn(COutPoint(85d4e6a81c, 0), scriptSig=, nSequence=4294967294)
    CTxIn(COutPoint(d12a5e7187, 25), scriptSig=160014726d057ab1044dd6e5, nSequence=4294967294)
    CTxIn(COutPoint(881db86218, 4), scriptSig=1600146ef598af918c5a9064, nSequence=4294967294)
    CTxIn(COutPoint(e283c68eb8, 0), scriptSig=16001479d36f7d700d72585e, nSequence=4294967294)
    CTxIn(COutPoint(51621fad57, 3), scriptSig=1600140991872d83fb837016, nSequence=4294967294)
    CTxIn(COutPoint(7279e53877, 0), scriptSig=16001493140918fbfffe911a, nSequence=4294967294)
    CTxIn(COutPoint(e0f1c812ee, 1), scriptSig=1600140736f7fe48402d316a, nSequence=4294967294)
    CScriptWitness(3044022021d7de713db46be968cfae24dae82bd199767972593ab5936bb4f856b13eea1002204c36bd0eefd45e74f19da9dc6bd9543b8c58491d6edf7eec7e9a47941c32531d02, 023eb124f7e1cf221416a10c91fdad8fbd0b75442e510ea7c0799d77d9f7e2c5c5)
    CScriptWitness(304402206f8e67d41822a7913a40a64369de71ece60814900ae517045867ce182e1f310c02206db1d613741939b85ab8977f2f05dc0371a4da19bce7f843414b403c739198ea02, 02bf2925f6cc07d5942916f70bcea96c8644a756cea5cf5bf097fce9f5ded68327)
    CScriptWitness(304402201bd671f87d5d0e5c4f69e38f7f067a2416ed6eba674aaa65bef068a46e295d2702203833cc2a032210d34cccfeca2fdb6bf3381302171907c78c67d043b7710ea1d302, 032aa52f8534a0269c756193f1b5a6ab759364150afaecef83c63d6cbc38adf292)
    CScriptWitness(304402203ae1fb440e6f3630a0c0773263a7eb7f502263553082cfc2074ce490f501c82b0220436ada44af74391c8c4acddd42b6830260e55f87c9fc1bf228752f14ac5c1cb902, 02ddf12cbd487fcd91c7cc4c2556194fa7117c8be3f108a7cb0b7c8ccba17a9d72)
    CScriptWitness(3044022058ea08b1a863989e941391583669d225685a734672a730865434239859f7041c022042b5f2b97f093e1d2e90c71f6344dc93a68f6a3bc6af38bceadda17942944ba302, 0395232ba2deb14b15c0475524e43cf1583dbd4eaf0c361a08bf009341edbe3d2c)
    CScriptWitness(304402206ed1becaf62ad97b0bfe26dc673b6e5027ca5cfc85976e63b4d1e9f41f99fe3b02205b3434bbad54e5c9ab4b6eb7dca71761535486189627b54189bb051712c0d60802, 03798f0bff406228d85a65d5bc4139a801766d5ae939aff70b028abccf3ad5611a)
    CScriptWitness(304402206efd5019016bfc300eea812ccc95e45faa4e7f927f4b7f79c09e2f08fbf823c102203aa3d05758082fb88d6fcc7087fc1d373acd1140c4ac6aeefdfd1e6f5ef6fe7602, 0206ecb5b628da0cb8b07ce9ace1c62a7eb1f4b34a0d004f7413732146e05ba811)
    CTxOut(nValue=0.08658863, scriptPubKey=76a9140defb8e8a5f44458e472d4e0)
2022-11-09T01:48:04Z [wallet.dat] AddToWallet 27aac9440529f4f29748e546d33bf8e1c20895649b192aba2e1aab1d5aa0455a  newupdate
2022-11-09T01:48:04Z [wallet.dat] Submitting wtx 27aac9440529f4f29748e546d33bf8e1c20895649b192aba2e1aab1d5aa0455a to mempool for relay
2022-11-09T01:48:04Z [wallet.dat] AddToWallet 27aac9440529f4f29748e546d33bf8e1c20895649b192aba2e1aab1d5aa0455a

I am confused. First of all, I started looking for any logs and clues on the server, but were unsuccessful.
In the RCP node config, the server is configured only locally.
Node version is 23.0.0
https://blockchair.com/bitcoin/transaction/27aac9440529f4f29748e546d33bf8e1c20895649b192aba2e1aab1d5aa0455a
Any ideas?

Any ideas?

It looks like the computer running your node has been compromised. Either someone else has physical access to it or someone has introduced malware onto it.


text:
Why are mined blocks not always full
Why do mined blocks tend to vary so much in size. If the miner's objective is to maximize their revenue from transaction fees they should add transactions starting with the one with the largest fee, working down to the one with the lowest until the pool of waiting transactions is empty.

If you look at recent blocks on https://blockstream.info/ (as of today, Aug 15 2020), nearly all blocks are very close to 4000 kWU. The variation is due to availability of sufficiently small transactions to fill up the last part, and differences in selection algorithms.
Occasionally, an empty block appears instead. These happen as a result of pools learning about a new block faster than they can construct a new template on top, and inform all their hashers. Instead, the instantly tell everyone to start working on an empty block (which is definitely valid), and only when a new full block template is constructed do they inform the hashers of it. This is exacerbated by validationless mining, where the pool may learn about the new block hash tip, before actually having even seen the new block.
So, as far as I can see, in recent times with sufficient pressure for demand, effectively all blocks are full, except for empty ones occasionally.


text:
"Wallet loading failed: The location of the wallet you previously used has been overwritten (outdated). Now, after fixing the error ..."
An early backup of a Bitcoin wallet .dat is now being restored with the following error message:

Wallet loading failed. The location of the wallet you previously used
has been overwritten (outdated). Now, after fixing the error, you need
to re-index (for already open wallets). Just re-download and update
the new node.


text:
Bitcoin compilation keeps failing
hi everyone so i tried compiling bitcoin using the cmake but i keep having issues with the compilation i keep getting this error:
26%] Built target leveldb
In file included from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/uint256.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/muhash.h:9,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/muhash.cpp:5:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h: In function ‘constexpr auto util::hex_literals::operator""_hex_u8()’:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:50: error: ‘bit_cast’ is not a member of ‘std’; did you mean ‘bad_cast’?
  434 | constexpr auto operator""_hex_u8() { return std::bit_cast<std::array<uint8_t, str.bytes.size()>>(str.bytes); }
      |                                                  ^~~~~~~~
      |                                                  bad_cast
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:95: error: expected primary-expression before ‘>’ token
  434 | constexpr auto operator""_hex_u8() { return std::bit_cast<std::array<uint8_t, str.bytes.size()>>(str.bytes); }
      |                                                                                ^~
In file included from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/uint256.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/siphash.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/siphash.cpp:5:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h: In function ‘constexpr auto util::hex_literals::operator""_hex_u8()’:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:50: error: ‘bit_cast’ is not a member of ‘std’; did you mean ‘bad_cast’?
  434 | constexpr auto operator""_hex_u8() { return std::bit_cast<std::array<uint8_t, str.bytes.size()>>(str.bytes); }
      |                                                  ^~~~~~~~
      |                                                  bad_cast
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:95: error: expected primary-expression before ‘>’ token
  434 | constexpr auto operator""_hex_u8() { return std::bit_cast<std::array<uint8_t, str.bytes.size()>>(str.bytes); }
      |                                                                                ^~
make[2]: *** [src/crypto/CMakeFiles/bitcoin_crypto.dir/build.make:174: src/crypto/CMakeFiles/bitcoin_crypto.dir/muhash.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/crypto/CMakeFiles/bitcoin_crypto.dir/build.make:286: src/crypto/CMakeFiles/bitcoin_crypto.dir/siphash.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:830: src/crypto/CMakeFiles/bitcoin_crypto.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

What compiler are you using? Bitcoin Core (as of version 28.0) needs clang 16 (or later) or GCC 11.1 (or later).

hi thanks for responding i am using the version that uses the make to build

make will use your system's default compiler, on Linux systems that is normally gcc. Type gcc --version to find out its version. You may need to install a more modern compiler, or upgrade your operating system.

I am using WSL for some reason I can't put another os on my PC because of the bios password and I think clang 16 isn't available for WSL but gcc 13 but errors keep popping up during the build


text:
What to look for in Bitcoin-core logfile when something bad happens
About a week ago I was trying to reorganise my file structure with Bitcoin Core, I accidentally moved the file before listing it as a backup so when I opened Core, it didn't work.
I tried returning the files to the same location but that didn't work so I reinstalled it and tried to open my wallet but it would freeze up as soon as I would click the "Open Wallet" button. I then synced it up to date but the issue persists.
I have seen a suggestion to read the log but honestly I'm not sure what I'm looking for.

I have seen a suggestion to read the log ...

That is a good suggestion.
Normally it wouldn't be needed. The program should explain to the user when it is unable to do something. However if you have been deleting, renaming or moving it's data files, you are undermining it's foundations in a way that the program designers won't have anticipated - in these circumstances, a logfile is a good place to look to try to understand what the problem is.
For any program, not just bitcoin core, you can check for program options to increase the amount of information logged - for example there might be a debug option - often a -d or -debug command-line flag.

... but honestly I'm not sure what I'm looking for.

You are looking for anything that looks like a major error rather than routine activity. Mostly indicated by words like "error", "failed", "unable", "denied" and so on.
You are also looking for messages relating the the action you took just before the unwanted behaviour occurred. In your example, you clicked "Open wallet" so you are looking for messages that contain the word "wallet" or "file" or "open". In Bitcoin core you know the wallet is stored in a file named "wallet.dat" so that is a good thing to look for.
Most likely these messages are near the end of the log file, so that might be a good place to start looking.
If you find lines in the log file that look interesting, also look at nearby lines to get a sense of what the program is trying to do and what might be happening. If you post an extract of the log to a Q&A website like this, include maybe ten or so lines either side of the ones that caught your attention. Don't include too much as no-one wants to read hundreds of lines. Don't post too little.


text:
conditional spending from P2WSH address
What im doing wrong?
Sinse I found out  that Bitcoin is programmable money Im trying to use it potential.
Using this site https://improvein.github.io/bitcoin-forge/?#/script/create I’ve created a conditional  script that holds 2 time locks for two pub keys.
OP_IF 1694275749 OP_CHECKLOCKTIMEVERIFY OP_DROP 03cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535 OP_CHECKSIG OP_ELSE 1694277749 OP_CHECKLOCKTIMEVERIFY OP_DROP 036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23 OP_CHECKSIG OP_ENDIF
Script 63051694275749b1752103cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535ac67051694277749b17521036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23ac68
Used this script to create with this tool
https://improvein.github.io/bitcoin-forge/?#/address/create Payment to Witness Script Hash
address  bc1qes2v6ts5ckxuz5mkwdeukcn62hkac05kf97gugc4jnu3kj3wg5as3nes34
Now I’m using bitcoin core cli to sign the input and create raw transaction. And I’m completely stack at this point. How and what to sign and how to put this puzzle for unlocking transaction.
The scope of this script is to give to family member some funds locked in future with ability to be spend it with one of 2 privet keys. If he loose his key, I can spend it with op_else condition.  I will provide some data
gettxout 14290ef656c05f8e0c06b6d99a6ae72c77a8809b3a69dd5fb00f07ce9cee1637  vout 133

{
  "bestblock": "0000000000000000000528fb0e92c1e79378a1b241eb144ca0f97054fdf42dfb",
  "confirmations": 155,
  "value": 0.00007726,
  "scriptPubKey": {
    "asm": "0 cc14cd2e14c58dc153767373cb627a55eddc3e96497c8e231594f91b4a2e453b",
    "desc": "addr(bc1qes2v6ts5ckxuz5mkwdeukcn62hkac05kf97gugc4jnu3kj3wg5as3nes34)#k8s5es0p",
    "hex": "0020cc14cd2e14c58dc153767373cb627a55eddc3e96497c8e231594f91b4a2e453b",
    "address": "bc1qes2v6ts5ckxuz5mkwdeukcn62hkac05kf97gugc4jnu3kj3wg5as3nes34",
    "type": "witness_v0_scripthash"
  },
  "coinbase": false
}

the locking script
{
  "asm": "1692429480 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_IF 03cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535 OP_CHECKSIG OP_ELSE 1692602280 OP_CHECKLOCKTIMEVERIFY OP_DROP 036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23 OP_CHECKSIG OP_ENDIF",
  "desc": "raw(04a86ce064b175632103cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535ac6704a80fe364b17521036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23ac68)#r3dcxvh2",
  "type": "nonstandard",
  "p2sh": "38cTqVJf1jPBDCjg8wKdFx476uHX3qgEaB",
  "segwit": {
    "asm": "0 69672524bb7737429280e9c862b3fdcea0dc22037cbaaa755d6132b4841811e4",
    "desc": "wsh(raw(04a86ce064b175632103cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535ac6704a80fe364b17521036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23ac68))#7uzehfsr",
    "hex": "002069672524bb7737429280e9c862b3fdcea0dc22037cbaaa755d6132b4841811e4",
    "address": "bc1qd9nj2f9mwum59y5qa8yx9vlae6sdcgsr0ja25a2avyetfpqcz8jqg69shh",
    "type": "witness_v0_scripthash",
    "p2sh-segwit": "3NqDPiKTsbYA18GRWzrsE5wYYxGhH9XS96"
  }
}

and 2nd question
how segwit time locked script will work considering The "Year 2038 problem" when issue arises because a 32-bit signed integer can represent a maximum value of 2,147,483,647 seconds, which is approximately 68 years. The Unix epoch started on January 1, 1970, so adding 68 years to this date brings us to January 19, 2038. so question is : funds time locked after January 19, 2038 will be spendable same way like today?

Regarding 1st question,
I guess your locktime 1694275749 is unix timestamp not little-endian byte(hex). Your script must encode number in little-endian byte(which is a598fc64), not timestamp decimal itself. If you already sent with 1694275749 locktime, it would be interpreted as little-endian byte(hex number), not as decimal, so unspendable as far as I know.
Regarding 2nd question,
BIP65 describes how to handle 2038 problem, which simply allows to accept 5 bytes number exceptionally for utc locktime when it's used with OP_CHECKLOCKTIMEVERIFY.
In BIP65,

If we kept to that limit we'd have a year 2038 problem,
even though the nLockTime field in transactions themselves is uint32 which only becomes meaningless after the year 2106.
Thus as a special case we tell CScriptNum to accept up to 5-byte bignums, which are good until 2**32-1, the same limit as the nLockTime field itself.

Therefore, OP_CHECKLOCKTIMEVERIFY locktime upper bound for timestamp is same with uint32 nLockTime.


text:
Cash app withdrawal transaction not found
I submitted for a withdrawal on Cash App about 4 hours. A go and so far, It still says transaction not found and the little circle just keeps spinning. I have a second transaction as well for today. That is doing the exact same thing. I had a couple other transactions that went through. No problem, but these 2 have been stuck for several hours with nothing found. Here are the transaction id's:
6eaf9a995a93aae4480375997eeac500547ff00edf4abfeffae3aab595544ce8
0e20f488180b3506b3ca737a635cd85f126631ab384b8d8ad15f77db44afdf20

Both transaction IDs show as confirmed (about 3 hours after question was posted here) and as having a fee of 1 satoshi per vbyte
That fee rate is low and accounts for any delay in confirmation.


text:
How to use recovery phrase in Bitcoin.com wallet app on Android
Can't remember my master password for my Bitcoin account, and loss access to my funds, after I had to reinstall my Bitcoin app

I was able to reinstall my wallets on my Bitcoin application, but can't figure out how to bypass the cloud recovery process and use my 12 word recovery phrases to get access to my funds.  I also have the wallet data file, but can't get pass inputting the master password to get access to the data containing my master password.  Please any assistance in this matter will greatly be appreciated.

The app info is Bitcoin.com Wallet, that the precise name, also I see Google Play has the name reflected Bitcoin & Crypto DeFi Wallet.

You commented

The app info is Bitcoin.com Wallet, that the precise name, also I see Google Play has the name reflected Bitcoin & Crypto DeFi Wallet.

You mean this wallet https://play.google.com/store/apps/details?id=com.bitcoin.mwallet which claims

The Bitcoin.com Wallet is the easy-to-use, multichain, self-custody crypto wallet that puts you in full control of all your cryptocurrency holdings.

My emphasis.
Self custody implies that you should be able to recover control over your money using the twelve-word recovery phrase in this app or in any that supports the same recovery phrase system (e.g. BIP39) and derivation path.
Their support email is shown as wallet@bitcoin.com.

Your question asks

can't figure out how to bypass the cloud recovery process and use my 12 word recovery phrases to get access to my funds

They explain the recovery process in a video on their website and on youtube

Select "ADD/IMPORT"
Tap "IMPORT WALLET"
Enter the asset type "Bitcoin (BTC)"
Select the wallet type (personal or shared)
Enter your twelve word recovery phrase
Tap the "IMPORT" button


text:
How would I avoid spending my Bitcoins when I need to buy a house quickly?
A specific house I would like to buy has come up for sale. This opportunity is unlikely to arise again.
I have almost enough money in Bitcoin to buy the house.
I have no other money or assets sufficient for the purchase.
I do not wish to spend my money or transfer control of my money to a third party
How can I buy the house?

,،so what is your problem ? If we can help you How much time do you have?
how much do you have to pay for the house?
How mach your bitcoin?

My problem is how to get the house without having to waste my Bitcoin in my situation. If there is a solution. I doubt there is, but I'm desperate.

If you feel that this house right now if worth spending your BTC for, then you should do so. Otherwise, don't, or buy another. Nobody can make that decision for you.

If you want to buy something without spending your BTC, you'll need to spend other money.

Does this answer your question? Is there a way to take out a loan on your Bitcoin like how Ethereum can be used as a CDP in the MakerDAO to get DAI?

As usual, the "Does this answer your question?" question does not answer my question...

I have edited your question in an attempt to prevent its deletion. I believe the edited form reflects the essence of your question. If you object to the edits, please click the "edited..." link and select "rollback".

The essential character of money is that you transfer it (or control over it) to another person in exchange for some object or service.
There is no way to use money to purchase something and still retain the money.
None of the alternatives are acceptable to you for various reasons

Rent
Mortgage
Invest money in a business and defer purchase until investment returns exceed purchase prices

Bitcoin is money.
Therefore your problem is insoluble. You cannot have your cake and eat it.


text:
I want to generate raw transaction data in Nodejs
The information I have Source address Destination Address Source private key Amount That's it.
I don't know much about bitcoin, so I worked hard to get this information from the private key of the sender.
{
    "blockheight": 2396902,
    "confirmations": 55942,
    "fees": 0.0000096,
    "time": 1672593257,
    "txid": "b17ed30654152beacfc023b6a07bfffe129a069d76154984fd1c65db4fd1a563",
    "vin": [
        {
            "addr": "LaFNH65KaMk9j3yR2CRSet4nRVPPpFVVoq",
            "txid": "403f8513364e949505226825c2693657577c071561cb61247d7d3bb62e238718",
            "value": "0.00108063",
            "vout": 0
        }
    ],
    "vout": [
        {
            "n": 0,
            "scriptPubKey": {
                "addresses": [
                    "LZKd7zNB7FNBLDjLEeHmMgYfEjNSL5kAaa"
                ],
                "hex": "76a9149aa4472a77a9ee9f150351fa4222b029ef80d92488ac"
            },
            "spentIndex": 1,
            "spentTxId": "2f591faa79d32228451139aad9c7a924a67357acd76a4f06adc1150af70f64cf",
            "value": "0.00107103"
        }
    ],
    "vsize": 192
}

How do I use this information to generate raw transaction data in Nodejs?

Would you be satisfied with an answer giving general principles or are you only interested in working JavaScript nodejs code?

I want to build raw transaction data with Nodejs
I'm interested in the code.

Anything wrong with articles like How to create a raw transaction using bitcoinjs-lib or similar search results - any specific problems?

I don't know what the string used in the code in the article is.
As I wrote earlier, I only have the source address, the source private key, the destination address, and the amount (3.6e-05 BTC).
I got this information from the source address, but I don't know how to put this information into my code.
Once you have the information, edit and share your questions