text:
Libbitcoin How to generate addresses on demand from xpub?
Well, I am really new to this. Just installed libbitcoin and I am reading trough the wiki and everything.
Could someone really quick hint me how to generate addresses whenever I want from xpub that was exported from Electrum wallet? And/or Ledger wallet - if someone knows?
I know that it can be done in bitcoin core, however I would like to give libbitcoin a try.
Thank you very much.

Did you try this section from their documentation?
https://github.com/libbitcoin/libbitcoin-system/wiki/Addresses-and-HD-Wallets
// Load mnemonic sentence into word list
std::string my_sentence = "market parent marriage drive umbrella custom leisure fury recipe steak have enable";
auto my_word_list = split(my_sentence, " ", true);

// Create an optional secret passphrase
std::string my_passphrase = "my secret passphrase";

// Create 512bit seed (without optional secret passphrase)
auto hd_seed = decode_mnemonic(my_word_list);
data_chunk seed_chunk(to_chunk(hd_seed));
hd_private m(seed_chunk, hd_private::mainnet);

// Derivation of master public key M
hd_public M = m.to_public();

// Derive public children of master key M
auto M0 = M.derive_public(0); //Depth 1, Index 0
auto M1 = M.derive_public(1); //Depth 1, Index 1
auto M2 = M.derive_public(2); //Depth 1, Index 2

// Derive further public children
auto M10 = M1.derive_public(0); //Depth 2, Index 0
auto M11 = M1.derive_public(1); //Depth 2, Index 1


text:
Regex for validating xpubs
I am wondering if someone can help me with regex for validating all types xpubs like:

xpub (mainnet P2PKH or P2SH)
ypub (mainnet P2WPKH in P2SH)
Ypub (mainnet P2WSH in P2SH)
zpub (mainnet P2WPKH)
Zpub (mainnet P2WSH)
tpub (testnet P2PKH or P2SH)
upub (testnet P2WPKH in P2SH)
Upub (testnet P2WSH in P2SH)
vpub (testnet P2WPKH)
Vpub (testnet P2WSH)

Thank you.

The following regex should work for validating that a string starts with one of xpub, ypub, Ypub, zpub, Zpub, tpub, upub, Upub, vpub or Vpub and is followed by 79-108 characters that are one of 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz (the Base58 alphabet) which is as close as you can get to validating BIP32 keys with regex:
^([xyYzZtuUvV]pub[1-9A-HJ-NP-Za-km-z]{79,108})$

(try at: https://regexr.com/6cn9a)
If you want to accept BIP32 keys that optionally include the ?c={timestamp}&h={bip} arguments, then add (?:(?:$|\?)((?!.*&c=)c=\d{10}|(?!.*&h=)h=bip\d{2,3})(?:(?=(?:&c=|&h=))&(c=\d{10}|h=bip\d{2,3}))?)? at the end, like this:
^([xyYzZtuUvV]pub[1-9A-HJ-NP-Za-km-z]{79,108})(?:(?:$|\?)((?!.*&c=)c=\d{10}|(?!.*&h=)h=bip\d{2,3})(?:(?=(?:&c=|&h=))&(c=\d{10}|h=bip\d{2,3}))?)?$

(try at: https://regexr.com/6cn9s - this will check that c is a valid 10-digit UNIX timestamp, h is bip{2-3 digit number}, that there is at most one of each parameter, and allow parameters to be in either order.)
However, a more accurate way to test that a BIP32 key is valid is to simply decode it with Base58Check (similar to how regular Bitcoin addresses are encoded), verify that the checksum is valid, and check that the length of the decoded data is exactly 78 bytes.

You could factor pub out of the brackets btw :)

source: Stack Exchange

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

sort: votes


text:
BTC Treasure Hunt Volume 2
Similar to Whoiszo, I too am helping a friend locate a bitcoin treasure.
In a period between 2010 and 2011 my friend owned a blackberry curve 8330. At the time she was into some online gambling and because many of the gambling sites were becoming illegal in the US, she thought she would try putting some money in Bitcoin, which seemed like it would be easier to use on the gambling sites. She remembers buying the bitcoin and even had an app on her blackberry that she could access the exchange to keep an eye on the value. She decided to never spend it and eventually got a new phone and forgot about the bitcoin, which is reasonable considering it wasnt worth much at the time.  Fast forward to 2017 when bitcoin began to move rapidly, she remembered the bitcoin she had and tried to locate it. Unfortunately the phone was gone, the email service she had at the time was no longer in business and the email account could no longer be accessed. To top it off she cannot remember the name of the exchange or the app she used to access the bitcoin.
When I was speaking the other day about investing cyrpto market she explained her situation to me and she asked for my help. Of course I was very intrigued but skeptical. I thought surely she is mistaken. However she mentioned a few numbers , How many she bought and the amount she owned and after checking  the numbers are consistent with what the price of BTC was at that time. Also the fact that she said she could access it and monitor the value for that time means she would have had to definitely have purchased it. So now I have decided to help
what we have done so far:

tracked down the email service provider and followed the trail through about 3 different acquisitions of the company to arrive at the one that is currently functional. We got them on the phone and they said they have access to the @ ###.com email accounts however, hers for some reason could not be located.

Gone through years of bank statements searching for the transaction, hoping for a clue of the location or exchange with which it was made. - Nothing found in the bank statements, working on collecting all credit card statements from this time period now. (hoping it was not purchased with a gift card)

found and accessed her ###@sprint.blackberry.com account over the phone but was told there was no information there except the email address she had on file (same one as item 1).

Contacted Blackberry to see  if blackberry ID was required at the time she set up her phone and if so,, would that profile log information such as which apps were downloaded on the phone.
(waiting on reply)

What I would like to do now is start from the opposite end and try to make the connection  back to her . my Plan is to try to figure out which exchanges  it could possible be  and see if an account was made in her name at any of them , however I am having ttrouble determining which exchanges it could possible have been. Does anyone recall any early cryptoexchanges  from this time period which  would be worth looking into?  does anyone recall accessing bitcoin holding account through aa blackberry app in this time period? which exchanges were even in existence in 2010 & 2011?
Im running out of  ideas and leads to pursue, where would you go from here?
Your assistance would be greatly appreciated and if wyour suggestions lead me  on the trail to finding the lost bitcoin I will  dmake sure that you are rewarded!!

It seems she kept the Bitcoins in the exchange, can she remember any backup that the app might give her? Like 12 words or something like that? Because if she has something like this, it would be possible to recover the Bitcoins in another wallet.

If it was between 2010-2011, it must have been MtGox [dead], Britcoin [dead], Bitmarket [dead], Bitstamp [alive], Kraken [alive]. If she's lucky, she used Bitstamp or Kraken.
She stored the BTC on the exchange or did she ever transfer any to a wallet?
If you know the company or individual who owns the domain her email was registered on, I'm sure they'd be willing to register her username (probably would need to add some motivation by way of money).
I don't know of any exchange that would accept giftcards to fund your account, so there must be something in her bank statement or credit card statement to reveal where her funds went.
Also did she use her legal name to register on the exchange?

Hey thanks for the reply. Any idea what happens to the open accounts on exchanges that go under?  Her bank statements came up empty but  Im hopeful to find something in her credit card statements from that time, which we are still collecting. Shes not too technically savvy so I doubt she did anything too creative with it . in the next comment  Ill paste an email I got from her yesterday that discusses the possible movement of the BTC.

"I was looking to play poker on the internet, so it would have been after that was banned, most likely because I always played on PokerStars until they quit letting USA players play. I found a poker site that would allow you to play with bitcoin, so I probably googled and followed a link to purchase the bitcoin.I don’t have any idea where I bought it. I thought it gave me a long email address or web address connected to bitcoin somehow.I don’t think I ever played with any of it because I tried once but couldn’t ever figure out how to get the bitcoin to go to the poker account....

...I’m pretty sure the gambling site wasn’t one of the main ones like full tilt or party poker, etc., because I I would remember that. It seems like the exchange or wherever I put it  was considered a vault for the bitcoin at that time. So I may have bought it somewhere else and then put it there. I remember looking at it on my blackberry and being surprised that it was actually worth more than the amount I had bought"

well, if she never transferred the Bitcoin into the gambling site, then it's irrelevant which gambling site it was. Just need to have an idea of what exchange it was. and did she use her legal name to register on the exchange?

Yea she would have used her legal name. We will contact Kracken and Bistamp to see if her name and info were ever used to open an account. I will reply back on that update and on any findings with the credit card statements.

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


text:
Is money that has gone into bitcoin already spent?
Is money that has gone into bitcoin already spent? When I buy a bitcoin from someone and they get USD I get bitcoin. They go buy lambos or real estate for their gains. So the underlying currency is spent, but BTC market cap is increased. This would mean that cryptos don't actually have any real money in them and they could collapse without bottom basically. Is this logic correct or is real really currency as value behind crypto?

Change the word bitcoin to euros and see if that helps you?

@RedGrittyBrick So you say that bitcoin is a FIAT currency? I would disagree, bitcoin is speculative asset and taxed as such. It's only value is the current price, there is no ultimate underlying value.

@ram4nd, sounds like you're trying to slight-of-hand the instability of value into saying it has no value.  Sure, talk till the cows come home about how it's a less stable value, but that whole conversation presupposes that there is at least some value.  And as long as there is some value, then see RedGrittyBrick's answer.

What does "real money" even mean?

@TonyEnnis In this context I mean currency what you use to buy bitcoin. But "real money" is historically gold and silver, and currency was substitute to that.

What does "spent" actually mean? When I spend a dollar bill, does that make that dollar bill worthless?

@ram4nd LMAO gold standard currency has long been replaced with fiat currency, or in the latin translation "its worth something because I said it is, now shutdup and use it".

As Yuval Noah Harari put it, "everyone wants money, because everyone wants money".

See : Velocity of Money

This would mean that cryptos don't actually have any real money in them and they could collapse without bottom basically.

Short answer: Yes
Longer answer:
The value of bitcoin is what other people are willing to pay. If noone wants to buy bitcoin the value is zero.
Bitcoins are "marketed" as the new payment system with zero transaction cost. If true, it would be fantastic. In the meantime there are a number of issues with bitcoin -- I will list some, whether they are important is up to others to decide.

Bitcoin is marketed as a payment currency / system. But compared to the total value of all bitcoins the payment flow is probably small. Most people hold bitcoins as speculative investments, not to pay for good or services. Compared to national and International payment flows the bitcoin usage is totally insignificant.
Bitcoins are forbidden in some countries, and more may follow. Polititians may believe either that they have no control or that bitcoins are mostly used for illegal transactions such as drugs (true or false, decisions are often made on beliefs).
Transactions are far from free: it is estimated that bitcoin mining currently uses about as much electrical energy as a smaller country, say like Netherlands. Energy usage is hardly free.
There is as already known no intrinsic value in bitcoins. It is really only a "key". Compare to as example gold -- even if gold prices goes to zero you can actually use gold for making things.

So the longer answer is still yes -- the value may go down to very close to zero. And it could happen in a very short time.

I agree with everything here, but people assume that they put their money in somewhere, it's invested and it will grow. But the problem with bitcoin is that you put money in it and other people will spend it. So there is no money in it, just until other people are willing to pay more for it. Like if you buy commodities, you invest betting on that the value of the commodity goes up(supply shortages, demand increase or for what ever reason).

Yes, it similare to other speculative investments. Often stocks in "high-tech startups" (I only use this as an example) has a similar situation. What you invest in there is not the actual "intrinsic" value right now but you invest in the expected future increase in value. Not all wishes are fulfilled though, so some fail. Good advice generally is to never invest money you cannot afford to lose.

As @RedGrittyBrick says, change the word "bitcoin" to "euros" and see if that helps you. All currencies work this way, not just cryptos:

Is money that has gone into euros already spent? When I buy a euro from someone and they get USD I get euro. They go buy lambos or real estate for their gains. So the underlying currency is spent, but euro market cap is increased. This would mean that euros don't actually have any real money in them and they could collapse without bottom basically. Is this logic correct or is real really currency as value behind euros?

And someone in Europe probably has the exact same question about USD.
All currencies are fundamentally worthless. Except for things like gold, which you can use to plate the contacts of electrical switches, coins, which can used as paperweights, and paper notes/bills, which can be used as toilet paper.

But bitcoin is not currency. Bitcoin is speculative asset.

@ram4nd You keep saying that. How does that change in terminology affect the result? If I buy a painting or a house, I can say it has value, solely because someone else would pay an amount of money for it. Neither is a currency. Granted, a painting has some value to you personally when you look at it. But when you go to sell it, it is purely a speculative asset, and is only worth what someone will pay for it.

@ram4nd all the vendors who accept BTC as payment for goods and services would beg to differ...

@ram4nd "A rose by any other name would smell as sweet" - Bill

@ram4nd yes, and so is any foreign currency. If that country goes up in flames, it's worthless. Calling it a "speculative asset" a) is not an argument at all and b) is not excluding it from being money.

Dollars are a bit less 'fundamentally worthless' because the US government is required to let you pay your taxes with them. This can't absolutely guarantee their future value (given the potential for hyperinflation), but it's a slightly stronger basis than pure speculation.

@LawnmowerMan All two of them!

@user3153372 A currency being legal tender actually means that it has more uses than just taxes.

@user253751 You are trying to refute arguments I didn't make.

@LawnmowerMan They don't accept bitcoin, it gets converted. The store owner doesn't want bitcoin. But he doesn't care how you get your dollars.

@ram4nd that's like saying Amazon doesn't accept euros because it converts them to dollars.  What the vendor does with with the currency once the transaction is complete is immaterial. Consider refunds. If you purchased a widget for 2 BTC, would you accept a 1 BTC refund because of currency volatility? That's grounds for a lawsuit.

@user253751 what is a PayPal dollar?

Bitcoin is like every other asset; it does not matter if you buy Bitcoin, or some stock, or a fond, a future, expensive cars or houses, raw materials, or even simply a foreign currency.
For all of these assets it holds true that they have almost no intrinsic value; they all only have the value that we as humans give them. Even food has no significant value if you've eaten and are full.
They gain value primarily because they are limited. To a starving person, the same piece of food that someone else would discard without a single thought may be worth more than a piece of gold.
All of these can "collapse without bottom", in principle. A company can immediately go bancrupt without warning. A future can go wrong. Your expensive car can total, a meteorite can strike your house, your raw materials can get lost at sea, and your food storage can be decimated by mice.
The "value" we attribute to Bitcoin specifically is that at the time it tickled the fancy of those who wanted to have a currency which is not centrally controlled. Other virtual currencies (e.h., Ethereum) add more features due to supporting contracts or even games built on top of the currency. If the designers and developers manage to convince people that they want to buy this stuff, then it becomes valuable.
Someone commented that bitcoin is not "real". Futures, ETFs and many other instruments are not "real" either, they are a pure bet on the future development of an underlying asset (which in turn might be virtual), or a mix of other assets. They are backed by something. Bitcoin is "backed" by a promise, an idea, or just the number of people already invested in it as well. Highly risky, yes, but nonetheless the same as many other assets.
And if you want to become more concrete, on a most technical level, the value of Bitcoin comes from the fact that we cannot conjure them out of thin air, but have to spend electricity. This is really a core (if not the core) function of the virtual currencies for now, if a little pedestrian. Obviously the energy has been spent and is now gone, so we cannot get it back. But this introduces scarcity, which often translates directly to value.

Bitcoin is not like every other asset, it's not real. Assets like company shares, real estate and commodities have value. Bitcoin has no value, it's virtual. These arguments seem very short sigted.

@ram4nd: Lehman shares are worthless. Enron shares are worthless. Penn Central shares are worthless, even though it had lots of real tangible assets. There are hundreds of 'superfund' sites where the land is worthless or has negative value -- people won't take it even if you pay them. Futures traders actually did pay people to take 'spot' (physical) oil just a year ago. Nothing has more value than what people will pay/exchange for it.

@dave_thompson_085 yes but there was a point when those companies had worth, until they messed up and broke their balance sheets. Oil has value, people have to move. Also price has fluctuations. If there was no manipulation(example: oil cartel OPEC). Then the price would be more stable and up to the market situation. Also FIAT system messes with markets. So I still would argue for real assets. But this is off topic.

Futures and many other instruments are not "real" either. They are "backed" by something. And bitcoin is "backed" by something (a promise, an idea, or just the number of people already invested in it) as well. Highly risky, yes, but nonetheless the same.

I have also added this point to the answer; hope it helps to bring across my point better. @ram4nd

@AnoE I wouldn't say that bitcoin is backed same way as commodities. One has real backing, other has no real backing. Idea doesn't make bitcoin special there are 10k different cryptos. The number of people invested is the point of  this post, I am afraid that the money invested is already spent and gone.

OK, then we will have to agree to disagree, @ram4nd, no problem. I cannot really offer a much better answer (or I would have) except to point out that bitcoin is not that different to other assets. I gave some reasonable examples where other assets may be more fleeting than thought at first glance. I gave the two actual "values" that bitcoin has (i.e., being scarce due to energy expenditure; and having the philosophical value of being a decentralized currency, for people who want to have such a thing). Maybe you find a better answer amongst the others... ;)

