text:
Force Closing a BTC lightning channel on Umbrel
I requested to close a lightning channel on my Umbrel node. Sometimes this is a quick process. And other times it takes days. It's been like 2 days now that a lightning channel with peer "Lightning. Watch" has been closing. It is still not closed. I can't find an option to force close.
However, I do see on Ride the Lightning App on Umbrel (under peers/channels) that the channel is pending force closing. Should I be worried?
This is the first instance where it has taken longer than 1 day to close a channel.
Any thoughts?

This seems pretty normal. When you force close a Chanel this means that your node publishes the latest presigned commitment transaction. However we have no way of knowing if is really the latest or an older one. That is why there is a timelock on your own output which gives the other party time to invoke the penalty mechanism in case you didn't vpublish the latest commitment transaction.
I don't know your config or the defaults in umbrel but a typical timelock value can be 2016 blocks which is equivalent to about 14 days. If you had posted the short channel id of your channel (potential privacy issue) we could probably have investigated further what exactly is the situation of your force close as we could lup the transaction on chain

Thanks for that info! Interestingly enough as soon as I posted the question here, the channel closed :)


text:
What actually did Alexander Vinnik / BTC-e do?
As far as I undesrstood, Vinnki / BTC-e just allowed anonymous operations, nothing more. They didn't steal money, Vinnik didn't launder it himself. Other criminals just used BTC-e for their activities, while Vinnik himself wasn't familiar with the criminals.
Is this true?
If this is true, then how does it work? The owner of knife store is responsible for crimes, commited with his knives or what?
Why doesn't Satoshi Nakamoto responsible as he also has created a tool, allowing anonymous money transactions?

What actually did Alexander Vinnik / BTC-e do?

According to ZDNET

A French judge has sentenced today the founder of the now-defunct BTC-e cryptocurrency exchange to five years in prison and a fine of €100,000 for laundering funds for cybercriminals, including ransomware gangs

According to The Guardian

During his time in the digital currency market, US authorities allege Vinnik facilitated crimes including hacking, fraud, identity theft, tax refund fraud, public corruption and drug trafficking. Greek police described Vinnik as a “an internationally sought ‘mastermind’ of a crime organisation”.

There were other, as yet unproven, allegations of crimes including direct involvement in ransomware activity and theft of Bitcoin from the MtGox exchange.
So Vinnick was not simply the owner of an exchange unknowingly used by criminals. He was convicted for knowingly receiving and laundering the proceeds of criminal activity.

I suspect it is casuistry. Given the fact, that many bitcoin exchanges are doing excess identification, passport verification etc, which contradicts the ideas of cryptocurrencies, we can conclude that somebody force them to go againt that ideas. For example, Vinnik could regarded as "knowingly" participating in laundering just because he knew that clients were anonymous and knew that "honest people doesn't need anonymity".

source: Stack Exchange

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

sort: votes


text:
Unable to start BitcoinCore: Unable to start HTTP server. See debug logs for details
After long time of not running Bitcoin Core I ran it and got:

Config file was:
 # server=1 tells Bitcoin-QT to accept JSON-RPC commands.
server=1

 # You must set rpcuser and rpcpassword to secure the JSON-RPC api
rpcuser=user
rpcpassword=password

According to recommendations from other post, I have added this to config file
# added
rpcallowip=0.0.0.0/0
rpcbind=127.0.0.1
rpcbind=bitcoind

but it didn't help.
Log file is following
2022-10-28T21:02:52Z Binding RPC on address 127.0.0.1 port 8332 failed.
2022-10-28T21:02:54Z libevent: getaddrinfo: nodename nor servname provided, or not known
2022-10-28T21:02:54Z Binding RPC on address bitcoind port 8332 failed.
2022-10-28T21:02:54Z Unable to bind any endpoint for RPC server
2022-10-28T21:02:54Z Error: Unable to start HTTP server. See debug log for details.
2022-10-28T21:02:58Z Shutdown: In progress...
2022-10-28T21:02:58Z scheduler thread exit
2022-10-28T21:02:58Z Shutdown: done

What else can be done?

rpcbind=bitcoind

In the question you referred to, "bitcoind" is supposed to be the network-name of the computer on which bitcoin is running.

# local DNS name (container name used in my Docker Compose file)
rpcbind=bitcoind

Open a command prompt window and type the command hostname to find out the network name of your computer. If the hostname shown is squonk, double check it by using the command nslookup squonk or equivalent (e.g. dig squonk or host squonk on Linux)
The clue in your log file is this pair of lines
libevent: getaddrinfo: nodename nor servname provided, or not known
Binding RPC on address bitcoind port 8332 failed.

If you run bitcoind with the -help option it tells you
  -rpcbind=<addr>[:port]
       Bind to given address to listen for JSON-RPC connections. Do not expose
       the RPC server to untrusted networks such as the public internet!
       This option is ignored unless -rpcallowip is also passed. Port is
       optional and overrides -rpcport. Use [host]:port notation for
       IPv6. This option can be specified multiple times (default:
       127.0.0.1 and ::1 i.e., localhost)

You could then change the line in the configurartion file
rpcbind=squonk

Your extract from the log file omits the line before
Binding RPC on address 127.0.0.1 port 8332 failed.

But those few lines before the above may tell you about a more important problem that is the root cause of your difficulties.

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


text:
How to get data, required to mine one block and how to send results back to BC network?
Suppose I posses quantum computer, which can reverse SHA256 in one microsecond. The only thing I want then -- is to mine one block. After that I will throw away my computer and go to Hawaii.
Hence the question is: how to get current block from Bitcoin network, and how to send my work back to it?
May be there are some linux commands like
downloadcurrentblock > data.dat

upploadresults < data2.dat

I need something maximally simple to do exactly this: receive input information and send output information.

Mining software and a wallet do this for you.
Of course you would have to modify the software, so instead of repeating hashing you just submit your solution.
Nothing currently exists that is ready for your scenario.
Also, have a look at these two bitcoin RPC calls:
getblocktemplate
submitblock "hexdata"

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


text:
How to buy bitcoin to my local harddrive?
There are stories about people searchung dumps for their thrown away harddrives with bictoins with brazillions of money. I want to get such harddrive too :)
Is it possible nowadays? I.e. buy bitcois directly to my wallet, without any third party accounts?
I registered on CoinMarketCap and coinbase and looks like first site doesn't allow to buy bitcoins and another is maintaining it's own accounts with their security and 3rd party auth. But I don't want their accounts, I want my on my local selfcontained harddrive.
Is it possible?

I'd suggest you to:

Look into hosting your own bitcoin node.
Try using P2P non-custodial non-kyc exchange, you can find the list here.
You may want not to store your wallet on a hard drive. The suggested
solution is to own a hardware wallet


text:
Do I need to register my shiny new Crypto with some agency if I want to pay someone with it?
While I am guessing that, as most anyone can create a crypto and sell it or accept it as a form of payment, that it would be legal to give crypto as a form of payment (as bitcoin originally did with the Pizzas). However with SEC (or possibly some other government body) wanting to regulate and/or tax cryptos I wonder, am I allowed to give crypto as a form of payment without some sort of registering it with a government agency? I have not found any laws prohibiting it and can only find info about registering ICOs with SEC (in the US). Any thoughts?

If you agree to buy your neighbour's old lawnmower using buttons and lint as payment, the SEC don't want or need to know about your novel form of payment.
The same generally applies to other forms of payment.
Generally where a taxable event occurs, you have to work out the equivalent amount in some government approved currency. For example, if the price of lint skyrockets and your US neighbour sells her lint stockpile for huge profits, she'll probably have to work out the dollar equivalent and pay some sort of capital gains tax. But this is different from registering lint as a currency - you don't have to do that.
Where government agencies mostly like to be involved is when  you are setting up some sort of financial institution or money handling business like a payment processor. The creation of BItcoin did not involve the creation of any financial institutions or money handling businesses. In fact it was designed to do away with that sort of third-party that needs to be trusted. Such institutions may have crept in and taken over a lot of Bitcoin usage but that does not mean the SEC are after Nakamoto to register Bitcoin. If Nakamoto had needed to register Bitcoin in 195 countries beforehand, it would never have got started. Ditto any cryptocurrency or lint-based system invented today.
Of course all this depends greatly on jurisdiction. The rules in Burkina Faso may differ from those in Ecuador.


text:
Which crypto currencies have shortest payment address?
Different crypto-currencies have different lengths of payment addresses.
For example, LTC address length is 34 case sensitive letters and numbers.
NXT address length is 20 digits.
Short payment address can be easier to remember, read, write, compare and transmit by phone, which makes it advantage of crypto-currency, making it attractive investment, doesn't it ?

The human mind can remember approximately 7 digits quickly and easily. That's how you can remember US phone numbers (sans area code) without even thinking about it. However, when it gets to 10 digits it starts to reach the limit of working memory, and 20 digits is definitely out for most people. Of course, if you actually spent the time to try to memorize it, 20 digits is a lot easier than 34 alphanumeric characters.
That said, I don't think the benefits justify the costs. Cryptocurrency is designed to be used by people with access to a computer or smart device. Copy-pasting is a lot easier than trying to remember a bunch of addresses. Granted, it might be useful to remember one address, your own, that you can give out to people in conversation. But these days most people have their smartphones on them wherever they go. Also, regarding "transmit by phone": Only if you use a touch-tone phone. Otherwise, you can just copy-paste and then SMS/email/submit it to the other party.
What disadvantages are there? Well, now that there are only 10^20 addresses, or 66 bits - much less than the 160 bits of Bitcoin and pretty much all of its clones, decreasing security. Moreover, this also means addresses must be generated on-network to prevent the possibility of duplicate addresses and registered as an account. For NXT, only 12 billion addresses are necessary for there to be a 50% chance of collision (a la birthday paradox). For Bitcoin, 1.4 septillion addresses need to be generated for that to be the case - which for all practical purposes, will never be generated. So people can generate addresses without being connected to the network and be very confident that no one else has ever generated the same address, making cold storage solutions easier, for instance.
Edit: To answer the question in the title: I only know of two address schemes, Bitcoin-like and NXT. For Bitcoin-like addresses, the first character is always something which identifies the coin (not uniquely - multiple coins, including Bitcoin, begin with a 1, Dogecoin and Digitalcoin both begin with a D, etc.), followed by a 160-bit hash and a checksum. Then you have NXT, 20 base-10 digits. I don't know of anything shorter than NXT, and any shorter would be unreasonable given the increasing probability of collisions.

