Why did bitcoin programmers release mining code? Why did anyone ever release bitcoin mining code, aside from promoting bitcoin and eventually raising investor awareness?

Looking at a price chart, bitcoins were valued at just a fraction of a dollar until it was better explained to people. Was this because

a) a lack of trust in fiat currencies during a recession, or
 b) release of mining code solely to get bitcoins to have any value in the collective at all.

Was the global liquidity crisis and recession merely coincidence?

I'm curious because bitcoins have offered a really great return for people that were mining before the promotions or at other points in time.

Bitcoin is a decentralized digital currency.  It is meant to be resistant to corruption and external control.  That is the reason it was created.

Bitcoin achieves this only through the approach where consensus of the ledger is achieved by performing work.

Bitcoin is vulnerable -- this consensus mechanism can be blocked by anyone with 51% of the mining network capacity.   To prevent anyone from having that ability to block, the mining network needs to be large enough so that there it is vastly economically unfeasible for an attacker to disrupt the network.

So to achieve this requirement of being protected with a ginormous amount of hashing capacity, the mining process is subsidized.  This subsidy comes from the issuance of new currency. This subsidy helps to bootstrap the currency by putting it into many hands who might be willing to spend the funds for goods and services which draws merchants and service providers into the bitcoin economy.

So the combined goals of bootstrapping the bitcoin economy and ensuring that mining capacity is more than sufficient to dissuade any 51% attack are two reasons to release mining code and letting mining revenues be distributed to those willing to participate.

Because bitcoins aren't always circulating, there must be some willing to hold bitcoins as a store of value at all times.  Again, Bitcoin has value only because it is a decentralized digital currency that is resistant to external control.  If it doesn't have that then it is simply an online ledger -- no different than what PayPal provides, or what your online banking system provides.  There are plenty of other open source ledger software options for this.

Only from the protocol being open (and trusted as being open by having the software being open as well) would an investor that is willing to hold bitcoins be assured that the currency truly is decentralized.

For Bitcoin to be valued, the source code had to be released.   If the source code were never released, Bitcoin would never have achieved any value.


Miner modify pending block (not yet on chain) and successfully solve the PoW For example, I pay a cup of coffee with bitcoin, and later remove that transaction from the pending block that is not yet on chain. After 10 mins, I successfully and luckily solve the PoW problem, and broadcast the modified block to everyone as well as append it to the blockchain.

Is the scenario above possible? If it is, how is it prevented?

It is perfectly possible, and it is why it is discouraged to take irreversible action based on transactions that are unconfirmed (=not in a block yet).

However, the transaction is not invalidated just because it is reversed. Another miner can still include it at a later time, unless you issue a conflicting transaction  (=double spend) with a higher fee.


ScriptSig Conversion in Python I'm trying to convert a scriptsig into bytes so that I can better extract R & S values, but when I try and convert, I'm missing some of elements that should be there, like x30 for example.

scriptsig = '473044022015d8e1ba1d7fa0bd065f3da2d91d71d12890ff4d9a655161783504714c8b06a3022007d71d93d79039d73fc47ab9787128b7a6d7449e72688f0cf6dc175cfa90755d0121037ab79af7f21e54e03297fc9447952bfacedc57dcebd802eb19ba75636ad1fd5e'

import binascii
bytes1 = binascii.unhexlify(scriptsig) #doesn't work
bytes2 = scriptsig.decode('base64') #doesn't work

The output:
bytes1
'G0D\x02 \x15\xd8\xe1\xba\x1d\x7f\xa0\xbd\x06_=\xa2\xd9\x1dq\xd1(\x90\xffM\x9aeQax5\x04qL\x8b\x06\xa3\x02 \x07\xd7\x1d\x93\xd7\x909\xd7?\xc4z\xb9xq(\xb7\xa6\xd7D\x9erh\x8f\x0c\xf6\xdc\x17\\\xfa\x90u]\x01!\x03z\xb7\x9a\xf7\xf2\x1eT\xe02\x97\xfc\x94G\x95+\xfa\xce\xdcW\xdc\xeb\xd8\x02\xeb\x19\xbaucj\xd1\xfd^'

bytes2
'\xe3\xbd\xf4\xe3\x8d6\xdbMyw\xc7\xb5m\xad]\xed\xf6\xb4m\xdd:\xe5\xfd\xddkg}\xd5\xde\xf5w]\xbc\xf7G\xdf\xe1\xdfZ\xeb\x9eu\xeb^\xfc\xdf\x9d8\xef^\x1c\xf1\xbd:k}6\xdbM;w\xbd]\xf7w{\xf7M\xfdw\xbd\xdfs\x8e\xdao\xde\xfc\xef]\xbco\xb6\xbaw\xbe8\xf5\xee\xf6\xeb\xcf\x1f\xd1\xc7\xfau\xcd{\xe5\xc7\xda\xf7N\xf9\xe5\xdd5\xdb]7\xed\xa6\xfb\xf5\xa7\xfb\x7fm^\xe7\x87\xb4\xdfo{}\xcfx\xe3\xbfy\xd9\xb7\xdaq\xe7\\\xe7\xb7\\y\xb7|\xd3g\x9b\xd7\xd6\xda\xef\x9e\xb7\xe9\xa7u}\xde^'

Once I got the right format I was going to use asn1decoder to parse for x30 and then extract R and S

0x30 is there it's '0' in ascii (second character in your bytes1)

>>> b'\x30'
b'0'

You also want to extract the signature from the scriptSig before passing it to a decoder, right now it contains both the signature and the public key.


Any multi-currency accounting ledger that lets me use BTC? Are there any online or open source (i.e., free, or at least cheap) accounting systems that do multi-currency so that I can record revenues and payments made using BTCs in the same system that I use for USDs?

If not, are there any suggestions for how best to do this?

Just found Kashoo.  Freemium, or $10/month.  Haven't used it yet though.

http://www.kashoo.com

Also, what might work, Aqilla:

http://www.aqilla.com/multi-currency-ledger

Infinity PFM (Personal Finance Manager) can read transactions from the Bitcoin.org client:
 - http://launchpad.net/infinitypfm

Ledger:

http://www.ledger-cli.org  <-- Command line only, no GUI.
http://www.reddit.com/r/Bitcoin/comments/155gw5   <--- Writeup


Splitting BTC and BCH from cold storage using bitcoin core wallet sending to exodus I had BTC long before the forks of BCH (bitcoin cash) and any of the others.

I wanted to finally split some BCH off of my BTC and so this is what I attempted to do

Bitcoin Core Wallet Send to Exodus Wallet
I verified the blockchain and refreshed Exodus and I see  .023 BTC  ( $181.41 currently)  .
I clicked on Help in Exodus and the claim your bitcoin cash in which it is supposed to scan to see if I have any BCH
It says none found.

Either this is not how to find the BCH and split it of, or .023 BCH is too small of an amount ?

What other decent options are there as I want to split up at least the BCH from the BTC .

Did you import the keys from your bitcoin core wallet to the exodus wallet?

It seems to me that you simply transacted your bitcoins to another adress (+Wallet).

This however does not mean that your bitcoin cash will also be send to that adress ( unless there was no replay transaction of course.(Which there is))

Your bitcoin cash is still at the adress where your bitcoin was at the time of the split.
Import that adress ( or rather the private key) into a bitcoin cash compatible wallet and you should see your BCH balance.


Who bitcoin get the transaction fee? part2 I know this question asked before, but the answers give still make no sense to me.  The most common answer is "the transaction fee goes to the miner" I'm in a small mining community and nobody ever received a fee. So I'm curious who is are the people and companies who really receive the fees, because this seems to be real real big business.

Miners receive the fees. Really.

If you're not getting fees, either you mine in a mining pool that doesn't keep track of fees and block reward separately, or you mine for a mining pool that doesn't distribute transaction fees to its miners, or you aren't including transactions in your blocks.

So either 1) you get the transaction fee, but you don't know it, or 2) the pool keeps the transaction fee, or 3) the pool includes no transactions and therefore gets no fees.


How to track the bitcoins I spent? I'm studyng the transactions and how they work.
Suppose I would track some bitcoins that I spent.
This is a scenario:
My pubblic addresses are: addr1 and addr2.
I made a transaction tr1 (output like blockchain.info):

tr1
input addr1 2BTC        output  addrX 1.5BTC
                                addr2 0.4BTC
                                addrY 0.1BTC

Now I would know where will be spent the 1.5BTC that I sent to addrX.
Suppose I use the blockchain.info explorer and the addrX makes another transaction tr2.
What I do is:

1 - search for the addrX,
   2 - find the tr2 where my input of 1.5BTC is spent
   3 - reapet the first step but with the addresses specified in output of the previous transaction

Am I correct? In this way can I "follow" the bitcoin that I spent?
Many thanks.

Yes, you are correct. This is the way to follow. To easily follow you can use tools like blockseer


Out of order mempool TX I notice that mempool messages result in multiple tx messages, usually completely out of order.

What I generally do is re-queue the message until the parent is processed, however that doesn't seem to be the right approach. If the parent can't be verified, shouldn't it be discarded immediately?

In a hostile scenario I could receive an unsolicited tx that relies on an unseen parent. What are the best practices here? Just wait up until N seconds and then discard?

If the parent can't be verified, shouldn't it be discarded immediately?

Then you risk needing to redownload that transaction.

  What are the best practices here? Just wait up until N seconds and then discard?

I think what bitcoin does, adding it to a size-limited cache, works well in practice. You just have to make sure that when you receive the parent you broadcast invs for both the parent and the child (assuming the child is still in the size-limited cache).


Setting up a coinbase like service in India , need suggestions I have read and researched extensively on bitcoin, but I haven't found any service like coinbase that allows a user to buy or sell bitcoins online without having a US bank account. So how can one start an exchange like coinbase for India ? What are the legal obligations and initial startup cost ? Any advise would be welcome.

You should first consult a lawyer in your country and discuss such topics as:

Money laundering laws
Whether Bitcoins are considered a currency, commodity or none of the above
Regulations considering money exchanges

In relationship to the law in your country. It would also be good to asking a legal representative of the government for an official statement in writing on trading Bitcoin and their legal status. This way you would be able to refer back to that decision in case any legal doubts come your way.

Having done that, the procedure would probably be similar to starting any business in India, with a possible addition of any special laws that you'd have to abide by when running an online money exchange.

I should state however, that I am not a legal expert nor do I have any experience with running a business in India. As stated above, consult a lawyer before taking actions.


dumpwallet always corrupts my wallet I have repeated this process a few times, always with the same error.

In one terminal,

