text:
How to transform a private key into an ECKey?
I´d like to construct an ECKey from a hardcoded private key but it´s not working...
First try
If I run the code in this example the key import is working just fine. But since I actually want so send money I need to import my own key...
I tried this private key L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCnkh and used this site to generate it. When I try to make the private key an ECKey like this:
ECKey key = ECKey.fromPrivate(Base58.decodeToBigInteger("L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCnkh"));

I´m getting the exception
Exception in thread "main" java.lang.IllegalArgumentException: private key exceeds 32 bytes: 304 bits

Second try
I tried the solution form this question with this code
String priv = "L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCnkh";
ECKey key1 = DumpedPrivateKey.fromBase58(TestNet3Params.get(), priv).getKey();

Which leads me to this exception
Exception in thread "main" org.bitcoinj.core.AddressFormatException$WrongNetwork: Version code of address did not match acceptable versions for network: 128
at org.bitcoinj.core.DumpedPrivateKey.fromBase58(DumpedPrivateKey.java:59)
at com.javamaster.TicTacToeApplication.main(TicTacToeApplication.java:42)

Third try
I tried another solution form this question
    byte[] b = priv.getBytes();
    System.out.println(priv);
    ECKey key3 = ECKey.fromPrivate(b, true);

It results in the same exception as from the second try.
What is wrong with the key? Should I use another way to generate the private key?

The valid private key is L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCn not L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCnkh. You mistyped and added "kh"


text:
How to tell congestion info on the Bitcoin network?
I just tried mining again, using 2Miners and mining Clore.ai, and it can be distributed as BTC.  So finally I had the 50 Clore minimum payout amount at around 2am, and distribution is at 4am everyday.
The amount is only about US$7.
Now it is 7:25am, but my Trust wallet is showing:

BTC network is currently under congestion

and so I have not got the BTC yet.  I tried to look at the blockchain info on https://www.blockchain.com/ or https://btcscan.org/ , but can't find any congestion notice there.
For privacy reason I won't share my Bitcoin wallet address here.
How do I find the congestion info that the Trust wallet is indicating?

There's really no such thing as "congestion" in Bitcoin. Rather, Bitcoin has a limit on how many transactions it can process, which is 1 block (1 MvB/4 MWU, around 2000-4000 transactions) per 10 minutes. Miners typically select transactions paying the highest feerate to include in the next block, which means a transaction gets included only when it's in the top-paying 1 MvB of unconfirmed transactions. When there are many high-feerate transactions waiting to be confirmed, a transaction paying a low feerate can wait potentially weeks or months (theoretically forever) to get confirmed.
If a service pauses payouts because of "congestion", it simply means they don't want to pay the high fees to get their transactions confirmed and prefer to wait for fees to go down.
You can check mempool.space for current fees. The minimum feerate to get into a block has been above 50 sat/vB for a few weeks, which is quite unusual.

I just got the BTC 10 minutes ago. The instructions on 2Miners says the fees should be only about US$0.20, but I did a calculation... the fees was at least $1.50 to $2.00. It was https://www.blockchain.com/explorer/transactions/btc/9e7da424e744d42c1415ef4b8a8da95aae786e069ca469f1c6bc1ce906c600fa with a fee of $924, for 468 outputs (recipients, I think), so each recipient had to pay about $2.00.  If for $7, the fee was $2, then it is like a 28.5% fee

source: Stack Exchange

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

sort: votes


text:
How to decrypt encrypted_privkey
Background how I got here:
I have a very old wallet file in .dat format (from 2017)
The backup is as far as I remember just a copy of the wallet file from bitcoin-core's ~/.bitcoin directory.
I tried opening it in "modern" bitcoin-core by:

copying the wallet file into ~/.bitcoin/wallets/walletName/walletName.dat
adding the wallet name to list in ~/.bitcoin/settings.json

Now, upon starting bitcoin-core I get this message:
Error: Failed to load database path '/home/{redacted}/.bitcoin/wallets/OldWallet_1'. Data is not in recognized format.

So, having no meaningful results in google other than pywallet, I decided to try importing it to electron... and discovered that electron doesn't have an option to import bitcoin-core wallets (wtf?).
I did find some information about "pywallet", I tried using it to recover information from my .dat file, I had to modify it a bit since my encryption password is really long and has many weird characters in it so passing it as an argument for script execution is incredibly difficult.
I managed to get list of all addresses defined in this file and "encrypted_privkey" for each address.
I didn't manage to get it to decrypt anything, because the script crashes with "Segmentation Fault (core dumped)" (everyone loves C/C++).
The question:
So, my question is, given I know the password to this wallet (I think I also recovered the encryption salt) and I have "encrypted_privkey" list, how do I decrypt them so I can import them in electron?
[edit]
I just tried importing my dashcoin wallet to dash-core, I get the same error message, so it's very likely that something about the wallet file format has changed during the time I wasn't using cryptocurrencies.
If anyone knows how to "upgrade" the file format, please let me know, it'll also solve the problem.

if this file is from Bitcoin Core you should be able to open it again using the same software. Bitcoin Core will allow you to open the wallet without type the password, download the Bitcoin core version v0.20.1, then you put your wallet.dat into ~/.bitcoin. Nothing else.

copying the wallet file into ~/.bitcoin/wallets/walletName/walletName.dat

Try ~/.bitcoin/wallets/walletName/wallet.dat    -i.e. just wallet.dat
Looking at my wallets, the wallet files are all called wallet.dat irrespective of the name. That might be the problem.

Try pywallet a github repo that has what you need. it will dump your keys in WIF
https://github.com/jackjack-jj/pywallet

Pywallet.py is mostly not compatible with wallets. Should be updated. Even if dumps then passphrase usage is making an error.

there is command opton in bitcoin core, there you can type "upgradewallet"
check if something happens.

If bitcoin core can't open the file, it certainly won't be able to upgrade it.

To decrypt an encrypted_privkey, you typically need two main pieces of information:
The passphrase or password that was used to encrypt the private key.
The encryption algorithm used for encryption, which is usually defined in the encryption method or file format.
The exact steps depend on the format of the encrypted_privkey.

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


text:
Is it correct to say that continuous transactions are on different blocks most of the time?
I'm new to the idea of bitcoin and I'm taking an introduction course about it. Given the following picture from the original bitcoin paper, is it correct to say that continuous transactions are on different blocks most of the time?
If this is true, after a miner receive a broadcast of some transaction, how did he find those predecessor transactions for these to be processed transactions, so he can form his own block containing these transactions? Does he have to browse through all the transactions in the world to find these "predecessors"?

Each bitcoin node keeps an index of 'unspent transaction outputs' (the "UTXO set"), which is updated with each new block received. At the genesis of the network, the UTXO set was empty. With each block after the genesis block, the UTXO set was slowly populated, as each new block would contain some number of transactions (that create/destroy UTXOs).
Each bitcoin transaction specifies some number of inputs (other than the coinbase transaction in each block, which is a special transaction that has no inputs), and these inputs must be valid, existing UTXOs in the UTXO set. These UTXOs are 'consumed' entirely as inputs, and thus deleted from the UTXO set that the node keeps track of.
Each bitcoin transaction also specifies some number of newly created outputs, which are added to the UTXO set.
So when checking to see if a transaction is valid, the node will check to ensure that all inputs to the transaction are valid, currently existing UTXOs. Under the hood, each input is specified by the transaction ID, and the outputs index, and it is this data that the node uses to lookup the UTXO, as one step towards determining the validity of said transaction.

For "the coinbase transaction" do you meant the txn for the miner that firstly solves PoW and earns the reward?

@Rainning yes the coinbase transaction is the first transaction in each block; the output(s) it creates will pay the block reward to the address(es) that the miner specifies. See for example: https://bitcoin.stackexchange.com/questions/4571/what-is-the-coinbase

Regarding "the UTXO set", can I say that each miner keeps a local UTXO set, which represents an update to the global UTXO set, and then periodically push these local UTXO changes to the global one?

@Rainning there is no 'global UTXO set', bitcoin has no such admin or hierarchy. Each node creates and keeps their own copy, and each miner (or mining pool) will run a node so that they can have their own copy as well. By following the rules of the network, all nodes will independently come to consensus on what the current network state is.

So eventually all copies represent the only truth of the network? I think I got it, many thanks!


text:
How Can I speed up decrypting?
I have a recovery company retrieving my scammed bitcoins. They have moved them directly to my brand new wallet but the decryption process is very very slow. They say I should purchase more bitcoins and deposit them in my wallet to create history. Will that speed up the process?

What does it mean "scammed bitcoins"? What do you mean by "decryption process"? If it's your wallet, and you know the keys/passwords how can it take time to decrypt? The part about "purchase more bitcoins and deposit them in my wallet to create history" doesn't make any sense. Are you sure, that someone isn't scamming you again? Are you keeping your bitcoin on non-custodial wallet?

This really sounds like a scam, there is no reason to need to 'create wallet history' by receiving a transaction, that doesn't make any sense.

You are likely being scammed again.
The vast majority of bitcoin recovery companies are scams. The ONLY scenarios in which coins are recoverable are if you mistakenly sent them to another address in your wallet (such as an address after the gap limit, sent BTC to an LTC address, ETH to an ETC address, and so on), or if your wallet had a catastrophic derivation issue that resulted in it giving you non-standard addresses which normal wallet software cannot find.
Pretty much anyone else claiming to be able to recover coins that were stolen in scams, hacked from exchange accounts, sent to scammy brokers/investment/mining operations, etc. is also a scammer, trying to capitalize on your loss to extract more funds from you.
Cut your losses now, and do not give these people any more funds.

Good on you for asking before sending money. All so-called "recovery companies" are scams and they will all ask you for money, even the ones that promised they wouldn't.


text:
How to use a wallet. transactions, addresses, signing, verifying, receipt, collection
I have a transaction ID it
has 630 transactions on it.A lot of them are confirmed but they have the same address they're supposed to be going to it's full. I don't know how to sign and verify correctly. That particular address cannot handle anymore how do I put in more addresses for the same receipt and do I have to collect them all at the same time I don't know any of these things and I'm trying to get help please

I don't know any of these things and I'm trying to get help

Using a wallet (basics)
The basic actions using any wallet, such as Electrum, include