Even our hardest backing (gold bullion) has almost zero intrinsic value. You can't eat it. You can do very little with it. There are extremely limited technical processes where we actually require gold to create an item (jewelry aside). If all our gold reserves would go poof right now, nobody would care (except obviously, the financial sector). It's just valuable because people think it's nice and shiny, and in the distant past it was special because it didn't corrode. So - not much better than Bitcoin or other virtual currencies. ... That's it for me, over and out. :) @ram4nd

Bitcoin is separate from fiat (dollar or euro or any governement currency) people choose to exchange a certain amount of dollar for bitcoin, once the exchange is done, the buyer got bitcoin and lost his dollar and the seller got dollar and lost his bitcoin.
If peoples dont want to exchange their dollar for bitcoins, then yes the price will go toward zero.

But dollar gives bitcoin it's value. On it's own bitcoin is just a crypto token. Without current price, it's value is 0.

But what give dollar its value ? except that dollar is a legal tender

Since it's no longer backed by anything. It has no value, just like bitcoin. But the question is about the money that is in crypto, is it spent or is it there? It sure seems like it's all spent and it might be in a freefall at any moment.

What gives bitcoin its value is not the dollar. Instead, what gives it value is the same as for any medium of exchange: the fact that you can buy stuff with it, i.e. the fact that sufficiently many people will accept it in exchange for goods.

@ram4nd no, not really, all the other currencies give bitcoin value as well, and so do the people trading with it.  Which sounds like all the other currencies that exist: they have value because you can use it. Either for purchasing stuff or exchanging it for other currencies

@LeeMosher : Although Bitcoin can be considered as a form of currency and yes, theoretically you could buy something for it, the overwhelming proportion of its price is not because people want to use it as currency, but because people have seen it rise and hope it will continue to rise. Bitcoin might have its uses, but the price it is traded by today is orders of magnitudes higher than what it would really be worth if it was merely used for its original claimed purpose. So no, "the fact that you can buy stuff with it" is not what gives Bitcoin its current "value".