./bitcoind -testnet

in another

./bitcoind -testnet getnewaddress

mgj4Y8AvckxborhQzqFAhppcGVGFExqJvB

./bitcoind -testnet dumpwallet /path/to/testnet3/wallet.dat

error: {"code":-1,"message":"CDB() : can't open database file wallet.dat, error 22"}

./bitcoind -testnet stop

Bitcoin server stopping

In the original terminal,

libc++abi.dylib: terminate called throwing an exception
Abort trap: 6

Then I type

./bitcoind -testnet

Error: wallet.dat corrupt, salvage failed

Anybody have an idea what is going on? I updated my bitcoin to the latest on github. I also searched for the error 22 but didn't find anything. I'm guessing CDB means corrupted database. I also looked in debug.log, but I didn't see anything weird.

I know it is the dumpwallet command that is breaking it, because when I omit it from this process, nothing breaks.

The same things happens on the mainnet, altho I have not tested it as much.

Am I using the dumpwallet command incorrectly?

The path you pass to dumpwallet is the filename of the dump.

If you pass the name of your wallet database itself (or any existing file, actually), it will get overwritten.


How to know where number of inputs field ends in a transaction if it is not a fixedsize field? I know that we parse a transaction in bytes. So there are 2 quesions that I search for the answers of:

1- Can VarInt field -that gives the number of inputs in a transaction- be more than 2 hex digits(2 Hex = 8 bits = 1 byte)? I am asking this to be sure that it is not fixed size. We know that 2^8 = max 256 and I am pretty sure that there can be more than 256 inputs in a tx.

2- If it is not a fixed size field how do we know where number of inputs field ends or prevTx field starts?

A Varint is a Variable Length Integer, and can be up to 9 bytes in total

It is usually only one byte, which can represent numbers 0-252. 253-255 (0xFD-0xFF) are used as markers for the next three lengths.

Marker    Payload
None      1 byte of integer data
0xFD      0xFD followed by two bytes of integer data
0xFE      0xFE followed by four bytes of integer data
0xFF      0xFF followed by eight byes of integer data

Each marker indicates how to interpret the upcoming bytes.


Will all crypto-currencies exist on the same lightning network? In the basic form, lightning-network is a chain of iou:s in one currency. But as far as I have understood, the plan is to put atomic swaps on lightning network. Will this mean that all currencies exist in the same lightning network? Does LN care and know about the curreny that is exchanged? Will it also work out the routing? What about exchange rates?

The Lightning Network can be used across currencies, but each individual payment channel must only correspond to one currency. Furthermore, each currency must use the same inputs and outputs system that Bitcoin uses and a similar scripting system for the HTLCs to work. Other than that, I think the Lightning Network should work across multiple currencies.

  What about exchange rates?

Exchange rates don't matter to anything technically, so they have no effect on LN.


Do I need the bitcoin client running in order to receive bitcoin? I am new to this and don't have any bitcoin yet, but I was wondering if I were ever to get any, will I have to have the client running in order to receive them?

Also what would happen if the client it not running at the time a bitcoin is sent to the address?

No, you do not need to have the client running to receive payment on an existing address. Your transaction would go through because bitcoin transactions aren't contained on a local file, but a distributed ledger called the "blockchain."

You don't need to be logged in or anything to receive bitcoin.  What's important is to keep your wallet file containing your bitcoin private keys secret and backed up, as without those, you have no access to the address with your bitcoin.

In fact, a lot of people, fearing their computers being compromised by hackers, actually advocate you store large amounts of bitcoin in a wallet that's generated offline and stored on an offline computer, USB flash drive, or piece of paper.  This practice is called cold storage, and is a very good idea for large amounts of bitcoin you don't want to lose and have no intention to spend quickly.  So, the paranoid strategy would be to never have your wallet online, believe it or not.


How to make paper wallet from Electrum wallet I see a lot of information about how to import a paper wallet into Electrum but can't find much in the other direction.

I want to generate a paper wallet from bitcoinpaperwallet.com (locally) so that I can store the amount. To do that I need a WIF private key. In Electrum I can see my master public key, my transaction ID, my receiving address, and I can export private keys. When I export private keys it is 27 pairs of addresses and private keys.

I see this conversion procedure, from the bitcoin wiki, for private keys to WIF or vice versa. And gobittest.appspot.com/PrivateKey to implement it.

My question is why are there 27 key pairs in electrum for one wallet? Do I choose one and convert that? Is the balance split up amongst the keys?

My question is why are there 27 key pairs in electrum for one wallet? [..] Is the balance split up amongst the keys?

Yes, a wallet is a collection of private keys their corresponding addresses. Best practises for making transactions includes using a new address every time you receive bitcoin, and almost every send will also generate a new 'change address' that your wallet software controls. Any wallet that is used to transact will end up being a collection of keys, unless it is poorly coded. Search for 'bitcoin address reuse' to learn more about why this is the norm.

  Do I choose one and convert that?

By choosing one, you will be storing that specific address' private key, and none of the others.

If you would like to make a physical backup of your entire electrum wallet, then you should make a copy of your mnemonic seed phrase. This seed phrase is used to generate your master private key, and each subsequent private key your wallet generates will be derived from this master key.

I don't know your exact intention, but I think it is worth mentioning: the usefulness of a cold storage paper wallet is that it is preferably generated on a machine which never connects to the internet. This helps protect your keys from 'hacking' attacks, largely reducing the attack surface to physical breaches (ie someone breaks into your house and steals the physical paper wallets). So creating a paper wallet that is just a copy of one of your electrum addresses does not give you any additional security (rather, it would increase your attack surface). In general, this is why there probably isn't a good tutorial for 'creating a paper wallet that matches a software wallet': the best way to back up a software wallet is to store the seed phrase! Using paper wallets to do the same adds unnecessary complications.

Also worth mentioning: do NOT input your private keys into the website you linked that does private key format conversions. If you must use it, you should save the html file and open it in a VM or offline machine.


What is currently the fastest way to buy a large amount Bitcoin? I want to purchase on the order of $10k of Bitcoin in USD. I can't seem to a find a way of accomplishing this in less time than multiple weeks.

I've been looking at the major exchanges, and it seems to be bad news all around.

Mt.Gox requires you to verify your account before allowing incoming wire transfers. This could take 5 days. Then you are required to wait at least 5 business days for it to be processed, then wait an unspecified period for their AML checks to be completed.

Other exchanges I've looked at (such as btc-e, bitfloor, etc) allow incoming wire transfers, however don't specify how long the processing should take.

What is the quickest way I could theoretically accomplish this?

This might be your best bet... https://localbitcoins.com/


Arguments against Bitcoin using adaptive blocksizes Besides the risk of miners artificially increasing the average block size on purpose, what are some of the potential negatives of adaptive blocksizes?

Are there any advantages of human set hard limits? Are there any advantages of requiring periodic human intervention to evaluate and modify blocksize limits instead of codifying that task?

The strongest arguments against dynamic blocksizes which can be determined by miner actions, is that they do not necessarily represent the interests of other participants such as users, node operators, or even all miners.

If miners setting the blocksize have good equipment and connections, they may want blocks so large that others are forced off the network. This could include large miners (with the best equipment and network connectivity) forcing smaller miners off the network. Alternately, (some) miners may want a small blocksize while others would prefer a larger one, but be unable to exert any real influence.

Other issues may include concerns that a specific algorithm could grow too fast, too slow, down not allow for downward scaling if usage decreases, or could be attacked.

In summary there is significant:

Difficulty in designing an adaptive blocksize formula that cannot be
"gamed"
Difficulty in creating the best model to minimize cost of
node-option (CONOP)
Difficulty in designing a system that can
efficiently scale both up and down
Time and expense to compare
alternative formulas and thoroughly testing them

Finding the optimal CONOP model that can satisfy the above concerns will be difficult and time consuming. Until then blocksize limits previously set by humans (and possibly adjusted by humans to allow for more time to study/research codified adaptive blocksize solutions) is the best option available.

CONOP was introduced in this article by Paul Sztorc:

http://www.truthcoin.info/blog/measuring-decentralization/

The concept in the context of adaptive blocksizes was also recently discussed at the Bitcoin On Chain Scaling conference by Riccardo Spagni:

https://www.youtube.com/watch?v=mM2ra-LzMQk


Why does the Bitcoin protocol use the little-endian notation? Why does the Bitcoin use the litte-endian notation? It is less common than big-endian notation, thus when programming low-level applications working with Bitcoin protocol, one quite often has to create custom operations for handling the endianness switching. Is there some specific reason why this notation was chosen?

Modern computers almost always use little-endian internally, so this choice improves speed. If Bitcoin used network byte order, then order conversions would be necessary for every message sent or received.

Hashes are defined by the standards as being big-endian, and crypto libraries deal with them in that form, so hashes are transmitted in big-endian. Bitcoin displays hashes in little-endian because Bitcoin sometimes considers hashes to be little-endian integers instead of strings.


Migrating from bitcoin core to bitcoind I have installed bitcoin core in my ubuntu-14.04 which is working fine.
Now I want to install bitcoind in the same Machine. Can I install bitcoind along with bitcoin core or I need to uninstall bitcoin core from my machine.

What should I do to migrate from bitcoin core to bitcoind?

Thanks in Advance.

They are identical in functionality, data store, and wallet storage.

You can run one or the other, but not both at one time (this will throw an error if you attempt it).


When did litecoin fork bitcoin? I'm looking for the git tag of Bitcoin at the time of the fork as well as litecoin after the fork

Since the v0.8 release Litecoin is developed using patches to the Bitcoin code base.


I Found old wallet but there is new mined transactions but unconfirmed the wallet is old
but transactions are new 2020
transactions type : mined
unconfirmed

Those are orphaned blocks, it means while you were mining that block someone else mined it faster than you, thus you do not get the credit for those mined blocks.


Difference between regtest and testnet I'm not sure what is the difference between regtest and testnet, they seem are different things but i cant find the different between them.

Does one have more stuff than others?

On the regtest, peer are seem to not being found.

Regtest is a network designed solely to be private and for testing only. You can create a private regtest network and do testing and experimentation with it. It is not a public network and has no peers for you to connect to.


Why did my lightning node not route payments after I have funded 5 payment channels? I have setup a docker-compose with bitcoind and clightning.

After 28 hours funding 5 channels I see nothing at all. I do not expect income, but at least that the channels are used.