How did you calculate 50% chance ? 12 billion addresses fit into 11 digits, we got 9 digits left, meaning that chance of collisions of each new address is 1 in a billion. Only for billion new addresses chance will be 100% for one of them to collide. In order to ensure collision does not exist all it takes is to send one transaction to the NXT network.

See birthday problem - sometimes called the birthday paradox for the exact same reason you're questioning the math, because it's unintuitive. If d is the size of the space, then you need sqrt(2d ln 2) samples for a 50% chance.

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


text:
What is the point of comparing sha256 of downloaded file with published on the same website code?
Some websites publish sha256 to check authenticity of downloaded file.
I suppose this is to protect against man-in-the-middle attack - that my file was not altered during download.
What prevents man-in-the-middle from altering web traffic and fix hash code that I see to match malicious downloaded file ?
Those sites often do not provide SSL, so capturing and fixing HTTP traffic is easy, all it takes is to work with my ISP or some backbone router.
There are even sites that allow to calculate sha256 by uploading file over unsafe HTTP with no SSL - ridiculous isn't it ?
Not only I have to trust that this website does not work for government, I also have to trust my ISP by connecting without SSL.

This question appears to be off-topic because it is not about bitcoin or cryptocurrencies but about general security and verification. It would probably be more at home on another StackExchange sub-site.

I somewhat agree, but I planned to ask it together with this question: http://bitcoin.stackexchange.com/questions/24489/using-blockchain-to-publish-downloadable-software-verification-codes and then decided to take them apart.

Agree - though nice, this question pertains more to another S.E. site

Which site ? I don't know how or do not have permission to move it. I guess somebody with higher rating could move it for me.

Nothing. It is mostly only useful for checking data integrity, not detecting malicious modification (unless you know someone trustworthy that signed the hash). SSL has the same problems though, because public keys can be altered too of course.
There are multiple solutions to this problem, although none is perfect.

Trusting some central authority to decide who is trustworthy and who is not (i.e. Certificate authority). This approach has been shown multiple times to be dangerous, see DigiNotar for example.
Building a web-of-trust, the method PGP (and later GPG) implemented.
Circumventing the normal network with private lines and routing (the military approach), or wait for quantum encryption to become available.


text:
Restore lightning network node/channels
If one wanted to restore a lightning network node, what files have to be saved?
I read that saving hsm_secret is enough to restore private key(s), but I also read about a problem with channels. How channels are restored after a re-installation of lightningd and the "pasting" of hsm_secret file?
And, if it is impossible to restore channels, how to force the closure of them so that one can retrieve all locked funds?

in c-lightning all the state information is stored in the lightningd.sqlite3 database. so if you shutdown your daemon and you copy hsm_secret as well as lightningd.sqlite3 you should be able to fire up the node again and have your channels operating (I did this already)
You have to be carefull though. If you start the node with an old backup of lightningd.sqlite3 your channel partner might think you try to publish old state and will close the channels and redeem also your balance.
with only the hsm_secret it will be hard to close channels. you can derieve the keys you used but you are missing the signatures of your channel partners to reconstruct the commitment transactions. Technically (not 100% certain how the implementation handles this case) you can try a collaborative close with the third party just with your hsm_secret since you know the keys to the funidng txs and with the other party together you are able to spend them. However you would have to trust the partners to provide the correct channel balance that you previously had agreed upon.


text:
Why does Binance use USDT instead of USD?
binance seems to have BTC-EUR but no BTC-USD. I can see BTC-USDT. Is this the closest one to trading BTC-US dollar?

It makes sense to me that they don't offer a USD trading pair, as binance does not have access to the US banking system, much less so to the or a federal reserve account.
How they are able to represent the euro in the first place within their exchange/framework, i don't know. That would mean they would have an account at a EU bank and subsequently at a NCB within the eurozone, which i highly doubt given they operate with and within "anonymous" accounts. (I highly doubt this would be allowed by the ECB and subsequently their commercial bank), If anyone could shed some more light on this and how this would actually work (I fear I might be wrong here.), I'd be extremely interested.
Before thinking you can use USDT as a safe haven, you should note that more often than not, these "stablecoins" are not backed 1:1, or at least not proven to be, and that while they might be stable as of right now, that that is not a guarantee for the future.
USDT in particular lacks audits. A quick google search on the topic will give you a wide range of articles why they're so controversial.
Anyway, to answer your question, yes, USDT is probably the closest to representing the value of an actual dollar, but, as i said, it is NOT an actual dollar, and you should be really careful using them, or preferably; not use them at all.

So other exchanges (e.g. Bitfinex) have had BTC-USD for ages. Why is binance so different? I just need the value of BTC in US Dollar for a presentation. I am not involved in trading cryptocurrencies so would not hold USDT. Do you think using data for BTC-USDT (and in fact *-USDT) would be a good approximation to the exchange rate against the US dollar?

Do you think using data for BTC-USDT (and in fact *-USDT) would be a good approximation to the exchange rate against the US dollar?                                                                         For the aforementioned purpose, i wouldn't see why not, - unless you really care about small discrepancies, in which you'd probably take a weighed average from several BTC/USD exchanges such as Bitstamp/Coinbase/Kraken.

You might find this interesting https://bitcoin.stackexchange.com/questions/95483/the-purpose-of-usdt-and-other-stable-coins

which i highly doubt given they operate with and within "anonymous" accounts not all of the Binance accounts are anonymous and also Binance is registered in Malta, so I don't see any reason why they can't have a business or company account in Maltese banks (= Euro banks)