Initial set-up.
When you first use any wallet program, it will create some secret numbers
that are used for creating addresses etc. You can regard these secret
numbers as the main part of a set of data also called a wallet.
A wallet program manages wallet data.
It is very important that you either make a backup of this wallet data and
keep it somewhere safe or write down the private keys or the recovery
phrase and store them safely where no one else can see them. Anyone
who finds these can create a new wallet that has control over all money
sent to your wallet in the past and in the future.

Receiving money
A wallet usually has a button or menu-item to "receive" money. Typically
this generates a new address. You give that new address to someone who
intends to send you Bitcoin money. You don't need to do anything else.
Your wallet talks to a few other Bitcoin nodes and finds out when there
is a transaction paying to your new address. You don't need to do anything
to receive or collect Bitcoin money. You can receive money when your
wallet is turned off. This is because money is kept track of in a list of
transactions called the blockchain and each wallet either keeps its own
copy or can get access to a copy.

Spending money
In the Bitcoin world, spending money means creating a transaction to send
Bitcoin to another Bitcoin wallet. This might be to the wallet of someone
selling a car or it might be sending to the wallet of someone who exchanges Bitcoin money for Canadian dollars they pay to you separately.

Things the wallet does automatically when needed
Signing
When you spend money, your wallet automatically signs the transaction it creates. You don't get involved.
Verifying
Your wallet automatically verifies information about transactions that it receives from nearby Bitcoin nodes (other people's wallets etc). You don't have to do any verifying yourself. It is part of the work the wallet does internally.
Collecting
Bitcoin money is never collected, that isn't the way it works.
If you  want to exchange Bitcoin for US dollars or for Japanese Yen, you typically send Bitcoin to an online currency exchange that accepts Bitcoin.
Beware of fake exchanges.

About Transactions and Addresses
A transaction-Id identifies exactly one transaction. One transaction-Id can never have 630 transactions on it.
A Transaction, identified by a Transaction-Id, could pay money to 630 different recipients by paying 630 different addresses in a single transaction. This is very typical of how Exchanges pay money. it saves them money (Bitcoin transactiuon fees) to join hundreds of payments into a single transaction. 1 transaction with 630 outputs is cheaper than 630 transactions each with 1 output. So if, for example, I paid an exchange some Icelandic Króna to but Bitcoin, they might tell me the transaction-Id of a transaction that paid me, to the address I gave them,  as well as paying hundreds of their other customers. I could check this transaction-Id on some of the many Blockchain Explorers to see if my address is listed. Alternatively I could enter into the explorer the address I gave the exchange and see if the explorer shows any transactions that paid to that address. Even without me doing any of this, my wallet should tell me I have received money.
An address could have 630 transactions that have paid money to that address.

So when. The transaction is confirmed how do I get it to show up in my wallet and how do I turn it int.o Cash USD and transfer out. This is from mining I left a phone on or two or three I don't know I had a lot of phones back that anyway it covers like 6 months and like they're like 3 cents four cents seven cents and the one transaction receipt has 630 transactions on it I didn't know anything about addresses I gave it one of my addresses and it sent supposedly sent a bunch of them to that but I it doesn't show up

I am pretty sure it has never been possible for one person to mine Bitcoin on just a phone - they just aren't powerful enough. Phone mining has to be a scam. For example see https://bitcoin.stackexchange.com/questions/117009/is-bitcoin-bonus-and-cloud-mining-real


text:
Can I recover my investment? I've been scammed
I am a victim of a scam. There is a company saying that they can recover what was stolen, it's almost 200 k euros and according to them, I am required to top up the balance of your secure crypto wallet by 3-5% of the requested amount and send them the confirmation of payment.
The email is refund@blockchain-department.net but I don't know if should trust them.
Can anybody say if they are legit or not?

Legitimate companies, especially those dealing with refunds or recovery of stolen funds, do not typically require an upfront payment. Asking for 3-5% of the requested amount to be topped up in a crypto wallet is a common tactic used by scammers. Do not send any money. Report the incident to your local authorities.

See also Is there a 'BTC Refund Department'? and Who really controls bitcoin

Översätt text med kameran
thanks for your answer. Until now I notice many inconsistencies in the emails... definitely scammers... I don't know what else to do to recover my losses

How do I recover from a cryptocurrency scam?


text:
Bitcoin core balance isn't working properly
while moving funds to my multi-sig, my balance on bitcoin core sometimes is subtracting. Even though my balance on sparrow is correct and is connected to my node. So it should be getting all of its information from my node. Bitcoin core also shows my list of transactions (though sometimes even when I do a payment to self the debit and credit shows 0 instead of normally showing the amounts)

Is it possible you're seeing the effects of Change Addresses? Your sparrow wallet may be sending change outputs to new, non-visible addresses that are part of the wallet, but perhaps you have not imported in Bitcoin Core?

Could this be a symptom of the switch in backend you described in https://bitcoin.stackexchange.com/q/118706/13866 ?


text:
bitcoin is not showing the correct balance after reusing an address
(i only reused because the first one was a test) Bitcoin core gui is showing a balance lower than the amount on sparrow. Sparrow is connected through my node and showing the correct amounts so I know my node is not messed up. Here's what I think is wrong but I don't know how to fix it: I send a small amount of bitcoin to an address. Then sent a larger amount to that address after I was sure that it was safe to send to it. The second spend went through and is properly displayed on sparrow, but the balance I sent is now not showing up on bitcoin core. How can I get bitcoin core to display it properly? I think it is because of the address reuse thing because that is the amount that is missing on bitcoin core and also chat gtp said that it could be a reason for issues. I don't know how to fix this. Is there even a way? I was planning on sending more to this same address because I am switching from a singlesig to a multisig and like to reuse an address when moving larger funds. but i dont like that it doesn't show up in bitcoin core

Well I spent the transaction that I suspected to be missing from the bitcoin core balance to get it to a different address. It fixed it but then when I did some more transactions it got messed up again and now I have no idea how bitcoin core is adding up its balance. Sparrow seems to work normal even though it's connected though by node but the balance on core is still off

Was the transaction perhaps still unconfirmed?

chat gtp said that [address reuse] could be a reason for issues.

I wouldn't rely on Chat GPT because Chat GPT also says that 2+2=5 and doesn't understand what the heck it is doing. Chat GPT is a language model that takes any old nonsense and converts it to a superficially plausible grammatical paragraph or two.
As https://openai.com/blog/chatgpt says

ChatGPT sometimes writes plausible-sounding but incorrect or nonsensical answers.

I suspect that "sometimes" may mean "often".
Address reuse was the norm when Bitcoin Core was first written, I am sure that address reuse does not cause the issues you describe.

How can I get bitcoin core to display [the balance I expect] properly?

I would make sure Bitcoin Core is fully synchronised. There is an icon at bottom right of its window that tells you if it is synchronised or catching up etc.
I would check that the transaction corresponding to the missing amount is a confirmed transaction (e.g. using a blockchain explorer)

I've done the things like checking block explorers and the transaction are going through normally. I should also note that bitcoin core shows the transaction. (but sometimes not the amounts of the transactions, weird) and remember that sparrow is working fine and normally even though it is getting all of its information from my node.


text:
I lost my BTC from 3 USA BTC traders
I lost money nearing 10k.USD from 3 BTC traders. How to recovers. please help me.
What is the procedure for complaint against BTC Traders.
Still one person is asking for 150$ for Transfer Fee, Another one also.
I am ready to share full details( name / phone.no / mail-id address etc).
if any one reply me.

What is the procedure for complaint against BTC Traders.

Contact your local police if you believe someone has fraudulently taken your money.
I don't know who you mean by BTC Traders but that is probably not important.
If you mean btctraders.cc, their website FAQ says "BTC TRADERS Limited is a private limited company registered in UK under Company No. 10561882". But that is the number of a different company that has been dissolved. This means btctraders.cc is not the sort of company I would give my money to.
If you mean three different people who just claimed to be traders in the Bitcoin currency, then I guess you've been tricked by several criminals.

one person is asking for 150$ for Transfer Fee

That is typical of scammers/fraudsters/tricksters.

I am ready to share full details( name / phone.no / mail-id address etc)

You will be contacted by people either offering to recover your money or telling you about marvellous people who can recover all your money. These are liars trying to trick you out of more money by inventing more fees - transfer fees, release fees, investigation fees and anything else they can think of.
Ignore them.


text:
RPC on Umbrel via SSH - some bitcoin-cli commands don't return value
I connected to my Umbrel full node from a terminal via SSH, and found that some of the bitcoin-cli commands don't return any value while others work fine. Some examples:

Working - help, getinfo, getbestblockhash, getblock
Not working - getbalance, listunspent, getnewaddress

When calling the "Not working" commands, there's no error message shown. I wonder what I'm missing? Here's what I use:
Umbrel v0.3.13
Windows PowerShell v1.0
RPC Client v0.21.1.0

You are missing a wallet on your Bitcoin Core.
Note all your "not working" commands are wallet related and all "working" ones are blockchain related.

Thanks, you are right and now it works fine. Since my node is already running on Umbrel now, I will look up how to use it on RPC.

You can use RPC commands using bitcoin-cli bin for example
~/umbrel/bin/bitcoin-cli getblockchaininfo
~/umbrel/bin/bitcoin-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"


text:
Blockchain not letting me send all of my bitcoin (Please help)
I've been using blockchain for the past couple years and i have received lots of transactions (daily) for the past time. Today i decided to have them transferred to a Trading app which I've always been using, Binance. All my bitcoins are held in my blockchain app and when i try sending the full amount it says I only have 0.3 BTC which is false (Check Photo 1) I have a current balance of 0.5 ish BTC and only lets me send 0.3 BTC. I haven't sent any transactions for the past year only received. I tried to contact support for blockchain they told me the miner fees, doesn't make sense they wouldn't charge me 0.2 BTC = 7K USD ish for fees LOL
My Current Balance on my wallet

Me trying to send some of it to another wallet (Says not enough funds)

When i press Use maximum amount this is what it let's me
As you can see from all the screenshots provided they are not letting me send all of my bitcoin.
On my portfolio i can see that i have 0.5 BTC when i go to send they says
AVAIALBLE AMOUNT OF BTC : 0.3 BTC
Please i need your guys help i have been trying to resolve this issue nothing has worked so far.
I updated the app on App Store and i also tried doing on their website same thing happening on the phone and website.
Thank you if you have read this and trying to help me with a solution.
Here is another screenshot on the app. I have 20k

I can cover my Network fees but why i cant send 15k? I have over 20k in my bitcoin main wallet!!

How many times have you received btc payments? This fee might make sense if you have thousands of outputs in your wallet and you need to consolidate them in a giant transaction. But either way you should resolve this with the support team of the wallet you are using.

I have received over 500 transactions for sure, i don't mind the fees are only 700 but now they have been lowered to 80 bucks but the thing is that i own .5 BTC on my blockchain wallet when i go to send all of it doesn't let me, it says my available balance of bitcoin is .3 BTC on the send page and now fees are 80 bucks. 0.5 BTC ish around in my wallet it only says i have 0.35 BTC = 12K USD. and basically the other 0.2 BTC doesn't show up i want to make a 1 big transaction.
I have contacted support all they say is that that fees are taking the money, there is no way in hell .2 BTC for fees

You may have received such small amounts that it is impossible to accumulate them in one transaction due to the restrictions on the size of the transaction.
Try sending 0.3 BTC and then 0.2 BTC in a second transaction (be prepared for unexpected large fees).
It is also worth analyze your UTXOs. Maybe you have such small amounts that they are flagged as unprofitable.

Thanks for the reply, I'm afraid that if i sent 0.3 BTC afterwards i wont even have an option to send the rest of it. Like i keep receiving money but my available balance to send stays the same. Also how do i analyze my UTXOs and when you say that they might be flagged does that mean that money is lost or can i just go make a Exdous account and have the 12 passphrase to recover my wallet on Exodus and recover all of my funds

Every deposit means one UTXO(unspent transaction).
Your sending transaction uses (consists of) this UTXOs.
If the number of your deposits exceeds 24386, it means that total amount cant be sent in a single transaction. As the maximum number of inputs(UTXO) that can fit in a valid transaction is 24386.
In this case only option to transfer full amount is to brake it in a few transactions with smaller amount.
It is better to choose the time when the fee is lower, because such transactions are very heavy and therefore expensive.

Okay i get it now but where can i check my UTXO, every time I want to receive a bitcoin transaction my wallet changes so if i were to to check the blockchain explorer i wouldn't be able to keep track of my whole bitcoin wallet which makes it impossible...


text:
Questions about Lightning Network: Connectivity, Funding, Dealing w\ Bad Counterparties
TLDR
Long time buyer, holder, and user of Bitcoin (since 2015). Absolutely zero experience with Lightning Network. I've read some entry-level tutorials but still have basic conceptual questions regarding funding, capacity, revocations, etc.
Hypothetical Situation
Let's say I run a gambling site. All business is conducted in BTC. More and more customers are asking that Lightning Network be made available to facilitate quick and cheap deposit and withdrawal of funds.
Where do I connect for maximum reach?
The tutorials always seem show to show two parties, Bob and Alice. They open a "channel" using a funding transaction. The example then typically adds in a third party (e.g. Festus) and says something along the lines of "and look, Bob can pay Festus through Alice."
The implication seems to be that the network size could become enormous, to the point where anyone can pay anyone because hey, every Bitcoin user is inevitably connected by only a few degrees of separation on the network.
But this doesn't really answer the question of to whom I, as a brand new user, should connect. I could connect to you, I guess. But maybe you're a new user too and have zero other connections. Do I connect to some sort of hub? Guess that would work but doesn't that make things overly centralized?
As a site owner (see hypothetical above), is it best for me to act as a hub and open a channel with each of my users, which means I'd have thousands of channels open? Or is it better to make a single connection to one really popular, well-connected dude? Seems like the latter, but which dude? How do I find him?
Do I always have to be online looking for cheats?
Ok, so I get that my LN peer can try to cheat me by broadcasting a settlement transaction of a prior balance state that's more advantageous to him. And I also know that his cheat TX settlement won't clear for twenty-four hours, giving me time to broadcast a "revocation" TX that settles everything in my favor instead. This is what dissuades my peer from cheating.
But this also implies that my Lightning node needs to be up 24/7, or at least never offline for more than 24 hours and, furthermore, I have to be ever vigilant to make sure no one is cheating, and execute revocations if they are. Are these assumptions correct? Does the Lightning software automate the cheat-detection process for me?
How do I add funds to an existing channel?
It's still not clear how to add funds to a preexisting channel. I've seen some material online indicating that a third party service needs to be paid for this? I can't imagine that's correct is it? That doesn't seem compatible with the whole ethos of LN.
Using my hypothetical example. Let's say a client opens a channel with me and sends me 1 BTC. He bets on an upcoming UFC fight (Ronda Rousey vs. Oprah Winfrey). A successful bet on Winfrey pays 15x. That means in the unlikely even that he wins, I need to have at least 15 BTC available on that channel to pay him out.
How do I add funds to the channel if he wins? Or does that 15 BTC have to be placed in the channel via the initial funding transaction?
Now, if I'm servicing all users over a single channel, that's fine. But if each user has his own channel, I'd have to fund each one with an enormous amount of BTC -- despite the fact that 99.99% of my users will never even bet on that particular event at all. That would be an inefficient use of funds. I assume there's a way to add funds to a channel after initial funding, but how?
Wallets
I'm running on Win 2019 Server and need to be able to create channels, send funds, be notified of incoming funds, etc. using an API. Which wallets support this?
With Bitcoin's first layer, I have the option of either running a full blown node or leveraging a centralized service like Electrum? Does LN have an analogous situation with two different styles of wallet?


text:
Is there a multisignature scheme that don't need xpub backups?
A disadvantage of a HD multi-signature scheme compared to a Shamir's Shared Secret Scheme is the need to back up the xpub keys. There's no BIP39-like encoding for xpubs, they're long, and they're sensitive so you can't just widely distribute them to counter risk of loss.
Is there a multi-signature M-of-N (M < N) scheme that only needs M private keys, thus simplifying backup (and restore) considerably?
In my very rudimentary understanding of Taproot, you can efficiently chain multiple scripts together. Would it work to reduce a M-of-N scheme to a set of M-of-M schemes OR'ed together? For example, splitting a 2-of-3 with keys A, B, C into a script that accepts (A AND B) OR (A AND C) OR (B AND C)?

Is there a multi-signature scheme that only need the private keys,
thus simplifying backup (and restore) considerably?

Yes, the 2-of-2 scheme.
The 2-of-2 is highly underrated in context of cold storage.
Obviously, no single key can be lost, but that can be managed with a multi-location backups.

A disadvantage of a multi-signature scheme compared to a Shamir's Shared Secret Scheme is the need to back up the xpub keys.

If you don't want to backup the xpub (or xpriv) you can backup the individual private keys used in the multisig and ignore the fact that they were generated as part of a HD tree (if indeed they were). To spend from a 2-of-3 multisig you will need all 3 private keys or 2 private keys and a public key not associated with the 2 private keys.

In my very rudimentary understanding of Taproot, you can efficiently chain multiple scripts together. Would it work to reduce a M-of-N scheme to a set of M-of-M schemes OR'ed together? For example, splitting a 2-of-3 with keys A, B, C into a script that accepts (A AND B) OR (A AND C) OR (B AND C)?

You can do what you describe with Taproot. Murch has written a blog post on how to do this. If you want to spend using A and C and it is in the script path (rather than the key path) you will need to prove that it is in the Taproot tree. Hence you will need more than just the private keys of A and C so I don't think it meets your wish to only store a BIP 39 mnemonic.


text:
Sending "generalized" secret messages over LN using "Lightning messages"
In the Mastering Lightning Network book section 3, it describes the Lightning Network as being "... so much more than the cryptographic protocols on top of the Bitcoin scripting language. It is a comprehensive communication protocol that allows peers to exchange Lightning messages to achieve the transfer of bitcoin. The communication protocol defines how Lightning messages are encrypted and exchanged."
My question is: can Lightning messages be leveraged for purposes other than "to achieve the transfer of bitcoin" (i.e. generalized communication messages)? Can Lightning messages be sent over the network using the LN protocol to an address of, for example, a friend of yours? Seems like the network could have an extendable purpose in this way; however, since I am new to the LN and learning as I go, I'm unsure of the technical feasibility of this.

yes it can! As part of the offers proposal Rusty is currently suggesting to add a standard for so called onion messages to BOLT 07.
You can find more details in the open pull request: https://github.com/lightningnetwork/lightning-rfc/pull/798/files

Cool! Thanks for the link, I'll take a look!


text:
Payment addresses arent showing up on electrum
quick question.
Using the electrum wallet for my website checkout. But the addresses generated arent showing up in my electrum wallet?
was working fine last week and now its showing different wallet addresses that arent showing in my electrum wallet address section
Note I’m searching for the addresses payments have been made to that are linked to my seed / master key, but the addresses don’t show in my address list on electrum

Not I haven’t …. Will this show the address that the funds have been paid to tho?
There’s about 10 payments to 10 different addresses all linked to my master key / seed.
But searching for those addresses in electrum. They are not there.

Ok, but doing this will the addresses the money has been sent to appear?
Which crypto woo generated (which electrum master key is linked to)

thanks for that input, but this did nothing to help the major question asked on my post

How many addresses do I need to create then, to see the addresses that the funds have been sent to mate?


text:
Transaction fees for smaller transactions
Thinking about the potential problems with Bitcoin, I am doing a thought experiment.  Suppose that Bitcoin is successful in replacing gold.  The market cap of gold is $9.6 trillion (10^12).  At that level, each bitcoin would be worth $400,000.  In such a world, let's suppose that people were making $40 transactions to buy things.  Then the average transaction would be  0.0001 bitcoins.  Assuming a reasonable transaction fee of 1%, this would imply that transaction fees should be 1 micro bit-coin in such a world.
Bitcoin-qt would clearly need to adapt to this.   Some miners (payment processors) could offer different terms,  and users could choose these payment processors with the addnode option in bitcoind.
I just wanted to get some feedback on how transaction fees are going to adapt to a higher marketcap.
Kind Regards,
  Harold Naparst

The default fee is in place to decrease the chance the creation of dust outputs (miniscule amounts of bitcoin). Dust outputs cost more to spend than they are worth themselves and they still need to be stored in the disk space of anyone that stores the complete blockchain - thus are frowned upon.
To read a discussion on that matter with some of the Core Developers you might want to review The minimum transfer fee is not trivial anymore.
Currently, there are some mining pools that accept transactions even without transaction fees. The default transaction fee in bitcoin-qt has been lowered before when the value of bitcoin increased sufficiently to make the recommended transaction fee too high. This happened for example in May 2013, when the default fee was reduced to 0.0001 BTC from 0.0005 BTC.
It is therefore expected that the default transaction fee will be kept at a respectively low level should the value of bitcoin increase dramatically. In any case, anyone can choose to ignore it by changing the settings of their bitcoin-qt.

I guess one of the things worth remembering is that you can place any legal/unspent transaction you want on the Bitcoin network without any fees whatsoever. The issue comes down to whether the next miner would accept your transaction and put it in the next block even if there's nothing to be gained from it.
There are currently recommended fees put into the major clients (bitcoin-qt or its CLI only back end) as you well know. I would imagine that the major clients would be updated to accept various fees if the economy changes that much.
As for different payment processors, I'm not sure I understand your plan. Surely ultimately it's down to whoever mines the next block and connecting to a specific node wouldn't really make a difference?

Currently VISA and Mastercard are payment processors who charge about 2%, and Amex charges about 5%.  If they got into the game and ran miners, they probably wouldn't verify transactions for less than these amounts.  I am guessing that the hope of finding new bitcoins will not be the incentive to run mining programs, but rather the transaction fee, as it is not with the card companies.  What do you think?

Currently the sum of transaction fees is magnitudes away from the block reward. Block 262232 for example has an estimated transaction volume of 2.7k BTC and a transaction fee of 0.15 BTC. That would mean that the average fee is less than 0.06%. If anyone would be trying to verify only transactions with 2% of fee, they would be creating empty blocks. Verifying empty blocks, however, takes the same computational effort as verifying transactions, so they might as well take any fees.

BTC fees are currently around 10%... that's insane.

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


text:
What is the maximum allowed password complexity in Multibit
What are the maximum number of characters allowed in a Multibit password, and which characters are allowed?
Since I use Keepass as a password manager, my usual practice is to generate passwords with the maximum allowed complexity.

Internally the password is a byte array (made from the unicode representation of the characters).
The only hard limit is the amount of memory the bytes take up in the MultiBit process. If you had a password of a million characters I think it would work but a billion characters would probably break it.

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


text:
error reading configuration file : parse error on line 1 server -1
After installing the program, I encountered this error. How to eliminate this error? When running the program, it gives this error thanks. (bitcoin core)

Please, if anyone knows how to solve my problem, I would be grateful

Please update your question to include the contents of your bitcoin.conf file. Without seeing that it's hard to guess what might be wrong.

I wanted to activate bitcoin mining, and then I went to the settings section, configured three codes, and clicked the save option. I thought it was not saved. At the bottom of the program, I clicked the save change option. After this, when I run the program again, I face this error.

I just downloaded the program, I had created a wallet, and then it took two or three hours. The program file had to be downloaded in order to activate the transaction and send bitcoins in my wallet.

You'll need to describe the actions you took in far more detail.

It sounds like the configuration changes that were made to your Bitcoin Core are incorrect. Try checking them for mistakes against the instructions you were following, or remove them to use the default configuration. If you want concrete help with the error, please share details on the configuration you are using (please obscure sensitive information like access credentials if any appears in the configuration).


text:
Is there a way that we can report a Bitcoin scam?
Good day
Is there a way that we can report a Bitcoin scam? I was recently scammed over R200000 therefore I would like to report the person and the platform to alert people of her fraudulent platform.

The primary way to report scams is to contact your local police.
Since Bitcoin is a peer to peer payment system, there is no hierarchy of control, no Bitcoin central authority to whom you can report scams or who can act or coordinate actions against scammers.
There are some social media and other websites that collect lists of scams, so you could report your problem to those. For example, search for bitcoin scam blacklist. I doubt that this is very effective though. It might alert a few of the more diligent people but many people who fall for scams don't seem to have done much research of this sort beforehand.
Scams that exploit weaknesses in, for example, wallet implementations can be reported to the developers of the software concerned (see recent phishing attack on Electrum by malicious servers issuing false update warning dialogues).
I don't know of scams that exploit weaknesses in the underlying network protocols - but those tend to get noticed by developers and result in Bitcoin Improvement Proposals (BIPs).

People wishing to submit BIPs, first should propose their idea or document to the bitcoin-dev@lists.linuxfoundation.org mailing list.

Depend on your context so if you got scammed when you send them the money and they didn't send u the bitcoin then yes, this can be reported or chargeback as money are government controlled.
If your dealing with the cryptocurrency transaction for a good (aka send bitcoin for something) then this cannot be recoverable as bitcoin is a one-way transaction. Even if this is reported, your coin will still loose since bitcoin is mostly (not completely) anonymous way of sending/receiving money (Another reason why hackers/scammer uses bitcoin).


text:
Why doesn't "Bitcoin Wallet" app for Android transmit payment?
Why doesn't Bitcoin Wallet app transmit payment?
Bitcoin Wallet app no delivery transaction.
From the 18th of March to the date Bitcoin Wallet app retains my satoshis with the message "this payment has not yet been transmitted"; they invite you to make payment increases in the network fee in the order of 0.000288 satoshis, increments that I have paid 2 on the 18th and 2 plus on the 19th for a total payment increase to the network fee of 0.001152 satoshis, more than generous amount to call the attention of the miners (these increments do not record any address). The address generated by
Bitcoin Wallet app after receiving, and consulted in explorers as blockchain records that "There are no transactions for this address". As additional data Bitcoin Wallet app received satoshis from paper wallet. As you can see it has taken more than prudential time to get any results. I don't know what may be happening in the menpool, I don't know who may
be responsible for this delay, I don't know who to complain to, I only have the community interested in Bitcoin continuing to be decentralized.  For this reason if someone can respond by clarifying what is happening with this deficient delay will be very welcome.
In short, use Bitcoin wallet app to receive a paper wallet, receipt accepted and generating new address, invite to increase the action network commission that is made several times, to date impossible to use the satoshis. Again community interested and knowledgeable to respond, thank you very much.

What software is this about? Bitcoin Core does not have any app.

This software is one more effort of the Bitcoin.org community to improve every day to be more disruptive.
You can also benefit from this technology, but without getting confused from the download page, pay close attention to the link: https://bitcoin.org ... wallet ... mobile

Are you talking about the Bitcoin Core software, or a mobile app listed on the bitcoin.org site?

Hi, thanks for answering. If I'm talking about a mobile application that appears on Bitcoin.org and specifically for smartphone with android OS.
For your interest thank you, in new post I will give information how this question was solved; thank you again.

That software has nothing to do with Bitcoin Core (which is a desktop application that implements a full node for the Bitcoin protocol). You'll need to clarify which app you're talking about, as there are dozens.

To close this thread and give it as solved.
The wallet object of these comments is the one that suggests the official page of Bitcoin.org. In this particular case it corresponds to the one used by a mobile phone with android operating system.
Solution: .- Make a security copy of the wallet.
.- In the application go to settings then diagnostic and finally change string block.

Please answer my question. Bitcoin org is not an official site, it has a curated list of dozens of software implementations of the Bitcoin protocol; this question can't be answered without knowing what software you're talking about.

I edited the question to remove confusing references to Bitcoin-core (a completely different program).


text:
Bitcoin QR code on a product sold in stores
How and which company do i turn to implement a QR code for bitcoin on a product sold within stores.

What do you expect a ‘QR code for bitcoin’ to do exactly? It’s not clear to me what you’re asking.

what company/website do i go too..to download a QR (BTC) code? To have on products.

I want the QR code for products. too accept bitcoin payments.

Basically generating my own code.

Putting a bitcoin payment address (in QR code format, or otherwise) is generally not the way to accept bitcoin for a sale. There would be very basic vulnerabilities, such as having someone swap the payment address displayed on your product, etc. Attempting to use the same address on every product is bad for privacy/fungibility, and it makes backend accounting difficult.
Accepting Bitcoin for payments is best done using a bitcoin payment processor such as BTCPayServer (an open source project), or for small scale you could even process payments manually at the till. In either case, customers would be presented with a payment address during checkout, not a payment address per product.


text:
How to transfer from unsync'd Bitcoin core wallet to Electrum?
I would like to transfer my btc wallet to an electrum wallet. Syncing is taking to long.

related: https://bitcoin.stackexchange.com/q/6056/5406

Follow this guide.
Summary:

Download Electrum and verify the signature to prove it was not modified in transit. Create a new Standard Wallet and choose "Create a new seed". Electrum will give you a seed phrase which you should write down on paper.
If using Bitcoin-Qt, click Window -> Console.
If your wallet is encrypted, use this command to decrypt it for 5 minutes (300 seconds):

walletpassphrase your-wallet-passphrase 300

If addresses with balance are known:

Use the dumpprivkey command to get the private key. Repeat for as many bitcoin addresses as have money in them.

dumpprivkey <your bitcoin address>

If addresses with balance are not known:

Use the dumpwallet command to get all private keys from the wallet.

dumpwallet path/to/exported-wallet.txt

In the Electrum window, click Wallet -> Private Keys -> Sweep. Paste the private keys from Bitcoin-Qt here. Check the resulting transaction is okay and click Broadcast to sweep from the addresses in Bitcoin Core to the Electrum wallet.

If the address generated from the private key is wrong, then on the Sweep Private keys dialog box in Electrum click the Info box in the upper-right. It will give instructions for prefixing your private key so that the correct address is generated. For example if your address starts with 3 then use p2wpkh-p2sh:[your-private-key].

Warning: Make sure the Electrum wallet is not a watch-only wallet. The Electrum window title bar should not say [watching-only].

Worth noting that "sweeping" cost mining fees, it's actually transferring all the coins to the newly created Electrum wallet.

Turn off the syncing using the icons in the bottom right and send your coins using the send tab.


text:
Which cryptocurrency server software supports the walletnotify feature?
I am looking to build a realtime service for crypto payments and would like to know which currencies are based on server software that supports "walletnotify" out of the box in the way Bitcoin does - specify the script to run on payment received and confirmed.
Am I correct to assume BCH, BCG and LTC support this since they are forks of the Bitcoin code?
What are other cryptocurrencies I should look at?

Yeah, All bitcoin forks support walletnotfiy.
most digital-currencies have a walletnotfiy with some a few code changes.
that's a list of all Bitcoin forks


text:
Bitcoind linux disk usage
I'm running bitcoind (086) on a dedicated linux machine with about 35Gb of disk space. Earlier today I discovered the machine ran out of space (blockchain was 33 gigs) and proceeded to delete the whole directory. Now all bitcoins in the wallet are missing, balance shows 0, although I did back up and restore the wallet.dat file.
Is it normal for the blockchain to grow to that size?
Is there another way to clean it up periodically, say, via a cron job?
Should I keep hoping that the missing coins will return to the wallet somehow, maybe after it downloads the blockchain again?
TIA!

Should I keep hoping that the missing coins will return to the wallet somehow, >maybe after it downloads the blockchain again?

No, they will not return, since you deleted the whole directory, particularly your wallet.dat. You may recover the previous wallet by copying the original wallet.dat to the directory with current wallet.dat, followed by running this command:
bitcoind -rescan

This will scan the balance for wallet.dat that is stored in Bitcoin data directory, on inlux ~/.bitcoin/
EDIT: from (Nate Eldredge) -rescan would only work after downloading the whole blockchain.

Is it normal for the blockchain to grow to that size?

Yes, bitcoin blockchain grows exponentionaly as the amount of transactions still increases, https://blockchain.info/charts/blocks-size. However there are some light-weight clients that require just few MB of disk space. Keep in mind that these depend on 3rd party servers that provide you with information about unspent transaction and your balance, look for Multibit or Electrum.

-rescan will only work after the block chain has been downloaded again, and at that point it may not be necessary.

Thank you Marek and Nate. I will add some more space to this machine.

The blockchain is around 30 gigabytes. Unfortunately, if you want to use a full node client like bitcoind, you need all of that data. It's possible to prune the blockchain to just the unspent transactions, but the core devs have not implemented this yet on bitcoind. So no, you can't reduce the blockchain size as you need all of that data for a properly running bitcoind.
There are alternatives like electrum which use something called SPV to make the footprint of the application much smaller. This does require that you trust electrum servers, but it's very hard to fake that data, so it's fairly safe.

Can't use electrum, it doesn't seem to offer a RPC API. Sorry I forgot to mention that bit.

Weird, all the SPV wallets don't seem to have an RPC API. You can use stratum protocol to talk to electrum servers.


text:
Transactions not showing up in bitcoind log?
I have a bitcoind running on a server behind the www box which I poll every minute for new transactions and save new data into a table.
Something strange is happening sometimes. If i send 1 btc from my wallet to an address on the bitcoind server, it gets through just fine and shows up right away in the log when downloading transactions via RPC.
If however I send from an exchange, it does not show up (at least not for a day or two). I've noticed that these exchanges add another address and amount to the same txid, could that be the cause?
Is there a workaround for this?
TIA

Should you be polling for new transactions? http://bitcoin.stackexchange.com/questions/12380/how-to-do-address-callbacks

Probably not, the only reason for doing this is that I keep btcoind separate from everything else on a different server with no access to my databases or anything else (for security reasons)... so RPC was the most viable option. But I'll try using that notification thing. Although if someone hacks this bitcoind thing they will be able to inject transactions into my database.

Check the btc hashes when processing em to avoid any security problems. But you can still get ruined if your bitcoind gets "hacked".

Had to drop all the old code and use walletnotify. if someone else goes for this, remember to check for duplicates as you can get several hits from the notification thing for each transaction. jtorba if you post your comment as answer I can click the green thing

Use walletnotify instead of polling.
how to do address callbacks?
It's basically a argument you can specify and Bitcoin will the specified program upon receiving a transaction (BOTH receives and sends from an address in wallet get notified). So you just setup a small script to run and point to it in bitcoin.conf.
Be sure to check for duplicates as walletnotify sends notifications for when a txn is first received (unconfirmed) and when it receives a confirmation.
Also blocknotify does the same thing as walletnotify but for blocks, may be useful for checking unconfirmed transactions.


text:
Can't sign using Trezor T derived multisig wallet using Electrum | Invalid script_type

I created a P2WSH multisig wallet using Electrum  4.0.9 using a single Trezor T, to which I sent a large amount of BTC.

Electrum allowed me to set up the wallet using the same device when I used two different derivatives, one being " m/48'/0'/0'/2' ", and the other  " m/48'/0'/0'/3' ".

When I attempt to sign using the first wallet derivation, I get an invalid multisig signature, which is explained by when I attempt to sign or view the transaction on the second wallet derivation of 3, which produces aninvalid script_type error.

I've made some progress in figuring out the issue, but have hit a roadblock.
As it turns out, the script_type of 2 in the derivation " m/48'/0'/0'/2' " represents a Native Segwit (P2WSH) wallet, and the issue is that the only other script_type defined under BIP 48 at the moment is a Nested Segwit (P2SH-P2WSH), represented by " m/48'/0'/0'/1' ".
I found this out from the BIP 48 documentation which outlines the derivations possible below:
m / purpose' / coin_type' / account' / script_type' / change / address_index
[Source : https://github.com/bitcoin/bips/blob/master/bip-0048.mediawiki ]
So apparently Electrum and Trezor allowed me to derive keys using an undefined script_type of 3, but now I cannot sign any transactions to spend the funds because there is no definition for the script.
I won't go as far as to blame software for my misinformed mistake of course, and I know it allows for forward compatibility, but why would the code for Electrum and the Trezor T allow for key derivation using an undefined script at all?
Is there any way I can define the script_type 3 myself by perhaps copying the code for a script_type of 2 and inserting it as a new definition, while still being able to derive the keys from the HD seed and access my funds?
I would really appreciate help from someone knowledgeable enough to help me answer this, enough to make sure some of those currently unspendable funds go to anyone that can help me solve the issue.

You can restore your trezor wallet from seed using electrum and get access to your funds that way. Go to file > new/restore to begin. Choose multisig as the wallet type and select the right number of cosigners. In the keystore step  choose to enter the seed, check bip39 under options during the seed entry step, choose native segwit as the script type and enter the correct derivation path "m/48'/0'/0'/3'" and  do it again with another cosigner entering  "m/48'/0'/0'/2'" as the derivation path.

Thanks for the response and your time, however when I try restoring the wallet using the Trezor T seed, Electrum produces different Zpubs and addresses, despite entering the correct paths and cosigners for each multisig wallet. Is there some different kind of encoding Electrum or the Trezor T HD wallet itself might be using?

@AndrewBreedlove You have to make sure you enter the exact derivation path and script type as you originally did when creating the wallet and make sure it says bip39 checksum ok next to the options button when entering the seed words.


text:
Will we have blocks with hash 000...000 (all zeros) in the year ~2070 if hashrate will increase with the same rate?
I have made an estimate on when the total hash rate will be high enough that we might observe blocks that have a hash with complete zeros.
000000001aeae195809d120b5d66a39c83eb48792e068f8ea1fea19d84a4278a <-- Block 50000  (04/10)
00000000000000000006834ff0dd4567d98352d077bf045ea3f13c4041b582f5 <-- Block 709798 (11/21)
                                |
                                | ( some years later if we assume
                                |   similar hashrate growth)
0000000000000000000000000000000000000000000000000000000000000000 <-- Block ?? in ~2070

It is a very rough estimate base only on two data points. From logarithmic total hashrate plots it seems that the multiplicative growth rate (slope in logaritmic plot) is not constant but seems to decline over time. But if we still assume that the hashrate is increasing with the same multiplicative rate as it did between those two observations, i.e. that we will have that many more leading zeros every 11 years (note that we have hexadecimal digits representing 4 binary digits, I only do a rough estimate), we will run into problems around 2070.
Did I make a mistake or is it true that these kind of problems (block hash collision, difficulty adjustment will first have low resolution and finally can't prevent blocks from being mined too fast) are not too far away? Are there already plans to circumvent such issues (harder POW hashing algorithm, concatenate two hashes to have more bits)?
EDIT
My estimates are based on the assumption that the hash rate growth rate will continue to be exponential (i.e. constant slope in logarithmic plot). Despite the fact that in the recent two years the hashrate growth seemed to be approximately linear, I think that it is reasonable to assume that in the long run, the total hashrate will grow exponentially. This assumption is backed by Moore's law. Here are two logarithmic plots of the number of transistors and the supercomputer power (FLOPS) over time and indeed, the logarithmic growth rate is linear here.

So I think that indeed we can assume that the total hashrate is exponential in time, i.e. that the number of leading zeros in block hashes is linear in time in the long run and that this will be a problem for Bitcoin sooner or later.

No, it's not reasonable to expect that the hashrate will continue to grow exponentially (sustained exponential growth is generally unlikely for pretty much anything). See this chart of the hashrate growth since inception on a logarithmic scale:
via bitcoin.sipa.be
As you can see, hashrate growth has been slowing down. Bitcoin's hashrate was increasing very quickly at first, because mining hardware went from CPU to GPU to FPGA to ASIC to miniaturized ASIC. For a while each generation of hardware was obsoleted in less than a year after release. Meanwhile, ASICs have caught up the state of the art of chip production, and improvements will be more gradual.

Well, it could still be exponential growth from now on - just with respect to a smaller base :) Especially since you are saying that now ASICs have caught up, i.e. before that we had a phase where state-of-the-art technological capacity was not fully exploited, and from now on we have more gradual improvements = pure Moore's law growth without superposition of strong miniaturization effects.

I doubt it, but who knows. Either way, block 50 000 to block 709 798 would not be representative, though, since 50 000 was even before GPU mining was publicly available.

Bitcoin targets are not actually evaluated as a count of leading zeroes.

If we look at a chart of Bitcoin difficulty we can see that the long term trend in recent years looks much more linear than exponential. There have additionally been significant periods of decrease rather than increase.

It seems unlikely that Bitcoin will still exist if it ever becomes computationally feasible for a mining consortium to force a double SHA256 hash of real data to a single desired target value.

Thank you, I didn't realize that enforcing a hash of zeros is basically equivalent to find a double SHA256 preimage of a desired 32 bit value.

2.: You say the growth rate is rather linear: I updated my question to justify the exponential growth. 3.: Saying Bitcoin will not survive until then is similar to the thoughts that will lead to the Year 2038 problem where people thought unix would not survive until then. Admittedly, there will be enough time to fix it when we approach that day.


text:
How is "engine lag" on Mt Gox calculated?
When looking at external API-driven charts of Mt Gox trades, there is a "Trading engine lag" shown, which shows the backlog of orders queued and waiting-to-be-executed, relative to the present time:

(For example, see http://bitcoinity.org/markets, and http://bitcoin.clarkmoody.com/ )
How is the "engine lag" time calculated?

It is the difference between current timestamp and the submission timestamp of the oldest order submitted, which has not yet been processed by the order book.

From the Mt. Gox API Documentation:

Order lag
https://data.mtgox.com/api/1/generic/order/lag
  The "lag" value is the age in microseconds of the oldest order pending execution. If it's too large, it means the engine is busy, and the depth is probably not reliable


text:
Bitcoin-qt v0.8.0b client on Mac OS X 10.8 crashes, why?
I was running the stable 0.7.2 bitcoin-qt client (under OS X 10.8.2) for a couple of weeks, with the block-chain completely sync'ed on an ongoing basis. No transactions in my wallet.
I upgraded to the 0.8.0b release, and it spent a few hours reindexing the entire blockchain and catching up. So far so good.
0.8.0 client continued to run normally (launch, download / sync new blocks, etc.) for several days.
Then, today, it crashes right after loading the wallet, but before it attempts any network connections. Crash is reproducible and persistent across reboots. Here's where the debug.log output ends. (No further errors.)
Bitcoin version v0.8.0-beta (2013-02-18 18:38:34 -0500)
...
init message: Verifying block database integrity...
Verifying last 288 blocks at level 3
No coin database inconsistencies in last 222481 blocks (8492 transactions)
block index            4479ms
init message: Loading wallet...
nFileVersion = 80000
wallet                 1500ms
init message: Importing blocks from block database...

I fixed the problem myself.  During a system sleep or perhaps a hang and hard reset (graceless shutdown) the block index got corrupted.  Best-practices for Bitcoin-qt, at least on a Mac, are probably to quit out of the app before putting the system to sleep.
To fix the problem, I trashed the entire directory
~/Library/Application Support/Bitcoing/chainstate/
and then relaunched the client. It re-indexed all the existing blocks (took about 2 hours,) but did not have to re-download the entire blockchain.
After allowing it to fully re-sync and catch up all blocks, I was able to do transactions normally. 48 hours later the client is still running stably and normally. (Including quitting & re-starting the client.)

I had the same thing happen to me on Windows (older version of the client though), reinstalling Bitcoin solved the problem for me.

Did you have to re-download the entire blockchain from scractch?


text:
"Fee estimation is currently not possible" in Bitcoin Core
I need some help in transaction fee in Bitcoin Core.
In Send section there is a message after Transaction fee saying "Warning: Fee estimation is currently not possible." Why is it there? Blocks are up to date.

The Bitcoin Core software needs to have been running for a little while before it is able to provide fee estimates.
This is because the fee estimation mechanisms observe unconfirmed transactions on the network and the time it takes for them to confirm. With no (or little) observation, it's not possible to provide an estimate.
For more details about how fee estimation work in Bitcoin Core see this answer.


text:
How to setup insight explorer?
How to setup insight explorer and using its API?
https://github.com/bitpay/insight
Please your detail instruction to install and setup it.

The readme.md for that project says "THIS PROYECT HAS BEEN REPLACED BY BITCORE-NODE, AT https://github.com/bitpay/bitcore". If you want to use obsolete unsupported software you can try checking out the previous versions of readme.md

Do you instruction detail how to setup it ?

See prior versions of readme.md

can you help to share me ?

https://github.com/bitpay/insight/commit/34a4b3585c942f2eb7772066f85c4157023c4d5b


text:
Why there are signature and public key pair on blocks when transaction verifying is over
I'm student studying about bitcoin and blockchain. I want to know why all blocks have signature and key pair after the transaction is over.
Why I ask this, I'm studying post quantum cryptography (PQC) and almost PQC have very large key and signature size, but now bitcoin block size is limit to 1MB. So if the hardware performance will be similar to nowadays in future, then I think the block size is critical.
I read the bitcoin post quantum white paper, but there solution is that increase the block size to 16MB.
Is there any reason to store the key and signature? Is there something critical vulnerability?

Signatures and pubkeys are needed in order to verify transactions after the fact. Miners are not the only verifiers, and just because a transaction is in a block does not mean it is automatically valid. Other full nodes still need to verify all blocks, and that includes verifying all of the transaction in the blocks, which means verifying signatures.


text:
How did peer discovery work in Bitcoin v0.1?
Nowadays there are DNS seeds and hardcoded IP addresses, but back in the day when Satoshi released Bitcoin v0.1, how did new nodes connect to the rest of the network? My initial thought was that the first release would have Satoshi's IP address hardcoded, but I couldn't find anything of the sort in the source code.

The first seed mechanism was IRC-based. There was a hardcoded IRC server and IRC channel (#bitcoin on Freenode), and the Bitcoin client would connect to the server, and join the channel with a nickname that encodes the client's IP address. Through that, it would receive "JOIN" messages from other Bitcoin clients joining the channel, which would get inserted into its IP address database.
In version 0.2.12 (June 2010), hardcoded seed IPs were added, as a fallback for when IRC seeding failed.
In version 0.3.0 (June 2010), the IRC server was changed from Freenode to LFnet.
In version 0.3.21 (April 2011), the DNS seeding mechanism was introduced (but off by default).
In version 0.3.22 (June 2011), the IRC seeding mechanism was extended to 100 channels instead of one, due to it growing too big. Every client would randomly join one of the channels.
In version 0.3.24 (July 2011), DNS seeding was enabled by default.
In version 0.6.0 (March 2012), the IRC seeding mechanism was turned off by default.
In version 0.9.0 (March 2014), support for the IRC seeding mechanism was completely removed from the codebase.

Quoting from the wiki:

In addition to learning and sharing its own address, the node learned about other node addresses via an IRC channel. See irc.cpp.
After learning its own address, a node encoded its own address into a string to be used as a nickname. Then, it randomly joined an IRC channel named between #bitcoin00 and #bitcoin99. Then it issued a WHO command. The thread read the lines as they appeared in the channel and decoded the IP addresses of other nodes in the channel. It did this in a loop, forever, until the node was shutdown.
When the client discovered an address from IRC, it set the timestamp on the address to the current time, but it used a "penalty" of 51 minutes, which means it looked like it was actually seen almost an hour earlier.


text:
How do i restart my account after replay in progress has me stuck
Every time I try to use my account.It says transaction is not possible because a replay is in progress.

"Account"
You say "account", which makes the rest of your question unclear to me because Bitcoin was designed to work with no accounts. The normal type of wallet is a software program you download onto a phone or PC and run yourself without any link to a business. Some businesses offer Bitcoin accounts of various sorts but these work very differently from normal Bitcoin wallets. If you have opened an account with one of the many many online Bitcoin businesses, the following information will not apply.
"Bitcoin Wallet" app for Android, developed by "Bitcoin Wallet Developers" (The Schildbach wallet)
There is an old discussion on Bitcointalk about a similar problem in the Bitcoin Wallet for Android, by "Bitcoin Wallet Developers"
The exact message shown was

Currently Payments are not possible because a replay is in progress

That is different to your

transaction is not possible because a replay is in progress.

But perhaps you didn't remember it exactly
The person who asked about this on Bitcointalk seems to have eventually solved the problem by allowing the app to complete synchronising with the network - by just waiting patiently.
The discussion there suggests an alternative approach of recovering by transferring keys to a desktop wallet but I think this is too complex for anyone new to Bitcoin and involves the use of rather technical Linux commands.

Also, in a comment at The App's page in Google-Play store it says

Why it say "replay in progress"?? What does that even mean? I cant send any bitcoins because of it. Edit: after update i got my transaction. But now i tried to send coins and its been stuck for 5 days. No response from developers by email. Did a report about transaction with data, still no response after 3 days.

Bitcoin Wallet developers 26 juni 2024
This issue is fixed in version 10.15, which you can update to via > Google Play.

So you might try updating to the latest version if you are using an older version than 10.15.


text:
Are transactions with an insufficient value marked as "failure"?
I have made a payment with an installed CardGate(curopayments.com) bitcoin gateway on a site, got a unique deposit adres, i sent a bit less than actual asked. The problem now is that the site owner says he didn't receive any payment because this occured.
Does anyone recognise this, and where is are my bitcoins?

This is a screenshot he sent of his CardGate admin panel

Are transactions with an insufficient value marked as "failure"?

Hello, welcome to Bitcoin.SE! This question is off-topic since it is a customer service issue. If you have record of a transaction being confirmed in the blockchain history (ie, a transaction ID, or at least a bitcoin address you paid to), you should show that to the merchant as proof that some payment was made.

@chytrik I did but they're declining they ever received something

@guest then consider them scammers

@Guest it may just be that the payment gateway is provided by a third party service, and the software is not built to properly deal with payments of incorrect amounts (ie, the merchant is not a scammer, they're just using crappy software). I would try contacting the merchant to explain things clearly and politely, and perhaps contact the payment software business as well to see if they can help out. There is nothing anyone here can do to help directly though, this is entirely a customer service issue at this point.

Are transactions with an insufficient value marked as “failure”?

No.
The blockchain, other nodes and miners have no idea how much the recipient is expecting to receive.
If your wallet and blockchain explorers show the transaction as being confirmed then the recipient has received your money. It is now under their exclusive control.

the site owner says he didn't receive any payment

Either they are confused or they are trying to deceive you.


text:
Fraudulent transaction
I have been in contact with a blockchain group and they are supposed to have a large amount of money sitting in my wallet waiting for withdrawal. I have had to send a large amount of money to try to get and each time am met with some excuse of why they cannot complete it. What can I do? Is there a way to even get my initial money back?

Probably no... Sadly this sounds like you fell for a scam. Don't send any more money.

They don't have any money sitting in your wallet waiting for your withdrawal. They're just scamming you. Stop sending them money immediately.


text:
What can I do if someone obtained control of my blockchain wallet?
I fell for a bitcoin scam and I would like to undestand what are the risk associated to it.
i established contact with scammer on instgram he convinced me to join the mining pool i had to create a new blockchain wallet and deposit founds and send them to one of the addresses he gave me.
I still have access to that wallet but I dont use it anymore for my transactions.
after that intese experience I decided to research the crypto space more deeply and do it by myself instead of relying and giving trust to random people that promise gains.
That was a huge mistake, I am ashamed of what I did and this is my intent undestand more,and don't forget that mistake.
I lost my money but i also lost the keys of my blockchain wallet.
what should i do ?

I did the account as they asked and money where in the account, but I couldn't access them. after i realized that they sent me this :Hello Sir,
We noticed that you want to make withdrawal in your account. Due to the irregularities encountered from your wallet ,there has been a glitch in the withdrawals process, you will need to pay for tax of %10 percent of your money in your account now to be able to with your money fully. Thank you.
after that which i didn't do
i realized that the website they linked me, and asked me to create a profile, in order to complete the withdrawal was asking to  put my bank details to complete the deposit.
At that point, I stopped and I never shared any of my bank details.
we kept talking he tried to get more money from me and i tried to get my money back, now he is gone blocked me on whatsup.
Was this website a strategy to get my bank account?Can be a way to create a backdoor access?
My biggest fear is that I don't understand if there is a larger scam happening or their only goal was to get my money? if so why did they needed my blockchain account?

To be completely safe, you should throw away every piece of information and data to do with the old wallets used or accessed by the scammer. user-ids, passwords, recovery phrases, backups, keys, addresses and anything else that is related to anything the scammer had access to.
Those wallets and the keys in them are forever unsafe. Even if you reset passwords, change 2FA or do anything else they are still unsafe forever.
In those circumstances I would assume the scammer also has back-door access to any computers or phones or other devices that you, or anyone else in your house owned at the time of the scam.
I would back up any important data (photos, email, other documents) and wipe those devices clean and reinstall the operating systems then sell them.
I would only create a new wallet using reliable sources on a new computer or phone that has never been used on the same local network as any of the devices owned at the time of the scam.
This may seem extreme and it may be unlikely that all of it is necessary in your case. But you don't know for certain. The only way to be sure is to take extreme measures so far as you are able and/or live with the remaining risk.
If you are 100% certain the scammer never persuaded you to install software and never used remote access to share a screen to help you, then your devices might be OK, but you need to be certain.

Postscript:

Typically, potential investors are prompted to fill in an online contact form and then encouraged over the phone to set up a cryptocurrency wallet - but unknown to them the scammer installs remote access software on their device, granting them access to it as well.

From https://www.bbc.co.uk/news/technology-57267199 2021-05-27

Thank you very much for the exhaustive answer. What do you mean by every piece of information?I have some questions regarding the back-door access how is it possible? How did they gain access to my devices? The scammers convinced me to share the wallet address, they gained my trust

I have never shared the screen live, I only sent screenshots. the only information I gave the scammer was the password and wallet Id of my blockchain wallet and my phone number and my email address. the only thing that comes to my mind is an email he sent me, it had a link necessary to see my "gains" he was asking for another deposit, and to demonstrate that the deposit would be worth it, he wanted to show me the balance on this account

I have update my answer to address the comments.

Don't use the same computer for any financial stuff incl. Bitcoin anymore unless it's setup with a fresh OS. But against other advises you should save all data on a stick you might need the evidences for the time when the scammer is caught. If you have another computer just use the other one until this case is close. And it's the right thing to get better educated about bitcoin and security stuff. There is no need to get help of a person to do any bitcoin transactions. If the amount was not very low it might make sense tracing the scammer until cashout at exchanges. I have the right analytical software to do this. If you know the BTC address where your bitcoin were sent to send me a message and I'll do a quick check if it's traceable yet or if you need to be patient. E.g. if the scammer didn't move the coins yet then you need to wait. So for this it's important that you know the BTC address or transaction id.
Good luck in claiming the funds back from the scammer!

yes, I realized that too late, I really appreciate the help and assistance. I have currently accepted my loss. I would like to know what kind of analytical software you are able to run, what are they? what kind of advantages does this research research provide? The addresses given by the scammer to receive my funds were multiples. In the compromised blockchain wallet are registered the transactions I did.  There no founds and no activity.

If at least one BTC address of the scammer is known or alternatively the transaction where the funds left your wallet then our tool (see my profile) or other similar tools are doing a search for other addresses belonging very likely to the same person. Then for wach address in this group the outgoing bitcoin transactions are traced to see if some of them end at an exchange. If not then it's too early and one need to wait, If yes then you'd need to report it to police, they can ask the exchange about threir client which is likely the scammer and claiming the bitcoin can start.

Thanks tempo, I have accepted my loss- I am not going to run behind  those money, because I believe they are gone for ever. What I want to make sure is that there are no other risks associated with the fact that the wallet address is shared with a scammer. Like what they can do with it ?
I’ll never send money again or receive on that address.


text:
What prevents a faster, better-connected node stealing a miner's block solution?
Some questions already adressed similar issues (preventing fraud in a mining pool, what prevents a pool miner for stealing an entire block) but my question is different from those, if I understand correctly the mechanism.
Here is my point: Let's say for simplification there are only three nodes in the blockchain:

Platform node, the only platform where you can exchange BTC for FIAT, in America
My node, in Europe
Bad guy's node, in Europe

My and bad guy's node are both mining, as well as Platform's node. Now, imagine I find the solution for a block at T time. At T + 1 second, my node sends the solution on the network. My solution is made of:

My public key where I'm getting the reward
Data = block with the solution
Signed Data with my key

At T+ 2 seconds, bad guy's node receives the solution. But bad guy has a special code snippet: he reads my candidate solution, steals it and writes a new candidate block that he sends on the network with his public key and his signature.
Because he has better connection, CPU or whatever network tricks, Bad Guy's candidate block arrives to platform's node at T+3 seconds and my candidate block arrives at T+4 secondes.
Question:
So in this situation, the reward from mining would go to the bad guy's node from the point of view of the platform's node. And I would not be able to recover them in FIAT. What mechanism prevents such a stealing?

The block is not protected by the block author’s signature, it is protected by proof of work. Does https://bitcoin.stackexchange.com/q/95564/5406 answer your question?

Interesting link, but this does not address my question. It would be interested though to integrate my question in this subject

The first transaction in a block is the so-called coinbase transaction and it is this that pays block-reward and transaction fees to the miner's address.
Note that these details are contained within the block and are not external accompanying information.
This coinbase transaction's data affects the block hash, so changing the coinbase output to pay a bad guy would change the block hash to one that almost certainly fails to be less than the target and so is an invalid block.

he reads my candidate solution, steals it and writes a new candidate block that he sends on the network with his public key and his signature.

a block with (i.e. containing) a different public key or a different signature is a different block with a different hash - the "solution" is different and almost certainly invalid (hash > target).

Thanks you answered my question. I had not understood before that the cryptographic problem was different for each of the miner because each miner included his own public key in the transaction


text:
Why is there no block time bias to <10min due to increasing hashrate?
Since the difficulty adjustment is based on a 2016 block window from the past, if we assume that the hashrate of the network is steadily increasing over time (up to temporary disturbances), why do people say that a block is created approximately every 10 minutes?
In my opinion there should be a bias towards of the blocktime towards less than 10 minutes because for the past blocks taken for reference in the difficulty adjustment, the hashrate was probably a bit lower than now. Is there a method to account for this bias? Or is it just very small? Or am I missing something?

you are right, there is a bias. You can easily see it in the time between halvings:

3 years, 10 months, 19 days for the first epoch
3 years, 7 months, 12 days for the second epoch
3 years, 10 months, 2 days for the third epoch

all considerably shorter than the expected time of 3 years, 11 months, 29 days.
You can also take the time elapsed from genesis block and divide by the number of mined blocks so far. At time of writing the average block time is 9 minutes 31 seconds, so about 5% off from theoretical value.
There is really no easy way to compensate for that in a deterministic way as the generation time is a convolution of stochastic events (nonce finding) and non linear events (market price <-> hash rate available).
The hash rate in facts is not growing linearly but can go up and down by large amounts in relatively short amount of time depending for example of Bitcoin market value as well as unexpected events like weather catastrophes affecting large areas where miners are located or political facts such as China mining ban that recently (mid 2021) caused relocation of big miners to other jurisdictions with related down-time.
On top of that also consider that the algorithm used for difficulty adjustment is affected by a off-by-1 bug (by some definition of bug) where the actual time passed in creating the 2016 blocks is divided by 2015 instead of 2016, causing a tiny systematic drift.
In all cases both the bug and the probabilistic bias do not pose a problem for Bitcoin and are not and will not be addressed in any foreseeable future, according to my humble opinion.
Hope this answers your doubt.
-E-


text:
Why does the chacha20 implemented in the Bitcoin Core use a 64 bit nonce?
The draft of chacha20 uses a 64-bit nonce, but the final version of chacha20 specification uses a 96-bit nonce.
The #9792 PR adds chacha20 to Bitcoin Core. We can see the function ChaCha20::SetIV(uint64_t iv) is using 64 bits for setting the nonce value. The chacha20.cpp mentions that it follows the chacha20 implementation from here.
Is there any specific reason for bitcoin using a 64-bit nonce? Wouldn't it be better to use a 96-bit nonce as recommended?

It doesn't matter. The old version has a 64-bit nonce and 64-bit counter, while the new one replaces it with a 96-bit nonce and 32-bit counter. For our purposes however, they can reasonably both be thought of as a single 128-bit number that should just never repeat.
The ChaCha20 implementation in Bitcoin Core is used as basis for the random number generator, and not (yet) as a stream cypher for encryption, where the nonce/IV and block counter are used for somewhat distinct purposes.
In the RNG, the 256-bit key is randomly generated (using OS and system randomness), and the nonce and counter are both just set to 0. The block counter then increments every time 64 bytes are generated. If we'd switch to a 32-bit counter instead, we'd need to deal with the situation where the counter overflows, and most likely the way to do that would be to increment the nonce when that happens. And all of that is still exactly identical as just thinking of it as a 64-bit nonce and counter with incrementing non-overflowing counter instead.


text:
P2SH-Multisig transaction not going through
I have some funds locked in a testnet P2SH address which requires 2-of-3 signatures.
This is the address: 2NEKRqUqoDtsELzpBa5wuWEiJeVbio5cSa2
and the 3 keys:
#1 - cU1mPkyNgJ8ceLG5v2zN1VkZcvDCE7VK8KrnHwW82PZb6RCq7zRq
#2 - cPTFNJD7hgbZTqNJgW89HABGtRzYo5aLpCQKvmNdtRNGWo49NAky
#3 - cNUe2L9CNJZoedMU8YNrzRuxFc56dvMjFxzK4mTsSGhXwbidAyog

The multisig script is:
OP_2 <Key #1 length> <Key #1 PubKey> <Key #2 length> <Key #2 PubKey> <Key #3 length> <Key #3 PubKey> OP_3 OP_CHECKMULTISIG
I have also created a transaction spending the funds in this address, however I cannot broadcast this transaction because it gives the error Mempool accept test failed: 16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation).
Here is the transaction:
01000000  //Version
01        //Input Count
e29cf4dad1c36d5e316bac18edfc665f8323050d7260b94b72777b12a4eecba0  //TXID
00000000  //Out index
fb        //ScriptSig size
0046304302202848f7f4087da2e01adcaca2da30fe9004861ca284efffcae6b49d2cf9f239b2021f7794619a597f5847e92fef4bdebeba42b91544d267220bfe8e2824f3ef74190147304402201dd2ba26a81ac13da8ecd5d967f9394ec0c5356e6d303adeb71f84bd2ee62d0202203632bfc457d778a71ca72007cce9d0e6f92a1bf8226e010fc9e59e0572afe454014c695221034d0953ff49ed8e98cce462e9ecd3ead6cf641b299ec500329dc153443d4cced721024be733c116a4ca8bd7dd2aafa6fb6877d153962e0f6a21709fab771ce6572b4821038c6a2191a2e77ede17063d8633fb9e08dba8535fd1dd99377b7dc9b6bea89efe53ae     //ScriptSig (2 signatures followed by the redeem script)
ffffffff         //Sequence
01               //Output count
204e000000000000 //Output Value
16               //ScriptPubKey size
001491c6c31a62b37a16447ccf44224eb1ab78ca0299  //scriptPubKey (Segwit P2PKH)
00000000         //Locktime

Here are the steps I took to sign the input:
1. Hash the input with the scriptPubKey as the scriptSig and SigHash ALL appended
2. Sign the hashed signature with Key #1 and Key #2
3. Construct the scriptSig by concatenating the 2 signatures and redeem script
4. Place the scriptSig in the scriptSig field of the input

Im not sure if I am missing a step or have done a step incorrectly. I did pretty much the same steps as signing a P2PKH input which I can successfully create, just with different scriptSigs.
Any help would be appreciated.

The signature verification seems to have failed. The calculation of the sighash used for the signature may be wrong.
BTW, e29cf4dad1c36d5e316bac18edfc665f8323050d7260b94b72777b12a4eecba0 is tx hash, not TXID. If the endianness is reversed, it becomes TXID.

I found where I went wrong.
When creating the hashpreimage for the input, I was substituting in the scriptPubKey of the input instead of the redeemScript.
When I used the redeemScript instead of the scriptPubKey, the signature was correct.

@Keijyu: You could add your last comment as an answer in the "Your Answer" section below - if you think it might help others in future, or delete the question if not.

I found where I went wrong.
When creating the hashpreimage for the input, I was substituting in the scriptPubKey of the input instead of the redeemScript into the scriptSig.


text:
Error broadcasting SegWit transaction
I have this testnet transaction that I created:
Version: 01000000
Marker: 00
Flag: 01
Input Count: 01
    Input #1 TXID: 42a752fe4ebd0bdc69cb1b3724de6ccc364661028ab9c043526f3f7cb0571147
    Input #1 VOUT: 00000000
    Input #1 ScriptSize: 00
    Input #1 ScriptSig:
    Input #1 Sequence: ffffffff
Output Count: 01
    Output Value: e8fd000000000000
    Output Script Length:16
    Output Script: 00143778e5361fdad0d209de8a16c2ec4ca64618993e
Witness:
    Witness Stack Size: 02
    Witness Signature Length: 47
    Witness Signature: 304402204af85395dd8c758ac379c343bc278351f73cdf9d8548d933aada5fa4e13194a80220126c0614f75520709e63ac41 9308344c00a4a22c021e1b9d8b42115aa73e37b01
    Witness PubKey Length: 21
    Witness PubKey: 02ad2a42eed9fecc022093e8682b62b034690b06587be18f01bb8e60df1afeaaf8
Locktime: 00000000

When I try to broadcast it, it gives me this error:
Mempool accept test failed: 64: non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation)

I believe this error occurs because the signature is incorrect, but I am having a hard time identifying how I created the wrong signature.
Here are the steps I took to sign the transaction:
Sign the hash of the following with the signing key:
1. Transaction version (4 bytes little endian)
2. The hash of all input outpoints (32 bytes)
3. The hash of all input sequences (32 bytes)
4. The outpoint (32 + 4 bytes)
5. The script code (26 bytes consisting of 0x1976a914<20 byte pub key hash>88ac)
6. The value of the input being signed (8 bytes little endian)
7. The sequence of the input being signed (4 byte little endian)
8. The hash of all the outputs (32 byte)
9. The locktime of the transaction (4 bytes little endian)
10. Sighash type (4 bytes little endian)

this signature was then used in conjunction with the Public key of the signing key to create the Witness script as seen above.
Here is the info I used to create the transaction:
Input #1:
    txid: 471157b07c3f6f5243c0b98a02614636cc6cde24371bcb69dc0bbd4efe52a742
    out: 0
    signing key wif: 3a8c0c731cba400917f66bc3435a405387a9a5b20cdbfdedb19e37d0c6cad8b9

Output #1
    value: 65000
    recipient: tb1qxauw2dslmtgdyzw73gtv9mzv5erp3xf7mt83vq

The sighash type is missing in the sighash calculation.
10. sighash type of the signature (4-byte little endian)

@ShigeyukiAzuchi My mistake when writing out the steps. My code was appending the sig hash type but still am getting the wrong signature.

As a result, what is the value of the sighash you generated?

I found my mistake. I was not reversing the TXID when serializing the tx according to BIP143. Thanks @ShigeyukiAzuchi

Witness Signature: 304402204af85395dd8c758ac379c343bc278351f73cdf9d8548d933aada5fa4e13194a80220126c0614f75520709e63ac41 9308344c00a4a22c021e1b9d8b42115aa73e37b01

It seems that the signature value contains white space.
Isn't the correct signature value below?
30440220722ed739d8a69832ecf6e5d636b2949ab6dc00026b88129a8652916904b80c6e0220370d30e8fb3e2d76f6c64b6d89e050ab47faefd3ca017752496035329534207e01
And full tx is:
01000000000101471157b07c3f6f5243c0b98a02614636cc6cde24371bcb69dc0bbd4efe52a7420000000000ffffffff01e8fd0000000000001600143778e5361fdad0d209de8a16c2ec4ca64618993e024730440220722ed739d8a69832ecf6e5d636b2949ab6dc00026b88129a8652916904b80c6e0220370d30e8fb3e2d76f6c64b6d89e050ab47faefd3ca017752496035329534207e012102ad2a42eed9fecc022093e8682b62b034690b06587be18f01bb8e60df1afeaaf800000000

tx_hash_big_endian":"5da8f74aa4d6612c58c0a740b4740579db57c95828e4cdf04e7d18c23b66cb4a","tx_hash":"4acb663bc2187d4ef0cde42858c957db790574b440a7c0582c61d6a44af7a85d",
Auto-correct ^ class S256Point(Point): ... def sec(self): '''returns the binary version of the SEC format'''    return b'\x04' + self.x.num.to_bytes(32, 'big') \ + self.y.num.to_bytes(32, 'big')


text:
If the Lightning Network is so great, why is it "level 2", not stable and not built into Bitcoin Core?
Lightning Network, as it's described, seems to solve all the problems with Bitcoin. I'm unable to accept payments due to the insane fees, but would be able to if Lightning Network were supported.
But it's not supported in Bitcoin Core.
Why is not the "real" Bitcoin project working on its own "layer 2", as a core feature of Bitcoin?

Stop downvoting for no reason, FFS.

Lightning Network, as it's described, seems to solve all the problems with Bitcoin.

That's not true. I would even say that Ligntning Network doesn't on its own solve any of Bitcoin's problems, but it does go a long way towards solving several of them (scalability and privacy).

I'm unable to accept payments due to the insane fees, but would be able to if Lightning Network were supported.

There are invoicing solutions that support Lightning Network, for example BTCPay Server. Considering Bitcoin Core as the only "serious" Bitcoin-related software is short-sighted as there is absolutely no reason for that. For example, I doubt many people would prefer storing their life savings in Bitcoin Core instead of a hardware wallet.

Why is not the "real" Bitcoin project working on its own "layer 2", as a core feature of Bitcoin ... ?

This is where I cover the rest of the question.
Bitcoin Core is the most widely used implementation of a Bitcoin node, but it's not the only one and anyone is free to implement their own version, as long as it follows the same protocol rules.
Similarly, there are multiple implementations of a Lightning node, and perhaps over time we will see the ecosystem converge on one of them being by far the most widely used, however there is no reason why it should be developed under the same project as Bitcoin Core.
Quite the opposite, I don't believe Bitcoin Core developers should leverage their position in order to favor any specific Layer 2 solution over another, and implementing their own into Bitcoin Core would be doing exactly that. I think it's much better for Bitcoin Core developers to bring upgrades that all Layer 2 solutions can take advantage of, such as Taproot.

"I doubt many people would prefer storing their life savings in Bitcoin Core instead of a hardware wallet." Well, I'm one of them. Those hardware wallets are way less secure, cost a lot of money, and advertise to everyone that you have coins. Not to mention they cannot be automated to actually power any kind of payment system.

As for the rest of your answer, I still get the feeling that you, too, basically "hand-wave" the issue away, seemingly in no rush whatsoever to finally get this thing going. ("This thing" being Bitcoin.)

Also, trusting "BTCPay Server" would be unthinkable to me.

You don't need to trust anyone. Both Bitcoin Core and BTCPay Server are open source software that you can review and build for yourself. There is no reason why one should be trusted more than the other.

"Verify yourself"... Right. Good joke.

As expected, there's no real answers/responses -- only trolls who downvote anything that questions the status quo.

@Kohlton if the only software you are willing to use is bitcoin-core, and you are unhappy that bitcoin-core doesn't currently include a lightning-network implementation, then why don't you open a pull request to get that work started, rather than repeatedly posting complaints to this website, under a new alias each time?