What is the difference between a dollar bill and a piece of monopoly money? Both are just pieces of paper with some print on it. Sure, the dollar bill has security features, but we could easily print monopoly money with the some security features.
The main difference is that all people collectively pretend that the dollar has value. The same is true for any fiat currency.
Back in the days, silver (or gold) coins had intrinsic value - the value of the metals present in the coin. Nowadays, almost all currencies are fiat currencies. They are literally just pieces of paper. The only thing distinguishing the from normal paper is that people collectively pretend those bills have value.
If you ever travel outside the US, you might actually encounter people who don't want to be paid in dollar, especially in Europe. For us, a dollar bill literally is a printed piece of paper. You can't do anything with it, except exchange it for paper we think has value - the Euro.
The same applies to cryptocurrencies. Cryptocurrencies only have value because someone else is willing to pay you for it. Bitcoins do not have intrinsic value. They are just a crypto token. They have value because someone is willing to buy them.
It doesn't really matter if you think of Bitcoin as currency or asset.
Lets pretend you buy a piece of art. you start with $1k. You buy a painting for $750. You still have $250, but also a painting worth $750, so your net worth didn't change.
Replace piece of art in the above with either Euro or Bitcoin and nothing changes.
It only starts to change if the piece of art, or the Euros, or the Bitcoins aren't worth $750 anymore -- either more or less. Your net worth changes accordingly, but you still only have $250 in hand. Only when you sell the asset/euros/bitcoin again you will realize those gains.
All of those can "collapse without bottom" -- including the Dollar! A piece of art might become worthless in a post-apocalyptic world, or simply because the artist is no longer en vogue. The Bitcoin bubble might burst. A financial crisis might make Euros or Dollars worthless, if people no longer believe that those things have value and start to barter again. We have already seen currencies collapse, e.g. the Reichsmark. Or look at the Venezuelan Bolivar for another example of hyperinflation.
The Dollar used to be backed by gold (Fort Knox). So there used to be some value to a dollar bill (the amount of gold is was backed with). But that hasn't been the case for about four or five decades.

This might have been a useful answer it if wasn't so one-sided. It missed a crucial difference between the US Dollar and game money or Bitcoin: The US dollar also has a value because a government uses it to raise taxes, and gives you the right to be able to use it to pay any debt.

@vsz That doesn't make it inherently valuable. Take the GDR. The GDR Mark or, "Ostmark", was the official currency. Yet there was rampart bartering in the GDR. If you wanted something special, you had to barter for it, because everyone had enough currency and due to planned economy, the stuff everyone wanted wasn't available. And sellers couldn't raise prices, so they wanted something else. or look at reichsmark. the currency collapsed after hyperinflation. being backed by a government doesn't make any piece of paper inherently valuable, a lot of land you can use is. Metals are.

It's probably worth noting that the US never held enough gold to cover node in circulation and there were times when silver coins had a higher face value than their metallic value.  Exchanging actual gold (or any commodity) for goods and services is barter.  Gold being called 'money' implies there's some distinction between the actual substance's value and it's use in exchange.

@Polygnome The reichsmark failed because of political choices.  The idea that the Weimar Republic could have paid their war reparations in gold is ridiculous.

@JimmyJames Who says they could they  repaid their debts? I used it as an example to show that being backed by a government doesn't inherently make a currency valuable, unlike a plot of land, machines or labor, which can always be exchanged for something else.

@Polygnome The point is that they purposely inflated their currency in extreme ways in order to make the extraordinarily large reparation payments.  It's totally irrelevant to the current world monetary system.

@JimmyJames So you say currencies can no longer collapse by governments doing stupid things?

No.  But the idea that land and metals are inherently valuable is, um, questionable.  They are worth what people think they are just like anything else.  If you doubt that, I can show you some brownfield sites that are available for sale.  Of course, you won't be able to do a lot with them until you clean them up.  Gold's value is largely based on people believing it's 'real money'.  It sits in vaults and we pay people to guard it.  That's pretty much the opposite of useful.

I don't really see much issue with the other answers but I think you are confused about some basic concepts here.
First of all, let's define market capitalization or 'market cap'.  This is simply price of a 'share' of an asset multiplied by the number of shares available.  This is a term that is usually used with relationship to stocks.  The implication is that this is what the market 'believes' the total value of the asset is.  For a company, it's roughly of the total value of the company.  As a side note, the idea of BTC having a market cap implies it's an asset. For 'currency' we would use terms such as 'money supply' and 'circulation'.
So let's talk about Lambo's for a second.  Let's say you sell some BTC, and buy a lambo.  The person you bought it from goes to the casino, and gambles it away.  The money is spent, gone.  Does the lambo have any 'money in it'?  It's lost some value but you should be able to find a buyer and get most of what you paid for it.  But let's say you then drive it into a tree and total it.  It bursts into flames as you escape and it is completely destroyed.  You pay to have the remnants of a lambo hauled away to a scrap yard.  Does it have 'money in it' now?
Money is a fiction: there's no such thing as 'real money', all money is imaginary.  But it serves a really useful purpose: it relieves us of the time and effort required to determine e.g. how many eggs a candle is worth.  When you buy BTC, you are giving up money and 'receiving' BTC in exchange.  What that BTC is worth to you is what ever you are able to get for it in exchange for something else.  What you exchanged for it in the first place is irrelevant.  These are independent transactions.  It's just like selling a home.  The buyer doesn't care how much money you spent on it or what you put into fixing it up, the price buyers are willing to pay is based on market value.
You might be thinking of so-called 'stable coins'.  These are digital currencies/assets that are 'pinned' to a fiat currency such as the US dollar.  Some countries do the same thing and tie their currency to the value of the USD.  The question is, though, do they actually have enough dollars to cover the pseudo-dollars they have issued.

Gold has value of the metal and silver is even better example. That is money and has been for thousands of years. USD was a substitution for gold, then it had value in the money itself. Now it's just FIAT, so no value in there. The point would be that all of the profits from bitcoin are spent, so there is no fallback price. It can go to zero like FIAT.

@ram4nd Gold has the value that the market gives it.  If no one wanted gold, it would have no value.  There are plenty of worthless metals.  There are even metals with negative value i.e. you need to pay someone to take it away.  Gold was used as money because it's rare, easy to work, and hard to destroy.  You can bury it in a hole and expect it to still be there.  That's all.  Platinum is actually a superior metal for such use except ancient people couldn't smelt it.

gold has multiple uses in electronics. If you want technology you need gold, also monetary aspect, minging costs, jewelry. But I agree it's more of a hold in vaults metal. Silver has more uses in real life, half of the supply is used industrially. Those real attributes gives the metal intrinsic value. Bitcoin has no such values, it's intrinsic value is 0. It's a collectible internet token.

@ram4nd Yes there are a handful things you can do with gold in industry, none of them impact the price significantly other than jewelry.  You seem to be missing the point.  Value is based on what we think things are worth: full stop.  The fact that things that are useful are considered to have value by people that might use them is pretty unsurprising.  I think BTC is a ponzi scheme personally but that doesn't change anything about what gives things value.

@ram4nd I just thought of a good example. Back when Rockefeller was getting rich selling kerosene for lamps, gasoline was considered a useless byproduct. It was literally just dumped on the ground. There wasn't any fundamental difference between the gasoline that people now spend significant parts of their income on in order to get around and the stuff that was considered a nuisance to be rid of. Gold is a commodity with an interesting history but its subject to the same laws of supply and demand as anything else. For example, it's rare now but there might be a lot more in the asteroid belt.

So the underlying currency is spent, but BTC market cap is increased.

The "Bitcoin market cap" is a bit of a misnomer. Usually the term is referring to the "total purchasing power of all bitcoins in existence based on the latest spot price of a trading pair with another currency".
You seem to assume that a trade has only one participant and the other side is some abstract construct like the "market cap" or the "economy". Trades have two sides.
When you spend money, it's just somewhere else, it isn't gone. When you sell bitcoins for USD, the other party of that trade is buying bitcoins for USD. The "market cap" only increases if the exchange rate of bitcoin was higher in that trade than the previous spot price. If the exchange rate was lower, the "market cap" decreases. Similarly, when you spend either USD or bitcoins to purchase a sports car, you gain a car, and the car dealer gets they money.
Money inherently doesn't have intrinsic value, that's sort of its point. You may enjoy the article Bitcoin Has No Intrinsic Value — and That’s Great..

Bitcoin has no purchasing power, only when it's converted to "real currency".
Actually historically money has intrinsic value and currency was a substitute to it. That system worked, this doesn't. History shows this very clearly.


text:
Is brute forcing a private key with unspent coins getting easier?
Is the likelihood of correctly guessing a private key with unspent coins increasing due to:

More addresses being used resulting in more private keys with unspent coins (i.e. higher chance that a random private key might have coins).
The fact lots of people use deterministic wallets (i.e. one could discount billions of deterministically generated private keys if the first 20 are empty).

Is this significant in terms of security?

It's increasing from approximately zero to approximately zero.
Since the starting seed of HD wallets is essentially random, I don't think this helps.
This isn't significant.

No, it's not getting significantly easier.

The key space is literally 67 magnitudes larger than the count of all addresses used so far. Even if address use increases by magnitudes it would make effectively no difference.
Bitcoin has no mechanism to prevent users from rediscovering keys except the vastness of the key space itself, so just because keys are part of some keychain doesn't prevent that they aren't part of another. As mentioned above, even discounting billions of addresses gets you nowhere.

There are 115,792,089,237,316,195,423,570,985,008,687,907,852,837,564,279,074,904,382,605,163,141,518,161,494,336 possible private keys. Compare that to fewer than 1B addresses ever used and about 75.7M UTXOs.


text:
I have an old blockchain wallet and a .txt file of 43 words, but the site wants 12 words?
I have a wallet.aes.json file and a .txt file that contains 43 random words. They were both made within minutes of each other back in early 2014, and my confirmation emails from blockchain are also within minutes of these file timestamps. I also have a wallet ID from blockchain. Blockchain wants a recovery phrase of 12 words, and won't accept my 43 word phrase. I'm not sure what I can do to translate these 43 words into something that will let me into this wallet.

I figured it out. You can input legacy phrases here
https://login.blockchain.com/wallet/forgot-password
It spits out your password and wallet ID. I logged in. It's an empty wallet :(