text:
The purpose of USDT (and other stable coins)?
Any institution that trades cryptocurrencies is not classified as a financial institution by definition. Therefore, any exchange involved with cryptocurrencies only is not subject to financial regulation and control (much like computer games with in-game currency and economy aren't). However, I suspect if an exchange lists BTCUSD or BTCEUR then they are dealing with a currency issued and regulated by a central bank and therefore become subject to financial regulation.
Am I correct in concluding that the purpose of coins mirroring real world currency such as USD is to allow an exchange to deal purely with cryptocurrencies and avoid falling into the scope of financial regulation yet have a cryptocurrency (in this case USDT) which is tightly linked to a real world economy (US and world economy)?

This question has multiple flags citing it as unrelated to Bitcoin. I disagree, because the main gist of this question appears to be about cryptocurrency regulation, and whether stablecoins are an effective means to sidestep friction caused by fiat. This is a fairly general topic that does impact Bitcoin users. I have therefore voted "Leave Open".

A very good question that still has no answers


text:
What money transmission licences are relevant to Bitcoin?
Tradehill was shutdown for various regulation issues, including not having the required money transmission licenses.
What were the money transmission licenses that were required?
What other compliance rules should be followed?

Since it was wrong, I'd remove the reference to Tradehill and keep the question general.

Tradehill got shutdown because it went bankrupt when Dwolla started reversing money transfers made to them despite their terms of service stating that no chargebacks could occur (at the time). There is currently a lawsuit pending.
The required licenses will vary depending on the legal context and the interpretation of the business, made by the relevant legal authorities.
There is a lot of legal uncertainty surrounding Bitcoin, but there is one thing that is pretty certain : in all jursidictions you need a license to maintain fiat-denominated balances on behalf of third-parties.

I recently co-authored an article that contains some background information to your question.  William B. Fleming and Joseph Evans, Bitcoiners in the Courtroom Part I: Government Oversight, Ford. Corp. L. Forum (Aug. 20, 2013)
Bitcoiners in the Courtroom: Government Oversight (PDF)
Bitcoiners in the Courtroom: Government Oversight (TXT)

Thanks for the info; also an aside - I'm a Fordham alumni as well :)

There aren't many regulations to transmitting bitcoins. Probably do some extra reserach, but it seems safe and clear

Technically bitcoins are not transmitted at all so it would most certainly not apply. It only appears this way to the user.

Tradehill was not shut down due to a lack of money transmission license.
But to the point of your question of what is required to maintain compliance, no one can really answer that as it depends greatly upon jurisdiction.
Now, IMNAL, but I would say that a general rule is that if you are operating an exchange, you probably are playing with fire in a legal sense.  There are a lot of organizations worldwide that will claim authority over that type of business.
However, a company like BitInstant and Coinbase are probably more in a safety zone for the simple reason that they are buying and selling their own stock of Bitcoins rather than doing so on behalf of a third party.  This falls much more under local jurisdictions and licensing requirements would vary greatly.  Does it require a money transmission license to operate this type of business?  Maybe.  It depends if the jurisdiction considers Bitcoin to be money or commodity.  If it considers Bitcoins to be a digital commodity, then you probably just need a business license, and perhaps a sales tax license.  If it considers Bitcoin to be money, then you likely will need a money transmission license, currency exchange license, or even potentially a banking license.
Again IMNAL, and you should certainly consult one before starting any type of business, let alone one in the Bitcoin arena.

FinCEN is still looking at what regulations if any will be pushed on to bitcoin industry. Like it or not and folks can stomp their feet, hold their breath until they are blue in their face but there is no doubt regulatory authority will be pushed on Bitcoin Industry.
OR- They could make it illegal. Going back to the civil war the US has outlawed alternative currency (my term)
To answer your question the Money Transmitter Regulatory Association and State regulations should be your guide. Different types of transactions fall under MSB rules/regs. In general there are likely going to be around 45 states that will require some type of regulatory oversight and licensing. Some will only care if the transaction means funds will be held in a balance or stored value account. some will say only the exchanges will need to be licensed.
Our company is working on that stuff now plus ways to monitor coins to prove it is not the proceed of a crime.
For a bitcoin to be relevant in the coming months and years it will unfortunately need to be regulated. Banks, businesses etc. don't want to be put in the position of accepting bitcoin that was received for selling drugs, illegal weapons, child porn etc. Because that puts them in the position of helping to launder funds.
So WE the People need to come to terms with some things. We need to work hard to ensure that any regulatory authority is correct and not too cumbersome.
I believe with every fiber of my being that the bitcoin community/industry can make bitcoin FAR (as in light years) ahead of cash as far as ensuring illicit use doesn't become the major factor. Cash is a low tech piece of paper. Bitcoin has everything I need as a compliance officer to ensure that when Cathy wants to buy something with her coins that the btc involved were not the proceeds of crime.
And make no mistake- the criminal element is there and they are some of the loudest voices (or their proxies) calling to resist any kind of regulatory oversight.
It is my hope that the btc community starts to reach out to their political representatives and news media to present the case that btc is safe. VERY safe. People may scoff but they'll listen. We just need to voice our concerns politely and factually.
BTC and be more revolutionary than anyone thought possible. We just need to make sure we all do the right thing.


text:
When does MtGox "volume" get reset?
What time of day (in GMT) does the volume get reset to zero?
I'm trying to correlate this with the charts, however I'm unclear as to when this actually would occur

I'm pretty sure it doesn't. The volume includes all transactions within the past 24 hours. If it did, you would have to compare volumes at the same time of day (or correct) to get an idea of how much activity there was, and that would be extremely annoying. And there would be one time of day when the data would be useless. Why would anyone do things that way?

It is a moving sum, it sums up the volume for the last 24 hours of trade.
Bitcoin trading never closes, so the usual way of calculating volume as the sum of trades that happen between the open and close of the market doesn't apply.

If you are referring to the volume displayed at the top of their site, that's a rolling 24 hour number.
If you are referring to the volume displayed in BitcoinCharts, then that is 00:00:00 to 23:59:59 UTC.
Also, the Bitcoin Charts metrics are per-market, so BTC/USD has its own volume as does BTC/EUR, BTC/GBP, BTC/JPY, etc. Whereas the volume number from Mt. Gox's site appears to be the total for all seventeen currency markets they operate.

You sure about the 00:00:00 to 23:59:59 UTC thing? Bitcoincharts displays the same moving sum as Bitcoin-Central.net does, you think it's different for MtGox ?


text:
What is the "unit of account" in terms of Bitcoin?
Traditional economics depend on a "unit of account".  Can anyone explain how a "unit of account" would be manifested in Bitcoin if so desired?

The "unit of account" is "what all your numbers are denominated in".
For instance you might work day-to-day in dollars/ pounds and yen but your unit of account may be dollars. Everything would get totalled up in terms of "dollar equivalents" and you would typically report in dollars.
You can choose whatever unit of account is convenient to you.
The obvious one to use is simply bitcoin. You have all your accounts in bitcoin and report in bitcoin.
However you may have to report yearly accounts to (in the UK) Companies House who want to see reports denominated in pounds. Say because of this you decide to have your unit of account to be pounds.
Thus you need a rule for converting your bitcoin to your unit of account, pounds. Perhaps you choose a daily conversion rate and convert all bitcoin received that day to pounds. (Or you might use another conversion algorithm).
Your unit of account is what you measure your money in.
It is a bit like measuring distance in centimetres or inches or light years. Choose the unit of account to be the easiest for what you are trying to achieve.


text:
What research papers cover Bitcoin's impact on Central Banks, "velocity of money", and reserves?
I'm looking for research papers that cover the impact Bitcoin may have on Central Banking, interest rates, velocity of money, and their reserve.
What research papers or information from thought leaders exists w.r.t Bitcoin's impact on economic matters?

I think it's much too early to expect that kind of academic research. At this point it would be mostly speculation anyway.

@David ostensibly your assumption is wrong. See my answer.

The Velocity and Dormancy of Bitcoin. It contains important observations and links to a research paper.
See also the comment I added to the bottom of that blog article, which should appear if the owner of that blog accepts my comment, which is quoted below.

You assume that only “change” needs to be removed from the total of
  transactions when computing the velocity. Transfers to self in and out
  of the system also must be removed, because only the fee in money
  transfers is part of the GDP when the transfer is not to another
  person for a real good or service. Ditto your section making the
  erroneous claim that transfers in bitcoins external to the main
  database should be factored into the velocity without regard to
  whether they are transfers to pay for a good or service.
I find it unfathomable that every Bitcoin owner is spending his entire
  balance 7 times every quarter. This would require he has the means to
  receive bitcoins 7 times every quarter from someone else paying for
  goods and services. Such a Bitcoin economy does not exist.
If data is analyzed more deeply, perhaps with the aid of data from the
  FX services, I am confident that vast majority of transactions would
  be transfers buying in and cashing out of Bitcoin, or moving money to
  self across borders and through exchange vehicles such as real estate,
  etc. There are not that many merchants accepting Bitcoin. It is
  fathomable that there might be a significant quantity of illicit or
  black market transfers, since Bitcoin aids anonymity. However, even if
  so, such markets can not likely scale to velocity of fiat for the
  mainstream population. Also FinCEN is preparing to crack down on this
  market sector.
As you noted, the problem with computing dormancy in Bitcoin is there
  is no way to know which are transfers to self. Perhaps one could make
  the reasonable assumption that large value transactions that paid a
  significant transaction fee are not likely transfers to self, since
  one would be motivated in that case to likely tradeoff speed of
  verification for cost.
Since FinCEN will be regulating transfers (to self or other party),
  but not transactions in exchange for goods and services, users do not
  have an incentive to reveal the data we need.
So perhaps the only metric that is reliable is your weighted-average
  of dormancy relative to itself, not as an indication of relative
  velocity to those computed with GDP. I think that may have been your
  intended point, but IMO you did not elucidate it.
Your weighted-average of dormancy is not Bitcoin Days Destroyed—
  the latter weights the past dormancy of coins that have been
  transferred over any chosen period, whereas yours is a snapshot of the
  current dormancy of coins. The histogram of the percentage of Days
  Destroyed graphs distribution of dormancy over the measured period.

Update: I expounded on why the 7 velocity is not likely at this time for Bitcoin.

Too bad the article is unreachable now. I get this message: ""cryptonomics" is not available at the domain cryptonomics.org right now. This domain expired, and it has to be renewed before it is lost."
I couldn' find it anywhere else.
Could you please repost it at a free blog anywhere? I'd really love to read it.

I don't have a list or a wiki listing all the relevant documents, but the European Central Bank produced this document which covers several types of money schemes including Bitcoin.
Perhaps some lessons learned, and advice from this document can encourage adoption of Bitcoin.


text:
In a closed, working test network, how would I generate a signed block that a Bitcoin miner would otherwise create?
I have a POC where the essential, critical, priority goal is to use C# and the .NET Core Framework (Bouncy Castle for crypto, or Microsoft primitives for BigInteger ) where I do the following

Accept a number of transactions that include zero or some fee attached to the transactions (P2P pending Tx queue)

Calculate the relevant block reward and send it to an address as defined in the block specification format

Calculate the block's Proof of Work value as specified in the Target or other similar value (difficulty)

Finally submit the following, as calculated by NBitcoin, into the REST API in the full Bitcoin RPC client (isolated test network)

Any assistance in linking NBitcoin to a "software-CPU miner" just as if Bitcoin was invented originally in 2009 would be greatly useful for the prosocial endeavors I'm currently engaged for.

I will add a bounty of SO points and relevant other gratitude if this works.

It's hard to help without knowing where you're stuck. You could first look at the mining pseudocode and implement it without any regard to performance, and once it's working, copy-paste SIMD mining code.


text:
How do I list all of my addresses in namecoind?
I just created a new address using namecoind getnewaddress and am trying to figure out what command lists them (in case I forget mine).
What is the command to list my addresses (that I have a private key for)?

namecoind listreceivedbyaddress 0 true

0 means to include even transactions with no confirmations, true means to show even "empty" addresses


text:
Do vanity addresses lower the security of my key? (reduced complexity)
Do vanity addresses somehow decrease the security of my private key?

No they do not.
A vanity adress is only trying to pattern match a specific part of an address. The complexity remains the same.
To generate the vanity address it usually takes millions of attempts per second to find a public key which matches your pattern. This is done by cycling through private keys and and checking the corresponding public key.
If an attacked was to do the same thing then they would still need to cycle through every combination of your pattern aswell, which is just as extensive.

They do if you reuse the address multiple times. When you spend coins sent to an address your public key is exposed to the network. This reduces security slightly.
Address reuse also leads to a loss of privacy. Remember all transactions are public information. By reusing the same address over and over again you are letting the world know how many coins you are receiving and sending!


text:
How does Bitcoin protect itself from invalid peers from being broadcasted?
From what I've inferred, is that Bitcoin gets a list of peers from other nodes.  What is to prevent a malicious node from

Sharing many ip addresses that will cause timeouts and a delay in block replication?
Using the getpeers to cause a DOS attack on an unsuspecting person/website?

The client connects to peers in its database randomly (?) so even if given a set of IPs of peers in which all IPs are invalid (connection fails), the client will only be slightly disrupted by this.
A node with a lot of invalid IPs in its list of peers may take longer to find a peer that it can connect to, but at the same time that lack of connectivity prevents it from receiving any new transactions from the network as well.  So there's no increased risk of accepting a transaction that ends up being a double spnd.
This receipt of non-usable IPs can cause this specific node to not get a new block in a timely manner, but because nodes remain connected most of the time there isn't a system-wide issue just because some of the nodes remain disconnected longer than they should when switching to a new node.
When the node does come across a peer IP that it cannot connect to it will ban the node and not attempt to connect to it again for at least 24 hours.


text:
What is "safe mode" and how does it affect RPC Commands?
The source code here has a list of RPC commands and a "okSafeMode" parameter.
What is the purpose of this SafeMode and how does it affect the usage of the client?

When Bitcoin-Qt detects that something is seriously wrong with the network, it disables most RPC functionality in order to prevent automated Bitcoin sites from losing a lot of money due to network problems. (The okSafeMode functions are not disabled.) All versions since ~0.3 go into safe mode when the longest chain is invalid (illegal transaction, creating too much money, etc.). Upcoming versions will also go into safe mode when a large fork (valid or invalid) is in danger of overtaking the current chain.

I thought that the longest valid fork was in fact the "current chain".


text:
Looking for unit testing data for Block.Bits to & from a JSON-RPC string
I'm trying to convert the JSON-RPC result of a Block's compressed bits property into a C# float with the following constraint
 //3  bytes mantissa, the leading byte as exponent (where only the 5 lowest bits are used) and its base is 256

Is there any sample data I can use to verify my implementation is working?
A JSON-RPC string, and it's corresponding 256-bit output in Big Endian format would be a great help.

You're looking for bignum_tests.cpp:
BOOST_AUTO_TEST_CASE(bignum_SetCompact)
{
    CBigNum num;
    num.SetCompact(0);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0);

    num.SetCompact(0x00123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0);

    num.SetCompact(0x01123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "12");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x01120000);

    // Make sure that we don't generate compacts with the 0x00800000 bit set
    num = 0x80;
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x02008000);

    num.SetCompact(0x01fedcba);
    BOOST_CHECK_EQUAL(num.GetHex(), "-7e");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x01fe0000);

    num.SetCompact(0x02123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "1234");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x02123400);

    num.SetCompact(0x03123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "123456");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x03123456);

    num.SetCompact(0x04123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "12345600");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x04123456);

    num.SetCompact(0x04923456);
    BOOST_CHECK_EQUAL(num.GetHex(), "-12345600");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x04923456);

    num.SetCompact(0x05009234);
    BOOST_CHECK_EQUAL(num.GetHex(), "92340000");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x05009234);

    num.SetCompact(0x20123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "1234560000000000000000000000000000000000000000000000000000000000");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x20123456);

    num.SetCompact(0xff123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "123456000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0xff123456);
}