$ lightning-cli listfunds
{
  "outputs": [
    {
      "txid": "619571d8f0f7c356cc7cdd77f28b140f1fee9bea49bf1c25aabe17a32192310f",
      "output": 1,
      "value": 284232,
      "address": "bc1q3ml5k2xx9ky8x3fcywru9l49eq0a8rw5k8f39w",
      "status": "confirmed"
    },
    {
      "txid": "653a044a414d4d024e8516e576ebf03db1189fd65e0dbc6dd52927e8f1c33e6b",
      "output": 0,
      "value": 499710,
      "address": "bc1qsszjrex638sxs0z40gf9yqml5ys2kv6nvr2jwa",
      "status": "confirmed"
    }
  ],
  "channels": [
    {
      "peer_id": "0217890e3aad8d35bc054f43acc00084b25229ecff0ab68debd82883ad65ee8266",
      "short_channel_id": "557879:1140:0",
      "channel_sat": 500000,
      "channel_total_sat": 500000,
      "funding_txid": "0df805611c572682d333d20110db731def388421786c99bd716734321cab8c0d"
    },
    {
      "peer_id": "032b2b3f4abda9677bb9563e226c068d3a2456fb8b036635a81c9bcaa1671d1ada",
      "short_channel_id": "557879:1210:0",
      "channel_sat": 500000,
      "channel_total_sat": 500000,
      "funding_txid": "5e1ebf763dcefae3d54102acfebc6fa8f77cac52ffb4dedb445218d21af2e617"
    },
    {
      "peer_id": "03f163a59b2929b4b515d9dfd558f15ce23e95eadc109de013e6f7080d24644be2",
      "short_channel_id": "557879:1211:0",
      "channel_sat": 500000,
      "channel_total_sat": 500000,
      "funding_txid": "69517703573ebba263b4acee2943b91016f767d0bcf1e5c6b9364b3a325e0fdb"
    },
    {
      "peer_id": "027c3abc90a51617fb9cf5162c2fedfd9832c620ef82b54e413e9ce0f892dabb0d",
      "short_channel_id": "557879:1212:1",
      "channel_sat": 500000,
      "channel_total_sat": 500000,
      "funding_txid": "a80348c99aabecaa10b811efffd7bd023e1f0ef59bb311789c5775bb676e9c56"
    },
    {
      "peer_id": "02986d2a01e7955583f04876f5b6219e0741e43ebaa00246232106bade5b429498",
      "short_channel_id": "557879:1213:0",
      "channel_sat": 31603,
      "channel_total_sat": 31603,
      "funding_txid": "619571d8f0f7c356cc7cdd77f28b140f1fee9bea49bf1c25aabe17a32192310f"
    }
  ]
}

log shows:
lightning             | 2019-01-11T11:13:41.880Z lightningd(6): ... feerate estimate for slow hit floor 253

$ lightning-cli getinfo

{
  "id": "035aef5661e1a6e370db60dc0455796800afd5b51fbc12a0a8b34836b15f5d7ef6",
  "alias": "TWronald✅",
  "color": "15c315",
  "num_peers": 5,
  "num_pending_channels": 0,
  "num_active_channels": 4,
  "num_inactive_channels": 1,
  "address": [
    {
      "type": "ipv4",
      "address": "220.133.223.206",
      "port": 9735
    }
  ],
  "binding": [
  ],
  "version": "",
  "blockheight": 558062,
  "network": "bitcoin",
  "msatoshi_fees_collected": 0
}

https://1ml.com/node/035aef5661e1a6e370db60dc0455796800afd5b51fbc12a0a8b34836b15f5d7ef6
shows

Time Lock Delta     Min HTLC

What do these values tell me, do they need to be the same as the other side of the channel?

I wanted to claim my node at 1ML.com but they require me to send a certain amount to the channel, but I sent before already. I tried to close the channel. Now the channel is inactive. How can I add exactly that amount required? Do I need to to get the money back first and fund again? If so how do I do that?

First of all welcome to the lightning network and keep asking excellent questions!

the important information is within the result of the listfunds command. For example here:

"channel_sat": 500000,
"channel_total_sat": 500000,

The channel_total_sat says that the capacity of your channel is 500k satoshi. Whereas the channel_sat says that you own 500k satoshi of that capacity.

Since you have opened these channels and you did not spend money yet your channels cannot be used for routing or for receiving money. You would to find a person to open a channel with you that provides you with incoming capacity.

I wanted to open a channel with you to provide you with some inbound capacity but I cannot peer and connect with you:

lightning-cli connect 035aef5661e1a6e370db60dc0455796800afd5b51fbc12a0a8b34836b15f5d7ef6
{ "code" : -1, "message" : "220.133.223.206:9735: Connection establishment: Connection refused. " }

is your node behind a firewall and did you open port 9735?

The Time lock detla values can be configured by any node and do not have to match other nodes (though other nodes could decide not to use you for routing if your time lock values are too high). The meaning of those values are the time lock that is set in your HTLCs which are outputs in your commitment transactions used for routing. They technically only become relevant if the channel gets closed while a payment is routed. It is the time your node has to claim the funds with a blockchain transaction.

As for the 1ml payment I cannot help you. from your listfunds command I can only see that there is one channel (that is probably in the process of being closed right now) that suggests that you did not pay an invoice to them and something went wrong but I can't debug that with the information you have given.


Need to use two bitcoin core but issue with syncing Need to know how we can use two bitcoin node for example. I do have two bitcoin full nodes A and B. Created wallet address at A and has all transaction details at wallet.db in node A. But I need to keep PK in DB and take those and send request to B node, but it fails as it dont have all transaction details, I dont want to re scan B node every time, is there any way we can achieve this. So that i dont need to worry on which node my request is going.

Thanks,
Prad

You can just copy the wallet files from node A to node B.

Note that this is not recommended and may result in strange behavior. You will not have any labels synced across the two nodes as they really are operating independently of each other. They just have wallet files that have the same private keys.

If you just want node B to have the transaction history from node A, you can import addresses from node A into node B so that node B is watching the blockchain for those addresses.


Why was the BIP33 ("Stratized Nodes") never implemented? What are the technical reasons that BIP33 was never implemented ?

It seems to have expired
See BIP-0002

BIPs should be changed from Draft or Proposed status, to Rejected status, upon request by any person, if they have not made progress in three years. Such a BIP may be changed to Draft status if the champion provides revisions that meaningfully address public criticism of the proposal, or to Proposed status if it meets the criteria required as described in the previous paragraph.

To see the exact details of the discussion of this proposal I believe you need to become a member of the bitcoin developers mailing list and bitcoin developers forum.
If you look at https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2012-May/subject.html it seems this BIP was maybe superseded by some work on Bloom filters?
To get a complete picture, I think you'd have to dig around a lot more.


Restore android wallet on a mac Ok, so I have this bitcoin wallet backup.

I have the 12 word seed
I have a password
I have a number in this format ****/** that I wrote down.

I made this backup on an android tablet. Not sure which app. I think "Bitcoin Wallet", which is android only, apparently.

I obviously would like to restore it, but I don't own anything android anymore. Any way I can do this on any Mac/iOS app?

I tried putting my backup in Electrum's wallet folder, with no success.
I tried decrypting it as described here. Not sure what I'm supposed to do with the "decrypted" file that is as unreadable as the original.

help.

Update : I tried restoring with Multibit, which I read was compatible with Android Bitcoin Wallet because bitcoinj. Multibit accepted my seed and the ****/** number as a timestamp, did not recognize the backup file (which according to MB docs is not a big deal) and went on an all-night journey to 'sync' with the network.

In the morning I had a new wallet with 0 bitcoins in it.

Does this mean my wallet was empty all along? That I'm using the wrong seed? That I just need to find an old Android phone to try again?

This is what I would do:

Find/borrow an android device (from a friend, relative, co-worker, etc)
Install the Bitcoin software you used to have
Restore the wallet from the seed (when restoring from a seed, in most cases the password isn't needed, because you can set a new password after the restoration of the seed)
Make a new transaction and transfer all bitcoins to the new wallet address on iOS/OSx

Caution! The seed is the most important thing you have. Don't show/give the seed to anyone because they can recreate the wallet!


How do I get my bitcoins back if they got sent to an incorrect address? I loaded my localbitcoin wallet with a total of $100 - I did 2 separate transactions. The first time I added $50, I tried to send half of it to cardrockcafe but it never showed up, so I tried to add the remaining amount. That also never showed up. A few days later I added another $50 to my localbitcoin wallet and attempted to transfer it to a different website. Again it never showed up. I've set up tickets with all 3 websites and not really getting any responses that are helpful so I've been researching on my own what is going on.

I noticed that when I copied the address and pasted it onto another website the address changed to a completely different one. So I went back to my last few transactions where my money never showed up and the addresses are different as well; meaning the one I was supposed to copy and paste was different when I actually pasted it.

So I added money to a different wallet and I actually typed out the address when I tried to transfer my money to website C instead of copy and pasting them, and the money or bitcoins rather showed up rather quickly. I checked the receiving address of one of the last transactions where my money disappeared and the address is stating the money is still there, but I cannot get to it, or do not know how to retrieve it, can somebody help?

You appear to have caught some malware that replaces Bitcoin your addresses with their own when copy-pasting one. You'll probably want to look into removing the malware from your computer.

Meanwhile, it is unlikely that you'll be able to recover your bitcoins. The Bitcoin network doesn't have a way of reverting payments. Basically, you're in a similar situation as if you handed cash to a different person than the one who was supposed to get it. Unless you can figure out who it was that got it, there is no way to get it back. There is no central registry of Bitcoin users, and as a general rule you cannot identify users from addresses alone.


How to determine first byte (recovery ID) for signatures (message signing)? I do realize that in bitcoin when we return the signature result for signing a message the first byte includes information for recovering the public key required for verification using a formula like this:

27 + (4 if comp. 0 if not) + (0<=num<=3)

What I am struggling with is how do we determine that num number?
According to section 4.1.6 of SEC:1 for recovering public keys:

x = r + jn
Calculate Q based on R if invalid move to next
Calculate Q based on -R

Since j (cofactor of secp256k1) is 0 and 1 and there are two values for R. So there should be 4 possible public keys. Is num the number of public keys that we rejected before reaching the correct one? Because that is the only explanation that I can come up with based on comparisons I have made between signatures generated using Electrum and public key recovery I have done myself using SEC1.

Bonus question: Why was 27 chosen?

FWIW this is what I have found regarding this question. Basically there are two ways of finding what libraries call "recid" or recovery ID. Most of them use the first method but there is another way:
Method 1:

Only requires r and s so it can be performed by anyone as long as you have the signature and the "message" that was signed.
It is so much slower because it has 3 scalar multiplication and based on cofactor of the elliptic curve used the whole operation may be repeated 2*(h+1) times, which is up to 4 times for bitcoin with secp256k1 curve (99% of the time it is 1 or 2 times).

The steps are explained in section 4.1.6 of SEC:1, I won't repeat them here.
To find recid you check the calculated public key with the given public key or hash of it and report number of rejected public keys as recid. For example if x=r+(0*order) and Q was used then recid=0 and if -Q was used then recid=1 and so on.
method 2:

It requires full r or R=(xR, yR) so it can only be done while signing (requires having the private key).
It is much faster because there is no additional calculations. It just needs value checks which are fast.
This is usually referred to as v in libraries

byte v = if(R.X > curve.N) then 2 else 0) | (if R.Y.IsEven then 0 else 1);
Basically it is check to see if xR is bigger than curve order (N) and whether yR is even or odd. Something that should not be forgotten is a "flip" that is performed based on s and whether s was used in the signature or -s
if s > curve.N/2 then v^=1 else do nothing
** Note that in the end you need to calculate the following:
recid = 27 + v + (if compressed 4 else 0)


