text:
Wouldn't it be profitable to make an ASIC capable of calculating private keys?
Just looking at vanitygen-plus (currently supporting almost one-hundred crypto-currencies) do its stuff, and it is capable of over 548,990 keys/sec on my CPU alone.
Well developed ASIC is several orders of magnitude faster than my CPU, wouldn't it be profitable for a company with the resources to do so to develop such a key miner, even if it is a one-off?
The reward (actually, theft) is access to the private keys of any address. Surely the development costs are not so prohibitive for ASIC as they are for general-purpose CPU's?
Future developments in this area seem like the most realistic threat to crypto-currency security so far.

Multiple organisations have tried that. I think, there is still 1 active "brute-forcing-pool (forgot the name)", but mining transactions is always worth it (over brute force) unless you win the lottery and find one of Satoshi's keys. I think, the brute forcing pool got 7 private keys of used addresses with 3 of them having Bitcoins on it (but less than 1 Bitcoin all in all). (but they wasted a lot of energy to do that)...

https://lbc.cryptoguru.org/about - there are positive and negative comments on the project. On the onehand side it proofs, that the math is incredibly “big”, and a good use for the bitcoin setup. On the otherhand side there are comments, that the found addresses are not really “found”, but merely “known” to be found. There was a longer thread in bitcointalk forums last year... Hint: ASICs do sha256, whereas keys is ECDSA logic. Haven’t seen ASICs yet to do ECDSA math.

@pebwindkraft True, neither have I. I am aware that vanitygen-plus uses Open-SSL for the EC math and figured that any process that does 'do this, this, this and then this' every time might be ASIC-able. ASIC performs any one function it is designed to do, it is only the Bitcoin mining ASIC that do sha256 but there are I, I make the presumption, plenty of varieties in industry purposes.

If you could steal everyone's bitcoins, no one would want bitcoins anymore; the market and the value of the coins would fall to zero.  You would have successfully stolen coins that no longer have any value.  (Alternatively, you could try to steal a few coins at a time in a sneaky, undetectable way.  But then your payoff becomes much slower, and also not worth the effort)

You could in theory build an ASIC to brute force private keys of any cryptographic scheme, like EC or RSA.
But ASICs only give linear improvements. That means that they 'accelerate' some search only by a constant factor, like 2, 3 or 100. Even if your ASIC does something a million times faster than a normal CPU, it's still a linear improvement.
If guessing a private key takes the current age of the universe in a CPU, an ASIC a million times faster would still take 13 thousand years.
Cryptography relies on problems being exponential on the key size. Exponential growth beats linear growth. If some day a powerful ASIC or CPU could guess a ECDSA private key, users of ECDSA would only have to increase their key sizes.
To yield a better than linear improvement, you would need a better algorithm. Implementing current day algorithms in faster hardware only gives linear improvements. It's widely believed, even if we still don't have formal proof, that it's not possible to get better algorithms for prime factorization and elliptic-curve factorization. (At least in non-quantum computers.) In other words, they are considered intractable problems.

ASIC does SHA256 hashes continuously. Getting Private key from Public key requires Elliptic Curve Multiplication in reverse. Elliptic Curve Multiplication is assumed to be very hard problem. i.e. By having point on the elliptic curve , You can add or multiply it as many times as you want but by having a point which has been multilpicated, you won't know its generator point. That is the hardness You have to solve in order to get that point. So no machine in this world can efficiently compute Private key by having Public Key.

Doesn't an ASIC do whatever it is designed to do very fast? sha256 ASIC does sha256 very fast, but what about other ASIC? ASIC is not limited to only one task but a specific ASIC can only ever do one task.

Solving a problem faster doesn't mean magically faster, see my answer above


text:
Importing private keys creates different address
How does importing private keys work?
I have previously imported the private key for a 1Archive... address into Bitcoin Core and noted then it added an address like 1AXbRq...  and I didn't follow it up further.
Today I have exported the private key for a 3... address from Bitcoin Core and imported it in Electrum. Electrum adds a 1... address and doesn't see any of the transactions.
How does this work? I understand that there is an underlying 1... address behind a SegWit address but how would I spend any BTC if it is not showing in my wallet balance? What else should I do?
If there is an answered question for this already on Bitcoin.SE I could not find it.
My private key begins with L.

Was the address that started with 3 a P2WPKH address? If so, that might help: https://bitcoin.stackexchange.com/q/72899/38618

@MCCCS Okay, that's actually close. I have a 3... address not a bc1... address. I have hope it is going to be easily solvable.

@MCCCS Actually, tried that method, Electrum says that the key cannot be imported. My priv key starts with L.

It's completly irrelevant that your private key start with "L". Don't share it!

ICIN, the official download for Electrum is from https://bitcoin.org/en/wallets/desktop/windows/electrum/

I suspect you can import it directly from the console within Electrum (based on this PR). Currently, Electrum does now allow importing individual p2wpk inside p2sh addresses (the 3 segwit addresses). You can, however, still import an entire seed by using a BIP49 derivation path.
Try running the following in the electrum console:
key = 'your_key'
txin_type, secret, compressed = bitcoin.deserialize_privkey(key)
wif2 = bitcoin.serialize_privkey(secret, compressed, 'p2wpkh-p2sh')
print(wif2)

Then import the wif2 which it prints out

That works. It imports the correct address.

Good to know! I wasn't super sure, and currently away from a machine with electrum on it. Thank you for confirming.

Note since 3.1 you can just prepend "p2wpkh-p2sh:" to the private key before importing it.

Prepend "p2wpkh-p2sh:" to the private key before importing it into Electrum. For example:
p2wpkh-p2sh:5Kkzs8XrJNAmf9VQDFeGBfaRvSByAvPK6DbDXw5BVqswWaXSG2Y

I cannot confirm this - I tried it on my priv key and I get an error but, then again I have already imported it.

@Willtech it only works with 3.1 and above.

Just checked my version, it is indeed not 3.1 and above.

you made me cry, after 6 hours of searching and trying. I wish I could give you +100 upvotes. Thank you.

This should be marked as the correct answer since it's simpler than the current accepted solution of using the console.

"I have previously imported the private key for a 1Archive... address into Bitcoin Core and noted then it added an address like 1AXbRq... and I didn't follow it up further."

First of all, I won't be answering the first question. It just sounds weird, and 99% it's caused by a mistake.

How does this work? I understand that there is an underlying 1... address behind a SegWit address but how would I spend any BTC if it is not showing in my wallet balance? What else should I do?