text:
Detection of double spend in Bitcoin for aged transactions
This is just to verify my understanding of Bitcoin double spend detection.
1) Use of UTXO indexes : This ensures that there as been no spend from that output (transferred to recipient in Block of height N)  in any of the subsequent transactions, up till last confirmed Block in chain (from N till current height). So the binary search if UTXO indexes is necessarily done for all transactions, right?
2) A con could theoretically double spend by garnering enough (51%) computing power to generate longer blocks that don't include his first (legit) spend', and pay himself or partner with from same output (since smaller length with legit transaction would be rejected). But this is only a theoretical possibility. right?
2) A wait of 6 confirmed blocks is recommended for high value transactions, as it is less likely for your confirmed transaction to get dropped from chain after that, even if con has upto 10% computing power. right ?

Possible duplicate of How do I detect a double-spend?

The Unspent Transaction Output (UTXO) set only includes valid transaction outputs that have not been spent yet.  Once a TXO is used, it is removed from the UTXO set. So, to check if an output exists and is spendable, you see whether it is in the UTXO set.
This actually makes discovering a double-spend attempt of "aged transactions" much easier than finding double-spend attempts in unconfirmed transactions.
A majority attack is not only theoretical, unless you deem someone acquiring 51% of the hashing power a theoretical possibility. But it's really expensive and would probably disintegrate Bitcoin value, so one could argue that it is unlikely to happen.
It puts the risk of reversal below 0.1% with an attacker that has 10% of the hashing power. Why is 6 the number of confirms that is considered secure?

thanks. Just a follow-up Q. In fork/longer length scenarios how far back can back-tracking be done, to discard shorter blocks? Is there a limit (imposed or settled to) ?

I don't think that there is a formal limit, but according to What is the longest blockchain fork that has been orphaned to date?, the longest natural reorganization was 4 blocks long (although the answer might be outdated now). There was a reorganization of 31 depth due to a bug that split the network once.

51-attack is not extraordinary expensive. And it will happen when the profit (in fiat currency) will be more than expenses. Nobody would care about desintegrating crypto performing it :)

amaclin: I disagree because it's against the interest of the major mining pools, so you'd have to compete with their hashpower.

A thought : Can the block chain be compacted by purging contiguous  blocks from  height 1 to N, having no  transactions with unspent outputs. Replace N blocks with a single header Block. Maybe only miner nodes have complete block chain for and others get it if they want it. Saves space. Assumes there are no unused coins buried in the earlier blocks.

@RajCherla: What you're describing is called "Pruning mode"

Re-read Satoshi paper and it does cover pruning and role of Merkle Tree in it.


text:
Segwit Address Supporting Testnet Faucet
Looking for a good Segwit supporting testnet faucet and preferably one that supports P2WPKH addresses, however answers that allow only P2WSH are fine too.

related: https://bitcoin.stackexchange.com/questions/60127/is-there-any-testnet-faucet-site-that-sends-out-to-bech32

That question was conflated with dropping support for older addresses and I felt this question was more clear.

Ended up using Manu's faucet with a nested p2wkh address NP2WKH.
It will reject native Segwit addresses P2WKH.


text:
Setting up a miner
Before I decide to buy a miner, I wanted to know what I would need to get it up and running, such as cords, equipment, etc. I've got my eye on a $35.00 1.4 Th/s ASIC miner, and i'm hoping anything else i need will be less than $15. Thanks in advance.

$35 dollars sounds pretty cheap. Are you sure that offer is for an intact device?

$35 is a good deal, may be too good.
Well there are a couple of things I would recommend.

Somewhere to put your miner. Maybe an open-air rack? You really don't want it to be mining in the corner of your house.
Extra cooler? Maybe some external heat-sinks and a good fan you can aim at the miner
Your miner should come with power cables, etc. I wouldn't expect to need any. But if you're worried, ask the seller if the miner comes with cables.
If you really want, a solar panel if you don't have one already. Doesn't have to be solely for your miner, you could use it as a long-term investment :)

Now that I'm looking at the product, it says it is a 1.4T ASIC miner. Is "1.4T" just the name, or is it the hashpower?

Not really sure. You'll have to mine to test out. Usually is should be rated at "1.4 TH/s, not 1.4T. If it doesn't say the speed anywhere else however, this will probably be the speed.

I'm not sure, because in the title, it says not only 1.4T, but later in the title it says 300G. It's really confusing.


text:
process to list cryptocoins in exchangers
I have a cryptocoin which is 50% premined. I want to list it on exchangers. How can I do it? Please mention the process to list cryptocoins in exchangers and also where can I get the list of best 50 exchangers.

There isn't a single set process. I mean, cryptocurrencies don't have a right to be listed on an exchange by dint of existing.

I can't believe that username was still available.

@m1xolyd1an: Usernames are not unique on Stackexchange (and there was another user with that name before).

-1 I don't find this question useful, and it doesn't show any previous research. The asker should familiarize themselves with value of cryptocurrencies and how their ecosystem works. A good starting point might be: Where do bitcoins come from and what gives them their value?

Exchanges only list assets. Until your coin is an asset with a value, there's no reason for exchanges to list it.

Lol. You're obviously trying to make your own coin to sell off as soon as it hits the market. Not good.
You will first have to build a userbase. Exchanges don't just accept anyone. If you have real supporters (Honestly I wouldn't support any premined coin, let alone one that's mined 50%).
Most exchanges accept one or two coins a week. To get your coin chosen, you need users to vote for your coin, or on some Exchanges like YoBit, pay a fee in bitcoin (say 1.5 bitcoin)
My recommendation if you are premining a coin just to sell it on an exchange, is to stop and reevaluate.


text:
What are all the new coins listed on the trading market & what value do they represent? what are their uses?
Just scrolled over all the different coins to trade I couldn't beleive how many there is, what are there uses, and is it something that is easy to set up?

All scams. None.

Ok. It depends on your view on altcoins, as @Jannes has so kindly demonstrated.
These are altcoins, built off the bitcoin protocol as an alternative to bitcoin. If you want, you can invest into them. But please, do your research on that coin. Altcoins have a notorious history of devs mining large amounts of coins before the coin is released, and then when the coin gets a bit of interest from the community and a higher price, devs just sell everything.
Some coins are scams, some very well may be, and some are actually pretty good projects and have a large userbase. Namely Litecoin and Ethereum.


text:
Bitcoins with several laptops with no electricity cost. Is it profitable?
English is not my mother language, so excuse me for any mistakes.
My Job is to test laptops for reselling in the outlet market. Between me and my collegues we test an average of 16 laptops per day.(And they stay there for the night too).
The catch is: After 24h we must format and close them and replace them for new others.
We were wondering if we could use them to mine, given the fact that the laptops are always being replaced i don't know how to do it or even if it's possible.
Many thanks,
pmleal

Short answer: no.  We all know that "free" electricity just means that someone else is paying, but even when you take theft into consideration, the profits wouldn't be worth the setup time.  Check the duplicate question for details.

Well instead of several laptops, and setting so many PC's that are not designed for this kind of work, and be set on fire after a day working. Why not consider taking some
 Acalon or Antminer R4, or something that is worth it.
 However using electricity is never a good idea, it is not cost efficient to mine on electricity.
 You can buy a bike instead :) and produce it yourself. Just a joke, there are different cheaper ways to make it work.


text:
Bitcoin sent to invalid address
In this transaction, some bitcoins are sent to bc1qp6k6tux6g3gr3sxw94g9tx4l0cjtu2pt65r6xp which appears to not be a valid bitcoin address. What is bc1qp6k6tux6g3gr3sxw94g9tx4l0cjtu2pt65r6xp  ?