Development questions regarding debugging and control flow I'm looking for a better understanding of how the flow of the code works. I'm running bitcoind -regtest in one terminal window, and in the other I'm using bitcoin-cli regtest generate to create blocks. What I'm having trouble with is understanding exactly what is happening in the code when I'm creating blocks.

My assumption was that blockencodings.cpp was used for that, so I put a print statement in it, but nothing ever prints to the console. Is there some issue with printing to the console when regtesting? Or am I not understanding the control flow here. Just looking for some help understanding either debugging, or the chain of functions when generating a block.

You want to look at miner.cpp, and perhaps at rpc/mining.cpp for the generate function that's exposed to RPC.

blockencodings.cpp is pretty much only used for the compact blocks P2P format specified by BIP152, and has nothing to do with normal block generation.


Is the 21 Bitcoin computer using Core or Classic? The 21 Bitcoin computer is using Core, right? I can't find any information that says otherwise. Can someone please confirm this for me though?

I assumed so myself since the alternatives were not in a mature stage (technically and/or socially accepted) when 21 released their computer.

However, in their tutorial they do say that you will have a Bitcoin Core full node running at the end.


how to get a seeed wallet in bitcoin-cli? hi how to get a seed wallet in bitcoin_cli ?
I use a bitcoin-cli sethdseed
but error :invalid private key
please help me

Bitcoin core wallets are deterministic by default i.e. all private keys are derived from a seed. However you can make sure that your wallet is deterministic by running the getwalletinfo command. In the response hdseedid  will only be set if it's an HD wallet.
Bitcoin core does not encode the seed as a mnemonic of english words. To create a backup of the wallet use the backupwallet command.


Pregenerate multiple receiving addresses In bitcoind I can generate addresses one by one. Is there a functionality that helps me generate 250 receiving-addresses for my wallet.dat at once?

Better use this software:

https://github.com/samr7/vanitygen

You can easy generate any amount of bitcoin's addresses:

# time for((i=0;i<250;i++));do ./vanitygen 125; done > 250_new_addressess.txt
real    0m9.437s
user    0m2.020s
sys     0m0.316s
# cat 250_new_addressess.txt
....
....
Address: 125r2fVnSXd6BtF66kTi83DuRzgzJmshPF
Privkey: 5JMqHqGccJjNz48izM6CEdDrTJ9P8DYRXQ96wcZhn86MWutECo1
Pattern: 125
Address: 125URJpbqr5eANYfLrhQVinQeexy2WfdhW
Privkey: 5Kh9eqyJQNzxCWMtfX1r6cPjAdmqJnZEceV8WmwRjYunHqTk7Hu
Pattern: 125
Address: 125wwU55kXQgDQYd8fQySNLQKS8AdRUote
Privkey: 5JZjn5sPnSqjbtBuXpuKcVDRa4bR5vxzWUZ9LCHsiscixBSyuGt
Pattern: 125
Address: 125N16rwWHgVWnAZYpz5XBvWptRhJ6iBKg
Privkey: 5KhX1Y1WjCu3dpHB2DPWt6f2mRFeMJCtkYZK66ApxTDM2iHMSM7
Pattern: 125
Address: 125HjL2QSCSUQHNExbMoSAUhHsz4GBuz3w
Privkey: 5JtMy31VbfK5xLtcwmALMjQj2WPMd6eLDe7tJR6T9bjwRwiimbW

Thereafter, import private keys one by one into the bitcoind:

# bitcoind importprivkey <bitcoinprivkey> [label] [rescan=true]

For example:

# cat 250_new_addressess.txt  | grep "^Privkey" | awk '{print $2}' | while read i;do bitcoind importprivkey $i "250 new addresses"; done

Additionally,

If you doesn't looking for "named" address, like 1uckyboyPT44PWgA5bu4NtxFMuCN or something or have no resources to generate cool named bitcoin address.

Then you can easy get any amount of address just by bitcoind the same way:

$ time for((i=0;i<250;i++));do bitcoind getnewaddress "250";done
real    1m48.950s
user    0m0.612s
sys     0m0.432s

Its pretty fast.


Which receiving address does my block reward go to when mining through bitcoind? I'm wondering where goes the BTC as my bitcoin server finds a block?

Using bitcoind, I see no setting for a bitcoin address..

Apparently, bitcoind creates a new address for the block reward and puts it directly in your wallet.dat file.

I suppose it is stored in your default wallet, but as a new address.


Could a futures market be included in the Bitcoin protocol? One of the most common reasons I hear that Bitcoin is "not ready for prime time" is that because of its wildly oscillating valuation businesses can't accept bitcoins without becoming speculators.  In my own experience trying to use bitcoins for business, I have found this to be quite true--at the very least, it is a significant problem.

The most common solution I hear offered for this problem is that the emergence of a stable, high-volume futures market may allow for businesses to transact in bitcoins while ignoring market volatility.

If this is the case, it leads me to wonder--is there any way to incorporate some sort of futures market directly into the Bitcoin protocol?  That way bitcoins themselves, like gold, could oscillate up and down according to market demand, but through some sort of digital derivative on them, people could trade much more stable values.  Are there theoretical and practical barriers to this?  What are they?

Silk road's hedged escrow is a first step in this direction, and seems to work.  But all the "trades" are bilateral (SR is always one of the parties) and you can't "buy" the "contract" unless its to hedge a sale made through the SR website.


Bitcoin erupters not stable on Ubuntu and cgminer 3.3? I setup p2pool on my ubuntu  12.04LTS x64 machine. Installed cgminer 3.3 and ran it. the newest cgminer is supposed to support the USB mode with the erupters without any extra configuration.

I have 2 erupters on a powered usb2 hub and 2 running off the motherboard direct. The hashing is just not stable; jumping from 50mh to 300, then getting sick and restarting- there are a ton of rejects. The avg on 4 should be 1.2gh but I am hardy getting 300mh.

I don't know what is wrong. I have been reading many posts all over over the place, one after the other and I am stumped. It is not meant to be this difficult- is it??

What did I miss?

I am now using cgminer 3.4.2 (Ubuntu 12.04LTS) as it is much more stable than bfgminer and all the bugs in cgminer have been worked out (it also supports hot plugging)

The best way is to compile cgminer from git direct. There is some dependency on usbdev1 that needs to be compiled into cgminer.

Install the dependencies using apt-get (including all the build stuff)
Make a direcotry somewhere and go into it
git clone git://github.com/ckolivas/cgminer.git
cd into the cgminer directory
./autogen.sh --enable-bflsc --enable-icarus --disable-opencl
CFLAGS="-O2 -Wall -march=native" ./configure --enable-bflsc --enable-icarus --disable- opencl
make -j8
Run cgminer from that directory, without any options. (except the mining pools you need) It will pick up on the erupters and is ready for BFL rigs too! Hot plugging works well also!

Its not running full speed because I have a slight power issue after adding 7 more. Need a new PSU


What is the length of largest known reorganization in bitcoin? Usually there is an assumption, that a transaction is fully finalized after 6 confirmations, e.g. 6 blocks mined on top of the block, which includes given transaction.

What is the length of largest known reorganization in bitcoin?

There have been only two large re-orgs in Bitcoin's history. The first is the value overflow incident in August 2010 that caused a re-org of 53 blocks and the March 12, 2013 fork that caused a re-org of 24 blocks.

Value Overflow Bug
On August 15 2010, it was discovered that block 74,638 contained a transaction that created 184.4 billion bitcoins for three different addresses. Two addresses received 92.2 billion bitcoins each. Yes you read that right. 184.4 billion Bitcoins!!! This was possible because the code used for checking transactions before including them in a block didn't account for the case of outputs so large that they overflowed when summed.
Integer overflow is the digital equivalent of a mechanical odometer wrapping around to zero after the car drives 999,999km. The overflow caused the software to think that the transaction contained only a small amount of BTC while in reality the outputs together had thousands of times more than the 21 million that should ever exist.
Satoshi published a new version of the client within five hours of the discovery. This release contained a soft forking change to the consensus rules that rejected output value overflow transactions (as well as any transaction that paid more than 21 million bitcoins in an output for any reason).
Although many unpatched nodes continued to build on the "bad" blockchain, the "good" blockchain overtook it at a block height of 74,691 at which point all nodes accepted the "good" blockchain as the authoritative source of Bitcoin transaction history.

March 2013 Chain Fork
The v0.8 release of Bitcoin Core switched the database that it used to store blocks and transactions from BerkeleyDB to LevelDB as part of an effort to reduce blockchain synchronization time. A bitcoin miner running v0.8 created a "large" block (at height 225,430) that was incompatible with earlier versions of Bitcoin leading to the Bitcoin blockchain split into two, with one half of the network adding blocks to one version of the chain, and the other half adding to the other.
In order to make an update to the database, the database process must make a “lock” on the part of the database which stores that particular item of information, a mechanism implemented to prevent two changes from occurring simultaneously and accidentally corrupting the database. In a b-tree, the data structure used by BerkeleyDB to store objects, two locks are required per update. However, BerkeleyDB requires its users to set a limit to the number of locks that can be made at the same time. If the values are too small requests for locks in an application will fail. If the values are too large, the locking subsystem will consume more resources than is necessary.
In the case of Bitcoin, this limit was 10,000. What happened in block 225,430 was that a single block simultaneously affected the status of over 5,000 transactions, requiring more than 10,000 locks on the b-tree to be made at the same time. As a result, BDB failed, and so the older (v0.7 and earlier versions) could not read the block. In the case of v0.8, LevelDB has no such restrictions, so it could accept such blocks just fine.
It was finally resolved by miners downgrading their Bitcoin Core to v0.7. This placed majority hashpower on the chain without the "larger" block, thus eventually causing the v0.8 nodes to reorganise to the v0.7 chain.