Here's how importing a P2PKH address works:
WIF result is affected by three parameters: Privkey type (a byte for BTC private keys), the private key (that also contains which y coordinate the pubkey has, if we want the compressed pubkey), and an extra 0x01 byte if we want the compressed pubkey. There's only one public key that can be generated using that WIF.
Here's how importing a P2SH address works:
1) Dump the WIF of the P2SH address
2) Import the WIF
3) Make a transaction, and watch how your wallet or Bitcoin Core doesn't recognize the transaction.
It won't recognize the transaction, because there's infinite number of P2SH addresses one can create using the WIF (Note: script has a size limit, so it's not infinite)!
To inform your wallet about your P2SH address, you should also import the script. And, this is not supported by 99.9% of the wallets. (However, the wallets can import Witness addresses, as they're standardized and widely used) That's why Electrum doesn't see your P2WPKH address, if you don't tell it to use the Witness address.

p2wpkh-p2sh scripts are standardized in the bip. As long as you prepend "p2wpkh-p2sh:" to the WIF Electrum will recognize it as such in Electrum 3.1 or newer. In the case of 3.0.x you have to convert the WIF which you can do using the script @RaghavSood posted or this menu based one here.

source: Stack Exchange

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

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

sort: votes


text:
Source code: Where is address encoding performed?
I would like to experiment with having fewer characters (trimming a few characters at the end, and fewer checksum) for an address while still retaining enough for adequate security.
I've looked into base56.h but it doesn't seem to actually check addresses?

firstbits.com provides a service that links short values to longer addresses, which might be close to what you're looking for.
You could easily shorten addresses by extending the character set that addresses use, but any non-standard way of sharing an address has to be usable by whatever person or software receives it. I'll leave it to someone else to point you to the line of code though.

At the current moment, note that the firstbits site isn't responding...

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


text:
-regtest generate 101 not working
when I type
bitcoin-cli -regtest generate 101

in the powershell it gives me this error:
PS C:\Program Files\Bitcoin\daemon> ./bitcoin-cli -regtest generate 101
error code: -32601
error message:

I am running bitcoind in regtest too ,this is the last message that I got fom bitcoind:
Adding fixed seed nodes as DNS doesn't seem to be available.

please help

the answer is :
bitcoin-cli -regtest generatetoaddress < nblocks > < address >

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


text:
Is bitcoin script necessary?
satoshi created bitcoin script which is the language that the bitcoin client uses to handle most of the operations such as sending or verifying transactions.
was it necessary to have another language for these operations? isn't it possible to write the whole runtime in one language?

was it necessary to have another language for these operations? isn't it possible to write the whole runtime in one language?

To be clear: the goal of the scripting language isn't for defining the runtime logic of blockchain validation. No part of Bitcoin Core itself is written in the Bitcoin Script language, just in C++. The goal of the Bitcoin Script language is for customizing the conditions under which transaction outputs can be spent. These scripts are intended to be written by "users" of the system, not by (authors of) the system itself. Of course, in practice they are written and designed by the authors of the wallet software these users use, but it permits a flexibility that wouldn't otherwise exist: wallet authors can develop and experiment with new scripts permitted by the language, without needing to wait for the entire Bitcoin ecosystem to adopt changes to specifically enable their use case.
Would it be possible to not have such a language: certainly. There are several cryptocurrencies that don't have such a concept at all. But this alternative doesn't need to mean that the Script language is replaced by C++ (or whatever other language the validation logic is written in) - it can simply mean there is no customizability of spending conditions at all, and every output is just e.g. a public key, and every input is just a signature, and nothing else is possible.
Having this language at all just introduces features that wouldn't be achievable through other means. The simplest example is having coins that can only be spent when multiple people sign off on it(*), or only after a certain amount of time, or after some secret gets revealed. Together these are the basis for example for trustless escrows (where the escrow can't steal the coins), or for systems built on top like payment channels.
Perhaps your question is: why is this customizability of spending conditions not done using the language as the one the validation logic is written in? There are several reasons for this:

It is essential that the outcome of evaluation of Bitcoin Script (or whatever alternative you're envisioning) only depends on data committed to by the transaction itself, or possibly in the blockchain it ends up in. Anything else is inviting risk of forks. For example, Scripts can (perhaps surprisingly) not observe the current time in any way. The (local) time at which validation is performed by various validators differs, so including the current time in Script could lead to a script that some validators accept and others reject, just by virtue of performing validation at different points in time. Bitcoin Script can however (indirectly) observe the timestamp of blocks in the blockchain, because this value is guaranteed to be identical for all validators. Imposing such strong restrictions on an existing language intended for general purpose programming is hard, and having a separate language for it makes it much easier to enforce this.
Size matters. As a global consensus system, capacity is limited. Bandwidth and latency constraints of the slowest and least-well connected devices the system wishes to let participate set a bound on how much data can be included in the chain. One aspect of that size is how much data it takes to express typical conditions in the Script language (or whatever its replacement is). As we envision many transactions whose conditions for spending at least involve some form of signature check, it stands to reason that it should be very cheap to express these. In Bitcoin Script, the logic "require a signature on the current transaction with public key X" can be expressed in 2 bytes + the size of the public key. This would be much harder to accomplish using a general-purpose language.
Computation cost, and predictability for that, matters. As the scripts included in transactions submitted to the network will be run and re-run by every validator (possibly ever), we care about the computational cost that validation entails for those validators, and specifically want an upper-bound on that cost. This means there needs to be some mechanism for stopping execution if it takes too long, or being able to determine ahead of time how long it's going to take.
Not every piece of software that interacts with the blockchain or transactions is written in the same language. In Bitcoin, the currently most-used validation software is Bitcoin Core, which is written in C++, but it is far from the only wallet software, and these other wallets are written in a variety of languages. Using C++ for the scripting language would pretty much require all these implementations to have a C++ dependency. Given that C++ is a compiled language, it would additionally require access to a C++ compiler just to run the scripts received in blocks and transactions from the network. C++ isn't designed for such on-the-fly code updating, and using an abstraction to e.g. run it in a virtual machine or interpreter would negate whatever advantages existed to use the same language in the first place. The situation may be different for other languages of course, but the point remains that the goals for a language to write a validation engine is, and the goals for the language to write spendability conditions are wildly different, so there is little reason to want to cover both by a single language.

(*) There are techniques in modern cryptography to actually make a single public key that can only be spent when multiple people cooperate to spend it.

It is theoretically possible that Satoshi could have taken the entire C++ language (Bitcoin Core is written in C++) and then severely restricted what C++ functionality was available for Bitcoin scripting. Ethereum did something similar by making modifications to Javascript and calling it Solidity. An alternative approach that other altcoins took (e.g. Mimblewimble based altcoins such as Grin, Beam) was not to have a scripting language at all and only allow single signature spends (no multisignature, no timelocks etc).
As RedGrittyBrick says for various reasons it made sense to start from a much more limited language (Forth) than C++ as even Forth was too expressive for Bitcoin Script; various Forth opcodes had to be disabled for Satoshi to be comfortable it wasn't exposing Bitcoin to uncertain verification costs. (There are also new opcodes that Bitcoin Script would like that aren't in Forth.)
Taking an existing language (C++, Javascript, Forth etc) and then removing and adding functionality so it can be used for Bitcoin scripting is an imperfect approach. Simplicity is an effort to build a scripting language for Bitcoin from the ground up. It is still a work in progress and would need a soft fork to be added to Bitcoin but designing specifically for the Bitcoin scripting use case and providing guarantees that aren't available in adjusted existing languages seems to be a much more promising approach.

Consider a script that says
 While (true) {
   // some pointless but slow calculation
 }

in order to discover if the transaction containing it is valid, every node on the network has to run this until it returns a value.
The halting problem means that it is impossible to know whether a script will ever complete.

These scripts are created by the transaction creators and could contain any script that a malicious person can dream up.
One way to combat malicious scripts is to have nodes know of a small number of standard scripts and not relay non standard scripts.
You could ask, if we only have a few standard transaction types, we don't need a scripting language at all, the evaluations could be hard coded in C++ and no scripts would be in the transaction itself. This would not be Bitcoin. Having a scripting language arguably provides for future flexibility.
We need the scripting language to be judiciously limited, so that we can be sure any script can be executed in finite time. we also need to be certain that no matter what malicious data is presented to the script by bad actors, it will terminate in finite time. having the scripting language be a carefully designed minimalistic language with limited capabilities arguably provides the best assurance of this.

As Crypto News said

the limitations in Bitcoin Script prevents a “logic bomb,” or an infinite loop from being included in any single transaction. This restriction eliminates the possibility of a denial-of-service (DoS) attack on the network.

See also

The Bitcoin scripting system is purposefully not Turing-complete - why?

there is only one global script that is executing on every machine, if someone sends something that doesn't conform to the rules of the script, it would simply be return an error.

i think you missunderstood my point, if i have the whole runtime of my blockchain as print('"hello world") then every node would execute only that and wouldn't recognise anything else and i could write that line only in one language .


text:
Using secp256k1 in personal project
I am trying to use secp256k1 for a toy project that I am working on for learning purposes. I am using Ubuntu 20.04 and I can clone and compile the library just fine. I have tried to include it in a simple hello world c file and I get the following error: secp256k1/src/num.h:19:2: error: #error "Please select num implementation" 19 | #error "Please select num implementation"
I have tried googling this but I can't seem to find anything (only https://github.com/breadwallet/breadwallet-ios/issues/60 but not sure how it applies to my situation). All I did was use this line #include "src/secp256k1.c" in my toy C code. I can't seem to find any documentation or walkthrough guide on simple usage of the library such as generating private keys and addresses (besides secp256k1.h). Any help would be appreciated!

There is a work-in-progress libsecp256k1 pull request that adds usage examples: https://github.com/bitcoin-core/secp256k1/pull/748.

See here for an example of a #define configuration. You may then search for those macros in the repo to see their alternatives and define the relevant ones before you #include "src/secp256k1.c"

I can't seem to find any documentation or walkthrough guide on simple usage of the library

This library is not meant for use as a single header, as explained in the README.md:

Expose only higher level interfaces to minimize the API surface and improve application security. ("Be difficult to use insecurely.")

The conventional way of using this library is compiling it and calling the linker when you compile your code with libsecp256k1.a for static linking (You may do gcc your-code.c libsecp256k1.a)
However, I used the library once with an #include only a long time ago, without any problems. That works, and as I described at the top, you just need a few #defines.
secp256k1.h is self-explanatory. You might want to read it all similarly to reading a story. Then you should be able to find the relevant functions.

Is there another secp256k1 library that can be compiled into my code?

What doesn't work for you with the standard one?

I don't like linking in black boxes (libsecp256k1.a), for embedded system I need full transparency, control over asserts, debugging if needed.

What I'd do is #include "secp256k1.c" however this is too hacky so maybe you should ask libsecp256k1 developers.


text:
Could not detect boost libraries when configuring Bitcoin core - Apple M1 Mac Mini
I´m trying to install Bitcoin from source on an Apple M1 Mac Mini (Big Sur 11.2.3) and Im getting this when running
./configure --prefix=$PWD/depends/arm-apple-darwin20.3.0

"We could not detect the boost libraries (version 1.58.0 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option."
config.log tells me:
configure:32586: checking for boostlib >= 1.58.0 (105800)
configure:32618: g++ -std=c++17 -c -g -O2 -I/opt/homebrew/opt/libffi/include -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -DPROVIDE_FUZZ_MAIN_FUNCTION  conftest.cpp >&5
conftest.cpp:73:10: fatal error: 'boost/version.hpp' file not found
#include <boost/version.hpp>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
configure:32618: $? = 1

I have boost installed via homebrew in /opt/homebrew/Cellar/boost
(Version 1.75.0) and I did try
export BOOST_ROOT=/opt/homebrew/Cellar/boost

before building, but keep getting the same result.
echo 'export PATH="/opt/homebrew/opt/icu4c/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/opt/homebrew/opt/icu4c/lib"
export CPPFLAGS="-I/opt/homebrew/opt/icu4c/include"

also didnt help. Any ideas very much appreciated. Thanks

Problem solved. Rosetta 2 was missing on the new system I set up. If anyone else runs into the same problem:
softwareupdate --install-rosetta

does the trick. Thanks to @AlgorithmicRisk on Twitter for pointing this out.

FYI fanquake has put up some cross compiled (minus Qt) binaries using depends for Apple M1 hardware here: https://github.com/fanquake/build_artifacts/releases/tag/m1_test

I had the same issue and it turns out that my system was missing the Boost library.
Install it using this(on wsl): sudo apt-get install libboost-all-dev
Then it should work.


text:
I used Bitcoin-QT to send BTC and it never confirmed. I used the zap command and resent with maximum fees, still no luck
Hello I sent about $300 worth of BTC and it never got confirmed. I then used the --zapwallettxes=1 command to get the BTC back and resend with max amount of fees, but it still didn't confirm on the other end. I tried this several times with different addresses, but nothing has worked. I can provide any details necessary to aid this process. Any help would be greatly appreciated!
EDIT: The transaction ID is a5966f30e0b170e4d1af9b47dea6b8154022ef5917189890eef72e831e5dffab
Also Bitcoin-QT is now telling me that the transaction has 13 confirmations, however it still hasn't showed up in my other wallet. I searched for the transaction ID on blockchain.info, and see that the amount was successfully transferred to the address I intended it to. However, it then shows my BTC being transferred again to another address I didn't create. Does this mean my BTC was stolen?

What does 'max amount of fees' mean? Bitcoin Core will let you send up to 0.1 BTC of fee. Even if you pay a high fee, transactions may take a while to confirm.

I used the "slider" on bitcoin-qt and pushed it all the way to the right, meaning the bitcoin would be confirmed within 1 block. I didn't manually type in an amount.

Sorry, I meant 2 blocks

Can you share the transaction ID?  Also, note that trying to hire someone to solve your problem isn't allowed on this site; it isn't for job recruiting.

I have added the transaction ID. My apologies for requesting payment, won't happen again.

The fee you sent is 97 satoshi per byte, which is good enough to confirm your transaction with in 1 or 2 hours.
1 or 2 hours because there is a large number of unconfirmed transactions now. And several hundred transactions of them have a fee rate larger than your transaction's fee rate.
Your transaction should be confirmed now, please check it.


text:
bitcoin core node cannot route to peers
I'm trying to sync a new full node in the cloud, however it's syncing a lot slower than I am used to: I am roughly at 70,000 blocks after about 12 hours.

It doesn't seem to be slow IO, iotop shows that everything is idle and almost nothing is being written.
My node is making connections: according to bitcoin-cli getnetworkinfo I should have 10 active connections right now.
There has been almost no network traffic, less than 100mb over the last 12 hours.

But this is what my debug.log shows:
~/.bitcoin# tail -n 100 debug.log
2018-01-26 10:07:07 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:09 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:10 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:10 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:12 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:13 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:15 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:16 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:18 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:19 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:21 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:22 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:24 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:25 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:27 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:28 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:30 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:31 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:33 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:34 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:36 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:37 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:39 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:40 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:42 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:43 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:45 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:47 receive version message: /breadwallet:0.6.2/: version 70013, blocks=0, us=[redacted]:8333, peer=885
2018-01-26 10:07:52 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:52 receive version message: /breadwallet:0.6.2/: version 70013, blocks=0, us=[redacted]:8333, peer=886
2018-01-26 10:07:53 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:55 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:56 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:57 receive version message: /Snoopy:0.2.1/: version 70001, blocks=0, us=[redacted]:8333, peer=887
2018-01-26 10:07:58 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:07:59 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:01 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:02 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:04 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:05 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:07 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:08 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:10 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:11 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:13 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:15 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:16 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:18 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:19 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:21 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:22 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:24 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:25 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:27 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:28 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:30 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:37 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:38 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:40 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:41 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:43 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:50 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:51 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:53 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:54 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:56 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:57 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:08:59 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:00 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:02 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:09 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:10 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:12 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:13 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:13 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:15 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:17 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:18 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:20 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:21 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:23 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:24 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:26 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:27 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:29 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:30 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:32 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:33 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:35 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:36 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:38 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:39 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:41 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:42 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:44 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:45 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:47 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:48 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:50 connect() to [redacted]:8333 failed after select(): No route to host (113)
2018-01-26 10:09:57 connect() to [redacted]:8333 failed after select(): No route to host (113)

I've redacted the IP addresses, but all of them are unreachable from my vps box, whereas I can reach them fine outside of the box (making this not a bitcoin core problem but a networking problem).

EDIT:
As requested more debug output:

the VPS host, can you try >telnet redacted 8333

Output:
~/.bitcoin# telnet [redacted]:8333
telnet: could not resolve [redacted]:8333/telnet: Name or service not known

And:
~/.bitcoin# nmap [redacted] -p8333

Starting Nmap 7.01 ( https://nmap.org ) at 2018-01-26 08:13 EST
Nmap scan report for [redacted] ([redacted])
Host is up (0.0069s latency).
PORT     STATE    SERVICE
8333/tcp filtered bitcoin

Nmap done: 1 IP address (1 host up) scanned in 0.42 seconds

Which is strange: nmap works but nothing else seems to be able to route.
I am not using Tor nor have I configured any bitcoin.conf file. Everything is default and I downloaded the default linux build (0.15.1) from bitcoincore.org (checksum matched).

Also, check which interfaces the bitcoin node is bound to especially if your VPS has multiple net interfaces.

It only has one called venet0 and one called venet0:0 (latter has the IP public bound). I am running Ubuntu 16.04.1 LTS.
Here is the first 150 lines of the debug.log (when bitcoind was first started): https://gist.github.com/askmike/5ae06e6ffec122e8634df97e9dae4cf5
EDIT2:
It turned out to be a firewall problem from my VPS provider.

Okay, nmap worked. telnet probably only didn't work because you have a : between the IP and the port, just leave a space. So the VPS can rout to a node. Probably just leaves Bitcoin Core. Are you running bitcoin-qt or bitcoind (and, is it running as a daemon?)? If you run >route -v -n how many destinations of 0.0.0.0 do you have in the left hand column with different iface values in the right hand column? Also, there may be a permission error since you have a few entries like Invalid or missing banlist.dat; recreating

What do you get if you run the command with Bitcoin Core running: >ps -eo user,group,comm |egrep 'bitcoind|bitcoin-qt' |awk '{print "Bitcoin user: " $1}' and does it give you the user you login as?

I'm only running bitcoind as a deamon. 2. telnetting doesn't work after adjusting the command (now it errors with telnet: Unable to connect to remote host: No route to host). 3. I think the banlist issue was just a message on first run (bitcoin datadir was empty so it had to create everything).  4. yes it does give me the user I logged in as.

I created a support ticket with the webhost, to me it sounds like a firewall issue.

It is fairly routine to get no route to host when connecting to IPv6 addresses (it is common enough for web hosts and segments of some ISP networks not to route v6) but I presume not all of the fail entries in your logs are IPv6. What about the route command? I am being presumptuous that your VPS is trying to route on the local interface that has no upstream routing to the intenet. A ticket with your host may help you solve this easily regardless.

Lines like this mean you are actually connecting to some nodes:
2018-01-26 10:07:57 receive version message: /Snoopy:0.2.1/: version 70001, blocks=0, us=[redacted]:8333, peer=887

But it impossible for me to tell from what you have posted if that peer is later one that is failing, I do not think so.
In the VPS host, can you try >telnet redacted 8333 or >nmap redacted -p8333 or >traceroute redacted -p 8333 and add it to your question?
btw: if you want a tool to do node checking apparently this works: https://bitcointalk.org/index.php?topic=760565.msg13820110#msg13820110
Also, check which interfaces the bitcoin node is bound to especially if your VPS has multiple net interfaces. It should show up in the debug.log shortly after node restart.
There are some options like -onlynet= that can cause connectivity issues, what is in your config file or on your command line used to start the node?
Are you using tor?
It could just be a smart firewall or web filter issue with your VPS host.

Added more debug information to the question!

@askmike when you get this sorted, I would appreciate it if you would accept my answer if it helped you, so as to not leave the question "unanswered" -- I am happy to edit my answer further if it is needed.

I will! It looks like a firewall issue (your last sentence) and once I know this for sure I will comment and accept.

it was indeed a firewall problem from the VPS provider. It has now been fixed :)


text:
How to close stale lightning channels with c-lightning
I was running a lightning node using c-lightning about 9 months ago. Unfortunately the server was shutdown while a few channels were open.
I have restarted the server and updated c-lightning to the latest version (0.6.3). After restarting both bitcoind and lightningd I am left with the 2 stale channels.
zap:~# lightning/cli/lightning-cli listpeers
{
  "peers": [
    {
      "connected": false,
      "channels": [
        {
          "state": "CHANNELD_NORMAL",
          ...
          "status": [
            "CHANNELD_NORMAL:Attempting to reconnect"
          ],
          ...
        }
      ]
    },
    {
      "connected": false,
      "channels": [
        {
          "state": "CHANNELD_NORMAL",
          ...
          "status": [
            "CHANNELD_NORMAL:Attempting to reconnect"
          ],
          ...
        }
      ]
    },
  ]
}

I am unable to connect back to these pairs using lightning/cli/lightning-cli connect x, when I try I get timeout or route errors. (EDIT: which means the other nodes are now down).

The problem seems that the other nodes are also offline which is why you can't connect to them.
Luckily you don't have to be connected  as you can do a force close by publishing your channel state to the Bitcoin network (the disadvantage is that you have to wait for the timelock until you can spend your outputs)
Just try lightning-cli close ENTER-CHANNEL-ID-HERE in case you are not connected your node should perform a force close

Am I at risk of losing any money if they aren't actually down (but pretending to be)? My node should have the latest channelstate since it was unlikely the server went down midst transaction.

If your node was offline there can't be a newer state and you should not loose funds by doing a force close (your onchain fees are a little bit higher than in the mutual close setting) of course I can't guarantee you this outcome as it is not sure clear if there wasn't something else going on but mentioned in your question or not observed

Unfortunately that command errors with { "code" : -1, "message" : "Channel close negotiation not finished before timeout" }, indicating that closing this way requires the other nodes (who are now down).

Figured out I can pass a true param to force close it. My node now published the tx. Thanks!

@askmike please can you share more about what you mean by 'figured out I can pass a true param to force close it'


text:
Aborting a three-way swap
Suppose Alice has 1 BTC, Bob has 1 LTC, and Carol has 1 NMC. Alice wants NMC for BTC, Bob wants BTC for LTC, and Carol wants LTC for NMC. Assume each cryptocurrency has the same value and can be 1-to-1 transferred. They need to make a three-way swap: Alice will transfer BTC to Bob, Bob will transfer LTC to Carol, and Carol will transfer NMC to Alice. However, there is no trusted authority/intermediary.
Preliminary:
H is a cryptographic hash function. Hashlock h indicates that if A sends the contract a value s, (i.e., a secret) such that h = H(s), then the contract irrevocably transfers ownership of those altcoins from B to A. Timelock T indicates that if A fails to produce that secret before time T elapses, then the escrowed altcoins are refunded to B. Here, T is the enough time for one user to publish a smart contract on any blockchain, and for the other user to detect that the contract has been published.
Detailed swap is as follows.
Step 1: Alice creates a secret s, such that h = H(s). Then, she publishes a contract on the BTC blockchain with hashlock h (timelock 6T in the future), to transfer her BTC to Bob.
Step 2: Bob first confirms whether Alice’s contract has been published on the BTC blockchain or not. If true, he publishes a contract on the LTC blockchain with the same hashlock h (with timelock 5T in the future), to transfer his LTC to Carol.
Step 3: Carol first confirms whether Bob’s contract has been published on the LTC blockchain or not. If true, she publishes a contract on the NMC blockchain with the same hashlock h (timeout 4T in the future), to transfer her NMC to Alice.
Step 4: Alice first confirms whether Carol’s contract has been published on the title blockchain or not. If true, she sends the secret s to Carol’s contract, while acquiring 1 NMC and revealing s to Carol.
Step 5: Carol then sends s to Bob’s contract, while acquiring 1 LTC and revealing the secret s to Bob.
Step 6: Bob finally sends s to Alice’s contract, while acquiring the 1 BTC. The swap is completed.
Questions:
a) If Bot halts in Step 2, what is the result?
b) If Carol halts in Step 5, what is the result?
c) If Carol posts her contract with Alice before Bob posts his contract with Carol, what is the result?
d) If Carol’s contract with Bob were to expire at the same time as Bob’s contract with Alice, what is the result?
e) If Alice reveals the secret s before Step 3 completes, what is the result?