That address is a bech32 encoded address, which is a new style of address used on the Bitcoin network, that starts with bc1....
It seems that the Blockchain.info explorer has simply not been updated to properly interpret and present this newer address type. The addresses you listed are perfectly valid.

They updated to decode them at least.


text:
Is it possible to split a key for transaction signing without using multisig?
I am developing a wallet API, but I don't want custodial control of the user's funds.  For reasons I won't explain here, I don't want to use multisig.
But I want the advantages of a 2 of 2 multisig.  I want the client to sign a transaction, and then send that signed transaction to the server.  The server will then finish signing the transaction and push it to the network.
Is this theoretically possible?  Does something like this exist yet in practice?
In summary, I want a way for the client and the server to sign a transaction together without either one having the private key.

If the transactions has more than one input and one (or more) of those is yours. But I doubt that's what you are looking for. For example: it doesn't protect the user against malware or key-theft/loss. And it also doesn't protect you against the user double-spending or sending the funds somewhere where you don't approve (if that was your goal).

There is a way for you to do so, but it involves something called Threshold Signatures which lets you do most of what you want (n-of-n without multisig). The thing about threshold signatures is that they require at least 2 round trips. That is, A and B have to exchange partial signatures a few times before the signature is valid. For 3-of-3 and higher, you need 3 trips to each person in order to produce a valid sig. Also, threshold signatures haven't really been implemented in any software than the one the Princeton researchers made.
The other method of sort-of doing something like what you want is using Shamir's Secret Sharing. I know Armory implements this for fragmented backups but you can't use the sharded pieces for actually signing, only for recovering the actual private key.

Wow.  This is why the internet is amazing.  Thanks for pointing out threshold signatures.  I realize it is untested but this is exactly what I was looking for.  I had no idea it existed.


text:
First step in understanding lightning network
I'm checking https://lightning.network/ and first paragraph of explanation says:

Bidirectional Payment Channels. Two participants create a ledger entry
  on the blockchain which requires both participants to sign off on any
  spending of funds.

What does this step mean.
Is this ledger entry a transaction?
Is this ledger entry actually one broadcasted multisig transaction signed by both parties that ends on the blockchain?
Or two parties broadcast two multisig transactions, or two regular transactions?
Can you give a numerical example?

Both parties create transactions which refund the
  ledger entry to their individual allocation, but do not broadcast them
  to the blockchain.

After the first step above then each party crate a regular transaction to refund what? (Can you continue on numerical example above)

They can update their individual allocations for
  the ledger entry by creating many transactions spending from the
  current ledger entry output. Only the most recent version is valid,
  which is enforced by blockchain-parsable smart-contract scripting.
  This entry can be closed out at any time by either party without any
  trust or custodianship by broadcasting the most recent version to the
  blockchain.

I'd suggest you to read this: https://bitcoin.stackexchange.com/questions/43700/how-does-the-lightning-network-work-in-simple-terms

I marked this as duplicate, and put another question that refers to your link. The question is here https://bitcoin.stackexchange.com/questions/62729/clarification-of-lightning-network-example.

The ledger entry is indeed a single multisig 2-of-2 transaction that is included in a block.
Then, both parties create a 1-of-2 multisig transaction that is not yet published to the network, but kept in reserve. This transaction is updated every time you make a transaction between both parties. Once either of the parties decides to close the channel, he or she publishes their second transaction and it is included in the blockchain.


text:
Is bitcoin node and bitcoin client the same thing?
What is the difference between btc node and btc client?
Which one is bitcoin-core and which bitcoind?

The Bitcoin system runs on a peer-to-peer network.
Each device participating on this network is called a "node" (of the network).
This node is actually a device running a Bitcoin client program.
Technically speaking node and client coincide. However they are different concepts in my opinion. One refers to the role of being part of the network, while the other refers to having a Bitcoin client program running.
Bitcoin-Core is a client program; namely, the reference implementation.
Bitcoind is just the "daemon" of Bitcoin-Core, that is the client core, running in the background, and can be controlled by bitcoin-cli (the command-line interface) via RPC.

From this it looks like bitcoin-core consists of bitcoind, bitcoin-qt and bitcoin-cli. But https://en.bitcoin.it/wiki/Clients shows bitcoin-core and bitcoind as separate clients.

That website is kind of outdated, so some information might be wrong.
In any case, if you look at the Download link, you will see they point to the same program.
If you try to download the archive, in fact, you will find there is actually no "bitcoin-core" binary, but only "bitcoind", "bitcoin-cli", and "bitcoin-qt", where the last two actually make use of bitcoind.

bitcoin-qt does not use bitcoind in any way or form.

Pieter Wuille is right. My bad. I changed my answer accordingly


text:
Can malicious peer hack freshly installed bitcoin-core node
I'm considering two scenarios of hacking freshly installed bitcoin core node.

Does freshly installed bitcoin-core node have genesis block included in the installation?
This fresh node contacts some peer for downloading blockchain. Can malicious peer give node wrong chain? Is this attack possible and how is it mitigated in bitcoin?

Does freshly installed bitcoin-core node have genesis block included in the installation?

Yes.

This fresh node contacts some peer for downloading blockchain. Can malicious peer give node wrong chain? Is this attack possible and how is it mitigated in bitcoin?

There is no way for the chain to be "wrong" that would not be detectable to the node. If it's invalid, the node will reject it. If there's a longer chain, the node will reject the shorter chain. If it's the longest, valid chain, it's not wrong.

So bitcoin relys on the fact that the node will eventually manage to get the main (longest) blockchain from honest peer?

@croraf That's unavoidable. There's simply no way to make the system work without at least one honest peer. No honest peers is equivalent to no network access at all.

by default the node will attempt to get connected to 30 peers, which usually contains enough honest peers to resolve any conflicts.


text:
What is multisig and why would I use it in bitcoin?
I read the term multisig address, as something that requires more than 1 signature.
What is that?
What would be the context of using that, why would I use something like that?


text:
How segwit blocks are seen by segwit and non-segwit nodes?
Let's say a miner mines a block.

In this block some transactions will be non-segwit and some will be segwit?
The block contains two parts:

The part with transactions
The segregated part with signatures of segwit transactions?

To old nodes non-segwit transactions look normal, and segwit transactions look like no-signature-needed valid transactions? These nodes don't see the segregated part containing signatures?
To new nodes non-segwit transactions look normal, and they recognize segwit transactions and check the segregated part to validate the signatures?

There aren't two part to a block like you describe. The word segregated in segwit means that the witness data isn't included in the TXID computation similar to how it always wasn't included in the signature hash computation. It's still included in transactions and blocks.
With segwit, the signatures are in each transaction in a witness field that is included before the nlocktime field.
When a node relays a segwit using block to a peer that doesn't understand segwit, it strips the witness fields out of all the transactions that have them.  Since they don't have any rules pertaining to segwit data they're perfectly fine with this.
If you were to hand a stripped block to a non-outdated node, it would just drop it and ban you for giving it invalid data-- it knows about the segwit rules and attempts to validate the additional data.

In this block some transactions will be non-segwit and some will be segwit?

Yes. Both types of transactions can be included in the same block.
Segwit transactions generally consume all types of UTXOs; while non-segwit transactions exclusively consume P2SH/P2PKH/P2PK type UTXOs.

The block contains two parts

No. Its mostly the same, segwit only has to do with how the transaction identifier (i.e. txid) is computed, which is pretty much just the hash of everything in a transaction excluding its signature. And similarly, the block simply contains all the transactions.

To old nodes non-segwit transactions look normal, and segwit transactions look like no-signature-needed valid transactions? These nodes don't see the segregated part containing signatures?

EDIT #1: As per Pieter Wuille pointed out -- no, old nodes will not see the same. New nodes will it simply remove the witness before sending. Post-reivision, I noticed this is because the scriptSig field for P2WSH and P2WPKH native inputs will be zero as described in BIP141.

To new nodes non-segwit transactions look normal, and they recognize segwit transactions and check the segregated part to validate the signatures?

Yes. New nodes have to do signature validation as per the convention of old nodes. Again, just to re-iterate, there is no segregated part for signatures.

No, old nodes will not see the same. When a segwit-compatible node sends a block to an old nodes, it simply removes the witness before sending.


text:
Get OP_RETURN from bitcoin-cli
Is there a way to extract old OP_RETURN transactions from the commandline with bitcoin-cli or something?
Something in the way of getAllOpRetFromBlock(345345) ...

There is not quite the method you are looking for, but you can use the getblock call which takes the block hash (not height, you can get the hash of a specific height using getblockhash method). That will give you the block, and you would then need to write a script to iterate through the transactions in the block and find ones which have an OP_RETURN output.


text:
Is there really a limited supply of bitcoin?
I don't get how there's a limited supply of 21 million bitcoin if we can go into the infinite amount of decimal places.
So for example, you can't go less then 1 cent if we take USD. in BTC, you can have 0.00000001 or however many zeros after the point, not sure but I would assume it's alot. So isn't there alot more than 21 million bitcoins, if we take in decimals into account?

You can't go into an "infinite" amount of decimal places. The smallest unit of Bitcoin is the satoshi, which is 0.00000001 bitcoin.
There will be a total of 2100000000000000 satoshi.

Fractions or decimals of the whole don't make more of the whole.  21x10^6 is a finite number but it can be divided infinitely. Division doesn't increase the finite number, it just increases the number of "pieces" of the original number. Think of $1. You can produce four quarters from $1 which is more pieces but still only a total of $1.


text:
Aren't blocks generated too slowly to catch up to transactions?
I read somewhere that it takes 10 minutes to mine a block.
What happens when the number of transactions exceeds the block size. Do we all have to wait 10 minutes until another block comes in?