text:
Is there a way to make a provably non-fake HW wallet?
With the current hardware wallets, there is AFAIK no way for a customer to verify if the HW wallet indeed generates secure, private addresses. All checks actually just use various methods to verify the firmware and hardware integrity which make hacks more difficult but not impossible. But still, you can't say if the HW wallet just does not emulate the original software while it does other things. Even when the firmware is open source, you can't say if the code you see is indeed running on the hardware. And even when you modify the code and upload it to the wallet, you still can't be sure if the upload actually rewrites the firmware, or if your code is just interpreted somehow to mimic your code but still controlled by an attacker's firmware.
At least, there are these potential attack vectors that the compromised HW wallets can do and software can't detect them:

Seed will not be randomly generated. Instead, some pre-generated seed (or one of) known to the attacker will be displayed. There is no way for the client to verify it, as the HW wallet generates it completely (and the software does not even see it).
The seed is random but the derived addresses (and xpubs) are not derived from the seed. Instead, some attacker's pre-generated addresses are used. Because the client doesn't know the seed (and it obviously should not know), it can't verify if the derivation is correct. Passphrases do not help either; another set of compromised addresses could be displayed as well and the client can't verify it.

The first issue comes from BIP39, and the second issue comes from BIP32, widely used standards. Are there any other standards/proposals that address these two weaknesses? Like generating a part of the randomness on the client and enforcing its usage in the derived addresses.
My goal is to be safe until both HW and SW are fake. The current state is we are safe if and only if the HW is not fake and genuine SW can't help.
Are my thoughts reasonable? Is this a problem?