a) If Bob aborts before step 2, then Alice will not reveal s. 6T will elapse and Alice will get her BTC back. If Bob aborts after step 2, then Alice will not reveal s, as she has no incentive to do so - only Carol is paid, so why would Alice reveal s and lose her BTC for nothing? Again the timeout is reached.
b) If Carol aborts before step 5, Alice receives the NMC, but Carol's payment times out and so Carol does not receive the LTC (and it is given back to Bob, who will, at the end of the protocol, have both LTC and BTC). However, Bob can continue executing the protocol and receive his BTC, so Carol aborting is only harming her. If Carol aborts after step 5, she will get her LTC payment. Alice has already received her NMC and Bob can continue executing the protocol to receive his BTC.
c) This does not make any difference in the protocol.
d) This would be a problem if Alice's contract expires in 6T, but both Bob's and Carol's expire in 4T. Alice could wait until time 3T has elapsed to claim the coins from Carol's contract. As soon as s is seen on the NMC blockchain by Bob and Carol, time 4T has elapsed. In this case, Carol can no longer claim her coins, as Bob's contract has now expired. Hence, the 1 LTC is returned to Bob. However, Bob can also claim the 1 BTC. So, in case Carol sees that Bob's contract has an expiration of 4T she should refused to create her contract.
e) In case Alice reveals s prior to step 3, Carol has not yet created the smart contract. If she is rational, she will not continue executing the protocol. If both Bob and Carol are rational, Bob can take the 1 BTC and Carol can take the 1 LTC. Then Alice is left without any money. Hence, Alice can only harm herself by revealing s early.
Maurice Herlihy has written a paper on atomic swaps involving multiple parties which I recommend.
PS: Typically, stopping execution in the middle of a distributed protocol is called "aborting", not "halting". The "Halting problem" usually refers to something else in theoretical computer science.