What is the use of hashing the public key to obtain the bitcoin address? What is the use of hashing the public key to obtain the bitcoin address (except to compress it) rather than using the public key directly?

Why not deal with public keys directly?

Early renditions of the Bitcoin client did use raw public keys in this way for pay-to-IP-address transaction orders, it's still valid to spent an output to <raw pubkey> OP_CHECKSIG, though miners might not be willing to include it in a block.

Before an output owned by a fresh address is spent, the hidden public key points are unknown to anybody but the creator. If the situation arises that ECDSA is weakened there is only minimal exposure between signing a transaction and having it included in a block. To transition from a weakened ECDSA a new signature algorithm would be soft-forked into the consensus and outputs quickly shuffled over to using it instead. This bit of protection is effectively gained for free so it would be silly not to use it, though some wallets choose to re-use addresses multiple times which destroys the protection offered by this system.

As pointed out addresses are also appreciably shorter at 20 bytes rather than 33 or 64 bytes, which makes a difference if you have the need to manually transcribe one.


Bitcoin 2 of 4 Multisig script with one required Hi I am to write a bitcoin locking script with property that 2 out of 4 signatures should be verified, but among those verified 2 there is a specific signature that should be verified.
I.e only 1 manager combined with 1 employee in a 4 employee company(including manager) can unlock the script, but the order of the signatures in unlocking script should not be important.
I have given a lot of thought to it, but was unable to satisfy the property that order doesnt matter in unlocking script. Could you please help me?
Thanks in advance!

Bitcoin script does not let you require a specific signature, however you could give the person that is required to have a specific signature additional keys and change it to a 4 of 6.
Manager has 3 keys.
Employee 1 has 1 key.
Employee 2 has 1 key.
Employee 3 has 1 key.
With 4 signatures required to spend the Manager only needs one employee present to sign, however the 3 employees can not produce a fully signed transaction without the Manager present as their 3 keys combined does not meet the 4 minimum required.


How to get my bitcoin payment confirmed? I have invested some bitcoins on a website.
They have made a payment to me of 0.002 bitcoins to my BTC wallet, but it is unconfirmed for more than 24 hours now.

Is it due to low mining fees is given from the sending party?
What can I do about this?

Unfortunately there is not much you can do yourself, other than contacting the sending party or simply waiting a bit longer. It is, as you suspect, most likely due to low transaction fees.
For more information you can take a look at this similar question (which is from a senders perspective):
Why is my transaction not getting confirmed and what can I do about it?


Where can I find the technical discussion between Satoshi and other contributors in the sourceforge website? Where I can find the technical discussion between Satoshi and other contributors in the sourceforge website?
I read the book of Satoshi in spanish and really excited about his comprehension of the economy especially for Satoshi. I was disappointed because couldn't find the technical concepts.
I'm Searching the comments in the forum especially Satoshi with Hal Finney
Where can I find all the comments?

Try https://satoshi.nakamotoinstitute.org
I believe this group has attempted to consolidate all known messages written by Satoshi Nakamoto on their site.


Why is the difficulty adjustment restricted to a factor of 4? What does this protect against? And why 4 in particular?

I know an adjustment of this magnitude is not likely to take place at this stage, but I'm wondering why this was implemented in the first place.

You need restrict how much difficulty can change. Imagine if someone managed to forge the timestamps on the block that they were creating, and make it so that it appeared that it only took one second to generate 2016 blocks. Should difficulty then go up by 1209600? Clearly, that would be ridiculous.

On the other hand, you need to make the adjustment flexible enough to adapt to unforeseen advances. 4 is an arbitrary value picked as a compromise between these two requirements.


How much are accepted shares on GUIMiner worth? I have just started Bitcoin mining and am using GUI Miner. I have an AMD 7870 OC edition that is mining for me. Currently i'm getting 380 mhash/s, is this good? Also how many of the accepted shares are worth 1BTC?

I have just started Bitcoin mining and am using GUI Miner. I have an AMD 7870 OC edition that is mining for me.

Welcome to mining. It's a blast.

  Currently i'm getting 380 mhash/s, is this good?

For Bitcoin, it's unlikely to be profitable unless your electricity cost is very low. See How much Bitcoin will I mine right now with hardware X? for more information.

  Also how many of the accepted shares are worth 1BTC?

None. It is unlikely that you will see 1 BTC total mining on that card during its lifetime. See the above link for why.


What data is available to Ethereum smart contracts? I'm wondering - what data is available to the Ethereum smart contracts? I stumbled upon some tutorials on how to write the contracts that give some indication as to a few examples of the data is available, but a more comprehensive list / wiki page would be useful to have for reference.

I'm not sure if this is actually complete, but the solidity language runtime exposes most of the useful stuff:

https://github.com/ethereum/wiki/wiki/Solidity-Tutorial#block-and-transaction-properties

So basically, only existing state and new data entered as arguments from new signed transactions. This means "real world" data mostly has to come from some kind of oracle mechanism.


oclvanitygen not compiling I am trying to compile oclvanitygen because I have an Nvidia GTX 1080 that would most likely be helpful for this. I'm using the Windows Subsystem for Linux with Ubuntu 18.04.

I tried this command: gcc oclvanitygen.o oclengine.o pattern.o util.o -o oclvanitygen -ggdb -O3 -Wall -L/usr/lib/x86_64-linux-gnu/ -lpcre -lcrypto -lm -lpthread -l:/usr/lib/x86_64-linux-gnu/libopencl.so.1

It basically says that libopencl.so.1 does not exist. However, I have libnvidia-opencl.so.1, so I try this command: gcc oclvanitygen.o oclengine.o pattern.o util.o -o oclvanitygen -ggdb -O3 -Wall -L/usr/lib/x86_64-linux-gnu/ -lpcre -lcrypto -lm -lpthread -l:/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1

Then it says /usr/bin/ld: cannot find -l:/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1

So I do a list of x86_64-linux-gnu, and there it is, clear as day. list of x86-64-linux-gnu

How can I compile this correctly? Here is a picture of what happens when I run the command: GCC Command

I have installed the ocl-icd-opencl-dev package, but it does not include libopencl.so.1.

Please tell me if I am doing something wrong. Thanks!

Perhaps, if you want to generate a vanity address, I suggest you use Vanitygen Plus

https://github.com/exploitagency/vanitygen-plus (More up to date and features)

and to compile, run make -f Makefile after u clone the repo and cd into it.


Receive money in regtest mode I am working on a app in which my project communicates with the bitcoin server to get the details of a transaction with transaction id as the parameter. I have bitcoind, bitcoin-cli and bitcoin-qt installed on my system. When I run the bitcoin-qt in regtest mode, I am able to create test transactions in which I can send money to an address and get the transaction id for the same. I use this transaction id in my app, I am able to get the transaction details from bitcoin-qt. The problem is, now my testing is limited to only outward transactions wherein I transfer bitcoins to another account. How can I create some test transactions wherein bitcoins are credited to my wallet?

You probably want to run multiple bitcoind instances in regtest to simulate multiple nodes.
Thats pretty easy. You can run a second instance by starting bitcoind with a clean data directory and a different RPC and P2P port.

For that, you could create a 2nd data directory (example: /tmp/datadir2). Create /tmp/datadir2/bitcoin.conf.

Use something similar than:

regtest=1
rpcuser=rt
rpcuser=rt
port=12340
rpcport=10340
discover=0

Now you need to connect your first node with your 2nd node by sending a addnode over the RPC interface.

bitcoin-cli addnode 127.0.0.1:10340 onetry

You can than distinct between both nodes with the -datadir argument while calling bitcoin-cli.

bitcoin-cli -datadir=/tmp/datadir2/ getinfo

Some examples:

generate coins in first node (50 BTC available)

bitcoin-cli generate 101

get address from 2nd node

bitcoin-cli -datadir=/tmp/datadir2/ getnewaddress

send coins to 2nd node

bitcoin-cli sendtoaddress <address> 10.0


Is it possible to buy half of a full bitcoin? I've noticed that certain products online do not require a full bitcoin to purchase. My question is do you need to start with one full bitcoin in order to make a purchase of such items?

No, you can transfer fractions of bitcoins easily. From the Myths section of the Wiki:

One Bitcoin is divisible down to eight decimal places. There are really 2,099,999,997,690,000 (just over 2 quadrillion) maximum possible atomic units in the bitcoin system.
The value of "1 BTC" represents 100,000,000 of these. In other words, each bitcoin is divisible by up to 108.
As the value of the unit of 1 BTC grew too large to be useful for day to day transactions, people started dealing in smaller units, such as milli-bitcoins (mBTC) or micro-bitcoins (μBTC).


Why is my blockchain.com not receiving bitcoin? I created a wallet on blockchain.com, copied the address from the '' bictoin request '', sent it to the person, and that person sent me a bitcoin after a few hours.
After a few hours my laptop restarted. When I logged in again, the Bitcoin address was different.
Bitcoin was sent to that address, but my wallet no longer recognizes the address it generated.

Can I recover the amount of bitcoin? What can I do?

Your bitcoins are not lost.

What you observed is completely normal behavior which one would experience across most wallets. The wallet generates a new address once it detects that you have received coins on the previous address. This is done to minimize address-reuse which improves the privacy of the sender and the receiver.

This has nothing to do with your laptop restarting.


Is Bitcoin Core storage compatible across different machine architecture? I want to run Bitcoin core on a raspberry PI (arm32v7), but the initial sync takes way too long.

I am thinking importing the UTXO set from another of my node which run on x64.

Would it work? Is it safe to assume it will always work?

The database format is supposed to be compatible across architectures.


Why are UTXO locks stored in memory only? Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list
is always cleared (by virtue of process exit) when a node stops or fails.

https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/lockunspent/

Because it was added as memory-only filter by Jeff Garzik in PR: https://github.com/bitcoin/bitcoin/pull/1861/

It might be nice to store this in the wallet, but to judge interest and review the interface, this is a useful first step.

Couple of users who care about privacy wanted persistency for locking unspents and created issue: https://github.com/bitcoin/bitcoin/issues/14907 but it was closed in May 2020 because of lack of interest and nobody tried changing it with a PR.


GDAX Java Limit Order (HTTP Post) Trying to send HTTP Post request to GDAX with auth. The 'GET' requests work fine and I'm unsure if I am passing the json params correctly as I keep getting Bad Request.