text:
output descriptor serialization
I'm looking at the following official test vector:
wsh(multi(1,xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB/1/0/*,xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH/0/0/*))

which is serialized for the first key as:
04 ; version 4
88b21e ; `xpub`
00 ; depth 0 == public key of a master key
00000000 ; parent fingerprint
00000000 ; child index
60499f801b896d83179a4374aeb7822aaeaceaa0db1f85ee3e904c4defbd9689 ; chain code
03cbcaa9c98c877a26977d00825c956a238e8dddfbd322cce4f74b0b5bd6ace4a7 ; key data
e233a252 ; base58 checksum

and the second key:
04 ; version 4
88b21e ; `xpub`
01 ; depth 1
bd16bee5 ; parent fingerprint
00000000 ; child index
f0909affaa7ee7abe5dd4e100598d4dc53cd709d5a5c2cac40e7412f232f7c9c ; chain code
02fc9e5af0ac8d9b3cecfe2a888e2117ba3d089d8585886c9c826b6b22a98d12ea ; key data
44183bfc ; base58 checksum

My question is for example for the second key: is the depth connected with the appended tail /0/0/*? If it is, shouldn't it be 2 instead of 1? Can depth be restored from the appended tail?

Why is the child index zero for the second key? Should it not be equal to the number that corresponds to the star. Can a child index be restored from the appended tail /0/0/*?

It looks like you are confusing the BIP 32 serialization with output descriptor serialization.
Output descriptors contain an extended public key serialized using the method described in BIP 32. This serialization applies only to that particular public key. The derivation appended to the end is independent and separate from that xpub's serialization. That is part of descriptors.

My question is for example for the second key: is the depth connected with the appended tail /0/0/*? If it is, shouldn't it be 2 instead of 1? Can depth be restored from the appended tail?

No. The tail is independent from the xpub. The depth applies only to the pubkey serialized by the xpub, which the derivation path is not a part of.

Why is the child index zero for the second key? Should it not be equal to the number that corresponds to the star. Can a child index be restored from the appended tail /0/0/*?

Because the serialization is only for that particular xpub. The appended derivation information is not part of this serialization.


text:
How a bitcoin node knows where the last transaction of my wallet is
when i send a transaction to a bitcoin node how can the node know that my address exists and where in the chain my address is? does it do a verification? how does it know that I have the funds knowing that it does not index the addresses

There is no concept known as "wallet" on the blockchain. Each address stands on its own, nothing associates them with each other except transaction history. The fact that a given set of addresses are grouped into an HD account-wallet is a secret known only to the wallet-client, except what can be deduced via transaction history.

Addresses
Transactions don't actually contain addresses.
A Bitcoin address is really more like an invoice reference number created by the intended recipient of the money.
The address value allows the senders wallet to construct a transaction that contains an output for that recipient. The output has a bitcoin script, a small program written in Bitcoin scripting language. This script is sometimes called the locking script and it ensures only the recipient can later spend that money. The script is created from the number we call an address.
So other nodes don't ever see actual addresses and don't need to check output addresses. They don't really care about outputs although they do keep a list of unspent outputs (UTXOs). It is only some time later (if ever) when that output is reference as an input to a later transaction that nodes will check the unlocking script produces the right values to satisfy the locking script.
Funds
The Bitcoin network doesn't keep track of your total funds or balance. Bitcoin nodes neither know or care about how much money you have. They only care about whether the coins being spent are genuine. Just like the owner of a coffee shop doesn't need to know your bank balance they just check the coins and banknotes you gave them look and feel real.
Bitcoin nodes check that the transaction inputs are not already spent. Each input should be a reference to a UTXO from some prior transaction.

So if I want to send BTC, I need the UTXO of the latest transaction + pubk/privk?
I can't just know my pubk/private key to send

You can't send BTC you don't have. To create a transaction you need to know the private-key corresponding to a UTXO created in a transaction sometime in the past. You can then use that UTXO as an input in your new transaction. Your wallet creates an unlocking script for the input in the new transaction that provides the right values for the locking script of the UTXO in the earlier transaction. This very loosely corresponds to you only being able to spend coins you have possession of


text:
Does a coinbase transaction's input field have a VOUT field?
In a coinbase transaction, the previous output field is 0000000000000000000000000000000000000000000000000000000000000000ffffffff because there is no previous output, the coins are generated.
If you look at this coinbase transactions raw data:
https://blockchain.info/rawtx/04183fe0d461697c043abd156276f14e810c2d250970170ce66debf687223ff6?format=hex
The previous output field comes immediately after the input count field. Normally there should be a 4-byte VOUT field in between. But because there is no previous output, does that mean there is simply no VOUT field?
Is this also the same for transactions which only have 1 previous output?

The previous output field comes immediately after the input count field. Normally there should be a 4-byte VOUT field in between. But because there is no previous output, does that mean there is simply no VOUT field?

There is; it's the ffffffff in the hex dump you cited. The rules for coinbase transactions are:

It must have exactly one transaction input

That input must have prevout hash exactly equal to 0000000000000000000000000000000000000000000000000000000000000000
That input must have prevout index exactly equal to ffffffff (=232-1, =4294967295).
That input must have a scriptSig between 2 and 100 bytes in length.
Since BIP34 activation (March 2013), that scriptSig must start with a push of the block height.

Oh I see. Thanks. I thought the ffffffff was a part of the prevout hash.

When a miner creates a candidate block, the very first space for a transaction is reserved for the coinbase transaction. An input is constitued of this structure :

Transaction Id (32 bytes)
Vout (4 bytes)
Script Sig Size (varInt)
Script Sig (Script Sig Size)
Sequence (4 bytes)

Regarding the transaction 0x04183fe0d461697c043abd156276f14e810c2d250970170ce66debf687223ff6, it's a coinbase transaction. Every transaction has a VOUT. In your case, this tx has a VOUT equals to 0xffffffff. This is specific to the coinbase transaction with obviously an empty previous transaction id (txId).
For others transactions, the txId is replaced by the previous user's transaction hash and the vout by the output number of this transaction hash in which there's the user's address. These data are stored in UTXO database.
Best regards.


text:
Is the coinbase transaction the one and only means of minting new coins?
I'm new to blockchain and want to start my own private network. I've gotten a lot of information here about coinbase transactions and how they make mining "empty" blocks useful. I would like to get precise answers to one major question and some offshoot questions:

Is the coinbase transaction the one and only means of minting new coins?
Is the coinbase transaction implicated in anyway in the creation of the first initial suppy of bitcoins or the creation of the genesis block?
Since coinbase transaction blocks don't include any previous transaction history (except reward transaction to the miner), is it less computationally expensive to mine than blocks with actual transactions? And does this expense grow with the size of the blockchain or is it constant?

Is the coinbase transaction the one and only means of minting new coins?

Yes.

Is the coinbase transaction implicated in anyway in the creation of the first initial suppy of bitcoins or the creation of the genesis block?

Yes. Bitcoin was not premined, which means that there was no initial supply created by the creator. All of the Bitcoin in existence came from coinbase transactions produced in the blocks after the genesis block. Additionally, the coins created in the genesis block are also unspendable, so do not actually count to the total Bitcoin supply.

Since coinbase transaction blocks don't include any previous transaction history (except reward transaction to the miner), is it less computationally expensive to mine than blocks with actual transactions?

Technically yes, but the extra computation required is basically negligible. Building a block requires hashing all of the transactions into the merkle root. The more transactions there are, the more hashes that need to be computed. However this only adds a few thousand hashes at worst, so the effect is basically negligible. It can be computed in a second or two at worst.

And does this expense grow with the size of the blockchain or is it constant?

The blockchain being longer has no effect on how difficult it is to mine blocks.

Thanks for clarifying that last part. Got more clarification here: https://bitcoin.org/en/faq#what-is-bitcoin-mining. Difficulty increases with the number of miners.


text:
Multiple receiving address on exchanges
If I have 0.01 on an exchange that allows generating new addresses , and I send 0.02 to a new address on that exchange , and then I send 0.025 off of that exchange , did I basically cross spend and the new address with 0.005, and the other 2 addresses , are now all traceable to be connected to each other?  To my understanding because transactions have many digits, they can be used to map the addresses (.010122+.024991=...do math with mining fees..==> ok these 3 are making this transaction)
For complete privacy and annonymity would I need to first empty out the account first ?  I would end up with a lot of dust.

Exchange services will generally consolidate customer deposits, and allow withdrawals from a communal hot-wallet. So the coins you receive upon withdrawal may have very little on-chain relation to the coins you deposited. The specifics of this will vary from one exchange to another though.

For complete privacy and anonymity would I need to first empty out the account first ? I would end up with a lot of dust.

Bitcoin can be used privately, but it takes some work. Emptying out your account won't do much, and if you're looking for privacy, then you shouldn't be transacting through a trusted third party anyways.

If I take out that it was on an exchange , and say I do this on Electrum , are the 2 original addresses and 1 address with the remaining amount traceable to each other ?

Yes, but not because of the output's values as your question suggested, it would simply be because all the inputs/outputs in question were party to the same transaction. See for example: https://en.bitcoin.it/wiki/Privacy#Common-input-ownership_heuristic


text:
HD addresses and traceability question
Say I have 1 underlying Bitcoin address, and it has receiving address A and B, and they both received 2 BTC each. If spend 3 BTC then A and B would have spent together so it's probably traceable. What about if I spend 2 BTC (or emptying address B exactly)?  Can B and A still be linked?
Thanks

Can B and A still be linked?

Not directly.
However it depends on context and external patterns and information.
For example if G sends 2 BTC each month to addresses A, B, C and so on,  and G sends no money elsewhere, people could infer that there is a connection between A and B. They could speculate about the nature of that connection. Some of those speculations might happen to be correct. There might be other transactions or other external information people could use to look for supporting evidence for those speculations.


text:
I have reinstalled my PC and lost BitcoinCore, still have the Private Key, can i get my Wallet back?
so i have reinstalled my PC a few years ago and lost my BitcoinCore Wallet, i still have the PrivateKey.. is there someway to get the Wallet back?

Yes, just make a new wallet in BitcoinCore and import your private key using
importprivkey <your key here>

in the console (Window -> Console, if you are using the GUI).
You may have to rescan the wallet for the funds to become visible (I believe BitcoinCore should generate the address and public key automatically upon import.).
Side note: You should only insert the private key into a system you trust (check the signature of the BitcoinCore client you downloaded) and make sure to encrypt the wallet after you do so. If it is compromised, your funds are gone. Consider keeping it offline at all times if the amount on it is large.

Yes. Your private key(s) is (the important part of) your wallet. See: https://developer.bitcoin.org/reference/rpc/importprivkey.html

This answer could be improved by elaborating what the link is for and how to proceed.


text:
Does got any optimise method can swap/splice/loop channel without on-chain cost in lighting node?
if I got custom Node and Alice has 3btc and bob got 0btc and bob got 0btc with Tom 1 btc. Is it possible we can change channel for Alice 3btc with Tom 1 btc. And close Tom. And it doesn’t go to on-chain btc. Does it possible Only swap this in off-Chain my node?

If initially the channels from Alice, Bob and Tom came from the same channel factory (we do not have channelfactories as part of lightning as they would be much easier to build on eltoo channels) then I guess Bob could easily be removed off-chain to have a new channel just between Alice and Tom.
As with current lightning network I think we have to hit the chain to achieve what you want

So the action will be 1. Remove Bob from this node (This will commit to on-chain btc). And move Tom to bob channel. For this one should I create new channel or got any function can do off-chain?

right now you would close the two channels (the alice-(3)----(0)-bob channel and the bob-(0)-----(1)-tom channel and then open a newly dual funded alice-(3)-----(1)-tom channel


text:
Transaction blocked by Blockchain
Payment was processed to me. Fees were requested to pay to sender.
Transaction was unconfirmed and due to delay I was requested to pay the following fees to unblock transaction. Is this correct?

No, you're being scammed.

Please explain in details. This company I have invested said they are going to make a payout. You are saying this is follow up scam? I have a guy pretending from Blockchain who is constantly asking for this fee to unblock transaction. Also transaction looks original but doesn't have any hash number. There is nothing to unblock, right?

@user120621 It is definitely a scam, without any doubt whatsoever . There is no such thing as "a fee to unblock a transaction", that is simply something scammers say in an attempt to steal your money.  Do not send the scammers anymore money, you will not receive anything in return.


text:
When you make a Bitcoin transaction, can the receiving person (and the world?) really see how much coins you have in the entire wallet?
I really hope that I've got this horribly wrong, but I have to ask...
I have this idea, which I base on comments and explanations I've heard over the years, that when you make a Bitcoin transaction, for example 0.001 BTC, your wallet (let's assume Bitcoin Core) actually sends your entire funds of your wallet, let's say 1.5 BTC, but also includes a "gimme back" signal for 1.5 minus 0.001 BTC, ie 1,499 BTC, in the same "atomic action", meaning you never actually risk losing all that money, but it is advertised to the person receiving it, and maybe the entire world.
I don't understand why it would do this, and it seems extremely bad for privacy, and I'm not at all sure that it's done. Maybe it only happens sometimes? If so, when? Or maybe it doesn't mean "the full funds of the wallet", but something else?
I hope that somebody can clear this up once and for all. It's pretty telling that somebody who knew about Bitcoin in 2009 is actually asking this question in 2021, after using it for highly sensitive tasks for over a decade... I'm not wild about random people knowing how many Bitcoins I have simply by sending them money, and hope that this is not how it works.

Does this answer your question https://bitcoin.stackexchange.com/a/56491/95422 ?

Bitcoin privacy has many facets. See: https://en.bitcoin.it/Privacy

No, you will not disclose the entire amount of your wallet when you make a payment, but effectively you can disclose some info on your bitcoin.
Your wallet has several addresses and each one can have received one or more payment, once you receive a payment this amount will become an UTXO (unspent transaction output) which you can use to make a payment later;  so you will have some UTXOs in your wallet and when you pay you must spend a full UTXO (the amount you received in a earlier payment) not the whole wallet.
For example, if you have received four payment to four different addresses (0.3, 0.04, 0.61, 0.05 - wallet total balance 1 btc)  and you must pay 0.2 btc, you will use an UTXO that is greater than requested amount, in our example 0.3 btc UTXO (but you can pick also 0.61). So you will make a transaction with one input (0.3 btc) and two output: 0.2 btc for the payment and 0.1 as change that you receive on a new address.
In this case you will disclose to your counterpart (the only one who know that this address is your) that you have at least other 0.1 btc but not the wallet balance.
Any other that see this transaction on blockchain can't know that this address is your and maybe can't even distinguish payment from the change, depending on how the transaction is made.
This is the most simple situation and the one in which you reveal less info, there are other factor that can reveal part of your holdings (i.e. if you use the same address to receive multiple payments, when you spend from that address, you will disclose the whole amount on it,  not only the UTXO you pick) but Bitcoin privacy is not so simple that can fully explained here.
You can read more here:
https://bitcoin.org/en/protect-your-privacy
https://en.bitcoin.it/Privacy

correct. but if person A has received 10BTC in one address only, than make a 0.1 BTC transaction to person B , privacy is gone. everyone will know the address of person A was having 10 BTC.
If instead a person A was receiving loads of payments, since the BTC protocol create a new address every time is used, than person B will have partial info from the public address person A sent the 0.1 btc
So the advice here for person A is to split the 10 BTC into different internal addresses of the same wallet ? or different wallets with differen seeds?


text:
Recovering dogecoin wallet
My brother and I had some dogecoins from way back.  He reformatted his hard drive at least once, maybe twice.
I have no hope in recovering them but I am going to try.  People are telling me to not even bother turning the computer on to use a program like Recuva or whatever.  They're telling me to keep it turned off and create an image of the hard drive.
I have no idea how to go about data recovery in a smart way.  If anyone has any advice it would be greatly appreciated.  If anyone has a data recovery company that is actually trustworthy and would likely not bone me, that would be great as well.  But I would like to approach this on my own if possible.


text:
I have a question. Can the price change if your transaction remain unconfirmed for a couple of hrs
I had to make a payment with bitcion to a wallet with specific amt. I made exact payment, but price bitcoin was going up. But my transaction was still unconfirmed till the evening. They rejected my payment bc the payment was a $3 more when they confirmed it.Can the price change if your transaction remain unconfirmed for a couple of hrs. It

In terms of value, the Bitcoin network knows only about satoshis and has no awareness of what other currencies (JPY, AUD, GBP, EUR, USD) peg to against it.
So when you create a bitcoin tx to send value to another party, that's always denominated in satoshis on the network; that doesn't change at all.
As you've observed, the dollar value may change if you paid a low tx fee, or the network was busy for the fee you paid, and therefore by the time it is mined, more dollar value may arrive, or less.
You've got a few options to avoid this - one is to pay a higher fee to reduce the time you're waiting for the tx (make sense on large valuable purchases), or to use the Lightning Network where fees are lower and settlement is near-instant.


text:
Decreasing Energy Consumption of Bitcoin's PoW with paired mining rounds
I found the following whitepaper on an algorithm called "Green-PoW" by the authors and i'm quite sure this would be a perfacet solution and also would get acceptance by the miners and the community.
You can find the white paper here:
https://arxiv.org/pdf/2007.04086.pdf
Key point of the paper here as a quote:

"In order to reduce the energy consumption in PoW, Green-PoW considers
mining rounds in pairs and adjusts the election mechanism during the
first mining round in the pair, to allow the election of a small
subset of miners that will exclusively mine in the second round.
Assuming the total network hashing power is equally distributed among
miners, a significant energy saving up to 50% could thus be achieved"

What is your opinion on this approach, are there any problems with this?

I think that implementing the protocol described in this paper wouldn't do much to diminish the total energy spent mining, but it would increase network instability and the potential for malicious miners to game the network to their advantage.
This protocol creates a condition where every other block actually requires that the miner to find 2 valid blocks in a row (the election block, and then the second round block), with a fall-back timeout of x minutes coming into effect after the first election block is found. Before x minutes has passed, the election winning miner(s) will have much less competition in trying to find the new block, so it seems to me that it is in their best interest to not publish their election block, until they also find a second round block! This way, the timeout condition will never be hit, but this also means that all other miners on the network will be working to mine their own election-blocks (and second round blocks), with little incentive to stop the search.
With this in mind, it is unclear if any rational miner would turn off their mining hardware ('mining-save-mode'), especially when considering that a miner will have many costs, including overhead (rent), staff, electricity, etc. Turning off their mining hardware will mean completely forgoing their chance of any revenue (the block reward), while only dropping their electrical consumption (and not any of their other costs). This only serves to put a high opportunity cost on any time spent not-mining.
Other issues I can see:

the bitcoin network has no mechanism for registering/identifying individual miners over time, so it is unclear how the protocol could restrict the eligibility of miners participating in the second round in each mining epoch.

The paper claims that the miner which wins the first round of the epoch would not
be allowed to participate in the second round, but it is unclear how
such a thing would be enforced. What is to stop the first-round winner from also attempting to find a 'runner-up' block and compete in the second round? Even if miners were somehow made to register an identity with the network (how such a thing would be possible is a big question in itself), what is to stop a miner from registering many identities, and switching between them?

There is no way to reliably enforce the time-out process for the second round. The network is asynchronous, it is not possible to accurately define '10 minutes after the election-block was found' as a starting point for the fallback process of allowing all miners to participate in the round to help guarantee network liveness. This creates instability at the chain-tip, as the validity of blocks created by the fallback process may be unclear to network participants.
This protocol may create incentives for miners to coordinate externally. For example: if I am a miner and I find a valid election-block, then I may want to sell the ability to participate in the second-round block to other miners! Doing so could help normalize my expected returns, while allowing other miners to reduce their opportunity cost of otherwise not mining in the second round.
Supposing the miners do not perform the election-block-withholding attack described above, in the event a single miner finds an election block, they may be further incentivized to perform a block withholding attack using their round 2 block as well! With little competition for the round 2 block, the miner would enjoy a much higher chance of having the withholding attack succeed, and they could begin searching for the round-1 block of the next epoch while withholding the round-2 block of the current epoch.

These are just some of my initial thoughts, I'm open to criticism of them, and there may be further issues I haven't seen. But at this time, I'm seeing a lot of problems that make this proposal somewhat uninteresting and untenable.

Perhaps also worth mentioning, I think that the premise of the paper is erroneous in the first place. The energy spent by bitcoin miners provides a mechanism by which the network is secured. Valuable things require security, and security cannot be gained for free. The openness of the bitcoin network simply allows a rather objective quantification of the energy (ie the opportunity cost) used to secure it, compared to other systems which have a more obfuscated or social form of security, that comes at a higher relative opportunity cost!

Like chytrik said, the paper is light on all the interesting details. How do the rules get enforced? How are miners identified? How is the global time agreed upon? Why wouldn't miners just hop pools for the second round? What happens when miners fiddle with their block template's timestamps to get a head start on mining the second round block in case the elected miners time out?—The consensus mechanism must work in presence of antagonism, but this doesn't even seem to stand up to passing scrutiny. If we could assume everyone to just follow rules, we wouldn't need a blockchain in the first place.
Anyway, even assuming that their proposal worked as intended, it would still not achieve a meaningful reduction in energy consumption. When miners spend half as much on energy for the same revenue that means they can increase their revenue by adding more hashrate... the equilibrium of revenue and cost is reached again when they spend about as much as with the original PoW.


text:
How can one join and leave Blockchain network?
As a newbie, it seems a bit abstract for me to imagine how Blockchain works! I'm curious that how my friends and I can join a Blockchain network? When we don't want to stay, can we silently leave and how can we do that?
Well, they may be stupid questions but as a beginner, I really want to understand them as clearly as possible.
Thanks a lot for your help

You mean joining and leaving the Bitcoin P2P network? Just open & close your node/wallet software...

@PieterWuille but where and how can I get a node, then any setups necessary? With the wallet, I just need to create a digital one, right?

Nodes/wallets are just software you can run: https://bitcoin.org/en/choose-your-wallet. They're all "digital", but if you're referring to websites that offer holding coins for you, those aren't generally to be in the same category (they're more akin to banks, which you have to trust). For those, it's really them that are connected to the Bitcoin network, not you.

Thanks a lot. I think I understood the concept and it's really a good start for me to go on

Let's say you want to send an email, so you type your email adress, your password and log in to your mail box, you type the mail receiver adress, and then send the e-mail
In case of Bitcoin, you want to send 0.001 BTC, so you log in to your wallet (A full node or an application in your phone or your desktop) you type the BTC adress, you type the amount, and then send the coins.
When you log in to your wallet, it's like you are connected to the blockchain via a node, when you sign out from your wallet you are no longer connected to the blockchain

There is really no "connection" to the blockchain. It's a data structure that some nodes have a local copy of. Logging into your wallet may or may not mean you're connected to the network directly - hosted wallets don't give you any connection at all for example, generally.

@PieterWuille Yes, that's right, just wanted to generally explain how it's for a beginner, thank you for the clarifcation


text:
Major changes to Bitcoin since original paper
Is there a history of the major changes/additions (as well as perhaps major proposals) to Bitcoin since the original paper by Satoshi? I realize of course that one can read through the BIPs and Bitcoin-Core release notes, but I was wondering if there existed a more concise historical "changelog" (or essentially a paper describing the facets of the current Bitcoin-Core implementation). The vast majority of Bitcoin (short) history resources that I can find are not at the level of specificity that I'm looking for (seeming to focus more on price history/external context), but reading through all the BIPs is perhaps more than what I'm looking for. Thanks!

I hope you know that the “paper” doesn’t really describe anything much about Bitcoin as a system, and is even completely incorrect in parts. It’s at best a short summary.

There is a list of all consensus rule changes: https://blog.bitmex.com/bitcoins-consensus-forks/ (This was released in 2017 but there hasn't been a consensus rule change since then, except for Taproot that has been locked in but not activated yet.)

Thank you @VojtěchStrnad, that's quite helpful! I'm certainly aware the paper is limited in its descriptions; is there some paper detailing Bitcoin as a system (and the history behind design decisions)?

Relevant: @David Harding's bitcoin white paper errata: https://gist.github.com/harding/dabea3d83c695e6b937bf090eddf2bb3


text:
Lightning Network: tricking a node to cancel transaction with revocation & money loss
After reading about Lightning Networks in this and similar articles, I realized that I don't understand how the protocol & the system prevents the following scenario:

There is an established channel between Alice & Bob.
The transaction outputs of the latest 'agreed' off-chain transaction are 1BC on Alice's side and 1 BC on Bob's side.
Alice & Bob initiate a new transaction.
Alice & Bob exchange their parts of revocation keys.
Bob decides to cheat and pretends to "disappear", not signing the new transaction and not responding, but still being online and monitoring on-chain transactions.
At some point in time, if Alice wants to free up her 1 bitcoin, she executes latest 'agreed' transaction, but her funds are locked for 2 weeks.
While pretending to be unresponsive, Bob is monitoring the chain and executes the revocation clause as soon as it happens, getting both bitcoins.

Obviously, significant time may pass between #5 and #6, but if Bob can afford to wait, he can pull that trick.
It seems that in order to avoid that, new off-chain transactions need to be signed in a single distributed transaction with the exchange of revocation keys, but I don't see how it is feasible. I've read multiple mentions that the keys are exchanged prior to signing new transactions.
I've read a similar question here, but I don't think it really addresses the situation I've described.
What am I missing?

You touch a point that is a bit subtle but never the less no problem. I have explained it step by step in the channel operation chapter:
https://github.com/lnbook/lnbook/blob/develop/09_channel_operation.asciidoc
TL;DR:
While changing the balance of a channel Alice does only revoke her tx and state after she has received signatures for the new state from Bob. Thus if Bob becomes unresponsive during the process and alice dies not have new signatures yet it is save for her to force close with the latest state for which she does have the signatures (as that state has not been revoked yet)
While moving forward the balance for a short moment each side of the channel temporarily has two fully signed but unrevoked commitment transactions. This is secure though as publishing the "old" state is not wrong while the new one is not fully agreed upon.

it seems the link has changed to https://github.com/lnbook/lnbook/blob/develop/09_channel_operation.asciidoc


text:
Bitcoin transaction not confirmed since 3 days ago
Hello I might sound stupid but it’s been three days since I issued bitcoin transactions, all unconfirmed so far. I use Blockchain.com to manage my wallet and have done everything normally (I think, as I usually do).
How long does it take for the blockchain to cancel unconfirmed transactions?
I am discredited in the face of my buyer and this situation may create problems for me in the days to come, I will leave the TXs of the transactions if u good will could help me that would make me very happy.
Here are the TXs:
e122bccd8ccbfe19f0263afb33b5458fa951d4c6ea71743e1bad9baabdbf3904
b51723ef74039503d966f2c90b05cf71774bbc12968ef60276996141ef561293

You set the fee rate to 6 sat/vbyte. That's very low, median fee in recent blocks has been 30-70 sat/vbyte. See mempool.space.
You could wait until the weekend when the mining difficulty is expected to drop by more than 25%. This will decrease fees as more blocks can be mined per hour. The difficulty drop happens around 1AM UTC on Saturday.
Alternatively, you could bump the fees. You have RBF disabled, but you could do CPFP (child-pays-for-parent). How you do this depends on your wallet. But it would basically spend the UTXO from your second TX (b5172...) again, but this time with a much higher sat/vbyte. Miners could then decide to include your 3 transactions in their blocks.
Given that you already created a descendant transaction, your new fee has to pay for a total of 3 transactions. So I would set it higher than the median fee rate from mempool.space.


text:
Why can't bitcoin be stolen in the following manner?
Assume I'm a miner. I would have the complete UTXO set with me. Let us say I try generating random keys and hash the public keys generated and compare it with the utxo set until I find a match.
When I find a match, I can transfer the money of that address to my own account since I would have the private key as I myself generated the key.
Why would this not work?
(I'm pretty new to bitcoin, so apologies if this is a stupid question)

What is your estimate of the expected time until the first success?

Related: https://bitcoin.stackexchange.com/q/105180/13866


text:
Bitcoin mining pre-computation benefits?
I asked this question on another forum but did not get any responses so I thought I'd try here.
I've been researching bitcoin mining for a while and I have a work-in-progress hypothesis that could potentially speed up the mining process. I am keen to seek some feedback on the viability of this approach.
I've identified a way that allows asynchronous pre-computation of a number of values that can be computed well in advance of knowing the hashPrevBlock. These are billions of pre-computed 32bit values that do not need to be re-calculated when the block height changes; i.e. they can be reused indefinitely. The only caveat being that ASIC miners would now rely on memory to fetch these values instead of having to calculate it for every new hashPrevBlock.
In my opinion, this saves a lot of energy and chip area as the ASIC miner no longer needs to calculate these values. These values can be calculated once in software and then 'fed' to memories that the ASIC miners have access to.
Any feedback on how this approach is flawed or a non-starter? I have read about memory hard PoW algorithms that are ASIC-resistant. Am I making Bitcoin mining ASIC-resistant by such an approach?
Surely there have to be benefits of being able to pre-compute gigabytes of data ahead of time that will simplify/speed up the Bitcoin mining?

Does this answer your question? Is pre-mining of a future block possible?

I've reviewed this already and it doesn't answer my question.
I'm well aware that one can't mine block X+1 until block X has been solved, as each block requires a hash of the previous block to be valid.
My question is more around the benefits of identifying precomputations for the next block and storing them in memory. Would this be a beneficial approach in hardware?


text:
External USB SSD not recommended for full node?
Peter Wiulle said:

Don't use an external drive connected through USB - such hardware is
not designed for the kind of heavy database load Bitcoin Core causes.

Why is that? Im using a Samsung T7 2TB on the USB 3.0 port, is a 16 core CPU, super fast. I have not seen problems using my Linux distro of choice and it was fully synced but now im worried. What could go wrong?
I bought this because in case I wanted to travel I could easily plug the drive on other computer. Also I don't use that setup for anything but to run the node so it seems convenient. It would just be so annoying to run this on a mounted SSD.


text:
How to use Bitcoin Core as a wallet without leaving no traces that used the wallet?
is it possible to open a wallet file, do transactions and anything you need, then backup the file inside a veracrypt container, move this file elsewhere outside of the drive running the full node and delete the unencrypted wallet.dat as well as the veracrypt container after moving it via shred or some other wipe option to really delete the files, and then make it impossible to know that this node was used to transact and make it appear as just an empty node in case that someone gained access to the node? (for instance, a government that passes a law that says running a node incriminates you as a potential Bitcoin holder that didn't pay taxes or what have you, which I think will happen in the future).
Anyway, the idea is to not leave any traces that you used the node to actually hold and transact any BTC but just as someone that altruistically supports the network but technically does not hold any, in case an attacker got in your house and saw you running the node.
I was considering using a Tails Live CD session. Install Bitcoin Core there eachtime one needs to transact or create new addresses, and since everything runs on the RAM, it would leave no traces, but im not sure if this is possible. Of course before shutting down the session the wallet.dat would go inside a veracrypt container and moved elsewhere
Which ideas do you have for this? plase let me know. Cheers

There is no reason why you couldn't run Bitcoin Core in a Live CD environment. I've done so several times myself.

Which distro would you recommend? Does it work on Tails? it makes sense for this goal of not leaving traces. The problem would be that you would need to build the binaries every single time unless you trusted built binaries to save time but there you are already compromising security.

It will work on any Linux distribution from the last few years. The Bitcoin Core release binaries only depend on the GNU C library version 2.17 or later, released in 2012.

Not entirely sure how to answer this question since I'm not sure what you're trying to achieve. But from what I'm reading, it looks like you're trying to send Bitcoin in a manner which is untraceable on your system.
If that is the case, then you don't need to run a full node. Transactions are stateless, so as long as you have the necessary information as well as software and/or libraries, you can craft the transaction entirely offline (on an airgapped computer) .
You just need:

Knowledge of the private key

Wallet's inputs

Knowledge of the recipient's address whom you want to send it to

Software or knowledge of how to craft the transaction and properly serialize it before signing

Once you've done those things, you can send your transaction through to any node to broadcast it. The decentralized nature of the network makes it inherently difficult for someone to trace exactly which point your transaction entered into the network.
There are multiple different websites you could use to paste your signed UTXO to.
Addressing the Node Issue
Whether you use your node or not, it will still be used by the network to relay transactions. This is how Bitcoin's network works. So whether they are your transactions or not, your node will be relaying someone's transaction(s).
From what I understand, node discovery is ephemeral to a certain extent - so once you 'tear down' your node, so to speak, peers will cease gossiping about the existence of said node because it is no longer a discoverable peer.
Concluding
It seems that you're under the impression that you must run a full node in order to send a transaction autonomously and this is not the case.
In fact, in my opinion, if you're really looking to send transactions through to the network in a manner that does not reveal that you ever transacted with Bitcoin, you would be best off crafting your transaction offline entirely, then finding a site somewhere that allows you to broadcast the transaction through their node (preferably via API if possible).
Doing this will ensure that your identity remains protected.
If running a full node is mandatory for you though for some reason, there's really no way to do so in a particularly private manner since the purpose of running a node is to be discoverable by the network and assist in relaying information to the rest of the peers around you.

I don't trust doing anything without a full node, see:
https://en.bitcoin.it/wiki/Clearing_Up_Misconceptions_About_Full_Nodes
So given that I need a full node, I want to know how one would hide any activity done on the online computer with the full node that has to do with the wallet, because you need the watch-only wallet in the online computer, to create the PSBT.
If someone gained access to the computer hosting the full node they would see you are doing transactions even if they cannot find the private keys = increasingly tyrannical governments can incriminate you for hiding money.

Honestly @walamagic generally I agree with you, but int his case, this person seems to be solely concerned with crafting a transaction and that's it. Also they don't want anyone to be able to detect that they are running a full node. So for these reasons, I think it would be counter-intuitive to run a full node as there would at least be evidence that the full node was used to relay at least some transactions.

@librehash Yeah thats why im trying to find a way to broadcast transaction without leaving any traces. One would just need to argument that you altruistically support the network but do not engage in transactions and its on their end to prove otherwise. At this point it would be your task to leave no traces and hide wallets. Of course the nightmare begins again when you realize Bitcoin Core can't let you spawn wallets with 12 words so now you have to hide a wallet.dat file somewhere. I must decide what is best.

I disagree with the notion that a full node necessarily means being discoverable or assisting with relaying information. The point is full validation - the rest is a service to the network you participate in or not. You can run Bitcoin Core with -connect=IP with IP the IP address of any other node you have some level of trust in for example, and it won't make any other connections. This even works over Tor.

@PieterWuille This is a fair point & I agree 100% when it comes to full validation. But imo, full validation only becomes relevant when you need the blockchain to confirm information / trigger other events (i.e., 'when John pays X,  e-mail him license key').
In OP's situation, it seems that they only are looking to send a TX and their only concern is in making sure that TX cannot be attached to any identifying info (assuming IP addresses included). [1/2]

@PieterWuille To address your point about connecting to a trusted node via IP to IP, I don't disagree here, but this kind of brings me back full circle to my original thesis of "why go through the trouble?"
Since TXs on BTC are crafted in a stateless manner (stateless = offline for anyone stumbling on this) - wouldn't it be more efficient (and perhaps more private) for OP to literally send his signed hash to that trusted node operator (via jabber / Tor, let's say), then have that trusted friend relay?

@PeterWiulle (last note) - think its worth taking into account the burden of increasing complexity for OP if he were to pursue this strategy. He must now know how to (a) set up a full node (b) likely host on-premise [VPS provider can+will monitor traffic, so that's out] (c) tunnel TX directly to friend (d) may have to use an ipsec vpn like strongswan (or noise protocol client like wireguard) so that there's some level of auth. [to protect against MITM since IP address could be subject to MITM, spoofing, etc.]


text:
How to use Bitcoin Core on a laptop as a hardware wallet
I would like to have the following setup:

Bitcoin Core on an offline laptop. Here the private keys are stored. Full disk encryption.
Bitcoin Core on an online laptop. Here watch-only addresses from the private keys in the offline laptop are imported to monitor funds without exposing the private keys online. The blockchain is fully synced. Also full disk encryption.

I have already downloaded the entire blockchain and it's synced on one laptop. Now im wondering how can I use the other laptop as a hardware wallet and broadcast transactions in the online node. As far as I know even if there isn't proper support for this like Electrum for some reason, it is doable. I reckon reading something about this and it was done with QR codes or something. I also would like to make this through the GUI to minimize screwing up in the process.
Any ideas? Thanks.

I don't know how to do exactly what you are asking, but I think you could use some wallet like Wasabi. Run it on the offline laptop with encrypted disk, and connect to local full node (bitcoind running on your online laptop) through local IP address. You can configure Wasabi to do that in the settings.
I use similar setup where my Wasabi wallet connects to a full node run through Umbrel on a separate computer on the same network.

I would like to use Bitcoin Core. Im only familiar with Bitcoin Core and I like the coin control features better than in any other wallet.


text:
How safe it is to store keys in Electrum? I think Luke Dash JR didn't recommend it
I agree with Luke Dash Jr and in general this wiki with the fact that doing anything without a full node is a mistake:
https://en.bitcoin.it/wiki/Clearing_Up_Misconceptions_About_Full_Nodes
But my question was in terms of just storing the keys in the Electrum wallet format to use in an offline gapped computer to sign the transactions and then broadcast on other full node computer online. Im just paranoid about the whole seed model. I reckon reading something to do with key derivation where if an attacker knew a private key of only one of your addresses and something else, they could somehow know subsequent addresses. Something to do with key derivation or something. I think this has something to do with it.
https://bitcointalk.org/index.php?topic=5265935.0
Im so paranoid to use anything but wallet.dat Bitcoin Core format that im not sure if missing on the clear advantage that being able to "spawn" your wallet anywhere in the world by remembering 12 words delivers, however, im concerned that you give away on security by using this. Why Bitcoin Core does not give you this method of wallet of knowing 12 words and being able to spawn your wallet if there were no tradeoffs?

Does this answer your question? Is there a reason to why Bitcoin Core does not implement BIP39?

Not really. Andrew Chow explained how BIP39 isn't considered secure and that is why Core does not implement it. But then he also explains Electrum does not use this anymore, yet Electrum still give you the option to spawn wallets with 12 words. On the Electrum website they say:
"Electrum 2.0 derives keys and addresses from a hash of the UTF8 normalized seed phrase with no dependency on a fixed wordlist.".
So the question would be, why isn't Core using this method for wallets then? Electrum devs still consider secure the "show 12 words for seed" method when creating wallet, why not Core?

What is a PR? @Prayank

Isn't that for coders only? a PR is to propose a code on github as far as I know, it's not a forum. Im not an expert enough to ask in that context so I came here in the forum.

Anyway, it's still not clear to me. Can someone a core dev to explain?


text:
Does Bitcoin Core install well in PureOS following this tutorial?
I would like to install Bitcoin Core in PureOS distro. I was going to follow this tutorial:
https://www.youtube.com/watch?v=lmMVoBgIzNc
Will this work or do I need to take additional steps, like installing some dependencies or stuff that PureOS is missing by default? What exactly?
I saw that Jameson Lopp uses PureOS for his node on a blog post so it's at least possible to use but not sure if I will encounter problems. Also I want to use the GUI.
Thanks


text:
Crossing borders: security scheme ideas
More and more airports force you to decrypt your data, they will also dump your stuff keeping a backup. This could happen in just about any border you try to cross. It is only safe to expect this to get more common.
The question: how do you keep your wallet.dat file safe?
-Full disk encryption: A big problem since you are prompted with a password right at the start when you turn the laptop on, no way out.
-Hiding it in some obscure file somewhere: Forensics have tools to find headers that match encrypted volumes made by popular encryption programs, so I don't think it would fly. Also realize that they do data dumps so your stuff would be there for them to find eventually.
-Putting your encrypted wallet file somewhere on the net: Where, and why would you trust this anyway? you don't control the servers. If you have to pay for the service, you have already linked yourself to the file. If it's free, you still can't trust these services, for instance these famous "end to end encryption email services". Who says they cannot access the data or that a database leak wouldn't happen? Plus the general not so nice feel of knowing a backup of your file is somewhere and even temporarily, once you delete it you don't really know if it was really deleted. Any encrypted file now is like a treasure for crackers since Bitcoin is a thing. Of course if we assume Bitcoin private keys are safe then a strong 64 character password should be impossible to bruteforce, but you must be able to remember this password on your mind, and im not so sure that you can generate a 64 character password strong enough that you can remember it while being safe from bruteforce.
Anyway, im looking for your ideas. Also because I only trust Bitcoin Core I do not store coins in Electrum so the "12 character password seed" is not a thing. HW wallets are just big signs that say "look, this dude has coins there" so it's pretty pointless. Im really out of ideas in how to try to move around borders while storing coins in the Core wallet format so please let me know your ideas. Cheers.


text:
Do I need to create a new backup each time I generate a new address even with HD wallet on?
I don't really understand this. Back then I remember there was something about how if you generated more than 100 addresses, you needed to backup because reasons. I don't remember. I never generated more than 100 so I didn't bother.
Point being, there was some change on the format of the wallet.dat that supposedly avoids this problem. So I was testing the latest version of Bitcoin Core. And I created wallet1.
Here I generated some addresses. I copied this file and renamed it to wallet2. Then I generated new addresses. I reopened again wallet1, and the new addresses that I created on wallet2 aren't found on wallet1. My question is, how could I get the same addresses I generated in wallet2 to show up in wallet1 considering they share the same seed?
Do I need to create a new backup each time I create a new address? Didn't HD solve this?
In practice what's the point if I need to create new backups anyway?
This is always been so confusing to me. Because im paranoid im just going to keep making a backup of the wallet.dat file each time I generate a new address.

You should not need to backup the wallet every time you use the wallet to request a new receiving address.
It may be that your wallet, by default, only displays addresses that have a non-zero balance associated with them or which have actually been used as outputs in a transaction.
An HD wallet can be fully recreated from the HD seed (or seed-phrase where used). Exceptions are where you have also imported a private key or watch-only address. You won't recover supplementary information such as labels/notes you have attached to addresses, transactions etc, as these are not in the blockchain and therefore not recoverable from it. However you won't lose money. You may also need to set the derivation path if using different software and increase the gap limit if you have generated many addresses but not used them.


text:
sha256 implementation
Hi I'm trying to use bitcoind's vectorized SHA256 implementation in src/crytpo/sha256_*.cpp in my project. On a first try feeding a block of 64 null bytes to SHA256D64 I obtain the hash {0xe2, 0xf6, 0x1c, 0x3f, 0x71, 0xd1, 0xde, 0xfd, 0x3f, 0xa9, 0x99, 0xdf, 0xa3, 0x69, 0x53, 0x75, 0x5c, 0x69, 0x6, 0x89, 0x79, 0x99, 0x62, 0xb4, 0x8b, 0xeb, 0xd8, 0x36, 0x97, 0x4e, 0x8c, 0xf9} which does not agree with openssl's output of f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b. Also the testvectors TestSHA256 in src/test/crypto_test.cpp have different outcome on openssl. For example "message digest" will give f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650 in that testvector, but openssl gives 3520b54ccec750d15256ada5b3d51cfddcec7fad1482f6bde2ea1c31a2c5b3a5. So I'm wondering what's the implementation difference?

Ah found my answer, bitcoin's implementation hashes twice the input instead of just once.

Yeah, the "D" stands for double.


text:
Send bitcoins directly from exchange to vendor
I want to buy something at a vendor that accepts btc only.
Can I buy btc from a website like switchere (I'd use SEPA transfer for payment) and send it to the Vendor's wallet directly instead of my own?
Help would be appreciated very much!

You should be able to as long as the vendor provides you with a BTC address in a format that the exchange you're using supports.
Also, some exchanges are known to censor transactions to some addresses, so there's a slight chance your payment might get denied. That's a risk you take when sending from a custodial exchange... not your keys, not your coins. On the flip side, if the exchange pays the outgoing bitcoin network fee, you'll save that cost.
Hopefully it will work for you.


text:
How to generate multiple legacy or segwit bitcoin address
I would like to generate multiple bitcoin (and litecoin) addresses via Bitcoin Core (and Litecoin Core). I saw this topic How can I generate a large number of Bitcoin addresses? but "keypool" does not work in the Bitcoin Core console (which is accessible with CTRL+T or in Window menu>Console). I saw that I can generate new address with this command line : getnewaddress label addresstype but it's a little bit long because I want to generate at least 100 address for each address type.
Thanks !


text:
Finding all BTC transactions from Dec,2017
I am doing a research and for that i need all successful BTC transactions that happened in Dec,2017. Is there a way to download this data ?

You can use the services of Blockchair for that, here is all the transaction that happened between the 1 and 31 december 2017 on the bitcoin blockchain:
https://blockchair.com/bitcoin/transactions?q=time(2017-12-01..2017-12-31)
For download you can scroll to the date you want here: https://gz.blockchair.com/bitcoin/transactions/ and download each day of december


text:
Already mined block hash showing zeros at the end when I hash it in online sha256 two times
Hi I tried hashing a already mined block with this block header 04E0FF37f09be87b288284c8e93a04fff7b4ac9b72178c2e6b4e0a00000000000000000035788eca05bccfaede03db9cb6276e9f7c125687b9321939755f03d73f15bd25C4F2EE60CE9813175230D962 of this block and I hashed it two times but the output zero are at end of the hash. b11f24d772b9fee7132b62e0bd17fefa76d29848e6930c000000000000000000
How does it work

You’re falling afoul of endianness. To promote equality, Satoshi sought to use Big Endian representation for hashes in Bitcoin, which have the byte order the opposite of what you are producing.

Should we little endian the output hash?


text:
Selfish mining attack: Probability of block being mined - CS251 exam question
I am currently studying for the CS251 Cryptocurrencies and Blockchain Technologies exam. In a past exam, there is this question without an answer and I would really appreciate your help so that I can better understand it:
Recall that a selfish miner temporarily refrains from publishing mined blocks in an
effort to get several blocks ahead of other miners, thereby causing other miners to
waste effort mining orphan blocks. When a selfish miner is only one block S ahead of
the public chain, if another miner mines and publishes a block O at the same height as
S, the selfish miner immediately publishes S. Let γ be the probability that, when this
happens, an honest miner will try to mine the next block on S instead of on O.
A) How can an attacker ensure that γ ≈ 1 (in other words, S almost always overrides O) on today’s Bitcoin network?
Thank you very much in advance for your help!

A guess: what if the selfish miner deliberately omits from S a number of high-fee transactions that are in O?  Then other miners have an incentive to mine on S, because then they can claim the fees of those transactions, whereas with O they could not.

@NateEldredge That's a good one! I would not have thought of that.

@NateEldredge thanks! So you mean the selfish miner omits the high transaction fee transactions so that miners have the chance to get a block with them for the next block?

@Python-Data-Science-Learner: Right.  But I don't know if that's what your exam has in mind.  I also don't know whether your exam would consider a miner "honest" who would  mine on S instead of O to get more fees, despite having seen O first.