text:
Does the BTC-e API have a method to transfer bitcoins?
It seems crazy to me that one of the largest exchanges could forgo including a methed in their API to transfer bitcoins from one address to another, but this seems to be what BTC-e has done.
Does anyone know of a way to transfer bitcoins using BTC-e's API?

As of July, on the wiki entry about them, they do not seem to have an API endpoint for "withdraw".
Source:

https://en.bitcoin.it/wiki/BTC-E#Withdraw_options
https://btc-e.com/api/documentation

I'm sure it would be helpful for arbitrage reasons.


text:
Bitcoin Core Wallet - Really Anonymous?
how does one remain truly anonymous on bitcoin network? Say, for example, if one use the bitcoin core as its wallet, while sending one's first transaction, will his/her IP be somehow revealed at that instance? Has anyone tried to run bitcoin core in a VPN/TOR setting or environment?
Nathan Aw

Say, for example, if one use the bitcoin core as its wallet, while sending one's first transaction, will his/her IP be somehow revealed at that instance?

In theory, it is possible, but in practice, no. IP addresses are not in transactions or blocks in any way.

Has anyone tried to run bitcoin core in a VPN/TOR setting or environment?

Yes. Bitcoin Core has options for using the TOR SOCKS5 proxy and has had this capability for a long time.

Note that IP address is not the only thing to be concerned about when it comes to anonymity.  Regardless of what IP address is used to broadcast a transaction, you have to hide where the coins you are spending came from.  That is probably the more important part of concealing your identity on the Bitcoin network.

The IP will be revealed to the supernodes or nodes you are directly connected to and if they are recording IP secretly,
I remember blockchain.info storing that data in early days
You can actually create raw transaction and broadcast it through some service accessed privately, Its the best measure or transfer funds to an online service you can trust

thanks! By that, it implies that true anonymity is not possible? Nathan Aw

it is , but with careful measures like bypassing your IP because its a necessary evil in computing
Please upvote if you found this answer helpful


text:
Refunding of payments made
I was scammed November 2017 by a woman called, Adele Johnson. I wanted to trade on bitcoin, but didn't had the experience to do it myself. She offered her help to trade on behalf of me. I paid R8000 into my Luno account where she requested all my registration details as well my wallet address. She made use of Tradeway Option Platform to trade for me. According to her my money growth to $50 000 and for me to withdraw this money I need to pay $7000. I told her I don't have such money, she got angry and blocked me.
A man, called Artem Vladys told me he can help me to trace this money through interpol. He requested a payment of $300 and he assured me that will be the only payment I had to make; which I made via Luno, I bought him bitcoin worth $300 and sent it to the wallet adress: 154oDjBXc1wSzYncP6YwrU7a9duVGd3J3. He requested another amound of $200, I unfortunately refused to make another payment before I haven't seen what he did to assist me tracing my lost money. He got mad and he blocked me.
Both people said they work for bitcoin.
All the transactions shows in my luno account. Is there any possibility that I can trace this money? Is there not honarable people/organisation who can get my money back?

Both people said they work for bitcoin

Some people lie.

Is there any possibility that I can trace this money?

Criminals often try to make that difficult for you. It is unlikely that anyone can trace exactly where your money went.

Is there not honarable people/organisation ...

There are but

... who can get my money back?

Part of the design of Bitcoin and other cryptocurrencies is to make it hard to track transactions to real people.
What you have done is the equivalent of putting banknotes in an envelope and posting it to a post-office box address in a foreign country where such boxes can be rented without presenting any ID.
You should report the crime to your local police. You would be wise to assume your money is lost.


text:
BitcoinCore cant load wallet
I have retrieved an old wallet.dat file from my harddrive that crashed about 5 years ago.
I have downloaded the new version of bitcoincore and downloaded the blockchain. I have then copied the wallet.dat file (which is in 96 kb) into the directory where the wallet should be.
But when i try to open the wallet.dat i get this sign: "Warning: Skipping -wallet path that doesn't exist. Failed to load database path'E:\bitcoin\wallet1.dat'. Path does not exist.
It says E because i had to download the blockchain on a separate hdd.
What could the issue be? I have tried to make new wallets and open them from the same directory and that has not been a problem. Can i somehow open the wallet to retrieve the private keys??

tldr: specify a directory not a file and have that folder contain a wallet.dat not a wallet1.dat.

Your error message said

 Warning: Skipping -wallet path that doesn't exist.
 Failed to load database path'E:\bitcoin\wallet1.dat'. Path does not exist.

However the help for the program says

-wallet=<path>
Specify wallet path to load at startup. Can be used multiple times to load multiple wallets. Path is to a directory containing wallet data and log files. If the path is not absolute, it is interpreted relative to <walletdir>. This only loads existing wallets and does not create new ones. For backwards compatibility this also accepts names of existing top-level data files in <walletdir>.

(My emphasis).
An example configuration file says
# Specify where to find wallet, lockfile and logs. If not present, those files
# will be created as new.
# wallet=</path/to/dir>