private static JsonObject LimitOrder(String symbol, boolean side, String quantity, String price)
    {
        BigDecimal dPrice = new BigDecimal(price);
        BigDecimal dQuantity = new BigDecimal(quantity);
        String sSide = side?"buy":"sell";
        String param  ="{\"size\":\""+dQuantity.toString()+"\",\"price\":\""+dPrice.toString()+"\",\"side\":\""+sSide+"\",\"product_id\":\""+symbol+"\",\"post_only\":true}";

        try
        {
                String timestamp= Instant.now().getEpochSecond()+"";
                String accessSign = getAccess(timestamp,"POST","/orders");
                String apiKey = properties.getProperty("key");
                String passphrase = properties.getProperty("passphrase");

                URL url = new URL("https://" + properties.getProperty("host") + "/orders");
                HttpURLConnection connection = (HttpURLConnection)url.openConnection();
                connection.setDoOutput(true); // Triggers POST.
                connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
                connection.setRequestProperty("CB-ACCESS-KEY", apiKey);
                connection.setRequestProperty("CB-ACCESS-SIGN", accessSign);
                connection.setRequestProperty("CB-ACCESS-PASSPHRASE", passphrase);
                connection.setRequestProperty("CB-ACCESS-TIMESTAMP", timestamp);
                connection.setRequestProperty("accept", "application/json");
                connection.setConnectTimeout(5000);
                connection.setReadTimeout(5000);

        //      System.out.println("WRiting: " + param);
              try (OutputStream output = connection.getOutputStream()) {
                output.write(param.getBytes("UTF-8"));
              }

              String status = connection.getResponseMessage();
                System.out.println("STATUS: "+status);

                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuffer content = new StringBuffer();
                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                if(content.length()>0){
                System.out.println(content);
                }else{
                     System.out.println("Empty Response");

                }
                in.close();

                connection.disconnect();
            }catch(Exception e) {
                e.printStackTrace();
            }
        return null;
    }

and the access sign method below:

 private static String getAccess(String timestamp, String method, String path) throws NoSuchAlgorithmException, InvalidKeyException {
        String secret = properties.getProperty("secret");
        String prehash = timestamp+method+path;

        Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
        byte[] secretDecoded = Base64.getDecoder().decode(secret);
        SecretKeySpec secret_key = new SecretKeySpec(secretDecoded, "HmacSHA256");
        sha256_HMAC.init(secret_key);

        return Base64.getEncoder().encodeToString(sha256_HMAC.doFinal(prehash.getBytes()));
    }

Your JSON String seems fine, however I suggest you use JSONObject library class .

In your getAccess() method, I think you are missing the param variable.

   String prehash = timestamp + method + path + param;


Why are Bitcoin addresses hashes of public keys? Currently, Bitcoin addresses and their checksums are constructed from the public key by a using repeated hashing with SHA256 and RIPEMD160. Now I understand the reasoning behind using hashing for constructing the checksum, but why wasn't just the original public key with a checksum added used? Is it just because of the shorter addresses or are there other privacy/security implications of using hashes of public keys instead of just public keys?

It's just to get shorter addresses. Regular public keys are 65 bytes long, which is much too long to be convenient. Compressed public keys are 33 bytes and could potentially be used instead of hashes, though these are a little longer than 20-byte hashes. It also seems likely that Satoshi didn't know about compressed public keys or wasn't comfortable with using them when he designed Bitcoin.

Hashes seem to help against certain attacks (some attacks against ECDSA, for example), though they also open up the possibility of other attacks (such as attacks against RIPEMD-160). It's not clear to me that they do improve security overall.


What can be done with old (unprofitable) ASICs? GPUs used for bitcoin mining have many other purposes and can generally be sold after they are no longer mining enough Bitcoin to meet variable (electricity, etc) costs.

What uses do old ASICs have after they are no longer profitable to operate?

If your electricity costs are high, unprofitable for you may mean profitable for someone else.

Some miners may still use unprofitable ASICs either to support the network (at a smaller loss than with GPUs) or in hopes that BTC price will rise in the future (although just buying BTC in this case may be more profitable).

Try to sell them. If you have no success, then recycle them or use them as weights, benches, etc.


How is a Transaction Output Marked as Spent? The Bitcoin developer guide states that

  each output of a particular transaction can only be used as an input once in the block chain. Any subsequent reference is a forbidden double spend—an attempt to spend the same satoshis twice.

So how does a Bitcoin network node actually mark a transaction's output as spent? I imagine it would need to be irreversible, so that other nodes cannot revert the "spent" marker, but I cannot think of a way that Bitcoin could ensure that.

Where in the standard Bitcoin code does this marking occur, and how does it occur?

Every full Bitcoin node maintains a database of which unspent outputs are left.

When verifying a transaction, all its inputs are fetched from the database. If one is missing, validation fails. Among the data retrieved is the value of those unspent outputs, and their script (od address), which define the conditions under which the output can be spent. This information is necessary to validate whether the spending transaction has the correct signatures and does not create more bitcoin than it consumes.

If all validation of all transactions in a block succeed, the consumed inputs are removed from the database, and all outputs of those transactions added as fresh unspent outputs in the database, allowing them to be spent by future blocks.

As this database only contains outputs (so no signatures, for example), and even only the unspent ones, it is much smaller than the entire blockchain (some 450 MB as of juli 2014). So, no, we don't go scan through the entire blockchain to know whether outputs are not double-spent - we keep a separate database with just the data we need from it for validation.


Has any illegal data been saved in the Block Chain? Has any illegal data been saved in the Block Chain, such as an illegal number, or illegal prime?

While working on my master thesis I used the AACS encryption key (09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0), considered an illegal number, as a basis for creating a fake Bitcoin address - 1ujTAfEQh2obwdt72GrmXonakx2RxvYpX. A 1 Satoshi transaction was sent to that address from address 17TQLZvXjKTrUyRnV9DuQs4RVDgNjUPeXQ. The transaction was encoded in block 177653.


Why do hard forks need special rules to allow replay protection? I've seen a lot of methods hard forked chains use to provide both strong and opt-in replay protection so that transactions are only valid on one of the chains. Examples of such rules include using a transaction-invalidating output, and using a specific OP_RETURN string.

My question is why are any of these mechanisms neccessary to protect a holder from replay attack? More specifically, why can't a person who holds coins pre-fork protect themselves simply by spending a pair of coin-splitting transactions on each chain like this:

Alice has sole knowledge of the private key needed to spend UTXO A which is valued at 1 "LegacyCoin" before the hard fork.
Hard fork creates a new coin called "NewCoin" based on the blockchain history  of LegacyCoin.

UTXO A now contains 1 LegacyCoin according to the LegacyCoin network and 1 NewCoin according to  the NewCoin network because that's how hard forks work.

Alice creates and signs two transactions: one that spends A to B and one that spends A to C (both of which Alice also has sole knowlege of the priavte key).
Alice then simultaneously broadcasts these signed transactions on the two networks: broadcasting the transaction A->B only on the LegacyCoin network and the transaction A->C only on the NewCoin network.
Both transactions get confirmed on their respective networks and now Alice has effectively split the original value of UTXO A into the two blockchains in complete absence of any replay protection mechanisms implemented by NewCoin. The coins can now be concidered split because even if she spends B, no one else can spend C (and vice versa) becuase they are different UTXOs and require different signatures to spend. Also, obviously no one can spend A because it is already spent on both chains.

Why is statement in step 5 not true? Where does this logic break down requiring actual replay protection mechanism to be implemented by hard-forked chains?

The LegacyCoin network and NewCoin network are not distinctly separate from each other. Unless network magic and ports are changed, LegacyCoin nodes will be able to connect to NewCoin nodes and likely many will be connected to each other. So if you broadcast transaction A->B, on the LegacyCoin network, it will likely reach a NewCoin node which then causes the transaction to also be relayed on the NewCoin network.

Furthermore, even if the networks are distinctly separate, people can operate a node on both the LegacyCoin network and NewCoin network. Without replay protection, someone can take transactions that they are hearing on the LegacyCoin network and broadcast them through his NewCoin node and vice versa.

Lastly, two way replay protection should be mandatory because the process of splitting your coins with UTXO tainting is rather difficult. You need to have decent technical knowledge to do it and you will likely need to have modified software in order to do so. It is not something that ordinary users are likely able to do without some very specific instructions and there is a high probability that they will mess it up and possibly lose coins.


bitcoind: corrupted database? looris@Palace-of-the-Nine-Moons:/tmp $ bitcoind
looris@Palace-of-the-Nine-Moons:/tmp $ Bitcoin server starting

************************
EXCEPTION: St13runtime_error
CLevelDB(): error opening database environment Corruption: missing start of fragmented record(2)
bitcoin in AppInit()

This happens when I start bitcoind, any clue on what could I do to fix it?

I tried to run it with -rescan but the result was the same.

Just run ./bitcoind -reindex and this will fix your problem.

-rescan is for missing wallet transactions


Where are Bitcoin online casinos hosted? With a few Bitcoin-powered online casinos popping up every now and then, I am wondering where they are hosted and if they operate legally in the given area?

This is sort of a general question, so to simplify I'll pick a specific example: SatoshiDice.com
SatoshiDice itself
does not list their location.
DNS
A whois lookup shows that they host their DNS with a company called Public Domain Registry. Using their whois lookup shows that the domain name is registered to privacyprotect.org
Jurisdictions
Public Domain Registry: Beaverton, Oregon, United States
Privacy Protect: Claim an address in Austrailia, but also have a telephone number that begins with Denmark's country code.
Hosting
Their IP address resolves to 54.247.163.243, which is part of a /16 allocated to Amazon, and reverse DNS shows that it is part of their elastic compute cloud. The ARIN/amazon.com whois/amazonaws.com whois all have mailing addresses in Seattle. However, the servers are not located in seattle. A traceroute shows that this ec2 server is hosted in their eu-west-1 region. (i.e. Ireland)
Jurisdictions
Amazon: Seattle, Washington, United States
Amazon's servers: Dublin, Ireland
Conclusion
Maybe. What I know about international law could fill a thimble. But if you wanted to shut them down, there are a lot of jurisdictions that you could attack them in.


How do I create an offline transaction in java to broadcast via blockchain.info? Blockchain.info has a PushTX API.

How do I create & sign a raw transaction in Java for use in this API?
Should I use bitcoinj?

Are there any code samples?

Mike Hearn's WalletTool (included in the bitcoinj library) is a pretty good starting point.

If you have a look at the 'send' method in WalletTool you can see that it:

1) Creates a SendRequest

2) Decrypts the private key if necessary

3) Completes the tx to get the inputs and find the fee

4) Signs the tx

5) Starts up a PeerGroup

6) Broadcasts it

For an offline transaction you can do 1 to 4, serialize the tx and then call the blockchain pushtx.

There is a method on Transaction called bitcoinSerialize to convert it to the bytes that need transmitting. I think you just have to convert the bytes to hex for the blockchain pushtx but you would have to try it out.


Is there some way to take advantage of the fact that I own 10 BTC without spending them or giving up control of them? Is there some kind of "Bitcoin society" where I can instruct my Bitcoin Core to run a command which then spits out some kind of cryptographic code which verifies that I control/own the number of BTC in my wallet?

And then I give them that code, which only proves that I (as in "whatevernickname123 on BitcoinGentlemanclub.com") own this amount of Bitcoin, so that my account there can be labeled with a "verified to own X BTC" text?

And then that, in itself, without me having to try to convince anyone with words or easily faked screenshots, gives me power of the same kind that somebody who is known to own X amount of US dollars on a fiat bank would have without actually having to spend that money?

I don't want this in any way associated with my actual name/person; only the account on this site which I assume exists and whose purpose is to connect people who own Bitcoin for potential cooperation/business deals, avoiding all the scammers because they have to cryptographically verify that they own the coins.

Bitcoin Core > File > Sign message, then you can sign your nickname. Be careful, this signs for you address, not your coins, and anyone who can use a blockchain explorer can see to whom you send if you ever spend your coins.


Noob questions about transfering and offline security I created a wallet on a USB and one with coinbase.  I bought a bunch of bitcoin on coinbase and transferred .01 bitcoin to my USB wallet to make sure I transferred it right before I transfer everything and lose it all.  Than I transferred .04 bitcoin.  The next day I transferred .01 and than .04 again, because of buying limits while my bank account autherizes.  I checked the balance each time on blockchain.info and the money was all going in there just right.  I than was getting paranoid being new to this that I set up my USB wallet wrong and decided to plug it in to make sure I wasn't throwing my money away.  I plugged it in and it had the funds.  I wanted to do another test and transferred .01, than .05 to my coinbase wallet.  the .01 went and the .05 went but I lost .04 after transferring the .05 .  I understand that transferring can have fees and am wondering if that .04 lost is all in fees?  Would the fees for all the transfers be taken out at the same time?  I listed every transfer I had done up to that point in this and am curious if .04 is normal for fees for that many transfers.  Also, while on blockchain.info I see the addresses I have sent bitcoin to, but their are usually 2 addresses, one says "spent" and the other "unspent", or both will sometimes say unspent.  I recognize one of the addresses usually but not the other one.  Is the unrecognized address the address of the miner who performed the transaction and the number next to it the fee?  Finally, is my offline wallet now compromised and at risk of someone having the keys to it?  Should I keep using it and not plug it in anymore, or should I create an entirely new USB wallet?  thanks!

Transaction fees occur for each individual transaction and .04 btc is far too large for one transaction fee. You should open a ticket with Coinbase in order to receive an answer that will not sacrifice your privacy (by linking your transaction ID here).

Look up "change addresses" to understand why you are seeing multiple destination addresses for each transaction.

You offline wallet will remain safe unless you expose your private keys to the internet.


Stop bitcoin-qt from retrying transaction I sent some bitcoins, forgot to uncheck "no-fee" checkbox. The transaction started, but never got confirmed. In the blockchain after some time it was "purged". I expected my bitcoins back, however, what I believe is, the client tried to send them again - because the transaction appeared on the blockchain.info just after I turn the client on. And this cycle repeats now.
Is bitcoin-qt really retrying transaction? If so, how can I stop it?

Yes, Bitcoin Core will try resending the transaction until it confirms or is replaced. You can make it forget the transaction by starting Bitcoin Core with the option

-zapwallettxes=<mode>

Then, be sure to use the inputs in another transaction, because the transaction is still valid and might yet be confirmed. The only way to invalidate it is by doublespending the coins.

The easiest way to make sure that you have invalidated the old transaction is by moving your wallet's complete balance to a new address.


What incentive is there for a miner to not include a bad transaction? 'A' has got 1BTC legitimately. He sends out a transaction to transfer that one bitcoin to 'B' with a 1BTC transaction fee added on. (i.e. a bad request.)

'C' is a miner who cares nothing for integrity of the bitcoin system and only cares about winning blocks and selling the BTC he gets as soon as he can.

What incentive does C have to pass on the free 1BTC and not include A's transaction when putting the next block together?

Any block that contains an invalid transaction will be considered invalid as a whole, and every other peer/miner will reject it. A miner must check that every transaction included in a block is valid, otherwise there is a high risk that all the hard work required to solve the block is just being wasted.

Any miner who disobeys the validity requirements (by considering some invalid block as valid, or some valid block as invalid) will be completely disregarded by the rest of the network, defeating the point of any mining activity.

Note: Sending 1BTC with a fee of 1BTC is a perfectly valid transaction (even though it might be a mistake by A). Of course, doing that, A must own 2BTC and give them away, or the transaction can't possibly be valid.


How does a wallet decide which utxo to use? I am using a cold wallet and made a few tx two days ago. However, though what I wanted to send was a very small amount of btc, the wallet made multiple utxo of huge amounts get involved and now all my assets are locked up as the tx are unconfirmed.
Questions;

Why does a wallet have to use multiple utxo (input>output 2>2 or 3>2) rather than just use one and split it in two (1>2)? (the aimed tx amount is smaller than each utxo)
Is the algorithm to select which utxo specific to each wallet or is there any general rule throughout bitcoin network?

Why does a wallet have to use multiple utxo (input>output 2>2 or 3>2) rather than just use one and split it in two (1>2)? (the aimed tx amount is smaller than each utxo)

There's no generic reason a wallet would have to do that.

Is the algorithm to select which utxo specific to each wallet or is there any general rule throughout bitcoin network?

Specific to each wallet


Is there a BTC Address generator that will check first blockchain if unused? I'm looking for a working implementation of a Bitcoin address generator that would accept string or integer then it will check the blockchain if the address is unused before it will print the keypairs.

Any repositories with similar function is highly appreciated.
Thank you.

No wallet software checks to see if they are 'used'- for you to have a collision in addresses would be astronomically unlikely (impossible for this sort of scenario), or indicative that you're not safely creating entropy for your keys.


How can I accept Bitcoin as a payment without a 3rd party gateway I want to create a website where users can pay with Bitcoin. However I want to create my own payment gateway because I do not want to rely on services like BitPay. I want a unique BTC address for every user where the users can send money to this wallet and then spend the coins on the site.
I heard that it is possible with bitcoin-cli/bitcoind. I also have high skills in PHP and Linux so this isn’t a problem.

There are several solutions out there and currently the most hyped one is probably BTC-Pay. It also supports lightning, so you should be pretty future-ready.


Does a Vanity Address reduce the randomness / entropy of the private key? Is there cryptographic proof? Since a vanity address discards many "valid" keys in order to find one that matches a pre-determined string, I think that the "randomness" of the data would be reduced, thus weakening the key.

Is there any cryptographic proof that indicates how this is / is not a factor in reducing the security of a given address & private key combination?

... or at the very least calculate the degree of "lost randomness"?

Vanity Addresses only reduce the apparent randomness of a public key. The underlying private key is still just as random as always, as the private key does not have any special characteristics (it does not have a special pattern in front or anything like that). A given public key is as likely to be generated by a private key from range 0-10, as for 1000000-1000010 and the like.

If knowing some given pattern would make it more likely that one would be able to find the private key, then since every public key is known when coins are spent then vanity address or not, it would be just as easy to steal one's coins.


How to make a profit doing 'spread trading'? I understand making a profit via arbitrage trading between multiple exchanges. I understand what spread is (gap between the bid & ask). How can one make profits by leveraging this spread within a given exchange? Good examples will be helpful.
Thanks

If the spread is $40 you will buy $1 above ask price, then when fulfilled immediately resell the btc at $1 below bid price. You keep $38 profit per btc


Why is average time for block 8 minutes, when the target is recomputed to keep it 10 minutes? I found out that the average time per block (based on the last 10 000 blocks) is 464 seconds - something under 8 minutes.

http://blockexplorer.com/q/interval/10000

However, I thought that the target recomputing is done so it is kept at averagely 10 minutes per block. Where does this difference come from?

The network difficulty is recalculated every 2016 blocks.  The difficulty is adjusted based on the duration of the most recent 2016 block interval.  The difficulty can adjust up or down at most by a factor of 4.

Currently, the network is growing rapidly.  The network finds blocks at a faster rate than one per 10 minutes because the current difficulty is based on the hashrate of the previous difficulty interval.


Moving armory watching-only .wallet file I have set up an offline wallet on computer "A". I set up a corresponding watching-only wallet on computer "B". I have signed and broadcast several transactions. But now I wish to safely move the watching-only wallet to a different computer "C". Then delete the watching-only from computer "B".

Should I import a digital/paper wallet backup of the watching-only wallet? Is this enough to ensure all existing adddresses and BTC are moved?
Or should I copy the actual .wallet file manually?

Can this proces be repeated without issues?

Thanks