Yes. If there are more unconfirmed transactions than can fit in one block at a time, then those unconfirmed transactions can be confirmed in the next block.
However having more transactions than can be confirmed in one block is not a bad thing. If the sum of the transaction fees of all of the unconfirmed transaction is high, then that means that miners are more incentivized to mine the next block instead of engaging in fee sniping where they will continue to mine for the block that was just found so that they can collect the transaction fees for that block. If all unconfirmed transactions were cleared, it would be more profitable (for some time) for a miner to continue mining the previous block as the reward for that block would include transaction fees and thus be greater than the reward for the next block which, for some time, would not include any transaction fees.


text:
Why couldn't bitcoin be hosted on the internet?
I was wondering why bitcoin wasn't hosted on the internet? Why create a completely separate decentralized network, I thought the internet was already decentralized. For example, couldn't they have rented a few amazon ec2's or some other servers hosted on xyz host and call it a day?
(Sorry for newb question)

First of all, bitcoin is on the internet, and the Internet is not decentralized, its managed by several private companies, universities and governmental institutions.
You said "couldn't they have rented a few amazon ec2's or some other servers hosted on xyz host and call it a day"
I don't know who do you mean by "they" whoever you mean, just replace it by bitcoin users and the answer is Yes, I've rented some servers on Amazon and it's connected to other bitcoin nodes.

Yeah sure, All bitcoin communications are done over TCP also, IPv6 is supported.

And onion... and sattelite (not internet) and cantenna (not internet) and ...

Agree with Adam. Bitcoin relies on blockchain, without it BTC can't exist. And Blockchain uses the Internet basically. Maybe some day people would create another blockchain technology, which wouldn't require the Internet connection... but that's another story.

And Blockchain uses the Internet basically This is incorrect, you can absolutely run a blockchain on just one computer, or a local network.


text:
Why doesn't bitcoin have a dns server?
For example, can a person pay to say "somewebsite.com" as opposed to "1MVY1e2vta5bA6BFEGnpqJeHUC5YaV5dsb"
There's no way the general public would use the latter.
p.s dns was an example, doesn't have to be a ".com", I meant some unique word as opposed to long randomized string.

Bitcoin addresses aren't meant to be reused as this significantly reduces privacy.  This was known to Nakamoto before the initial release of Bitcoin (see section 10 of his Bitcoin paper) and his original software was specifically designed not to reuse addresses.  That means any mechanism that turns easily-understandable string X into address Y should only be used once, which is not what most people want from a recognizable code word.
There have been a few described ways to work around this problem.  The first is simply having the easily-understandable and reusable x be a program somewhere (e.g. myaddress.example.com) that returns a different address each time it's used.  The problem with this is that it requires the receiver run a server, which most people don't want to do.
An alternative mechanism is called Stealth Addresses, which allows the receiver to create a static public key which the spender combines with a random number they select to create a secondary public key that nobody but the spender knows about but which only the receiver can spend from because it uses the same private key as before (basically).  The problem with this mechanism is that the spender needs to communicate the random number they used to the receiver in order for the receiver to recognize and be able to spend the payment, which adds extra data to the block chain and costs the spender more money in transaction fees.
Both of the systems above have been tried but neither has caught on and so when people have put in work into creating decentralized persistent registries (e.g. Namecoin or Blockstack), they've not really ended up being used to facilitate payments.

Because domain names cost money and Satoshi Nakamoto wanted you to be able to lend your friend 0.00001 BTC without him have to pay a corporation an annual fee.
Because that would raise all sorts of security concerns (See DNS spoofing etc)
Because addresses are cryptographically derived from private keys and the whole Bitcoin system really rather depends on that.

I'm sure there's some kind of algorithm that can convert a randomized address string into a unique word or phrase at least

That would definitely also lead to security issues. That's the thing with cryptography -- design of algorithms and safe-use of them are not things that 99.99% of us are qualified to do. If we try to do that we mostly fail spectacularly. You can't just randomly change some aspect without the likelihood of undermining the whole edifice.


text:
Why don't miners act as nodes?
Why didn't bitcoin make miners and nodes one in the same? It seems that the miner computers are not being used at all in for the network. Also their gpu power is not being used for the sake of the network -- they just solve some random problem that has no practical purpose (?) other than solving it and getting some coins in return?

My understanding is that solo miners and mining pools do act as nodes. I'm not sure what you mean.

I read that nodes (aka full nodes) are something entirely different

You can run a full node without mining. In theory, you could SPV mine without validating blocks too.

Miners are nodes, but nodes are not necessarily miners. In order for a miner to be able to mine blocks, they must be a node on the network. Otherwise they won't receive previous blocks to build on top of. So miners are nodes.
In the original Bitcoin whitepaper and the original Bitcoin client, nodes and miners were one and the same. However this is no longer the case as the cost of mining has gone up significantly. It is possible to run a node without mining, which is what many people do.

Also their gpu power is not being used for the sake of the network -- they just solve some random problem that has no practical purpose (?) other than solving it and getting some coins in return?

No, that is incorrect in many ways. First of all, mining is no longer done with GPUs. Secondly, the Proof of Work is done to secure the blockchain. The proof of work means that in order to make a block, you must perform a certain amount of work. So to replace a block in the blockchain, you must perform the same amount of work as was done for that block, and the work for all of the blocks that build on top of it. This makes changing the blockchain extremely difficult and costly as it requires doing massive amounts of work, so the blockchain is fairly immutable. So the proof of work is not pointless at all, it secures the blockchain.

Why didn't bitcoin make miners and nodes one in the same?

Because some people need to run nodes to perform transactions and have no interest in mining. Some people have miners that are optimized for mining but don't wish to expend the resources on running a node.

It seems that the miner computers are not being used at all in for the network.

I'm not sure what you're referring to exactly, but miners do use computers to control and manage their mining operations.

Also their gpu power is not being used for the sake of the network -- they just solve some random problem that has no practical purpose (?) other than solving it and getting some coins in return?

It's been a long time since bitcoin mining was done on GPUs. But it's important to understand that mining is the way bitcoin solves the double spend problem. It's not a random problem, it's the problem of ensuring that everyone eventually agrees on which bitcoin transactions are valid. It's a very specific problem whose solution serves a very specific purpose.

authors: Дамир Галлямов


text:
What if bitcoin has a bug?
If a fundamental bug is found in bitcoin does that mean that the only way to patch it would be a hard fork? I'm confused at how this software that only has one version is running for 10 years without even a bug?

There've been lots of bugs, some of which are fixed via a softfork.

Indeed, https://en.bitcoin.it/wiki/Value_overflow_incident describes such a fork that actually did happen in 2010.

If a fundamental bug is found in bitcoin

Bitcoin is mainly two things

A set of Network protocols and associated rules by which Bitcoin wallets can interact with each other and by which mining software can interoperate with other bitcoin software.

A reference implementation of a Bitcoin wallet. This is the "bitcoin core" software application.

Network Protocol
Exploitable weaknesses in the network protocols and rules can be fixed by a soft fork which changes or extends the protocols or rules.
Software

this software that only has one version is running for 10 years without even a bug?

See the release notes for bitcoin core
for example, the notes for 14.3 include

Denial-of-Service vulnerability CVE-2018-17144 ——————————-
A denial-of-service vulnerability exploitable by miners has been discovered in Bitcoin Core versions 0.14.0 up to 0.16.2. It is recommended to upgrade any of the vulnerable versions to 0.14.3, 0.15.2 or 0.16.3 as soon as possible.

Other implementations (e.g. Electrum) also have exploitable flaws discovered and fixed from time to time.

It does not necessarily have to be a hard fork.
The only way to update or fix an issue in Bitcoin is to push out updated node software, with an update protocol definition. However, not all changes to the protocol result in a hardfork - many can be, and have been, achieved by way of softforks, which are "backwards compatible" in some ways, allowing nodes running certain previous versions to continue to connect to and participate in the network.
The value overflow incident mentioned in the comments is one such example of a
soft fork performed to fix a bug. Segwit is another example of a soft fork, this time used to perform an upgrade. There have been many such events over the last 10 years, and we certainly aren't still running the origin Bitcoin code provided by Satoshi.


text:
Is Lightning Network a risk for Bitcoin security since it reduces miner fees?
does LN represent a risk for the Bitcoin ecosystem since it will reduce miner fees (the only income they'll have in a post-btc-minting world) and displace them into second layers?
I couldn't find any analysis that addresses this concern (the reduction of hashrate).
If fees are reduced for miners it will centralize even more mining, since even less organizations could support mining operations in a profitable way.
Will it centralize mining even more and reduce hashrate, thus reducing Bitcoin decentralization?

The idea that Lightning will reduce the amount of fees going to miners is very common, and we probably won't know for sure until we actually try it. However, I'll try to provide some arguments as to why I don't believe it'll result in a drop in fees for miners, let alone a drop in hashrate.
I think the idea that Lightning will drain transaction fees from the Bitcoin network is wrong. First of all Lightning will enable completely new use-cases for Bitcoin, increasing its reach and resulting in a vast increase in the transaction rate and tapping into markets that are currently simply too expensive to serve. Every single one of these transfers will result in some (small) fees for the channel operator, which she can then use to pay for the on-chain transaction for the maintenance of the channel. The fees can be much higher than a classical Bitcoin transfer since the utility the operator derived from the coins in the channel are much higher, since they have been sent back and forth an arbitrary number of times.
Think of Lightning as an aggregation layer for Bitcoin: it processes transfers that the current Bitcoin cannot process itself, accumulates fees and then releases some of those fees back to the Bitcoin layer.
Secondly, Lightning shifts the security model from a model where we broadcast a transaction and eventually it'll confirm, to a model in which the confirmation time becomes time-critical. There are transactions in Lightning, which we need to get confirmed before a timeout, otherwise we risk losing some coins, due to an old state being committed to the blockchain. This time-critical confirmation encourages channel operators to attach larger than usual fees to these settlement transactions. Fees that end up with the miners.
Finally, on-chain Bitcoin and off-Chain Lightning transactions have different tradeoffs, I don't see the world becoming Lightning only, but I do hope that Lightning is a useful tool for some use-cases. In the end Lightning is a system that is built on Bitcoin, and thus can only be as secure as Bitcoin itself.
(disclaimer: I am one of the developers working on Lightning)

thanks for the detailed reply. It'd be great if lightning ious implemented some miner fee amount that increases with each new tx (along with sharing the secrets).

We'll certainly do all we can to support the ecosystem, we're deeply reliant on Bitcoin :-)