Your E:\bitcoin\wallet1.dat is a file not a directory
I can reproduce something similar by copying a valid wallet.dat to wallet1.data in a separate folder with no other Bitcoin files in it
C:> bitcoin-qt -wallet=c:\Users\ZZZ\Documents\wallet1.dat

So I think you could

rename wallet1.dat to wallet.dat
specify E:\bitcoin\ not E:\bitcoin\wallet1.dat.

Thank you. That is somehow confusing since the wallet.dat file in the is not named ”wallet1.dat”. After this message, btq opens without a wallet. What is more confusing is that the other wallet.dat filés are able to open in a way this particular one does not. The wallet.dat is in a folder with bitcoin files in it, and the other wallets do open when i run then from the same path. Now what could i do to retrieve the private keys?


text:
Different address prefixes for different address types / network combinations
I'm working on a bitcoin project, and understand the differences between the wallet address which start with 1, 3, or bc1. I am looking to generate a wallet address that starts with 1.
I have seen the answers posted here, this is more or less the same info I have read elsewhere. However, when I create a legacy address via this method, it starts with an 'm'. When I create a wallet address that is not legacy, it starts with a 2.

Am I missing, or not understanding something? Why are my addresses starting with an 'm' or 2, instead of 1, 3, or 'bc1'?
How do I create a wallet address with a '1' prefix it Bitcoin Core

Thanks in advance!

You're probably using a test network. The equivalent of P2PKH addresses (1... on mainnet) is m... there. The equivalent of P2SH addresses (3... on mainnet) is 2... there. The equivalent of P2WSH and P2WPKH addresses (bc1q... on mainnet) is tb1q... there

Ahhhh, I AM using the test network! Let me see if this resolves the issue. If so, I.ll mark you as the answer.

Confirming this worked, thanks @Pieter Wuille! If you submit this as an answer, I'll mark it as such.

Different networks use different address prefixes.
In Bitcoin mainnet:

P2PKH addresses: 1...
P2SH addresses 3...
P2WSH and P2WPKH addresses: bc1q...
P2TR addresses: bc1p... (see BIP 341)

In Bitcoin testnet and signet (see BIP 325):

P2PKH addresses: m... or n...
P2SH addresses: 2...
P2WSH and P2WPKH addresses: tb1q...
P2TR addresses: tb1p...

Bitcoin Core's regtest network:

P2PKH addresses: m... or n...
P2SH addresses: 2...
P2WSH and P2WPKH addresses: bcrt1q...
P2TR addresses: bcrt1p...

See also https://en.bitcoin.it/wiki/List_of_address_prefixes


text:
Impact: unknown rules (versionbit 2) have been activated
I have an issue. My Bitcoin Core client shows "Impact: unknown rules (versionbit 2) have been activated". Bitcoin Core made a transaction by itself and sent all my bitcoins from my wallet to an address I don't recognize. I don't know what's happening. Can I do something with this issue and get my bitcoins back?

"unknown rules (versionbit 2) have been activated"

This means that you are probably using an old version of Bitcoin Core that doesn't understand new types of Bitcoin transaction. The current version is 0.21.1.
It almost certainly has nothing to do with  the second part of your question.
Installing a new version of Bitcoin Core from the genuine website should make the message go away. It won't get your money back though.

Bitcoin Core made a transaction by itself

If you didn't make the transaction, either someone else has access to your wallet or to a copy of your wallet (that is, they have had some kind of access to the private keys in the wallet). It is possible your computer has malicious software on it that you were tricked into installing.
Don't download software from trickster websites that use variations of the name such as "BTC Core". Mistakenly installing malicious software is one way of having money stolen. I note that there is a site whose URL spells bitcoincore with an accented ń - I can only assume it is a fake website providing maliciously altered software that steals money. That malicious imposter website seems to have currently bought its way to the top of the Google results (it's an "Ad" result). bitcoincore.org is OK, bitcoińcore.org is fake.

and sent all my bitcoins from wallet to address I don't recognise.

That sounds like theft.

Can I do something with this issue and get my bitcoins back?

You can't cancel, undo or reverse a confirmed transaction. Only the person or business who controls the receiving address can create a new transaction sending the same amount to you. It is possible the money has been moved further.
Beware of fake recovery agents. You are much more likely to be tricked out of further money than to any see any significant amount of stolen money returned to you.
See

How do I recover from a cryptocurrency scam? (some of the answers will apply to the type of theft you might have been victim to)
Is there a 'BTC Refund Department'?


text:
Can a Bitcoin node create an outgoing connection to a inbound node?
I'm trying to figure out if we can create an outgoing connection to a inbound node (a node which we are already connected to, but the remote peer has initiated the connection). I know that this does not make much sense since we exchange information to inbound and outbound nodes. However, I have looked at the source code and did not find the code that prevents a node from doing that. Is anyone out there more successful?

I misread that. Nothing prevents what you describe.

Nothing prevents this as it is impossible to distinguish whether the node that is connecting to you is the same one that you are already connected to. This is because one machine can run multiple node software or multiple instances of the same software and thus it can be multiple nodes on the network.
There's also no reason to block such a connection.

I see that there is no reason to block such a connection. However, as I see it, a node would benefit if it connects to another node (and not to a one it is already connected to). Can't we use the IP address?

No. IP addresses are not unique enough identifiers. Besides what I mentioned, there's also the issue of NATs. Two computers behind a NAT will have the same public IP address.

Jan,
there is a mechanism that prevents Bitcoin Core from opening a new connection (making an outbound) to an address it is already connected to (irrelevant of whether the existent connection is inbound or outbound).
See the function CConnman::AlreadyConnectedToAddress(), how it is called from CConnman::OpenNetworkConnection() and the surrounding code.
This check, however, could allow to open an outbound even if an inbound from the same address exists in the following cases:

When opening an outbound connection to RPC addnode onetry, RPC addconnection, ADDR_FETCH connections, connections to addresses given to -connect and -addnode. Then the port is also compared. So, for sure, we are not going to see an inbound connection from the node's listening port (e.g. addr:8333) during the check. Inbound connection are from some random port assigned by the remote node's operating system (e.g. addr:54721). In these cases the check would only prevent us from opening multiple outbound connections to the same node.

In the other cases only the address is compared, without the port, so the check would detect an existent inbound from addr:54721 when trying to connect to addr:8333 and would cancel the opening of the connection. However:

There is a race in CConnman::OpenNetworkConnection(), if addr connects to us between the two:

check whether connected to addr
if not, then open a connection to addr

This race is rare because the window is very small, but more likely if the network is slow and completing the connection takes some time, like could be with overlay networks, especially I2P.