You can just import the watching-only wallet on system "C".  In fact, no reason to remove it from system "B" (if you don't want to).  It's okay to have multiple "watchers" of a given wallet.  Moving the watching-only wallets around doesn't actually move the coins, it just changes which computers recognize coins for which the offline computer has signing authority.


Do mining clients affect efficiency of mining? Excuse my ignorance. I'm new to this. When trying to start mining, does it matter which client I choose to do the mining? If so, to what end?

The mining clients does heavily affect the efficiency of mining.

Different mining software has a various developer fee, some are better written than others, and some are working better for nVidia while other are better for AMD.

The GUI miners are usually just a GUI wrap up for console miners, so different GUI miners also perform differently on different algorithms and hardware.

The loss you can experience if mining with wrong software can be from 0.1% to as much as 100%+.

That's why you should:
-have updated drivers(or best if latest aren't the best),
-do a research on your mining hardware potential,
-test as many compatible mining clients as possible.


Do I need to be already running a full node to run LND Lightning? I want to start learning about lightning network and try setting up a channel.  However I don't know if I need to already be running a full node.  I stopped my core client from syncing a while back.

Using LND, you can use the neutrino client (which is a lite client). Instructions are available here.


Does blockchain without currency make any sense? I keep reading about private companies building blockchains for stuff like supply chain management, and about the billions of dollars that are going to be invested in blockchain over the next 5 years, but there is a gap in the logic here that I don't get.
Distributed Ledger Technology is totally reliant on participation to establish the principle of Distributed Trust. If there are not enough independent actors in the network, you cannot rely on the immutability of the ledger.
In Bitcoin, the blockchain provides a way for participants to "profit", thereby pulling independent participants into the network. Participants are attracted to Bitcoin as they view it as an alternative to another currency (fiat) they perceive to be weakening in value.
Private and Consortium blockchains make no sense to me, but let's say some agency decided they wanted to seed a new public blockchain to do something like: verify that a particular coffee brand came from FairTrade sources.
How would they incentivise independent actors to verify transactions in this chain? Is it the case that they have to create a token reward, and hope over time that the token develops some minimal transactional value, and hope that early adopters make a return? Why would such actors not just participate in standard cryptocurrency blockchains?
It seems like a very hard sell, given the effort involved in running Internet connected hardware.
From where I'm sitting, its hard to see how a public blockchain can have any application beyond replacing fiat currency.
Is my understanding of this correct?

There are a number of research papers that cover the question "Do you need a blockchain?", e.g. the eponymous paper by Wüst & Gervais (2017) and the extensive Blockchain Technology Overview by NIST (2018). At a quick glance, the article When do you need blockchain? Decision models. by Meunier appears to provide a survey collecting a broad range of answers to the question.
The general gist seems to be that you only need a blockchain if all of the following conditions apply to your use case:

an actual business problem that needs solving
shared consistent state
multiple authors
append-only data
no sensitive information
participants do not agree on single trusted third party

Since blockchains are complex and wasteful, they usually are not a better solution to problems that can be solved building on trusted third parties, audits, and distributed databases. If one or multiple of the listed criteria are not met, your problem can likely be more easily solved using these well-explored approaches. Blockchains tend to be the best approach only when they are the only option.
Meunier concludes a bit tongue-in-cheek that the only convincing application so far is the creation of unregulated money.


Why does mining / validation of new blocks have to be complicated / time consuming? Why does mining / validation of new blocks have to be complicated / time consuming ?
Why it can't be as simple as just find a hash for a text?
Is it just to control / limit the amount of new crypto volumes coming in ? If this is the case, isn't it an energy consumption issue ? Aren't there any other solutions ?
Sorry for asking too many questions. I am just a bit confused.

If mining was simple I could find a hundred million blocks in the next five seconds.
Would that be helpful? What would we do with all those blocks?
Thinking about these questions should help you answer yours.


Is there a way to pay my credit card balance with bitcoins? So imagine that I have 200 USD on my credit card balance from a bunch of small purchases and bar drinks and tips that I want to pay using bitcoins.

I know that I can but gift cards from gyft or do online purchases using joinsnapcard. But If I invite a round on my local non-bitcoin-friendly bar, I want to pay with bitcoin anyways (even I I use credit card system as proxy)

Is there any service that does that for me?

Edit 2017-07-27:  There is a debit card that can be funded with Bitcoin, Ethereum and Litecoin (via Coinbase) called ShiftCard https://www.shiftpayments.com/

Thanks,
Nico

If you live in the states the only service that comes close to this would be

https://www.xmlgold.eu/  - you can even order a pre-paid credit card that you are able to top up with bitcoins.

https://www.okpay.com/en/index.html - Okpay used to offer the same service but due to regulatory reasons they have ceased offering thier services to US citizens.

The only other way I can think of to do this would be to use http://bitcoin-otc.com/  here you  can see if you can find anyone willing to pay off your credit card for bitcoins.  Its kind of like online trading pit.  Hope this helps.


Why Bitcoin uses UTXO model? I know what it means. But I can't understand why Bitcoin decided to make such a model, where you have no balance, only unspent transaction outputs. And isn't the same thing as having the balance? I assume if you didn't spend coins, you have them in balance. What advantage does it have over a usual (non-UTXO) model? With comparison with other cryptocurrencies which has no UTXO, if possible, please.

Imagine we have a balance based blockchain, a transaction is produced which sends 1 BTC from Alice to Bob, this transaction is mined into a block and confirmed. Another block arrives which contains the same transaction again. This obviously isn't correct, however it's very difficult for us to create a system where this is not possible.

We either must:

Store a list of all transactions that have happened, refer to it in real time, and exclude any which have already been acted on (the balance deduced, and increased in the ledger).
Have a nonce for each address which increases every time it makes a transaction, and not allow a transaction with a lower nonce than we currently believe to be the case.

The latter, while being most sensible and the system used in Ethereum, is suboptimal. For every individual account as a consensus rule we must store all nonces for all eternity up to a maximum set by the consensus system. We can also not have out of order execution of transactions as they become exclusive actions (if 1 and 3 have happened, 2 can now never happen), this removes the possibility of storing pre-signed but un-broadcast transactions as is used in Bitcoin.

Instead, we store just a list of transaction outputs in the UTXO which have never been spent, and strike them from the database when they have been spent. Replay of an already existing transaction can not happen because it will spend an output that does not exist. This is ultimately the most scalable as spent transactions leave no fingerprint on the nodes storage, and allows for validity checks to happen in milliseconds.

Using a UTXO causes transactions to be atomic, and automatically not re-playable.


How nonce and diffuculty work? I struggle to understand one concept behind mining. It would be really great if someone could clarify some things.

This is an extract from blockgeeks:
From a technical point of view, mining process is an operation of inverse hashing: it determines a number (nonce), so the cryptographic hash algorithm of block data results in less than a given threshold. (The threshold is difficulty here.)

Source: https://blockgeeks.com/guides/proof-of-work-vs-proof-of-stake/

The question is why cryptographic hash algorithm results in less than given threshold? I always thought it should be equal or higher than threshold. If it can be less then blocks can be created really quickly.

What am I missing here?

If it can be less then blocks can be created really quickly.

This is not the case if threshold is referring to the target. In order for a block hash to be valid, it must be less than the target value. The lower the target value, the less possible solutions exist, because the target value (and block hash) are 256 bit numbers, meaning there is a finite number of possibilities.

There is a difference between target and difficulty. The article confuses the terms threshold and difficulty.

Target

The number that the block hash must be less than in order to be valid. This is a 256 bit number e.g. genesis block target:

0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Genesis block hash (notice it is less than the target above):

0x000000000019D6689C085AE165831E934FF763AE46A2A6C172B3F1B60A8CE26F

Difficulty

This describes how difficult, in relation to the genesis block, the target will be to reach. The higher the difficulty, the more hashes (on average) you have to do to find a solution that is less than the target. It is calculated as:
difficulty = genesis_difficulty_target / current_target


AltCoins based on Scrypt - How to do transactions with PHP? Im interested in other scrypt based coins other than Litecoin.

I have noticed that most of these coins have no documentation. So is it safe to assume that I can follow the Litecoin documentation if I have a question about a function or feature of said other scrypt based coin?

Second, I cant find anything about using PHP and doing transactions with Litecoins or any other coins (just javascript). Can anybody point me to some examples of how to do things like create wallets, send and receive transactions, etc..

Thanks.

I have a library in PHP for bitcoin transactions - https://github.com/Bit-Wasp/bitcoin-lib-php. It's mainly focussed on Bitcoin, and there are one or two places where hardcoded constants make dealing with altcoins tricky. That said, they are minor parts of the code.

(Only thing that comes to mind is if you're generating private keys just make sure you encode them to WIF's using BitcoinLib::base58_encode_checksum('privkey byte' . 'privkey hex'), passing the respective private key version byte, as the library will DEFAULT to using [address byte]+0x80 when generating addresses. This is how bitcoin does it, but it's not compatible with some coins, because they just use the first hex which gives the prefix they want)


Can Multibit be used as an offline cold storage solution similar to a setup with Bitcoin-QT? Currently have my cold setup offline in Bitcoin-QT. Downloading the blockchain from zero is rough. It's time to update. Can I create a similar cold storage solution with Multibit? Will this speed up load time when I bring coins online thru Multibit?  Are there any other benefits or weaknesses that you can think of with a Bitcoin-QT cold solution vs. a Multibit cold solution?

MultiBit cannot do true cold storage where your transactions are signed offline and then you transport them to a different machine and broadcast them.

The underlying library, bitcoinj, does support it but it is not in the user interface.

If the size of the blockchain is the main factor, Electrum might be worth looking into. I am pretty sure you can sign a transaction, move it and broadcast it on a different machine. I think this is done on a command line.

It is still several months away but a nice solution will be Trezor where the signing is done on a hardware device and the host machine is used to broadcast it. I believe all of MultiBit,  Electrum and Armory are planning to support Trezor.


How do I track transactions made from my stolen phone My phone was stolen few days ago, and the thief has transferred funds from my coinbase app to this account.

"1MaFK75o7iayPHEdjPJnD7ofaG13gAZcxP"
on 1st Jan at 14.40 (CET or Stockholm time)

I need to find the owner of this account number as he is the thief who has stolen my phone and money.

Sorry for your phone and your bitcoins, but unfortunately you can't find someone thanks to a wallet address. Wallet addresses are pseudonymous and any kind of personnal information (like IP address) are not stored on the blockchain.


Accidentally reused bitcoin address I've understood that address reuse undermines privacy and potentially also security in the future. Recently though, I accidentally reused the same public address when receiving funds from an exchange. Is there a way to fix this and future proof the security of my funds? Would it perhaps be sufficient to send all the funds to a new public address under the same private key or would I need to generate a totally new wallet?

There's no perfect answer for this question and it depends on individual.
You had used address A (one of the outputs) in a transaction 1 where inputs are from X.
You used the address A (one of the outputs) again in a transaction 2 where inputs are from Exchange Y.
IF someone is trying to analyze transaction 1 to know the owner of address A, he can look at transaction 2 to assume owner has an account on Exchange Y. Most of the withdrawal transactions from exchanges are done in batches with lots of inputs and outputs involved so it won't be easier to know more information about the owner except if one of the below tries to investigate:
Exchange, chain analysis companies, government agencies (in case of centralized exchanges) etc.
You have two options in my opinion:

Ignore and avoid reuse in future
Coinjoin


How do I move a client/wallet to a different machine? I have a client/wallet on a work machine of which I cannot control the proxy and allow the client to synchronise properly. Before I knew this however, I sent coins to the wallet. How do migrate this wallet to my home machine, so I can receive the transaction?

I am using Bitcoin-Qt.

Copy the wallet.dat onto another machine, put it in the appropriate folder and either sync your Bitcoin from the Genesis Block with the network, or run it with -rescan option.