"Every single one of these transfers will result in some (small) fees for the channel operator"
This is one big assumption.
In my worldview, If LN works, I see big players the size of Amazon, Google, Facebook, or financial institutions operating hubs and waving the fees completely to kill smaller would be operators that won't afford the on-chain costs. More centralization.

That might work as a short term strategy to push out smaller operators, however in the long run they'd be making losses. In your argument there is the implicit assumption that there is something to be gained in being a large hub operator, and I wouldn't be so sure about that. Ultimately we can only provide the tools and hope that a healthy network emerges. The important thing is that everybody gets the same tools, allowing them to participate on a level playing field.

Lightning Network doesn't necessarily reduce fees, it increases the number of transactions processed in one block. So each tranx costs less but total fees in the block add up due to more number of tranx. As adoption increases, so will no. of tranx. Its similar to increasing block size but better, because it needs less storage on full nodes, so more decentralization than block size increase.


text:
How to catch the fees on regtest mode?
I'm developing on regtest mode and it seems that the fees I specify in every transaction are not included on every new mined block (generate). I only view (listunspent) a new 50 btc coinbase utxo at the miner node. So how can I catch the fees on regtest mode?

Mining fees works in my regtest mode: http://i.imgur.com/RSLRp4M.png

I guess you are missing the coinbase immaturity here.
Coinbase transaction can only be spent after 100 blocks.
A single generate will not make the coinbase-transaction appear in listunspent. If you do a generate 101 it will (because you mine 100 blocks on top of your "fee block").
Then you should get something like:
{
    "txid": "11cc285148b32fd312260a67193875420931b8511b5f34f2991feb5d94901b8e",
    "vout": 0,
    "address": "n3y4wCJcY8zzim3CWuKpFi6BPPAf6DzhVm",
    "scriptPubKey": "2103559b1d5cd126e03b8ee0887ffc1ffd74d34fae49e2e2e65f7708071b032aabf5ac",
    "amount": 25.01920001,
    "confirmations": 101,
    "spendable": true,
    "solvable": true
  },


text:
BItcoinjs - safest way to manage wallet on a potentially untrusted device
As per the title, what would be the safest way to run a Bitcoin wallet on a potentially untrusted device, such as a mobile phone?
The question assumes the usage of bitcoinjs-lib (which allows, among the many, bip32, bip38 and bip39 features) and the ability for the user to spend his coins. I've tried to write down a potential flow