text:
bitcoind: cannot obtain a lock on wallet directory
Hello fellow bitcoiners,
I have a very annoying and mysterious issue with a bitcoind install. I had a blockchain corruption/stuck at some point. I deleted the old blockchain and copied an up-to-date blockchain from another machine. And now bitcoind does not succeed to run. When launched it complains about: "Cannot obtain a lock on wallet directory". I have deleted the .lock file, bitcoind obviously not running. After relaunch, the file gets created again. ps -aux | grep bitcoin returns no running process. bitoind starts (as a systemd service, which wasn't modified and run perfectly before, not in question). After the blockchain copy I chown the blockchain directory to the correct user on the target machine. I have enven  tried chown 777 giving all possible rights on the blockchain directory. Still have the lock issue.
Here is the debug log:
2019-12-22T21:26:19Z Using data directory /usr/local/bitc/blockchain
2019-12-22T21:26:19Z Config file: /usr/local/bitc/blockchain/bitcoin.conf
2019-12-22T21:26:19Z Using at most 125 automatic connections (1024 file descriptors available)
2019-12-22T21:26:19Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2019-12-22T21:26:19Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2019-12-22T21:26:19Z Using 4 threads for script verification
2019-12-22T21:26:19Z scheduler thread start
2019-12-22T21:26:20Z HTTP: creating work queue of depth 16
2019-12-22T21:26:20Z No rpcpassword set - using random cookie authentication.
2019-12-22T21:26:20Z Generated RPC authentication cookie /usr/local/bitc/blockchain/.cookie
2019-12-22T21:26:20Z HTTP: starting 4 worker threads
2019-12-22T21:26:20Z Using wallet directory /usr/local/bitc/blockchain
2019-12-22T21:26:20Z init message: Verifying wallet(s)...
2019-12-22T21:26:20Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2019-12-22T21:26:20Z Using wallet /usr/local/bitc/blockchain
2019-12-22T21:26:20Z ERROR: Error while attempting to lock directory /usr/local/bitc/blockchain: Permission denied
2019-12-22T21:26:20Z Cannot obtain a lock on wallet directory /usr/local/bitc/blockchain. Another instance of bitcoin may be using it.
2019-12-22T21:26:20Z Error: Error initializing wallet database environment "/usr/local/bitc/blockchain"!
2019-12-22T21:26:20Z Shutdown: In progress...
2019-12-22T21:26:20Z scheduler thread interrupt
2019-12-22T21:26:20Z Shutdown: done

Does anyone has a clue?
Best regards, cr!ptal.

Make sure that there is no other instance of Bitcoin Core running on your system. Once you are absolutely sure that nothing else is using the data directory, delete the files named .lock and .walletlock within it. Then start Bitcoin Core.

As I wrote, ps -aux | grep bitcoin retuns no running bitcoind process. It is not a simple problem. I think it might come from a side effect of some issue and it reporteed as a lock problem, when it makes no sense - the .lock file is created. I delete it, restart, it is created again. There must be some silent error in the background. I have no idea where is the root problem...

The .lock file is supposed to be created by bitcoind which will then remove it during the shut down process.  The issue comes from the lock file being there when bitcoind is not running. You also need to remove the .walletlock file too.

After looking at your debug.log snippet more closely, your error is actually due to the .walletlock file.


text:
Zcash z-addr in bitcoin
Can a improvement, difficult or easy, to Bitcoin Core implement z-addr like Zcash?
Zcash do it possible to send coin anonymous using z-addr. The blockchain do not show z-addr, only t-addr that is like a bitcoin address.

The developers of Zcash did try to implement their solution using the Bitcoin blockchain but it required several changes to Bitcoin core that where both difficult and more importantly difficult to come to consensus for the changes with the rest of the Bitcoin community. So the Zcash developers decided to make a new blockchain.
So technically speaking it would be possible (but hard) but convinving the Bitcoin community of the changes would be much harder.
Note that there are other anonymity proposals that will use the Bitcoin blockchain (e.g. Confidential Transactions, MimbleWimble) but I do not know the state of their implementation.

also, there's mimblewimble.

MimbleWimble would be very hard to integrate into Bitcoin, as its concept of a blockchain differs a lot (it is not append-only).


text:
How many transactions have been included into the blockchain?
This website shows the number of bitcoin transactions per day, but I want to know how many there are total. How can I do this?

As of block 210000, the total number of transactions in the chain is 9344662.
Version 0.8 of the reference client keeps track of this number, and reports it for every connected block in debug.log. I just copied the number from the debug.log of a node running pre-release code.

From this JSON source, the totals can be computed:

http://blockchain.info/charts/n-transactions?format=json

Thanks for the help, Stephen, but it appears that the data only goes back one year. Any other ideas?

Building on Stephen's answer, here's a python script that will parse out the data and give you a total.
There's an important problem, though. It will only load the last year of data.
import urllib2
import json

url = "http://blockchain.info/charts/n-transactions?format=json"
page = urllib2.urlopen(url).read()
data = json.loads(page)['values']
data = map(lambda point: point['y'], data)
print int(sum(data))

Gist


text:
How to get IPv6 connections on Linux
I have some Windows nodes and some Linux nodes for a couple of different coins all behind my domestic broadband.
My Windows nodes have full Qt wallets, my Linux nodes are running headless daemons.
My Windows nodes are making IPv6 connections and show their own ip as an IPv6 address, whereas the Linux nodes do not connect with IPv6 and only show their own ip as an IPv4 address.
The Linux nodes are on Raspian Jessie Lite, when I do ifconfig the adapters have IPv6 addresses.  /etc/modules has ipv6 in the file.
What do I need to do to get the Linux nodes listening on IPv6 please?
EDIT: As a test I added the internal IPv6 address of my Windows wallet to the Linux as an addnode=.  The Windows getpeerinfo shows the Linux machine as an ncoming connection, but with its LAN IPv4 address...

This is more of a network admin question for http://superuser.com/

I'm voting to close this question as off-topic because it sounds like a question belonging to superuser.com


text:
How is a version of Bitcoin marked as 'obsolete'
I'm compiling a pre-release version of a Bitcoin based altcoin.  I get a temporary connection to a current version fullnode of my own, but the connection is then rejected.
When I look in the debug.log of the current version node, it says the new protocolversion is obsolete, but the new version is higher than the current one.
I'm trying to understand how these mechanisms work, thank you.
EDIT for clarity: How does protocol version come into being, how is obsoleteness determined, why whould a higher version show as obsolete?

You have a bug in your code. Point.

Yes probably, but how does the protocolversion mechanism work?  How does it decide what is obsolete, why might a higher version qualify as obsolete? That is the question.

How does your code work? Nobody knows except of you.

Im asking about the standard Bitcoin code, so then I can attempt to look at this code and try and understand what might be different about it, thats why the title is: "How is a version of Bitcoin marked as 'obsolete'".

So the version is stored at https://github.com/bitcoin/bitcoin/blob/master/src/version.h


text:
message signing: is it safe to publish the address, message and hash
I want to use message signing in another application to prove a particular wallet owner did in fact make the transaction.  This as I understand it is what message signing/verification is for.
I just want to confirm that making the address, the message, and the hash fully public (open for the world to see) does not compromise the wallet security.  Also if I did this thousands of times on the same address, but each with a unique message and hash, the private keys would remain secure.
Thank you.

It shouldn't compromise the private key. Notice that publishing a message along with a signature is a common thing, and is necessary to verify the signature. Publishing also de Bitcoin address is similar to give the public key, since the former can be derived from the latter (actually, once you redeem your first transaction by signing it, you will provide the public key in the blockchain).
However, since you what to reuse the same key for signing multiple messages, there is something you should have in mind. There exist a well-known ECDSA vulnerability that affects the signing process, and by which if two different messages are signed using the same private random value k, anyone who knows the two original messages and the signature can derive the private key used to sign the messages. This is not likely to happen, since k should be chosen at random and from a good source of randomness, however some buggie implementations of the signature had lead to private key disclosure.
In order to ensure that this won't happen, you should use a deterministic ECDSA signature, in which k is chosen deterministically over the message to sign. Several wallets, like the Bitcoin Core, implement such a mechanism by default.

Thanks, so if I could use a different address (public key) for every signature, this would prevent any possibility of private key disclosure, even in (known) buggy implementations?

And a follow up, is there an easy way to check if a wallet uses the deterministic ECDSA signature?

It should, at least for the issue I'm talking about. Regarding checking if a wallet is implementing a deterministic signature scheme, the easiest way I think will be signing a message twice. Given a message and a private key, if you sign the message twice and the signature is the same, then the signature scheme is deterministic.

Right that makes sense!


text:
Can I have a fee rate lower than the one suggested by estimatesmartfee economical
I know what the inputs and outputs are, the weight of the transaction. At the moment I have $1400 divided into addresses (of my own bitcoin-node).
When using sendtoaddress, 24 blocks, ECONOMICAL he wants $400 commission. Is there anything I can do now?
Can I somehow transfer money locally to 1 address?
UPD: estimatesmartfee return
bitcoin-cli estimatesmartfee 24 "ECONOMICAL"
{
  "feerate": 0.00105724,
  "blocks": 24
}

Is there anything I can do now?

Yes, if you want to lower the fee rate, you can set the fee you want to pay manually:
bitcoin-cli settxfee 0.00081

fee are in bitcoin/kB  so they correspond to 81 satoshi/vbyte
and then you can do your transaction with
bitcoin-cli sendtoaddress "address" "amount"

Can I somehow transfer money locally to 1 address?

From blockchain viewpoint all address are equal, it don't know which belong to the same wallet, so there can't be local and external transactions.

Thanks for the detailed answer! I will definitely put LIKE when I can do this. I would like to know how online payment acceptance systems work with small amounts >= $20? What happens to them or what is the best way to handle them in my case?

If you don't need to spend right now, you can wait when the mempool is more empty (these weeks fee are crazy, near historical high) so you can pay lower fee. In this chart you can see how fee rise when mempool fill up https://jochen-hoenicke.de/queue/#BTC,1y,count
here there are other things you can do: https://en.bitcoin.it/wiki/Techniques_to_reduce_transaction_fees
If the answer is right to you, you can accept it with the green check.

Thank you again everything worked out. I will definitely take into account your answer, and i am sure that the last link has everything need.


text:
Novice has bitaddress.org-generated wallet with .08 BTC in it... how can i exchange them for a fiat currency?
I have the wallet ID and the private key. My wallet contains a fraction of one bitcoin from a single transaction in 2014.
I made an account at blockchain.com, but I'm unable to import my wallet into that account. ("Invalid Wallet ID")
If I wanted to sell, for example, what would I need to do?

Bitcoin is real money.

The "wallet ID" is specific to blockchain.com account and correspond to its login, if you have generated your address on bitaddress.org you can't have it, you should have instead the bitcoin address and it's private key.
These are the steps to import an external address from blockchain.com support:

To import a bitcoin address from a third party platform, click on +    Import Bitcoin Address and select Existing address generated outside this wallet. Enter the private key of the bitcoin address you want to import. Next, add a label for the address (optional) and select an existing sub-wallet to transfer the funds to, or leave this blank if you want the funds to remain in Imported Addresses. Click Import to complete the process.
In the mobile app, press the three horizontal lines in the upper left    corner to open the menu and select Addresses. Tap the + to the right    of Imported Addresses and then scan the private key's QR code. Next,    assign the address a name and press Save Name, or press No Thanks if    you do not wish to give the address a name.

Anyway, if you have a bitcoin address private key you can import it on any other wallet (you have just to know in which format is).
Once you have imported the address/private key in a wallet then you can send your bitcoin to an exchange and sell them for the currency of your choice.
Here you find info on private keys format and how to import them:
https://en.bitcoin.it/wiki/Private_key
https://en.bitcoin.it/wiki/How_to_import_private_keys

Thanks leevancleef. I got a Jaxx wallet and "swept" the 2014 wallet into my new Jaxx wallet. I don't know if "swept" is the correct term. Part of the problem was several mobile clients I tried, like BRD and Edge, wanted me to take a photo of the (square image with pixels) ... I didn't have this. I tried some desktop apps until I found one (Jaxx) that let me enter the Private Key of my 2014 wallet. That worked.

Option #1: Find a buyer like you would find at a comic-con.
Option #2
https://www.bitcoin.com/bitcoin-atm/
Option #3 Cashapp & Simplex
(* You still have to link a bank account because of regulation since 2014-2015.)


text:
Unconfirmed transaction: the status is "0 / unacknowledged, not in memory pool "
I started a transaction with bitcoin-0.21.0-win64, a Windows client. It may be that the fee is set too low, which leads to the unsuccessful transaction. What should I do in the future? What do I need to do? How to implement the specific operation steps? Below is the transaction details, please help! Thank you very much！
Status: 0 / unacknowledged, not in memory pool
Date: 2021 / 3 / 8 12:31
To: coin an 1kgsxf7krv1ab99tex1wjm643tsilczbg6
Expenditure: - 0.05193365 BTC
Transaction fee: - 0.00120000 BTC
Net amount: - 0.05313365 BTC
Transaction ID: aceea84e8a72b24654cba7b1d042561d8a9d36f7828855b52012de8a5a0b9c12
Total transaction size: 11767 bytes
Transaction Virtual Size: 11767 bytes
Output index: 0

The transaction you made is quite large, so also if the fee you paid is not low in absolute term, it is in relation to the space taken on blockchain.
0.00120000 / 11767 = 0.00000010

you have paid 10 sat/vByte that was borderline to be included in a block in the days you should have broadcast the transaction.
As you can check here:
https://jochen-hoenicke.de/queue/#BTC,3m,count
there are some transaction with a fee rate similar to your that have been verified (note that it generally takes 14 days for the transaction to be removed from the mempool if not confirmed), so i'm not 100% sure the fee rate is the reason because your transaction has not been verified, maybe there is another reason (eg. when you made your transaction your client is not fully synchronized and you close bitcoin-core before the transaction was actually submitted).

What should I do in the future?

Be sure that your client is synchronized or at least check on a blockexplorer that your transaction just submitted is in mempool (although not yet confirmed).
Enable Replace By Fee so if the fee you set turn out to be too low you can raise it later.
You can also use the bitcoin-core fee estimation choosing recommended transaction fee and setting a confirmation target no longer than a few hours.
Remember to check that the transaction has been verified before 14 days have passed since its submission.

It pays more than 10 sat/vB which would be plenty for it to be in the mempool any time in the last month. It must have just timed out. :)