seed generation with bip39
(users backup the mnemonic and it's not stored on disk)
generation of account "" (e.g. 0)
derivation of the external chain (there's no need of 2 chains in this case)
generation of an address (address X) to receive Bitcoin
store the private key of address X, aes-256-cbc encrypted on disk, in case the user need to spend the coins

What would be the security implications of this approach? Any suggestion?

If the device is untrusted, what stops the device from reading the private key out of memory after you decrypt it?

You are right.. first of all,users would be adviced to fed addresses hosted on that device time by time, exactly like we do with cash in our pocket.. that would be enough to discourage an attacker from wasting time for 10 dollars.. on the other hands, you could read priv key from memory in all bitcoin nodes in the world

You can't run trusted code on an untrusted device, end of story.


text:
Bitcoin mining with rented rigs
Can someone please explain to me if mining with a rented rig is worth the investment. I recently mined but the server went down. Also where does the hashed data go and is it available for my viewing? Thanks so much..

Related: http://bitcoin.stackexchange.com/questions/2269/why-would-someone-rent-hashing-power


text:
Can replay transactions effect both chains? or just the minority hard fork chain?
Can a seg2x transaction be replayed on the main bitcoin CORE chain?
I was reading that only the minority hard fork would need replay protection and that coins on the main majority chain would be safe

Can a seg2x transaction be replayed on the main bitcoin CORE chain?

yes

only the minority hard fork would need replay protection and that coins on the main majority chain would be safe

(a)this is wrong (b)nobody knows what chain will be major, what minor

What if the CORE chain does become the majority chain with significantly more mining support behind it... would having that majority hash power mitigate the issue at all? In other words are you saying both chains are at risk BECAUSE nobody knows what chain will be major, or that it doesn't matter which is major or minor, it has no effect on mitigating replays

A replay occurs when you intended a transaction to occur on one chain and it occurred on another chain instead of, or in addition to, the one you intended. The worst case scenario would be if you intended to send someone some low value tokens on the minority chain and that wound up executing on the chain with the higher value tokens.

So the higher value coins could become lost/missing in that scenario? Or the minority chain coins could become lost/missing? If I have coins on the majority chain and the minority chain, would selling my minority chain coins asap help protect me by keeping my value on the majority chain?  Or would neither be more safe than the other, both would be in jeopardy of lost/missing funds?

I think the majority/minority chain concept is misleading here. The problem is that a user intends to perform a transfer on one chain, and he creates a transaction for that chain. Due to lack of replay protection that transaction may also moves move the coins on the other chain (independently of which one is the majority or minority chain), which is not only unexpected for the user (he just wanted to move them on one chain, not both) and may lead to losses since the recipient of the transfer may not know how to handle the second chain, or won't help recover the funds for the sender.


text:
What is the benefit of opening port 8333 to a client?
I am running a bitcoin core (v0.15.01) full node according to https://bitcoin.org/en/full-node. They say

"To support the Bitcoin network, you also need to allow incoming
  connections."

I hesitate opening ports because having a port open for incoming connection allows for anyone to connect. So is this really necessary for bitcoin to work? They to not explicitly state what kind of support this enables.
I see that the client already makes connections to various domains like
x9.dnsseed.bluematt.me
x9.seed.bitcoinstats.com
dnsseed.bitcoin.dashjr.org
x9.seed.bitcoin.sipa.be
x9.seed.btc.petertodd.org
x9.seed.bitcoin.jonasschnelli.ch

Do these represent the "distributed" properties of Bitcoin? Why are there not more of them? Or is this completely unrelated?
Note: I have read questions like this one or this one, but they more focus on the how to, than what the benefit actually is.

If you don't want to, you don't have to open ports at all. You'll still have a full node, it will just have fewer connections. Full nodes usually make 8 outgoing connections and can have many more incoming if you have the port open (for a total of 125 by default). Incoming connections can also be SPV (phone) wallets, or other full nodes.
So the benefit is that you're helping out the network a little bit more providing connection opportunities and bandwidth to more other full and non-full nodes. There's not really a shortage at the moment though.
Typically only the first time when you run the software it might do a DNS lookup on the domains you mention. Each name represents dozens of IP addresses of random other full nodes (not just nodes run by those people). Once your node has a connection to a few peers, it will learn new IP addresses from those, maintaining its own list of IP addresses which is stored when you close the software shuts down.


text:
Improving transaction handling in shops: Is sending "prepared/approved/signed" transactions to a shop owner possible?
I am quite new to the idea of bitcoin but I have understood one of the main problems:
Sending money with Bitcoin takes approximately 10 minutes, by design. For use at the counter in a shop this is very much too slow, also the amount of transactions in 10 minutes (about 2000) is not suitable for planet-wide in-shop use.
My idea. Would this be feasible?
1. Create a signed, pre-approved transaction
So, as the customer at the counter, what if I could prepare a transaction of the required amount, from my wallet-app on the phone, somehow approve it/sign it/authenticate it, but not send it to the bitcoin network yet.
2. Hand out the transaction
Instead, I send the transaction to the shop owner, via bluetooth, QR-Code, NFC whatever. The shop owner takes this transaction, validates it against the current amount on the contained address/es. The idea is that this should guarantee to the shop owner that he or she will actually be able to retrieve the amount on a later time.
3. Collection of the transaction's value
At the end of the day, the shop owner takes all collected transactions, blends them into an new single one (to save bytes) and now sends this transaction to the bitcoin network. This single transaction should be cheap and more efficient compared to single transactions from all day's clients.
Is such transaction bundeling feasible? Or already in place somehow?

This is not currently possible nor is it secure at all whatsoever.

So, as the customer at the counter, what if I could prepare a transaction of the required amount, from my wallet-app on the phone, somehow approve it/sign it/authenticate it, but not send it to the bitcoin network yet.

This is possible, but only if the customer knows what address to send the Bitcoin to. If he does not, then this won't work.

Instead, I send the transaction to the shop owner, via bluetooth, QR-Code, NFC whatever. The shop owner takes this transaction, validates it against the current amount on the contained address/es. The idea is that this should guarantee to the shop owner that he or she will actually be able to retrieve the amount on a later time.

Doing that does not guarantee that the shop owner will receive any money. All that guarantees is that the shop owner has seen the transaction and can broadcast it himself. However the customer could perform a double spend attempt and have it occur successfully if the shop owner does not immediately broadcast the transaction. This is because the customer still has the information necessary to create a conflicting transaction (i.e. the private keys) and just broadcast that to the network. Simply handing over a transaction does not mean that it is suddenly impossible for that person to create a new transaction that sends the money elsewhere.

At the end of the day, the shop owner takes all collected transactions, blends them into an new single one (to save bytes) and now sends this transaction to the bitcoin network. This single transaction should be cheap and more efficient compared to single transactions from all day's clients.

That is not possible. No one can modify those transactions except the people who own the private keys. They cannot be "blended" with each other unless the person doing that "blending" controls all of the private keys associated with those transactions. "blending" would require creating a new transaction that spends the same outputs and creates a different output. It is an entirely new transaction which requires the customers' private keys in order to create.

Thanks for addressing each point well. Too bad this will not work.


text:
Do receiving addresses expire on Multibit?
Okay so I have tried Resetting Blockchain and Transactions plenty of times. The only thing is I used an old receiving address that I used about 2 months ago. Do these addresses expire? Can they only be used once? I don't know. I'm not too good at this. Here is my Wallet: http://puu.sh/8CBpT.png Here is the blockchain of my receiving address: https://blockchain.info/address/12EFht1oW3h2ybNYP2NrJKF26oPicFs8mM Is there any way to retrieve my bitcoin? Do you guys have any answers? I have looked everywhere on google and I have gotten nowhere.

That's weird. It is accepted, your wallet contains ~0.20 BTC but it doesn't show up in Multibit, right? Normally a reset would yield the proper result. Is multibit (and your computer) connected to the internet? Is Multibit updated? I guess it is, but it should work.

Im going to try to back it up and use a different wallet software. Hopefully that works. Thanks for your help!

But to answer the question: addresses do NOT expire. Not in Multibit, not in cold storage, not online (unless the site retired and you do not have an offline private key or wallet), nor any other wallet software. They can be used unlimited amount of times, so that's not the problem either. The problem your face is probably in Multibit. You can try to backup the .wallet or .key, and import it in another wallet software, or delete/reinstall Multibit.


text:
Electrum Linux run without sudoers installation
How to easy run Electrum wallet without its installation on Linux?
I want to run it from a single user account with no sudo. It is possible?

You have two options:

Install pyqt5 as root. Then, as an unprivileged user, simply download, verify the gpg sig and untar the electrum tarball download and execute run_electrum in the directory that gets created. Most dependencies are included with the tarball so this is all you will have to do.
Another option is to use the appimage version. Just make it executable and run it. It contains all dependencies. This is recommended if you don't have python 3.6 available for your distro.


text:
Can bitcoin history be changed?
It is known that historical database of all bitcoin transactions stored in blk*.dat files. Is it possible for bitcoin-core to change any of this files in any time? Or this database is equal for all bitcoin peers (may be except the last few files)?
I think this files consist non-changable historical data for blockchain. Is it true?

Yes, Bitcoin Core can and will change the blk*.dat files, which, as has been told to you many times before, can be different for all nodes. Once Bitcoin Core has validated a block, it updates its chainstate database so that it knows what its current blockchain tip is. It also updates that database with the most recent UTXO set. So once this is done, the block can be thrown away as we have now recorded that we validated it. This is what pruning does; it throws away old blocks that we have already validated. Having the correct chainstate (UTXO set and blockchain tip) is all that matters.

However, if pruning is not enabled, then AFAIK the most recent blk*.dat file is only appended to, and the older files are never changed at all.  Is that correct?

Yes. The files are append only.

@NateEldredge how to enable or disable prunning?

@Denis: It's disabled by default; see https://bitcoin.stackexchange.com/questions/37496/how-can-i-run-bitcoind-in-pruning-mode for how to enable it.

Bitcoin Core can change on-disk database. Malware? If need, I can prove it. Guys, don't be so homely. Answer to me.

I mean HISTORICAL DATA!!!

Bitcoin Core CAN change on-disk data. All that is stored in \Bitcoin\ directory! Wallet.dat there's too. Think about this! My log make clear the fog.

Bitcoin Core creates those files and uses them in its normal operation. Of course it can change those files! It isn't malware, its whole job is to modify those files, where do you think they come from?

@AndrewChow those files has historical data. I want to save em and when we invest in BTC, we must know that HISTORY has no way to been modified. That what i mean!

You told that the history is impermanent.


text:
Why there is only 8 peers in bitcoind?
I set maxconnections=125 in bitcoin.conf but still has only 8 connections in nodelist. Please tell why?

You should check if port 8333 is open. If port is closed from internet, bitcoin client will make only 8 outgoing connections. maxconnections parameter works only for incoming connections.

authors: معطي بن زاوية


text:
What is the actual threat of a majority attack on the Bitcoin blockchain?
As far as I understand, an attacker (in the role of a malicious miner) controlling a large portion of the current hash power could replace previously accepted blocks with alternatives.
But, what does that mean? He could

Collect the block reward
Add previously unconfirmed transactions, making them confirmed
Omit formerly confirmed transactions

But what would an attacker gain with this?

Block rewards are easier collected with real mining
Unconfirmed transactions may eventually confirm anyway
Omitted transactions may confirm just a while later anyway, too

So what's the danger with majority attacks?

Besides the technical posibilities to do a 51% attack, I would like to add, that it is nearly impossible from a complexity point of view. The required amount of mining equipment to achieve current hashrate is roughly 800.000   ANTMINER S9. They would "eat" 1000 MW of power (a nuclear power centre, or 500 wind power systems of the 2MW class). So this attack seems a very poor approach. On the otherhand one can think about miner centralization and "buy them". The amount of money required would have to be in the billion Euros (maybe half of bitcoin market value?). Thinkable, but not that easy.

An attacker controlling more than half of the mining power could do a few things. For example.

They could declare certain transactions as invalid. By refusing to include them in their blocks and refusing to build on any block that includes them the unwanted transactions would see any confirmations they picked up quickly reversed. Someone trying to make money could use this to set minimum transaction fees. A government trying to regulate bitcoin could allow only addresses registered with the government.
They could collect all the mining rewards by refusing to build on anyone else's blocks, since the total mining rewards are roughly fixed this would get them more bitcoins than just taking their fair share of mining rewards.
They could spend bitcoins to get something non-bitcoin in exchange and then later reverse those transactions leaving the people they exchanged with out of pocket.

If the attackers aim is to make money these things are probably a bad idea. They would likely destroy the value of bitcoin and destroy the attackers profits
OTOH if the attackers goal is to destroy or subvert bitcoin these things may be more worth doing.

So what's the danger with majority attacks?

The danger is more that such an attacker would be able to censor transactions and dictate what valid transactions are and are not allowed by refusing to mine certain transactions. With sufficient hashrate, the attacker could refuse to build upon anyone else's blocks, and with a majority hashrate, he could then make his blockchain the accepted one because it would have more total work than any other chain. This would mean that transactions which the attacker does not like would never be confirmed as they never make it into a block on the main chain. Other than that, there isn't much that an attacker can do with majority hashrate, but it still would be a problem.


text:
Bitcoin core database gone after error no more free disk space? How can I recover my bitcoins?
So I got myself into this situation.
I have a Bitcoin core wallet, which was up to date and all the way synced. Two days ago I tried to start it up again but when I tried to shut my laptop down I had a notification that I had no more free disc space, so Bitcoin core automatically shutted down. The day after I started my laptop again and the program was gone from my start task bar and had to go search it manually in program files. To my surprise when I opened my wallet it had to restart synchronizing all the way back from the start again. Not only that, all of my database directory was gone from the %appdata%\bitcoin folder! It started everything back from the beginning.
Of course I couldn't as I had no more free disk space. Now the strange thing is, all that space on my Hard drive went to the bitcoin database directory. But if my files are gone, and I still have no free disk space then where are they now, are they stored some place alse or hidden? Or did my hard drive crashed? If they where permanently gone I should have had free disk space again.
How can I solve this and recover my bitcoins? Please help, I'm freaking out as I'm afraid I won't be able to recover them any more as all my dat.files are gone!

Do you have your wallet.dat file still?

No, I'm afraid I don't. I know it's very dumb of me, I recently moved my btc from wallet and forgot to do it for this one now. I'm hoping to recover it somehow as my hard drive still has the database files I guess as it's still full.

Immediately, make a full image back up of the hard drive (not a file by file backup, but a backup of every sector) and do not make any modifications to any data on that hard drive until you have done so. If the file was deleted by not overwritten, everything you do increases the risk that the private keys will be overwritten. You need to be able to get back to where you are now before you make any changes to the data on the drive! This is absolutely vital.

What do you mean by "I recently moved my btc from wallet and forgot to do it for this one now".  You need to listen to David and immediately stop using that hard drive if you have any chance of recovering a deleted but not overwritten wallet.dat file.

I'm not touching it, it's turned off as I'm afraid to do anything wrong. What I mean is I made a transaction from one wallet to this one I made now to save disk space on my laptop I daily use. So I downloaded bitcoin core to another laptop and I put them on there, I received them but afterwards I forgot to make a back up file, and now this happened. Worst possible scenario!

So what should I do then? turn on the laptop and make a full image back up or leave the laptop off?

"So I downloaded bitcoin core to another laptop and I put them on there"
Then send them from the new laptop.  Did you also lose the new laptop wallet.dat file?  Don't turn on the old laptop if it's your only copy of the file.  Bring it to someone you trust to connect it to an existing machine as a secondary drive and raw read the hard drive to extract the file.  Did my answer or comments help?  Upvote!

This is not a complete answer, but the question implies a possible misunderstanding which this attempts to correct.
Summary: if you can rescue wallet.dat, you're fine.
The only valuable file in the Bitcoin Core user system is wallet.dat. The blockchain files are necessary for the application to be able to see the transactions on the blockchain that sent bitcoins to you and to figure out how many bitcoins you "own" (can spend). What is actually in wallet.dat are your private keys, which is all you need to have.
If Bitcoin Core doesn't have access to the blockchain data then it doesn't know that you have any bitcoins. Once it has access again -- after re-downloading (takes a long time!) -- on this or on another computer, you will be able to see your bitcoin balance.

Your bitcoins are safe as long as you maintain control of your wallet.dat file.
 You have a few choices.  You can either:

Use another bitcoin wallet software which does not require you download the entire blockchain (such as Electrum).  Import your wallet.dat file into this new program.  Bitcoin.org has other choices.
Free up space on your current computer and use the existing Bitcoin core wallet software.
Transfer your wallet.dat file to another computer and use Bitcoin core wallet software or the Electrum wallet software to gain access to your Bitcoins again.