Thank you for your help. I have successfully recovered bitcoin by using the command "abandontransaction ". I will restart the transaction


text:
What are the pool node mining difficulty settings for darkcoin?
What are the correct difficulty ssettings to mine darkcoin on a private pool node (pool side settings as shown below)?
"diff": 0
"minDiff": 0
"maxDiff": 0
"targetTime": 0
"retargetTime": 0
"variancePercent": 0

Credits to  CryptoSiD
"diff": 0.00390625,
"varDiff": {
"minDiff": 0.00390625,
"maxDiff": 0.0078125,
"targetTime": 15,
"retargetTime": 150,
"variancePercent": 30

Could you maybe expand upon these settings?


text:
What is an inv message?
I was reviewing the PR #25720. This is part of description for the PR:

However, if an INV for a block is received before our headers chain is
caught up, we'll then start to sync headers from each peer announcing
the block. This can result in doing a big headers sync with many (if
not all) of our peers simultaneously, which wastes bandwidth.

What is an INV message? I tried to figure it out by searching it but found nothing useful. This link had a small information about it but it is still not clear for me what it is.

inv is short for inventory. As the Bitcoin wiki says:

Inventory vectors are used for notifying other nodes about objects they have or data which is being requested.

Inventory vectors consist of the following data format:

The inv message (for transactions) was explained in the notes of this PR review club in Feb 2021 hosted by Elle Mouton.

Transaction relay is a three step process: inv -> getdata -> tx:

the relaying node sends an inv message to the receiving node to announce a new transaction.
if the receiving node wants to retrieve the transaction that it learned about in the inv message then it will send a getdata message to the relaying node to request the full transaction. (The receiving node won't send a getdata message to a peer for transactions that it has already seen or if it has already sent a getdata message for the transaction to a different peer.)
the relaying node delivers a tx message to the receiving node. If the relaying node is no longer able to deliver the transaction, it responds with notfound instead of the tx.

Michael's answer was very helpful for me, but I think it is also helpful to take a look at the source code and implementation of inv messages while the question is tagged bitcoin-core-development.
This is the source code for inv messages. Link:
/** inv message data */
class CInv
{
public:
    CInv();
    CInv(uint32_t typeIn, const uint256& hashIn);

    SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }

    friend bool operator<(const CInv& a, const CInv& b);

    std::string GetCommand() const;
    std::string ToString() const;

    // Single-message helper methods
    bool IsMsgTx() const { return type == MSG_TX; }
    bool IsMsgBlk() const { return type == MSG_BLOCK; }
    bool IsMsgWtx() const { return type == MSG_WTX; }
    bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
    bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
    bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }

    // Combined-message helper methods
    bool IsGenTxMsg() const
    {
        return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX;
    }
    bool IsGenBlkMsg() const
    {
        return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK;
    }

    uint32_t type;
    uint256 hash;
};


text:
What are packages in bitcoin core and what is their use case?
In bitcoin source code there is an entity named Package and I've seen them many places over the source code. I found this comment in src/policy/packages.h:
/** A package is an ordered list of transactions. The transactions cannot conflict with (spend the
 * same inputs as) one another. */
using Package = std::vector<CTransactionRef>;

Why they are useful?

You explicitly asked about the source code, but let me start by giving a broader explanation of the term "package".
When talking about a package, we generally refer to a set of connected transactions. For instance, a set of transactions {A; B; C} where C spends A and B is a package. A set of transactions {A; B; C; D} where B spends A, C spends B and D spends both A and C is also a package.
As you can see, this might get pretty convoluted. So why bother? In fact this "connection" between transactions is a dependency. From my first example above, C depends on A and B since it spends one of their outputs. This is a big deal because:

C is not valid without both A and B. While this is straightforward when the transactions are confirmed, it is less so when they are not: if a node hears about C but does not know about either A or B it will not accept it in its mempool and relay it.
An algorithm to create a block template ideally needs to take into account the feerate of the entire package. A and B may  pay a low feerate, but C pay a larger one. Since C depends on A and B it therefore incentivizes their inclusion in a block. This is known as CPFP (Child Pays For Parent).

Therefore, packages are useful to reason about the feerate of a transaction with all its unconfirmed dependencies. Packages have existed for many years in Bitcoin Core and don't always take the form of this data type. For example, CalculateMemPoolAncestors() provides a CTxMemPool::setEntries containing the mempool entries corresponding to a transaction's ancestor set. Each entry keeps track of its dependency relationships with other mempool entries.
Packages have been discussed a lot recently along with the work on Package Relay, a protocol extension permitting to not only relay unconfirmed transactions individually but as packages. While the work on package relay is not new, it has been significantly undertaken lately due to giving better security guarantees to some Layer 2 protocols such as the Lightning Network.
The line you quote has to do with the implementation of packages in Bitcoin Core's mempool validation code. This (critical) part of the code has to do with the acceptance of new transactions in a node's mempool. The type declaration refers to a list of pointers to transactions, and is used in two cases.
First, when accepting a batch of transactions that may or may not be related to each other. It is currently only exposed through the testmempoolaccept RPC command.
Second, when accepting a package of a certain kind: a topologically sorted (parents appear before child) list of transactions that represent a single child with all its unconfirmed parents. It is in the current development branch only exposed through a brand new submitpackage RPC command. The intent is to eventually make it accessible from the P2P network, with the recently proposed Package Relay BIP.
This line defines Package as an alias for std::vector<CTransactionRef> without any other inherent requirements. This may seem surprising (since packages are supposed to contain related transactions) but was introduced to hold a list of candidate transactions for submission to the mempool that haven't been validated yet. To answer why we bothered defining an alias, the idea is if we later create a class, add member functions like Package::GetFeerate, add a constructor that enforces dependency requirements, cache data about transaction fees, etc., we don't need to change all of the places packages are used.
You can read more about the current Bitcoin Core mempool acceptance rules for packages in the doc/policy/packages.md document.

Thanks for you explanation. So nodes relay transactions in packages, right? not relaying single transactions.

No, they are relayed individually. The relay of packages is proposed, but not adopted, as explained in the answer above mentioning the recently proposed package relay BIP.

@PieterWuille understood, thanks.


text:
Should we inform others that all tests are passed in the course of reviewing a pull request?
I'm not sure is there a right place to ask this question or not, if it is off-topic please let me know.
When reviewing a pull request of the Bitcoin Core, is it common to comment and inform others that all tests for this PR are passed? Or we should left comment only to inform failing tests?

If all you did was run the automatic tests on a standard system, and found they succeeded, there is little point in commenting at all.
The continuous integration system already runs all tests (in a variety of platforms), and pull requests are generally not merged before all tests pass. If all you did is run the tests on a fairly standard system, commenting that those tests pass doesn't add any information.
Of course, if you did more, for example:

You're using an unusual operating system, and the PR interacts with the OS in some way, commenting that the PR indeed doesn't break things for you is useful.
You did manual testing, by going through a scenario of operations (like RPC calls, ...) that aren't already covered by one of the PR's automatic tests, or you're testing on mainnet, or testing steps in the GUI (which aren't subject to automatic testing), that is useful too.
As you already pointed out in your answer, if a tests fails which normally doesn't fail for you before that PR, that is obviously useful as well.
If you did code review and are reporting the result of that (see Michael Folkson's answer), it won't hurt to add you also ran the tests.

As part of ACKing a top commit hash (post Concept ACK, Approach ACK) you are encouraged to explain what you did during your review that resulted in your ACK. As part of this comment it is perfectly fine (encouraged even) to say what tests you ran (and that they passed) on what operating system.
An example of such a review comment is this from Jon Atack's doc on how to review pull requests in Bitcoin Core:

ACK fa2f991, I built, ran tests, tested manually by doing X/Y/Z and reviewed the code and it looks OK, I agree it can be merged.

Some of the long term contributors may not do this and simply ACK the commit hash but maintainers have a better idea of what long term contributors are ACKing than a newer, less experienced contributor.

Thanks Michael, but consider that I'm very new to the Bitcoin Core project and in many cases I can't ACK or NACK the PR (due to my lack of understanding of many parts). So it is possible that I can't ACK the PR but I ran the tests and they're all passed. What is your opinion in this case?

It is fine to ACK the commit hash, explain what you did/looked at but caveat it with a comment saying you are still learning about this part of the codebase etc. The maintainers will generally know who is experienced and who is inexperienced so don't worry if you ACK something and there turns out to be a problem with the PR. Alternatively you can just Concept ACK, Approach ACK a PR if you aren't comfortable with your understanding to give a code review ACK. But even with Concept ACK, Approach ACKs try to explain what you've done or what you've understood to give it a Concept ACK, Approach ACK

Then maintainers can look at your review and go "Ok I think this person is inexperienced in this codebase but they clearly understand what the PR is doing and so I should factor in their review into the readiness for merge decision". With no rationale a Concept ACK or Approach ACK from an unknown pseudonym can't really be factored in. It could be a bot that hasn't even looked at the PR.


text:
how to obtain the IP addresses of nodes for mining pools?
I have set up a node for mining, and in order to maintain network stability and quickly receive the latest tasks, I would like to connect to nodes of some large mining pools. Does anyone know how to obtain the IP addresses of nodes for these large mining pools?

There isn't a way to obtain these IP addresses (that I know of) other than to contact the mining pool or to follow the sign up process for that mining pool. You don't need to know the IP addresses of multiple mining pools as your mining pool will take care of broadcasting any mined block that your hardware finds and probably has its own infrastructure for receiving mined blocks from other mining pools. If you are concerned with stability of the network of full nodes then just connect to multiple other full nodes (perhaps randomly), they don't need to be mining pools' full nodes.
If I misunderstood the question and you don't want to use a mining pool and solo mine instead then good luck in 2024. It is very rare for a solo miner to find a block (see this Coin Telegraph article).

I noticed there is an evaluation of all nodes on https://bitnodes.io. If I were to set up a mining pool, can its nodes be referred to using bitnodes for connection? Do you know about the connection strategy?

@youcaizhao: Bitnodes just indexes the IP addresses of reachable full nodes on the network, it doesn't present any information on mining pools. Obviously if you find an IP address of an mining pool you can look it up on Bitnodes and share the Bitnodes URL for it.


text:
libxcb-xinerama0 Library required by bitcoin-qt
I installed bitcoin core 26.1 on a Raspberry 5 (ARM Architecture) running Ubuntu 23.1. Upon running bitcoin-qt, I got the error that the library libxcb-xinerama0 is required but not installed.
It's easily fixed by installing it from the repositories (apt install libxcb-xinerama0), however, for a security conscious person this is a bit unsatisfying. Is there a reason this library is not packaged with the bitcoin core binaries?
After all you go through the hassle of verifying and cross checking all signatures of the binaries and then you have to install a third party untrusted library to run everything.
Many thanks for your answer regarding this design choice and about the safety of libxcb-xinerama0.

This might be better filed as a bug report on the Bitcoin Core repository.

Makes sense, will do that!

It is maintained by the Ubuntu Core Developers.
My suspicion is that it could depend on your X install. It looks like other libxcb packages are installed on my system; I'm wondering if this was assumed to be installed on many folks' distro's. Or, the library build might be heavily dependent on your environment.


text:
How do I calculate transaction fee for call to createpsbt()?
When my user invokes my app, he passes as an input parameter the desired value of the TX fee in satoshis per byte.  I create a PSBT by calling createpsbt().  I exert complete control over the determination of inputs and outputs.  For example, I don't call walletcreatefundedpsbt(), because I don't want bitcoind to select inputs on my behalf.  I have a chicken and egg problem in that I need to call createpsbt() in order to determine the size of the TX in bytes, but I need to specify the fee amount before the call to createpsbt().  The best solution that I can think of is to execute a dummy call to createpsbt() using a dummy fee value, then measure the size of the TX, then do a real call to createpsbt() after correctly calculating the fee amount.  Is there a better way?
Edit: I want to spend all UTXOs.  I want two outputs, one to receive a fixed amount, the other to receive change less the fee.  I have tried many incantations, I can't get it to work.  Here's my latest attempt:
raw_psbt = rpc.walletcreatefundedpsbt(
    # all UTXOs, as returned by listunspent():
    inputs,
    # one recipient: [ { addr : amount } ]
    outputs,
    0,  # locktime
    {
        "replaceable" : True,
        # I would like for the change less the fee to go here:
        "changeAddress" : xxx,
        "includeWatching" : True,
        "feeRate" : 0.005,
    }
)

This fails with Signing transaction failed (-4).  Any idea what I'm doing wrong?
Edit #2: I can't use walletcreatefundedpsbt() as suggested below to create the PSBT, because that function requires that its inputs be "solvable", which is not the case in my environment.  More info at this link:
Errors with walletcreatefundedpsbt & non-solvable UTXOs
So my original question remains unresolved at this point.
Edit #3: So I asked on Slack.  The problem is that our UTXOs are 1) not "solvable" and 2) cannot be expressed in the descriptor language, so Bitcoin Core has no way to calculate the TX size before the TX is signed.  Apparently I would have to calculated it manually as explained in the attached screenshot.

If you want to implement your coin selection, the only alternative to calculating the fee manually I can think of is the following:

You select which inputs you want to be used in your transaction based on your coin selection algorithm.
You then proceed to lock every input that is not the one you selected. You can get the list of all inputs through listunspent and you can lock an input with lockunspent false [{"txid":"hex", "vout":n}, ...].
Now you can use your walletcreatefundedpsbt without being afraid it will select any input that you don't want and you can pass the option {"feerate":your_feerate}.
After getting your raw transaction, you can unlock all previously locked inputs with lockunspent true

I tried to implement this with a call to walletcreatefundedpsbt(), it fails with Signing transaction failed (-4), I updated my OP with more details, any idea what I'm doing wrong?

Not sure what that error message means... maybe try to remove the last set of arguments and work your way adding more and more arguments/options. Also, launching bitcoind with the debug=rpc option might give some valuable information in the debug.log

I figured out why I was getting Signing transaction failed (-4).  It's because the input UTXO is not "solvable" as explained here: https://bitcoin.stackexchange.com/questions/91425/errors-with-walletcreatefundedpsbt-non-solvable-utxos
My original  problem remains unresolved.


text:
I need to import a private key - what is the entire process? [Electrum]
I need to import a private key like in this question for a p2wpkh-p2sh address. What is the entire process?

Maybe add electrum to the question title - Google might show this for generic import queries otherwise, and the import process will likely differ for different clients

Good plan! And, done.

This Q/A is linked on Puzzling.SE.

The entire process is as follows: (these instructions are correct for Electrum v3.0.6)

Install Electrum. The installation methods vary but, the official download is here. On some varieties of Linux it is in the default distro repository.
Run Electrum.

Choose Automatically Connect and click on Next.
Name your wallet if you like or accept the default and click on Next.
Select Standard Wallet and click on Next.
Select Create a new seed and click on Next.
Select Segwit and click on Next.
Securely, privately and accurately store your seed. This is your wallet backup. If it is lost all your BTC is gone permanently. Click on Next.
Type your seed in the box and click on Next to verify you have it correctly.
Set a good password that you will never forget. This must be secure to ensure your wallet cannot be stolen. Click on Next.
Your wallet is setup.

With Electrum setup and running, go to View -> Show console.
Click on the Console tab.
Using the instructions from here:

Type (or copy and paste) at the >> prompt key = 'your_key' and press Enter (leave the single quotes in).
Type (or copy and paste) at the >> prompt txin_type, secret, compressed = bitcoin.deserialize_privkey(key) and press Enter.
Type (or copy and paste) at the >> prompt wif2 = bitcoin.serialize_privkey(secret, compressed, 'p2wpkh-p2sh') and press Enter.
Type (or copy and paste) at the >> prompt print(wif2) and press Enter.

Highlight and copy the one-line string that is output (make sure you do not get any extra spaces) in your clipboard or, write it down.
Click on Wallet -> Private Keys -> Sweep
Paste the string you copied into the big box. The address that is pre-filled in starting (as of writing) with bc1 is one of your many receiving addresses. The balance will be transferred to that address.
Click on Sweep and follow the prompts (I didn't proceed to actually do this step - when I originally tested I used completely different steps to 'Import, not Sweep' just to prove it worked and not take the balance).
This will create a Bitcoin transaction transferring the balance to your own address.
Wait for at least 1 confirmations.

Done!
If you just want to import the address to make sure it is correct without trying to sweep you need different steps.

That's sweeping rather than importing and as far as the private key format goes just prepend "p2wpkh-p2sh:" to the WIF and you're good to go in 3.1 or newer. You shouldn't be using old versions like 3.0.6.

@Abdussamad When Electrum gets the new version in the Fedora repository then I will get the new version.

in the case of Electrum you should be installing from source. That's because it updates far too frequently for distro repos to keep up.