Is it safe to transfer coins directly between exchanges?

I have used BITTREX, and I have transferred between exchanges (HitBTC, BITTREX, Binance). I am not aware of any risk, as this happens as a standard transaction between two wallets belonging to exchanges. I have even noticed, that the addresses change (maybe they use HD wallets). My use case was simple, that one exchange did not provide the altcoin I was looking for. So I was able to transfer amounts between exchanges, providing the target address. I did that with bitcoins, ethers and bcash. I haven't been asked by any of the exchanges, and can't remember having seen s.th. like this from BitTRex.

I cannot say, under which circumstances this would be necessary, that is a question which might need to go to BitTRex. But I think it is a layer of protection for the users. Two many people sent their coins to wrong addresses, and then spammed the support teams with requests about their lost coins.


There is no correct fee for sending BTC to mtgox, and you can send to the same address. MtGox doesn't get the fee. MtGox only requires a number of confirmations. If you added a fee at all then there should be no extraordinary delay. A fee-related delay is for the first confirmation. The age of your source account(s) can make more difference than a fee. Just relax. The first time is painful to wait for.

    I've updated...

I don't know how you can send a ">10000 byte" transaction to mtgox unless you are talking about the bytes of a raw transaction rather than a bitcoin amount. In that case, you should be able to figure this out. Send the same amount again from same addresses but with a higher fee. It is a double-spend and the network may take the second first while leaving the first to be discovered invalid.


That is far in the future and can still be changed, but at the current time a coinbase transaction is required and will always be present. It is very likely that this rule will be upheld in the future as well. It is also possible that the transaction accuracy could be increased enough for there to always be a block reward, however minuscule.


Can a wallet/exchange provider ask for transaction details

Am I obligated to share transaction details with my wallet/exchange provider for any payment I made to an individual, like subscription to a website?

A proper noncustodial wallet will impose no such restrictions.

A business that is running a wallet service might impose restrictions though. So this question really just depends on the terms of service / policy of that business. If they are holding your private keys, you will be 'obligated' to follow their rules, though I'm not sure I agree with the use of that word, maybe the word 'forced' would be a better pick. Not your keys, not your coins, and all that.

  Irrespective of the above point, If I pay for a subscription using Bitcoins to someone, and the recieving party misuse the coins for something illegal unknown to me, will I be in problem?

Most businesses (ie exchanges) that impose such restrictions do so for legal reasons: the jurisdiction they operate within requires some sort of KYC/AML procedures. So these businesses will often employ the use of a chain analysis service, which can supply the business with more info about happenings on the blockchain, thus satisfying regulators. Chain analysis services are not capable of perfectly knowing what on-chain transactions represent, but they can make guesses based on certain heuristics, and data gathered from various sources.

Some easy ways to mitigate against this risk:

Don't store coins with custodians that might restrict your access
Create another wallet, send coins to it, perform a self-send or two with that wallet, and then finally, pay the coins to your intended destination. This adds some extra steps between the address which is known to be owned by you, and the person you are sending payment to, breaking the obvious link between you two.
Use a wallet which creates coinjoins to obfuscate your UTXO history, such as Wasabi, or JoinMarket
Use a wallet which has payjoin/P2EP enabled (this is currently an ongoing development)

There is a lot of nuance to bitcoin privacy, I'd recommend giving this wiki entry about Bitcoin privacy a read if you're interested.

Generally, the sort of worry you have doesn't seem to cause problems for users these days (I haven't seen many complaints of this online), but if you're worried I would simply suggest adding a new wallet and a transaction or two in between the regulated custodian, and the outgoing payment.

More broadly, in order for Bitcoin to really be useful, users need to not worry about these sorts of risks. Bitcoin can function in a way which allows all transactions to be perfectly traceable, but it can also function in a way which provides the user with financial privacy. As a user, you can employ certain techniques and strategies to help retain your privacy, but remember also: the businesses you support are the ones which will continue to grow in this industry. If you don't like the sort of existential risk imposed on the network by KYC'd exchanges, don't use them. As they say: vote with your dollars (or in this case, your sats).


How do I spend a paper wallet into my coinbase.com account using the Android Coinbase app and the paper wallet QR code?

I found another Android app called "Bitcoin Wallet" that let me "sweep" the paper wallet into another address. Everything is fine.


What is the difference between Trading Volume and Transaction Volume?

Trading, in this context, refers to the exchange of Bitcoins for fiat currency (dollars, euros, etc).

Major exchanges report on the number and total value of trades made on their platform.  Presumably the numbers on blockchain.info come from aggregating that data.


If lightning network transactions are "off chain", can we still see the transaction history then?

Are the transactions private or public?

Mostly private. If you are not involved in a transaction (i.e. not a sender, receiver, or intermediary), you really won't know anything about the transaction. Transactions occur off chain so there is no permanent record of a transaction happening. All that outside observers will see are the channel opening and closing transactions.

  it can possible get hidden in a payment channel?

Yes, you can have a payment channel which no one else knows about, at least until it closes.. These could even exist today and it would not be obvious until the channel closes. And if a channel is closed cooperatively, it will look just like any other 2-of-2 multisig transaction. So even then it is not clear whether a transaction is a closing transaction for a payment channel.


Why are there not mnemonic-seed words in Turkish especially considering the increasing rate of bitcoin adoption in the country?

Because no one has stepped up to do the work or hire someone to do it for them. That's how open source works : )
This repository contains the mnemonic list in different languages (Currently just 8). There are also wordlists in other languages that are stuck in limbo. However if you find it to be worth it, you might want to prepare a list and submit it to the repository as a pull request, and one day it might get merged.


Yes, those coins would be lost.  It would be as if you buried a chest of gold out in the middle of nowhere and died without telling anyone about it.

Though it is possible (though mindbendingly unlikely.  Even if bitcoin keeps existing until the heat death of the universe, it will almost certainly never happen.) for someone to randomly recreate the keypair for those coins and thus take possession of them.


Installing bitcoin and bitcoincash on same server

install Bitcoin ABC on Ubuntu 14.04.5 LTS, alongside Bitcoin Core, using these instructions:

Note: You have to create a new username because bitcoin and bitcoin cash use the same directory, so it won't work.

Download the appropriate binary from here: https://download.bitcoinabc.org/

For me, the command would be:

wget https://download.bitcoinabc.org/0.16.2/linux/bitcoin-abc-0.16.2-x86_64-linux-gnu.tar.gz
Extract the archive:

tar xzvf bitcoin-abc-0.16.2-x86_64-linux-gnu.tar.gz
Rename the binary files:

cd bitcoin-abc-0.16.2/bin/; rename 's/bitcoin/bitcoinCash/' *
Install the files into /usr/local/bin:

sudo install -m 0755 -o root -g root -t /usr/local/bin *

Finally!

bitcoinCashd -version outputs:

  Bitcoin ABC Daemon version v0.16.2.0-6af5e93

  [...]

bitcoind -version outputs:

  Bitcoin Core Daemon version v0.15.1

  [..]

ls /usr/local/bin outputs:

bitcoinCash-cli  bitcoinCash-seeder  bitcoind    test_bitcoin
bitcoinCashd     bitcoinCash-tx      bitcoin-qt  test_bitcoinCash
bitcoinCash-qt   bitcoin-cli         bitcoin-tx

Note: You have to edit the default port on bitcoin.conf file, Since Bitcoin-core and Bitcoin-cash will use the same RPC port. rpcport=4523


Do crypto-coins themselves (bitcoin, litecoin, ethereum and 100500 other shitcoins) generate dividends? :))))))))

the answer is: ponzi pyramid scheme. point.


Can I test Lightning on Bitcoin regtest?

Yes this is possible and (at least with clightning) very easy to do. I always use this script by Nadav Ivgi from his spark wallet. The key part is this : (MIT license by Nadav Ivgi)

$ mkdir -p /tmp/spark-env/{btc,ln1,ln2}

$ bitcoind --regtest --datadir=/tmp/spark-env/btc --printtoconsole
$ lightningd --network regtest --lightning-dir /tmp/spark-env/ln1 --bitcoin-datadir /tmp/spark-env/btc --addr 127.0.0.1:9600
$ lightningd --network regtest --lightning-dir /tmp/spark-env/ln2 --bitcoin-datadir /tmp/spark-env/btc --addr 127.0.0.1:9601

$ alias btc='bitcoin-cli --regtest --datadir=/tmp/spark-env/btc' \
        ln1='lightning-cli --lightning-dir /tmp/spark-env/ln1' \
        ln2='lightning-cli --lightning-dir /tmp/spark-env/ln2'

$ btc generate 101 && btc sendtoaddress $(ln1 newaddr | jq -r .address) 5 && btc generate 1

# wait for onchain funds to show up on `ln1 listfunds` (updated every 30s)

$ ln1 connect $(ln2 getinfo | jq -r .id) 127.0.0.1 9601 && \
  ln1 fundchannel $(ln2 getinfo | jq -r .id) 16777215 1100perkb && btc generate 1

If you use docker you can even spin up Nadavs docker image with:

$ docker run -e NETWORK=regtest -e API_TOKEN=1234 -p 9112:9112 shesek/lightning-charge

but if you want more lightning nodes fired up that already form a network you can use lnet by Christian Decker. With that script you can provide a weighed graph and get the lightning nodes as the graph defines.


How can i use Bitcoin payment method through Swift for my IOS Project?

Core Bitcoin is a library for iOS written in Objective-C.  I have worked with it in Swift using the bridging header.

I myself have written a few Swift classes, in my experimental/educational wallet, for creating addresses, keys, and transactions, but I wouldn't recommend using it for anything.  Feel free to take a look and see if you find anything interesting, or anything that you could learn from.


Bitcoin clients use several methods to locate other clients. The primary method is a list of nodes from a previous connection to the network. The works very well for everything but your first connection or a connection after a very long period of disconnection.

For the case where you have no previous known IPs or they aren't usable, the primary fallback method is by DNS seeds. Several host names (such as dnsseed.bluematt.me) are maintained that resolve to a list of IP addresses known to be running nodes. Should that fail, the client has a list of IP addresses believed to point to stable nodes hard-coded into it.

One method that used to be used, but that has since been abandoned, was having the clients locate each other using an IRC server. That worked similar to a BitTorrent tracker.

Once you are connected to the network, you will begin to receive lists of IP addresses and ports of known clients.


Bitcoin scripts that force disclosure of the private key

I've done some searches and research, and I also got input on #elements channel on bitcoincore slack, so I feel that I can answer these now (EDIT: At first I got confused about CODESEPARATOR method, but after some more time, I asked Anthony Towns and he provided the links to his messages in lighting-dev list explaining it.)

I think that the size 57 is chosen for increased guarantee against the possibility that other small-size R value would be found, that is larger than 21 bytes, but small enough that grinding for smaller S could enable to overcome the size limit. I've also seen other example of how this technique might be used (https://gist.github.com/nothingmuch/683042343c48a4ef07efd3d438e7ee56), but it sets 60 for the size limit. It might be assuming that R value that starts with 72 zero bits is not feasible to be found either. It also may be that 57 byte limit is unnecessary small. Note that grinding for len(S) <= 29 is feasible on general-purpose computer. This could be done by changing other inputs/outputs of the transaction so that sighash changes. Relevant: https://lists.linuxfoundation.org/pipermail/lightning-dev/2015-November/000344.html
The second way to achieve this on unmodified bitcoin may somehow involve the use of OP_CODESEPARATOR. There would be two signatures of one pubkey, but the second signature would use different sighash because this signature is checked after CODESEPARATOR is executed, and sighash will be calculated using only the part of the script after CODESEPARATOR. But while you can have two different signatures (on different messages) for one pubkey, it is not clear to me how to force nonce reuse here, if not with the same size-trick as described before, or using the disabled opcodes.

EDIT: Asked Anthony Towns about this, got reply. There is a tecnique using two codeseparators and three checkmultisigs, in such a way that forces reuse of R. See https://lists.linuxfoundation.org/pipermail/lightning-dev/2015-November/000344.html and https://lists.linuxfoundation.org/pipermail/lightning-dev/2015-November/000363.html

Other relevant links: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-December/016594.html https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-December/016592.html My experimental scripts: https://gist.github.com/dgpv/7818a4009f4e90868c0920cc1e238653

Note that CODESEPARATOR is non-standard for non-segwit inputs in Bitcoin, but should be OK for segwit inputs. But still not without some controvesy: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-March/016732.html (there was a proposal to remove CODESEPARATOR altogether, or to calculate sighash always using initial script, disregarding effects of CODESEPARATOR)
HTLC is simpler to implement, and the program that creates HTLCs does not need to be able to work with bignums, along with having the function that implements modular inverse on bignums. HTLCs would also generally be smaller in size. They are also more 'known' and thus popular.


Blockchain and anonymous data inside the chain

However, these transactions might contain sensitive information (like the details of their client).

Bitcoin transactions simply do not contain sensitive information, they need no other information other than the amount and the receiver, meaning that the publicity of it is of lesser concern. There was still implicit privacy issues in Bitcoin, but you avoid any issues with personal information being stored in the chain by just simply not doing anything that would cause this information to be included.


Can bitcoin-qt use imported address as a change address?

On Bitcoin-QT can use whatever change address you want. Go to Settings->Options->Wallet and check "Enable Coin Control Features". Now when you go to send you can check "custom change address" and enter whatever you want, even if you don't have the privkeys.


How do Cloud Mining Websites Divide Profits?

There are many different reward schemes used. One thing almost all of them have in common is that they base the rewards on "shares". Each miner earns one or more shares by producing hashes that are sufficiently low. Essentially, miners prove they're actually trying to find blocks by providing a sample of their best attempts to the mining controller.

Reward schemes generally try to do two things:

They try to even out the reward so that miners have less variation in the rewards they get if they mine at a constant rate.
They try to prevent people from strategically joining or leaving different mining pools to prevent schemes that give miners more than their fair share.

The simplest scheme is called PPS (pay per share). With PPS, each share earns a fixed reward, regardless of how well or badly the pool as a whole does. This provides the least variation to miners, but gives the pool operator the most risk.

One of the most common sharing mechanisms is called PPLNS (pay per last N shares). With PPLNS, when a block is found, the reward is divided among those who earned the most recent shares, proportional to the number of shares each miner found during that window.

Other schemes can get fairly complex.


How many confirmations in litecoin block explorer

Paste your litecoin address in blockr.io search and then you will get your litecoin address info page. Thare you will see your address balance, total received and total transaction so far.


How to actually handle the xPub gap limit when receiving Bitcoin deposits?

Any website that is handling user funds should be running a node to ensure they have an accurate view of the network. Depending on an API introduces trust of a third party into the situation, which is an unnecessary risk.
As a developer, you can then simply customize the gap limit to suit your business’ needs. In many cases this likely just means increasing the gap limit to a larger number.


Is there any advantage to owning physical bitcoins?

Is there a security advantage

Kinda. On one hand, you don't have to worry about getting a virus and losing your coins.

On the other hand, you need to trust that the person who made those physical bitcoins doesn't still have a way to spend them. (They could have saved a copy of the private key for claiming those coins before writing it below the hologram.)


How is "cumulative PoW" calculated to decide between competing chains?

First of all, "difficulty" as a concept does not exist in the protocol. It's a unit intended only for human consumption.
Internally, the value that corresponds with it is the target. The target is a 256-bit number, computed for every block, and a block is valid if its hash (interpreted as 256-bit number as well) is less than or equal to the target.
The difficulty is simply defined as the (floating-point, approximate) value of MAX_TARGET / target. MAX_TARGET us (216-1)2208, the maximum possible target (so the lowest difficulty Bitcoin will permit for any block).
To compare chains, a new metric is introduced: work. Work is the expected number of hashing attempts are necessary to construct valid proof-of-work for that block. It is simply 2256 divided by the number of potential hash values that meet the target, namely target + 1. So, the work of a block is defined as 2256 / (target + 1).
The work of a chain is simply the sum of the work values of the blocks in it. This makes sense: we want to make sure that an attacker needs to do as much work as the honest miners needed to produce a valid chain.
At block 678033, with approximate difficulty 23137439666472.1, we have:

Target is 1165190949371886336955396954992052935118810155482873856 (or 0xc2a480000000000000000000000000000000000000000 in hex).
Work is 99376063039054378510219
Cumulative work (sum of all work in the entire chain) is approximately 8.565487⋅1027.

So - perhaps remarkably - this is (approximately) equivalent to just summing the difficulty values of all blocks. No logarithms involved.
For completeness, Bitcoin Core's current rules for picking the best chain:

First exclude all chains with invalid blocks
Then pick the tips of all those chains, and leave only the ones with the highest cumulative work (which may be more than one if there is a fork).
Among those, pick the one for which the full block (not just the header) was received first.


Not sure if I accidentally double spent my LTC LITECOIN

The underlying problem is that somehow Ledger did not broadcast my transaction to the mempool. Don't know exactly why it wasnt relayed.

Solved in the following way:

Close the LTC Chrome app
Download the LTC-Version of Electrum Wallet. This wallet interfaces with the Ledger directly, like the chrome apps. No need to import the seed.
If Electrum gives a read error make sure you enable and disable broswer support once.
Make sure you started the correct app in Ledger. In my case it was LTC.
In Electrum go under the tab "Addresses" and copy one of your receiving addresses with 0 balance
Send YOUR ENTIRE BALANCE at once to your own copied address. For good luck make sure the fees are sufficient.
Wait until it confirms.
Thats it! When you start the chrome app again the new transaction will have replaced the unbroadcasted old one and the balance returns to the correct amount.

It should work in principle with every currency.

Got it from this reddit: https://www.reddit.com/r/ledgerwallet/comments/7rkicz/bch_transactions_sent_unconfirmed_but_dont_show/


Is SIGHASH_NONE encompassing of other signature types?

SIGHASH_NONE implies that Input 2 will only spend if Input 1 is included in the transaction.

This is false.

Input 2 is essentially a blank check. SIGHASH_NONE signs none of the outputs (I don't care where the BTC goes), and SIGHASH_ANYONECANPAY signs only input 2 (I don't care who else is participating in the tx. This essentially creates an input, which if you give to anyone else, is the equivalent of "Here's a blank check for X BTC, do what you want with it".

  Are they able to spend Input 1 (the SIGHASH_SINGLE) in another transaction without Input 2 included?

Since Input 1 is signed using SIGHASH_SINGLE, only output 1 is signed under it. However, the SIGHASH_ANYONECANPAY flag means that only input 1 is signed as well, which completely decouples it from input 2.

Now, if you were to remove the SIGHASH_ANYONECANPAY flag from input 1, then you end up with a tx that is able to spend up to input 1 + input 2 BTC, but is only spending output 1. In this scenario, spending input 1 is dependent on spending input 2 as well. However, since input 1 is SIGHASH_SINGLE, and input 2 is SIGHASH_NONE, anyone you share the tx with is able to add their own outputs to it, but not add any more inputs.

Moreover, since input 2 is SIGHASH_NONE | SIGHASH_ANYONECANPAY, anyone you share the tx with can extract just input 2, and reuse it in a completely different tx without requiring input 1. The way to counter that would be to remove the SIGHASH_ANYONECANPAY , so that it is at least locked to being spent with, and only with, input 1.

  What can I do to lock these two inputs together, with one of the inputs also being locked to an output, while still allowing people to add inputs to the transaction?

You could spend to to a single output, then create a new partial tx with that single output being spent with your required destination and amount, and sign that with SIGHASH_SINGLE | SIGHASH_ANYONECANPAY


dumpwallet output documentation & explanation?

AFAIK there isn't any documentation of dumpwallet's output. You need to read the source code to know. I suppose I can just document it here though.
The dumpwallet output contains comments. Comments are prefixed by a #. This can be found at the beginning of a line or in the middle. Anything on that line following the # is a comment and will not be parsed by importwallet. Comments are used to provide additional information to the user reading the dumpwallet output but prevent the importwallet parser from doing anything with the data in the comment.
The first 4 lines are just some extra information to the user to know which version created the dump and at what time. It includes the current clock time as well as the time and hash of the current best block.
For HD wallets, this is followed by the extended master private key.
After that, each line lists out an individual private key and some metadata about that private key. The private key will be encoded using the Wallet Import Format.
The private key will then be followed by a timestamp. This timestamp is in UTC time and is the time that the private key was created and added to the wallet.
Each private key will have one of the following metadata fields: label, hdseed, reserve, inactivehdseed, or `change.

label: This is a label assigned to one of the addresses for this private key. Since a single private key can have multiple addresses, and each of those addresses a different label, this just gets one of this labels. It's a holdover from when one private key corresponded to one address. All receiving addresses will have a label even if it does not have a label. For those addresses, the label is the empty string so you may see label= a lot.
hdseed: This private keys is the current active HD seed. You will always see this field as hdseed=1. The HD seed is a BIP 32 seed. Bitcoin Core stores this as a private key and it is therefore indistinguishable from other private keys. This HD seed is used to produce the extended master private key found earlier. It may also be used to derive many of the other private keys in this wallet. There should only be one key with hdseed=1.
reserve: This indicates that the private key is part of the keypool. You will always see this as reserve=1. The key has not been requested for use as a receiving address nor as a change address, it is in reserve in the keypool.
inactivehdseed: This private key was a HD seed previously used by the wallet but is no longer the currently active HD seed. You will always see this as inactivehdseed=1. It is the same meaning as the key with hdseed=1 except it is not currently active.
change: This key is no longer in the keypool and it's address is not a receiving address. The assumption is that such addresses are change addresses. So this key is marked as being change by having this metadata field. You will always see it as change=1.

Following the metadata, on the same line, will be a comment with some additional metadata that may be useful to the user but will not be parsed by importwallet. This will have 2 fields: addr and hdkeypath.

addr: This is a comma separate list of addresses that have been used for this private key. Since a single private key can have multiple addresses, you may see multiple addresses in this field.
hdkeypath: This is a string representing the BIP 32 derivation path for this private key. In cases where there is only one key marked as hdseed=1, you can derive this private key by using the extended master private key at the top of the file and then deriving from it the key with this derivation path. When there are multiple HD seeds in a wallet (i.e. when there are inactivehdseed=1 keys), it is not possible to know which seed this key was derived from without trying to derive from them all.

After each of the private keys is listed, you will see lines for scripts stored in the wallet. This is similar to how private keys are listed.
Each script is written out in hexadecimal. The script is then followed by a timestamp indicating the time that the script was added to the wallet. It will then be followed by script=1 to indicate that this line is for a script. Lastly there will be a comment containing an addr field. This address will be the P2SH address for this script.
At the end of the file is a comment End of dump to indicate the end of the wallet dump.

When you use dumpwallet, you should expect to see several thousand lines. This is because Bitcoin Core, by default, has a keypool of 1000 receiving keys and 1000 change keys. For a newly created wallet, there will be 2000 key lines.
If you have not imported any scripts, you should have the same number of key lines as script lines. This is because each key has a segwit script. This is an artifact of how the Bitcoin Core wallet supports segwit.
If you have imported any scripts such as multisig scripts or addresses which are not yours, then you will see those scripts in the script lines as well.


When running a full node, why does the first inbound node have an unusual IP?

That's an IPv6 address.  Basically, it's the latest version for formatting/assigning IP addresses.  At some point, we should all be seeing a lot of those...but they've been saying that for years.


Is there a BTC Address generator that will check first blockchain if unused?

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.


As Murch suggested in comments, I better leave this as an answer.

What I think your problem is that you haven't configured your bitcoin.conf file. You can see all the parameters and explanation of em' thoughtfully provided by the Bitcoin wiki here. See that example bitcoin.conf? It has all the parameters commented out with the # sign. Just uncomment them by removing the hash and fill in your configuration.

To use the api you are going to need server=1 to enable api commands, rpcuser=<username> and rpcpassword=<your secure password to be able to actually connect.

Now test it

It's easy to test your Bitcoind configuration settings with a browser, just load up the address of your Bitcoind in a browser like so: http://127.0.0.1:8332. It should throw a username and password dialog if everything is correct.

Note: You will need to enable rpcallowip=<ip> to allow connections from other than your own machine. This is also really dangerous and I advise against this.


You can set a password for your Electrum wallet by clicking the padlock symbol in the bottom right corner.

This can be a different password for each wallet. The password isn't just a barrier like the PIN of a bank card but the private keys actually are encrypted using it and AES-256-CBC (Source) which means that the password is needed to spend money. However, your transaction history, your own addresses (and therefore how much money you have) can be seen without knowing your password. This is the reason Electrum can give you this info (like your total balance) without requiring you to enter your password first.

If you want to back up your wallet, you can literally just do that because an Electrum wallet is just a single file.

The Electrum folder is ~/.electrum on Linux and Mac and described without slashes for Windows as UsersYourUserNameAppDataRoamingElectrumwallets on the official Electrum website but you'll probably find it. In it, there is a folder named wallets which is the default location for Electrum wallets. The wallets are text files which have the same name as the wallets.

Backing up the wallet files has the added advantage that you get your note-like data back (description of sent transactions, receiving notes, contacts). This obviously can't be generated from the seed because it's data entered by the user after the seed is set. However, it's written to your wallet file and if you copy it to a different computer (or the same computer later on after its hard drive exploded) you get the note-like data back.


Completely confused with mutisig address and scripts

Take a look at BIP0016.

  This new transaction type is redeemed by a standard scriptSig:

  ...signatures... {serialized script}

And...

  {serialized script} is popped off the initial stack, and the transaction is validated again using the popped stack and the deserialized script as the scriptPubKey.

In this case, {serialized script} is {m [pubkey1] [pubkey2] ... [pubkeyn] n OP_CHECKMULTISIG} for a m-of-n transaction. When Bitcoin detects one of these special transactions, the serialized script is popped of the stack as soon as its hash is validated (you're validating the script hash! not an actual public key!) and then executed with the remaining stack intact.

Your payment script looks like this:

0 /* null element because a bug pops one-too-many items */
304402205fdee0b00f5e2fa07324458fe06b47a41bb2ef4e73892343796e9f6456e378940220630b423ce14b0d5ed487da751c368d7fc0122efa21cac1a4afce7c3c017bf29f01
304502205edb6ce77a772346b21d60a775c81f52bec9e8957f795fce7ea4fab862bc656c022100fc1376399134348fae516d6e627b1f72c094affd3ba2f458685bdbe9b6a51f5e01
5221020678adff50855b6748e93ab03667968817363fff84306d7ffc13276191fd7f542102bff39dce7ae4c6a06104ac4e49948eb7bac9d4a82e9e16df41b1436d31b76f0052ae

The last part (5221020678...52ae) is actually your serialized script. If you decode it you get:

2 020678adff50855b6748e93ab03667968817363fff84306d7ffc13276191fd7f54 02bff39dce7ae4c6a06104ac4e49948eb7bac9d4a82e9e16df41b1436d31b76f00 2 OP_CHECKMULTISIG

Which is a 2-of-2 transaction!

The first two parts not including the null element (the ones that look like 304...01) are just your provided signatures which are going to validate against the serialized public keys when OP_CHECKMULTISIG is executed.


which was the purpose of changing the signature of a TX? or it was just a bug before segwit?

By using sighash flags you can flag a transaction to intentionally make specific parts of it modifiable after signing it.  This kind of intentional malleability is a useful, if not often used, feature and isn't changed by segwit.

Malleability in the SIGHASH_ALL was simply a design flaw and based on all the issues that the original software had with it appears to have been unintentional and unrealized at the time of the protocol's release.

The main origins of malleability in typical transactions arise from effects that aren't especially visible while writing the software-- e.g. that pushes could be serialized in different ways, or that there were multiple distinct valid signatures of the same data.


Whats the minimum recommended output for a faucet-like system? (April 2017)

Faucets in Bitcoin are outdated and economically infeasible today. Fees have been floating between 100 to 300 satoshi/byte. On some weekends they may drop to 20 satoshi/byte for a few hours.

To create a minimal transaction with one input and one output, you already have to purchase 10+148+34=192 byte. Even at only 100 satoshi/byte fee, half of an output with 43,478 satoshi would be consumed in transaction fee. Considering that you already paid for the output to be created, even with batching that's already ~60% of the value lost to fees. Unless you're about to dish out larger amounts, that's going to create more frustration than awe— and who would pay for that?


Finding Transactions with seldom used opcodes for testing

I did some digging with a parser I wrote and found 6 transactions that test a lot of the op codes:

efdf1b981d7bba9c941295c0dfc654c4b5e40d7b9744819dd4f78b8e149898e1
9aa3a5a6d9b7d1ac9555be8e42596d06686cc5f76d259b06c560a207d310d5f5
c5d4b73af6eed28798473b05d2b227edd4f285069629843e899b52c2d1c165b7
74ea059a63c7ebddaee6805e1560b15c937d99a9ee9745412cbc6d2a0a5f5305
e335562f7e297aadeed88e5954bc4eeb8dc00b31d829eedb232e39d672b0c009
dc3aad51b4b9ea1ef40755a38b0b4d6e08c72d2ac5e95b8bebe9bd319b6aed7e

These are all on testnet and test a very large number of the OP_CODES I requested. Here are still ones I'm looking for:

op_reserved
op_reserved1
op_reserved2
op_ver
op_verif
op_vernotif
op_2rot
op_2swap
op_1add
op_codeseparator


That's an interesting find! The transaction that created the output was in block 274227. The transaction that spent the output was 6 blocks later, 274233. So it's perfectly valid on the bitcoin network even though blockchain.info seems to have a glitch in the times they are reporting.

If they are basing the received time of the transaction at all on the time of the block it was included in, then you should know that the time recorded in bitcoin blocks can be a little off sometimes. See Why don't the timestamps in the block chain always increase?. Although, this doesn't appear to be what they are doing since they report two separate times, one for when the transaction was received and one for the time of the block.

Blockchain.info's API, Wallets, and Block Explorer are not known for being the most robust. They have started a bug bounty program, though: https://www.crowdcurity.com/blockchain-info.


Why are transactions separate in a block?

An interesting idea, but I don't think it technically works out.

Transactions include a digital signature of the set of inputs and outputs in a transaction. This signature could not be validated if the inputs and outputs where not linked.
Since signatures wouldn't be tied to specific outputs/inputs, what would stop a greedy miner from including your inputs but not your outputs?
Outputs can be created and spent in the same block. So you can't list all inputs, and then list all outputs, because some of those inputs depends on those outputs being known first. (There may be a work around for this, but it complicates things)


Based on the current fee lever from https://bitcoinfees.21.co/, the fee rate should be 200 satoshi/byte, with you tx, you at least include 0.002 as fees, considering the sending amount. I advise you delete this transaction or wait for the network to forget it. you could have a look this article for more details http://coinour.com/index.php/how-to-do-with-stuck-bitcoin-transaction/


What are the differences between the transaction and block versions? (v1, v2, v3, etc..)

BIP0034 added Version 2 blocks.  It enforces the rule that the transaction version is 1 (this was previously not enforced and there are some weird transaction versions in the block chain).  It also requires the coinbase transaction input script to contain the block height as the first data element.

There has been discussion about a new Version 3 block and Version 3 transaction which would enforce canonical encoding.  This would be a solution to the transaction malleability problem.  Skipping transaction Version 2 would make the versions the same once more for both blocks and transactions.

You can read the Bitcoin Improvement Proposals here.


What does a Bitcoin lightning private key look like?

Elliptic curve private keys are just scalar integer values between 1 and n (The order of G). These can be encoded by any means, but usually they are just represented as 256-bit integers with whatever endianness the platform uses. If interpreted as an array of bytes, it is simply a 32 byte sequence.

The WIF (Wallet Import Format) of Bitcoin takes the 32 byte sequence, prepends a version byte, then takes the double-SHA256 to generate a checksum. The first 4 bytes of the checksum are appended to the version and private key bytes to make a sequence of 37 byte in total. This is then Base58Check encoded to produce the textual representation of private keys you're familiar with. The reason they all begin with 5 is because of the version byte.

There is no specification for the storage or import/export format of private keys in any of the lightning specifications and it is left up to implementers to decide how to store them, or how to or export them, if at all. You can use the same WIF format if you want, as Lightning uses the same curve as Bitcoin for its signing and key exchange.

Private keys are used for two different purposes in Lightning. The Lightning node itself has a single, fixed private key, which is used both to identify the node (by its respective public key), and to sign messages proving that they indeed originated from that node. It is also used to perform an authenticated key exchange when connecting to peers to prevent MitM attacks.

The other private keys used in Lightning are entries of a bitcoin wallet, used to sign transactions regarding the channel states, which are standard bitcoin transaction outputs.

However, just knowing the private key for a particular channel is insufficient to spend from that channel, as they are 2-of-2 multisig outputs, and both parties need to sign off the transaction to spend it. You therefore need to have knowledge of a spending transaction and a signature from the other party for that transaction in addition to your own private key for the channel.

It is clearly not much use to just export these private key on their own - you would need a more detailed format which contains all of the necessary parts to reconstruct the current state of the channel at minimum. In practice, you should have a record of all previous channel states too, so that you are able to construct a justice transaction if the other party attempts to broadcast an expired channel state, unless you've delegated this role to a watchtower, who should have a record.


Transaction has 900+ confirmations but doesn't show up in my wallet

900+ confirms ...

Then you have definitely, incontrovertibly and irreversibly already received the money even though your wallet doesn't know yet.

... but nothing in wallet

Sure but remember that wallets don't contain money. They check the public blockchain to add up how much money you have.

No idea what to do.

is it properly synced to the network?

no idea

https://support.exodus.io/article/75-how-do-i-refresh-my-wallet
says

Did you send a coin to your wallet, but it's not showing in your balance? Is your Bitcoin displaying incorrectly? Do you get an error when trying to send?
If so, then your wallet may be out of sync with the blockchain. A quick wallet refresh tends to fix a number of balance-related problems and help your wallet correctly align with the network.
As a first step, make sure you are using the latest release of Exodus. Here's how to upgrade.
Refresh the wallet by clicking the logo:

Open the crypto wallet you want to refresh inside of Exodus.
Mouse over the asset's logo and click.
A dialogue asks you if you want to rescan the blockchain. Click Rescan. When the refresh icon is finished spinning, all your transactions will be updated and refreshed.

I think I'd try refreshing before upgrading but it's your call.
I hope you have your recovery phrase or your private key written down somewhere safe.


The context of FBI involvement with Bitcoin

There was quite a hype in the US about how bad Bitcoin is, and how they were going to crack down on it. I suppose this report comes from those feelings. Liberty Reserve has actually been closed recently, by the police forces.

Their interest is chiefly identifying and, if possible, removing threats. The EU actually has a similar (but better) report, to assert the status of digital alternative currencies.

The red thread to all of these documents is "Bitcoin is independent of law. Bitcoin cannot be legally prosecuted, and if it could it would be difficult to do it. Anonymity makes it suitable for criminals but it isn't fully anonymous, so maybe we can do something (because of the blockchain). Personally we think Bitcoin is pretty cool.". They also somewhere seem to understand there is a legitimate purpose to Bitcoin, but it's unclear whether that matters or not.

It's very hard to look into the mind of a millions of people wide security organization. If we don't know something it probably exist but it's still classified. This document had only public sources, so did not need classified status. They likely have build a much more detailed document now with knowledge from the NSA (about cryptography) and from Bitcoin companies in the US.

The NSA, meanwhile, has likely been tracking Bitcoin usage very closely. It likely has a pretty good way to de-anonymize Bitcoin traffic. All the aforementioned are, of course, as unprovable as PRISM was.

Most police forces in the world will have reports or accumulated knowledge about Bitcoin because it presents "a novel challenge to law enforcement". These reports will contain "nothing we didn't already know" and reflect the legal perspective of the agency, but only the mood the report writer thought his boss wants.

Good luck people. The police are our friends. Sometimes in the "Do not run, we are your friends" kind of way, sometimes as the robot friend.


To create a new bitcoin address cloned Bit-Wasp/bitcoin-php code

Since Bit-Wasp/bitcoin-php has its own composer.json file, after cloning you should just run:

composer install

If there is still some issue, run the following command to diagnose the problem:

composer self-update
composer diagnose

Otherwise report it at the project page.


What's happening in regtest mode? - Wireshark analysis

The regtest mode is basically for running a node in a test network where all peers have to be added manually and it is extremely easy to solve blocks. As such, there won't be any network traffic unless you start multiple nodes and connect them using the addnode RPC command.

Alternatively, maybe you meant to run this in -testnet mode instead of -regtest mode?


The "data" is not a number (only numbers have endian issues), but the raw byte data of a valid block. You may wish to read over BIP 22, which is the Draft-status standard detailing the getmemorypool protocol.


Might be worth reading through https://bitcoin.org/en/secure-your-wallet.

Personally I use a local encrypted wallet (standard bitcoin core software) that I back up to USB. My assumption is that the strength of the wallet encryption is good enough that even if my PC or USB is compromised the wallet pass phrase will keep my coins safe.


If transactions are changed in memory how miners know it?

The process you described is not what happens in Bitcoin. It is loosely what happens with software like PGP which use public-key cryptography to provide various security benefits when sending e-mail messages.

In either case, you don't use a private-key to verify the integrity of the data-content.

In the case of something like PGP, the recipient can use the sender's public-key to determine whether the signature was produced by the corresponding private key from the received message contents.

In the case of Bitcoin, any bitcoin node can verify any transaction in the blockchain using only data in the blockchain. For details of the principles you could read Satoshi Nakamoto's original whitepaper or online resources such as

https://en.bitcoin.it/wiki/Transaction
http://learnmeabitcoin.com/guide/digital_signatures_signing_verifying


Do transaction fees remain stable in bitcoins, or adapt to purchasing power?

Your understanding is correct. If the required fee rate on the network remains the same (denominated in BTC) and the value of BTC rises against USD, then the transaction fees rise in USD terms.

In reality, there are many factors which affect what the actual required transaction fee will be, such as time/day of transaction (there's generally less competition for block space over weekends), size of transaction and if the transaction uses segwit (since segwit witness data is discounted).


What does it mean to go negative on exchange?

When you buy 0.0001 BTC, it's the same as buying anything that you could, but are not required to, sell in the future. You (on the books of the exchange, until/unless you transfer the BTC out to a wallet you control) are the owner of 0.0001 BTC. If the price declines [or rises], you have a so-called "paper" or "unrealized" loss [or profit], but that's just hypothetical until/unless you actually sell the BTC.

If the price declines [or rises], you are "poorer" [or richer] -- your net worth declines [or increases], using the current BTC market price as the value of what you own. But until you sell it, you just own 0.0001 BTC and there is no need to pay (or receive) any $US regardless of price changes in the BTC market.


wallet.dat from 2014 shown as empty with latest client 0.18

Did you resolve this issue for yourself? If not, please do the following. First remove save your wallet.dat file into another folder on your pc. Second remove BTC Core entirely from your pc and restart the pc. Finally, reinstall BTC Core onto the pc. Go into the wallet directory, rename new wallet.dat which is created. Place backup wallet.dat file here. Restart BTC Core client and let it rescan the network. This will fix your issue.


Is it possible to remove my bitcoins from the Bitcoin network?

If you don't use them, nobody will be able to use them, so in a sense they will have disappeared. If you wish for them to be publicly, permanently destroyed, you could try one of the approaches at What is the Bitcoin equivalent of /dev/null?, such as sending them to the address 1111111111111111111114oLvT2, which is the address of an all-zeroes hash. There are technically many private/public keys that correspond to the address, but finding one is practically impossible.


You are just puzzling your self. We will start step by step.

What is Bitcoin output?

An output is an amount that was sent (via a standard transaction) to a Bitcoin address.
So when I send some bitcoins the recipient address is output address and if the recipient didn't spend the input I sent, it will be unspent output.

What is the relationship between claimed and unspent?

it's just the status of the output.

Do I have any unspent outputs yet?

No, You have one input. and the sender has "unspent output" which belongs to you.

If no, how does one create an unspent output (or in what circumstance/use case are they created?

When you make a transaction, you are creating outputs.
Unspent or claimed is whether the recipient spent the bitcoins or not.

Can a single address have more than one unspent output? If so in which circumstance?

outputs do not belong to addresses, but transactions. and a single transaction can have more than one output (e.g.) if you were sending for more than one address in same time.

Is there some article which explains these fundamentals in layman terms?

Mastering Bitcoin book.


Why do AMD's GPUs mine faster than Nvidia's?

Summary: different approach to calculations. Nvidia GPUs are more like CPUs, in that they have only a few processors that do work, but faster. ATI GPUs have slower processors, but a lot more of them.

You can find a more complete description on the relevant wiki page :

  Firstly, AMD designs GPUs with many simple ALUs/shaders (VLIW design) that run at a relatively low frequency clock (typically 1120-3200 ALUs at 625-900 MHz), whereas Nvidia's microarchitecture consists of fewer more complex ALUs and tries to compensate with a higher shader clock (typically 448-1024 ALUs at 1150-1544 MHz). Because of this VLIW vs. non-VLIW difference, Nvidia uses up more square millimeters of die space per ALU, hence can pack fewer of them per chip, and they hit the frequency wall sooner than AMD which prevents them from increasing the clock high enough to match or surpass AMD's performance. This translates to a raw ALU performance advantage for AMD:

AMD Radeon HD 6990: 3072 ALUs x 830 MHz = 2550 billion 32-bit instruction per second
Nvidia GTX 590: 1024 ALUs x 1214 MHz = 1243 billion 32-bit instruction per second

  This approximate 2x-3x performance difference exists across the entire range of AMD and Nvidia GPUs. It is very visible in all ALU-bound GPGPU workloads such as Bitcoin, password bruteforcers, etc.

  Secondly, another difference favoring Bitcoin mining on AMD GPUs instead of Nvidia's is that the mining algorithm is based on SHA-256, which makes heavy use of the 32-bit integer right rotate operation. This operation can be implemented as a single hardware instruction on AMD GPUs (BIT_ALIGN_INT), but requires three separate hardware instructions to be emulated on Nvidia GPUs (2 shifts + 1 add). This alone gives AMD another 1.7x performance advantage (~1900 instructions instead of ~3250 to execute the SHA-256 compression function).

  Combined together, these 2 factors make AMD GPUs overall 3x-5x faster when mining Bitcoins.


What is necessary for a Hotel to accept Bitcoin as a payment method?

Depends on your budget or technical expertise I guess.

A. Install a wallet and create a new address. Post this address on the hotel's website and you are ready. This is the low tech solution and you would manually have to check the balance to see what payments are received.

B. Use a gateway like BitPay. It works like a Paypal for Bitcoins. The payment will be handled by BitPay and BitPay will send the coins to your address or convert them to fiat currency for you. This is probably the option you are looking for but BitPay takes a little fee of course. Coinbase or BIPS are alternatives.

C. Hire a developer to do the integration for you. This lets you customize the way you want it but is probably way more expensive.


How long does it usually take to mine a bitcoin?

You would never be able to mine a solo mine any Bitcoin with a GTX 1050. The current network difficulty is so high that your GPU would have an almost 0 probability of finding a block and thus earning any Bitcoin.


How do I determine each transaction fee on the blockchain?

The transaction fee is the difference between the value of the inputs being spent and the value of the outputs being created. Most block explorers will tell you the transaction fee for a transaction though, so you don't need to calculate it manually.


It's in the witness right after the signature.

ScriptSig: PUSHDATA(22)[00144b9d2d3dd1174ad656754a0c664e7a129b131f3b]
Witness:     0247304402201cf8db0c4afc164970ec4397327fe9b1dd9b7ff4a9093f94e554d624b5ffdcb702202848072c17f2bcce16b8d3d7cb2efdad87bc6c942b79f44b79f1c52f817d81ea012102384052a5ecde83bf8ee7ed77f378edb58aa65de22c4e91af87eee68015b9d509

0247304402201cf8db0c4afc164970ec4397327fe9b1dd9b7ff4a9093f94e554d624b5ffdcb702202848072c17f2bcce16b8d3d7cb2efdad87bc6c942b79f44b79f1c52f817d81ea012102384052a5ecde83bf8ee7ed77f378edb58aa65de22c4e91af87eee68015b9d509

EDIT:

  Is there a way to reliably retrieve the pubkey and it's position in the raw transaction?

You have to parse the witness.

02 : 2 items to follow

47 : 0x47 = 71 bytes (signature)

304402201cf8db0c4afc164970ec4397327fe9b1dd9b7ff4a9093f94e554d624b5ffdcb702202848072c17f2bcce16b8d3d7cb2efdad87bc6c942b79f44b79f1c52f817d81ea01 : the actual signature (last byte is the sighash code)

21 : 0x21 = 33 bytes (the pubkey)

02384052a5ecde83bf8ee7ed77f378edb58aa65de22c4e91af87eee68015b9d509 : the actual pubkey


It is a blacklist of erroneous nodes' IP addresses which has accrued a certain amount of banscore due to "misbehaviour". To check what sort of erroneous behaviour is considered "misbehaving", you can check the Core source code.

It is a precaution to protect your node against potential denial of service attacks. Example actions which will accrue banscore includes spamming "mempool" messages, relaying invalid transactions/blocks, etc...


How is someone not able to steal my bitcoin with Dumpprivkey command?

I hope he meant that they can get the private key for any address in their wallet. Obviously, the software cannot dump a key it does not have.


How can I list my mined coins using RPC? And spend them?

You can use the listsinceblock command to filter out the mined coins. listsinceblock contains a category field. The values you're looking for are:

generate: for coins mined locally that are available for spending
immature: same as above but coins cannot be spent yet


developing a new alt-coin useful or not?

Is it useful?

Probably not for the community, but for you because you learn.

  It's possible create the alt-coin since my ubuntu and maintain this alt-coin since my pc if its always turn on?

There is a difference between creating and running it. But yes, you can create a coin with your Pc.

  My last question, at this moment is possible that this new altcoin get some real price in the market?

If you list it on an exchange and the community believes that it has a value: yes. Otherwise: no.

-

If you have only one Pc, you could create an ERC20-token (Ethereum based) and let the blockchain handle everything.


The tool for complete history of all bitcoin minted already exist and its called blockchain. You can see all history here (random transaction selected)

https://blockchain.info/tx/ff698f3e5321448d4d889fcd3c91f9e5f5767542d2f0fd7e4aa41a83abec3ab7

There is a term taint and it's meaning how two addresses are connected. It partially explained here What are tainted coins exactly?

Bitcoin is not a legal tender and nobody have to accept any bitcoin - with normal dollar any dollar is a dollar that is worth always the same and cannot be legally tainted with crime. It's more legal question that a technical one because government could not adhere to technology reasons.


Is there a way to tell if a specific Bitcoin node is on the network?

Bitcoin nodes do not have a unique identifier, and this is by design.

In fact, any property that allows someone on the network to verify whether two connections (even separated in time) are to the same node, is something we'd call a fingerprinting attack.

As such identification could be used to link transactions coming from the same node together, they are a potential privacy leak.


Cointrader rounds it:

  All calculations are performed to 16 decimal places. The final fee for dollars is then rounded up or down to two decimal places, and final fee for BTC is rounded to 8 decimal places. For example: a fee of $0.114 is rounded down to $0.11, and a fee of $0.116 is rounded up to $0.12.

Coinfloor uses something called "weighted stochastic rounding", whatever that may be:

  In order to ensure fairness, Coinfloor uses an approach called "weighted stochastic rounding" to calculate the fees charged to our users when trading. Weighted stochastic rounding over time minimises the effects of rounding errors. To understand why this rounding method is preferable to traditional "round-to-nearest" rounding methods, consider the case of one hundred occurrences of a 4.71 fee, each rounded according to the nearest whole number. Using the weighted stochastic rounding method, the expected value of the sum of these rounded figures is 471, which is exactly equal to the ideal sum of the unrounded figures. Using the traditional method, the expected value of the sum of the rounded figures would be 500, which is far from ideal as it results in a much higher fee charged.

I didn't find the information on any other sites, but I think they will use round


When will my no fee transaction come back?

It generally "comes back" in a week or two. Actually the transaction gets discarded by the mining nodes from their memory pools. Until then, your transaction is stuck.
However it depends on the wallet software as well if they let you spend it.
I had complete control over the addresses I was using so it was easier for me to retrieve the funds.


How can one generate a vanity Bitcoin address with both a given prefix and suffix?

Vanitygen has a regex option, for generating addresses that match an arbitrary regular expression.  I think that

vanitygen -r '^1Bit.*Bit$'

would work.

Note that it will not be able to estimate the expected time that would be required.


The way I understand mining is that you hash the previous block hash
  with the new transaction files and a variable to get certain amount of
  zero in the hash.

You have chain A-B-C-D- , you create a new block, E, with its header (with variable called nonce and a reference to D's header hash) and body (the new transactions). You change the nonce in E's header and then hash the header. This hash should have certain amount of zeros.

  So the stronger your hash power is the faster you
  find the new block hash.

True, but searching the correct hash means guessing the nonce from entire range of nonces, and everybody guesses their own variable. So the fastest computer will only have highest number of guesses. This doesn't mean someone else with only a few guesses won't guess it first. Like in a lottery, the guy who buys 1000 tickets is not sure to win comparing to the guy who bought 2 tickets, he just has better odds.

  and how do they get rewarded ?

Only the one who guessed the hash is rewarded.

  because the websites that offers hashing powers shows your balance to be
  continuously increasing and not as expected to increase step by step
  with each hash found.

If this site is a mining pool it gives rewards by some strategy, rather than giving the reward to the one who finds the hash at the moment when he finds the hash.


Trouble using existing .wallet with MultiBit HD

This is because the two versions use two different types of key management systems.

Multibit HD is hierarchical deterministic key management. All keys generated can be recovered from a seed since the keys are generated deterministicly.

Older multibit clients used single key management where you could not recover all keys unless you had a back up of your wallet or private key.


What if the miners allowed invalid transactions, and other nodes did validation?

I'm thinking, what if bitcoin was designed this way, or if someone created such hard fork, could it work? If yes, what drawbacks should be expected?

There are two I can think of:

No SPV

Right now, to trick an SPV client, you need to get 51% of miners to include an invalid transaction. However, if all miners include all transactions, then SPV is not possible.
No safe softforks

P2SH was a softfork that made it possible to send money to a hash of a script. If you didn't run P2SH enforcing code, enough miners ran it that your node would still agree with everyone else.

However, if rules are not miner enforced, then two clients running slightly different code can look at the same blockchain and get two entirely different pictures of who owns what.


Transaction version 2 - bytes between tx version and number of inputs

That is not something specific to version 2 transactions.

What you are looking at are the marker and flag bytes for a segwit transaction. Segwit transactions have a slightly different transaction format which is specified in BIP 144.


What new JSON-RPC calls are available with SegWit activation?

As you mentioned, strippedsize was added as a parameter to getblock() that shows the block size excluding witness data.

txinwitness has been added as value to the response from getrawtransaction() and decoderawtransaction().

That's all I was able to pick up from the RPC... I suspect looping through the transactions in each block and checking for the txinwitness value could get the number of segwit transactions.


Can the blockchain be outpaced by a chain of low-difficulty blocks?

There are two problems with this:

The "longest" block chain is selected not by total number of blocks, but by total difficulty.  A chain with a large number of low-difficulty blocks would not win.
The Bitcoin reference client hard-codes the hashes of a relatively recent block as a "checkpoint" and will reject any chain not containing that block at the correct height.  So any chain that diverges before the checkpoint will be ignored.


In what sense does the security model of proof-of-stake require users to "log on to the internet every few months"

What Vitalik is talking about is the Slasher algorithm that he designed which punishes the block signer if he attempts to create a fork in the blockchain. However the way that slasher works is that there will be basically a timeout; if a fork is detected during that timeout, the signer that created the fork loses his money. But after the timeout, he does not. This is so that he can actually spend the money at some point.

The problem with this is that once the timeout has passed, the signer can then create a fork without being punished. This is known as a long range fork. This fork, if it survives, can grow and, at some point, could be longer than what you have synced up to. In that case, because of how PoS works, you could end up switching to using the forked chain instead of the real chain. So to avoid that, you need to go online routinely to keep your blockchain up to date so that in the event of a long range fork, you are still using the correct blockchain.


Why cant i retreive my BTH coins from my blockchain wallet

I assume by BTH you mean BCH for Bitcoin Cash.

Blockchain.info does not support Bitcoin Cash so you cannot retrieve your Bitcoin Cash as that is an altcoin. However you can take your 12 word seed phrase and use it in a Bitcoin Cash wallet software that supports BIP 39 like Electron Cash to recover your coins.


bitcoin-cli get all tx hashes for watch-only address

Seeing as this question remains unanswered after a few months...

You will need to enable txindex = 1 in your bitcoin.conf per @Jannes' suggestion. If you want to scan your downloaded blockchain for another wallet's address transaction history, then you have to build the entire blockchain index on your machine.

Whether it's a watch-only address or not should be irrelevant.

What are pros and cons of txindex option?

Get non-wallet transactions using bitcoin rpc (gettransaction)

UPDATE

I think I may have solved your problem

This is my Bitcoin info

$ bitcoin-cli getinfo
{
    "version" : 110200,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 353776,
    "timeoffset" : -1,
    "connections" : 55,
    "proxy" : "",
    "difficulty" : 47610564513.47126007,
    "testnet" : false,
    "keypoololdest" : 1449210293,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00005000,
    "errors" : ""
}

My blockchain isn't quite as up-to-date as yours, so I gathered this transaction (within block 353776) and used the Bitcoin address of 1CTVqQSSVTjun32gRxmhJHhVYzzXpR894z from that transaction for my example.

# Import address WITHOUT rescan; we'll do this later
bitcoin-cli importaddress 1CTVqQSSVTjun32gRxmhJHhVYzzXpR894z "Index Test" false

# Stop Bitcoin
$ bitcoin-cli stop

# Verify Bitcoin is stopped, then run:
$ bitcoind -rescan

# Wait for rescan... mine took 15-20 minutes

# Once 'bitcoin-cli getinfo' returns valid info, run:
$ bitcoin-cli listtransactions "Index Test" 10 0 true

# Result:

[
    {
        "involvesWatchonly" : true,
        "account" : "Index Test",
        "address" : "1CTVqQSSVTjun32gRxmhJHhVYzzXpR894z",
        "category" : "receive",
        "amount" : 3.50000000,
        "vout" : 0,
        "confirmations" : 22539,
        "blockhash" : "00000000000000000548d8ef9a7d14c75b7b18ae5b792d520f44cc5ddd25adfe",
        "blockindex" : 536,
        "blocktime" : 1416848183,
        "txid" : "1db7b0703f441d4cea63a298131f8e766b557329f44c30898847d0fc23573606",
        "walletconflicts" : [
        ],
        "time" : 1452652576,
        "timereceived" : 1453438387
    },
    {
        "involvesWatchonly" : true,
        "account" : "Index Test",
        "address" : "1CTVqQSSVTjun32gRxmhJHhVYzzXpR894z",
        "category" : "receive",
        "amount" : 1.89990000,
        "vout" : 1,
        "confirmations" : 19031,
        "blockhash" : "0000000000000000134345f88fb68550d2102d392be6e1635eaa6fb50c37a2cc",
        "blockindex" : 15,
        "blocktime" : 1418994502,
        "txid" : "4cc761b286c23dab5dd07c260726d79e4baee88778a402e36c82a6b9e6ac757f",
        "walletconflicts" : [
        ],
        "time" : 1452652576,
        "timereceived" : 1453438430
    },
    ...
    snip
    ...
    {
        "involvesWatchonly" : true,
        "account" : "Index Test",
        "address" : "1CTVqQSSVTjun32gRxmhJHhVYzzXpR894z",
        "category" : "receive",
        "amount" : 13.63000000,
        "vout" : 0,
        "confirmations" : 211,
        "blockhash" : "0000000000000000021df02390f30985f34d871e4cc93c4e349cd3b23574bf76",
        "blockindex" : 1,
        "blocktime" : 1430041109,
        "txid" : "64540e42ec96118d11168d954641dd5390f4a46ba795c7b7588d38141e66117a",
        "walletconflicts" : [
        ],
        "time" : 1452652576,
        "timereceived" : 1453438694
    }
]

As you can see, the last transaction to show in the output is the one I grabbed from block 353776, with all of the correct details as displayed on blockchain.info, indicating a successful transaction listing for the imported address (account containing the address, actually).

As for why your rescan didn't work when you initially imported the address, I can't really say. Perhaps a more seasoned Bitcoin user could shed some light on that.

At this point, I recommend you stop your Bitcoin daemon and run bitcoind -rescan and wait for it to do its magic. Afterwards try your listtransactions again. I'm interested in finding out if it works for you.

Keep in mind that attempting to import a Bitcoin address that already exists within your wallet will not initiate a rescan, even if specified to do so on the command line. --- https://bitcoin.org/en/developer-reference#importaddress


How to interpret Mt Gox Live orders chart

It's essentially a market depth chart, with the orange/brown line on the left representing the (cumulative) volume of standing buy orders and the blue line representing the (cumulative) volume of standing sell orders. The y-axis represents an amount of BTC and the x-axis represents a given buy/sell price in USD. The green line represents recent historical price shifts in that value.

At the top right are large numbers representing the current, high and low prices for the day. From the "Help / Options" menu at the bottom right, several additional options are available including the ability to show volume as lighter or darker shades of green on the price line and the ability to disable the gray ghostlines which appear every time the volume curve shifts. This Help/Options dialog also contains the following helpful instructions:

  This is a cumulative graph of the outstanding orders on the MtGox
  exchange. It shows how much BTC/USD will have to be bought/sold before
  the market rate hits a certain USD price. For example, let's say you
  want to know how much USD would have to be spent buying BTC before the
  price reaches 40 USD. First find 40.0 on the bottom axis. Then find
  where the blue line intersects $40.0. Now find what value that
  corresponds to on the right axis. If it corresponds to $200000 then
  that's how much USD would have to be spent buying BTC before the price
  reached 40 USD.


Most Bitcoin lookalikes are not really worth looking at. The two that are more or less accepted are Litecoin and Namecoin, of which the latter is not intended as a currency. Another more or less popular cryptocurrency that is not based on Bitcoin is Ripple.

I know that there are many more Bitcoin-based currencies. Most of them are not adopted and are thus insignificant. The value of such currencies is made by the willingness of people to exchange them for value, like objects or other money. As long as no one uses these alternative currencies, they are of no meaning at all.

And frankly, wouldn't it be better to first try to make one cryptocurrency succeed instead of spawning hundreds of others before the world knows what a cryptocurrency is?...


How to convert HD wallet master key to extended key and child keys in javascript?

The base58 module is designed for Flickr; it uses a different alphabet ordering than Bitcoin, and only handles fairly small numbers not the size Bitcoin needs. For Bitcoin use bs58 module plus one other fix: the checksum is not the whole SHA256d but only the first 4 bytes, or since you store it in hex the first 8 chars:
const bs58 = require ('bs58');
... same except
var data_with_checksum = data + sha_256_2.substring(0,8);
var result = bs58.encode(Buffer.from(data_with_checksum,'hex'));
->
xprv9s21ZrQH143K3mfksXFtCXmQBeuA4wJqhcEJKgxzocJqadRRZZZvW2quiv9XiRw9BipJgvjbGLipAH5ZT9868uA4LFwJexUaJus2EVe4FXq

However, as the bs58 page says, there is a bs58check module that combines the checksum and encode for you:
const bs58check = require ('bs58check');
... first two parts only, computing data
var result = bs58check.encode(Buffer.from(data,'hex'));
-> same

And the same github user also has bip32 and bip32-utils modules that probably do the whole job for you, although the readme's are fairly limited and you'll probably need to look at the code (I didn't have time).


I know Poloniex and Bittrex is good, i use Poloniex my self to trade currencies.. http://coinmarketlist.com/ <-- maybe there you find some other exchange platforms.. there are lot of platforms out there.

About wallet i don't know :(


Why the blockchain isn't just a Merkle tree

A bitcoin full node independently validates the history of the network. To do so, it must validate each block in sequence (which includes all transactions in each block).

A merkle tree provides a cryptographic commitment to some data, but does not hold that data itself (it just holds hashes of the data). So a merkle tree alone is insufficient to validate the history of the network. Nodes need block and transaction data to do so, not just the merkle tree commitment.


Why do my 'sign message' not work on Bitcoin core

Addresses that start with bc1, called Bech32 addresses, can't be used to sign messages, at least for now. It might change in the future.


Mastering Bitcoin by Andreas M. Antonopoulos - bitcoinbook.info

  Mastering Bitcoin is a book for developers, although the first two chapters cover bitcoin at a level that is also approachable to non-programmers. Anyone with a basic understanding of technology can read the first two chapters to get a great understanding of bitcoin.

The first version was published in 2014, the second edition with updates was published in 2017. Although you can get a physical copy on amazon, the whole book is available on github. The second version can be read here: https://github.com/bitcoinbook/bitcoinbook/blob/develop/book.asciidoc

I find the book a good introduction to bitcoin for developers because it gets a good first explanation of Keys, Addresses, Transactions, Scripting and so on, and it does that not on the typical management level but also goes into the technical details of it. Although the book is somewhat older, the author also tries to explain new features of Bitcoin such as Lightning and Segwit, which you can find in the second edition in the Chapter 12 and Appendix.

You may find better resources on newer topics like segwit, but I believe the book is still a good starting point for coders to get into bitcoin.

A good overview of the books content you can find here: https://bitcoinbook.info/whats-new/


Try resarting the client, switching servers and make sure that you are connected to a server (green ball in the bottom-right corner) before making a tx


Is there a reason why miners should respect the default maximum block size?

You should know that as of bitcoin 0.8.6, the default maximum block size is actually now increased to 350,000 bytes.

The 350,000 bytes is a soft limit. All miners are motivated to maximize filling the block size to 1MB for each block because it would be irrational for them to do any less and leave fees to other miners that they could easily collect themselves.

Thus all blocks are usually mined to the maximum limit with paid transactions and then free transactions are included once all fee-based, unverified transactions have been verified.


Atomic Swap - What if redeem is done just before expiration

As you stated, setting 2 different expiration times provides safety.

My recommendation is to select the network with the longest period before immutability as the first contract, and pick a time that is agreeable with both parties.

The second contract on the other chain should use an expiry that is half of the first contract. This gives the redeemer on the first blockchain some time before the expiry.


What's the point of having a stack-based scripting language, if only a few standard forms are allowed?

OK, the original concept of scripts was not perfect. But with p2sh (BIP-16) any script can be realized


What is burning coins, who benefits, and who does it

Burning coin is performed in the early stages of a new cryptocurrency in order to avoid that early users hold the largest portion of supply in the market, so that they won't be able to manipulate the market itself or that the coin is a scam. If you hold the largest share of supplies you can control its price fluctuation and this is not good for the health of the currency since that would mean that the market could be rigged, causing users to flee from the market. Burning your coins is a way to show your commitment to the currency on the long term and to earn trust from the users that want to join the market.


Command line bitcoin cash wallet for linux?

You can use Bitcoin-ABC or Bitcoin-unlimited, Both are Bitcoin-cash.

after you successsfully install it, you can just send the commands as follows:

bitcoin-cli getnewaddress "account"

to get new bitcoin cash address.

You can find all commands on bitcoin.org. This documention for Bitcoin core, but as Bitcoin cash is a fork of bitcoin, these commands should work with you. You can find new commands or changes on Bitcoin-ABC on Github


Is it safe to receive funds at this 1FJJd... address?

Kind of. Your wallet knows the private key that corresponds to that address as it is the same private key for the bech32 address. However it does not necessarily know that it should be looking for coins sent to this address, so any transactions that send coins to that address may not appear in your wallet and thus it will be harder for you to spend those coins.

  Is there a downside to using this rather than Bech32?

As I said earlier, your wallet may not know about that address and thus won't track it. Even if it does, it is better to use the Bech32 address as that means that you will be using Segwit. The transaction fees for a spend from a segwit address will be lower than a similar spend from the non-segwit version of that address.


Trying to transfer BTC from Coinbase to Binance, commission 13 USD?

You can pay a lower fee but this will risk it being stuck in the mempool forever—-not an advisable option.


Heartbleed: When will bitcoind 0.9.1 be released for Ubuntu 12.04?

See my answer here.  Short version: if you upgrade your system OpenSSL libraries, it is not necessary to upgrade to Bitcoin Core 0.9.1.

(If someone will upvote the other answer, we can close this question as a duplicate of the other one.)


Why would you rather mine Bitcoins than Litecoin? What am I missing?

Mining Bitcoins with anything other than a purpose-designed ASIC is inefficient with the current hash rate, and is unprofitable in terms of power expended and daily profit. But mining coins using the Scrypt algorithm with graphics cards is profitable in a small or large operation.

Why is Scrypt Mining Profitable?

To simply put it, Scrypt requires more memory than SHA hashing and memory is expensive. GPU mining is popular and profitable, because it has large banks of memory standard and cheaply ($300-$400 a card). SHA hashing is easy to do with an ASIC chip because it can be done with very low memory and very inexpensively in terms of resources. So, building an ASIC to do the job of Scrypt mining is a lot more complex and expensive – keep in mind the designing a Bitcoin ASIC was a multi-million dollar process. Having large banks of memory on your ASIC chip introduces a lot more design issues. ASICs for Scrypt is very doable, but a lot less doable than Bitcoin ASICs. We probably will see the rise of Scrypt ASICs within 5 years or less.

What is Scrypt?

It is the hashing algorithm a majority of the cryptocurrencies use. Litecoin, Dogecoin, etc are all Scrypt-based coins. People use Scrypt for good reason, it makes ASIC mining tough, and that's about it. Bitcoin using SHA-256 is not bad in any way, but it's a lot more sensible to use Scrypt with any new altcoin to avoid getting ravaged by extreme hash rates ASICs can impose. And Bitcoin cannot simply change over from SHA-256 to Scrypt either.

When is ASIC Mining Profitable?

Don't get fooled into thinking Bitcoin mining is not profitable, the profit comes with large operations. Say you could get your hands on a few racks of ASICs mining Bitcoin, you'd have reasonable returns. You also have to move fast with Bitcoin, certain ASICs obsolete fast. You start turning a profit with ASICs when you've spent tens of thousands dollars. The BFL units that cost around $250 became inefficient within a few months of release, and you could find units going for thousands of dollars because those were one of the first few shipped early. See http://motherboard.vice.com/blog/a-guide-to-bitcoin-mining-why-someone-bought-a-1500-bitcoin-miner-on-ebay-for-20600


How do goods & services sellers manage price instability?

This isn't an account, but it covers anything an account could.

They update their prices based on how many USD they want for the item and the current BTC/USD ratio. There's even an electronic price tag that does this automatically: http://www.bbc.com/news/technology-26031331.

Online, it's usually handled by some outside payment process company like Coinbase. You set up the website to communicate to Coinbase "I need $x for this guy's order" then they redirect the user to Coinbase's payment page, where Coinbase asks the user for $x worth of BTC at the current price. When Coinbase gets the user's coins, you (the merchant) gets your money. Most merchants never touch the BTC.

In person, without the electronic price tags, it would be impractical (or even impossible) to price items in bitcoin by hand. One way around this would be to price them in USD, then take their total at the register to determine the amount of BTC needed for the purchase. Ie, the customer comes to the register with $x worth of goods, the merchant looks up the price of BTC (which they could do quickly), then asks the customer for $x worth of BTC.

If you mean how do they manage the risks of holding an asset that is volatile, the answer is that they don't hold it. They use Coinbase or similar.


How to find a list of all nodes in a p2pool network?

The answer is p2pool-scanner.

A little piece of javascript with minimal webserver (NodeJS) which keeps scanning your local p2pool-data directory for node ips and scans all nodes for public html frontend. If it finds a public accessable frontend, it will add it to a list of public nodes and displays the results sorted by uptime.

Its easy modified (scanner.cfg) to work with any *coins p2pool network.

Here is an example node scanner for vertcoin: http://q30.qhor.net:9172/


Should we wait 10 minutes to confirm a transaction

Yes, you need to wait, because the tx fee is too low, it won't be mined ever, so the transaction will be refused.

BUT if you're using the lightning network, you can create instant transactions. You can read more about lightning.

If you're dealing with tons of money, recommended to wait for 6+ block confirmation, because a strong miner can rebuild the last piece of the blockchain (this is almost impossible)


Question on getaccountaddress, getnewaddress, getAddressesByAccount

I recommend that you do not use Bitcoin Core's internal accounting system because it is deprecated and will be removed in the future. Once it is removed, whatever code you have written that depends on it will be broken. Furthermore, the accounts system is not all that good.

I suggest that you instead maintain a separate database where you keep your own accounting system. That database would record each user's address and how much has been paid to that address. To figure out how much has been paid to each address, you would have a script that is called by -walletnotify which then looks up what address is being paid and how much for each transaction that you receive.

There are software that handle this sort of payment processing for you already that can be used with Bitcoin Core. One such software is BTCPay.


How cooperative or competitive is the mining process?

Miners that aren't cooperating will never replicate work because they each want to get a different block as the next official block. If nothing else, the account the mining fee is paid to will be different. (And this ripples up to the header.)

For miners that are cooperating, work units are assigned by the mining pool. The pool will typically embed a different coinbase in the work units it assigns to each miner. When a miner finishes processing a work unit, it requests a new work unit (with a new coinbase) from the mining pool.

So there should never be any replicated work.


How to transfer my wallet.dat to dedicated Ubuntu server

Though not really bitcoin related...
How are the two systems connected? I mean, can you already login via ssh? Or do you only have a terminal running on both, and no ssh daemon?

If no ssh daemon, then netcat is the tool of choice.
If ssh daemon is running, use secure copy tool:

scp -port source target

e.g.:

scp -P 22022 ~/.bitcoin/wallet.dat 192.168.92.117:/home/mybitcoinuser/.bitcoin

And lastly, if the target server doesn‘t run ssh daemon, you can for sure start one in your terminal, and execute the scp from the target server (adopting the source and target).

There is a capital P when using scp.


A signature check failed for a valid transaction. This likely indicates a CPU or RAM problem with the system you're running on (even though you don't see regular errors in normal operation, Bitcoin does so many computations during validation that it's likely to see them more).

The result of this is that bitcoind marked the chain this transaction was in as invalid, and rejects new blocks in it.

To rebuild your database, you can start the client with the -reindex flag (if you exit while rebuilding, it will pick up where it was stopped on the next run).

One workaround that helps in some cases is running with -par=1, making validation only run in one thread. This seems to reduce the load enough to make some CPUs not cause errors anymore.


Is it possible to copy other scriptSig for using in different transaction?

No, because clients use SIGHASH_ALL in their transactions by default, which signs the outpoint you're spending in addition to the rest of the transaction.

People also sometimes add the flag SIGHASH_ANYONECANPAY to SIGHASH_ALL which still signs the outpoint you're spending.


converts WIF private key back to basic private key format
import hashlib
import base58
import binascii

private_key_WIF = input("WIF: ")
first_encode = base58.b58decode(private_key_WIF)
private_key_full = binascii.hexlify(first_encode)
private_key = private_key_full[2:-8]
print(private_key)


Specific namecoin address in merged mining

with p2pool at least for the coins are 'merged' mining you cannot reconfigure them to go to any other account except for the default account of that wallet.  However  you may be able to work around this in one of the following ways depending on your coding ability.
Monitor P2Pool logs and trigger script
Watch the p2pool logs and when a block is found trigger a script.
This can be achieved using swatch (linux tool for watching logs files) and looking for merged blocks that appear in /path/to/p2pool/data/bitcoin/log  (cant find the example merged block right now will edit later to include)  so in this instance what you would do is use this command:  swatch -t /path/to/p2pool/data/bitcoin/log  and create a ~/.swatchrc in your home directory with something like this:
watchfor /SHARE|BLOCK/
    exec echo "P2Pool Event:\n\n$_\n" | python ~/pyPushBullet/pushbullet_cmd.py 6xxxxxxxxxxxxxxxxxxxxxxxx60993c note xxxxxx"P2Pool Notification" "$_"

Im using push bullet to send notifications on share and block notifications.  however in your case you would want to craft a script to check the block itself for merged outputs.
Wallet Notify
Most Crypto Clients now let you configure an action for
  -blocknotify=<cmd>     Execute command when the best block changes (%s in cmd is replaced by block hash)
  -walletnotify=<cmd>    Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)
  -alertnotify=<cmd>     Execute command when a relevant alert is received (%s in cmd is replaced by message)

Courtesy Off The Bitcoin Wiki
again in the same vein as the first optin you could  create a script that is triggered on wallet notify for the Nnamecoin wallet and move the coins from the default addreaa to you chosen address.


Where can I get bigger amount of test BTC?

If you need 100 coins, you should use regtest mode, this is a message from a faucet website:

  Please do not ask me to send a coin outside the faucet!
  My stocks of coins are shrinking and generation new coins is becoming more and more difficult.

  If you really need a lot of testing coins, try some other solution. For example:
  bitcoin-testnet-box
  bitcoin-regnet

Link


How to access Electrum remotely via the rest api?

I got most of my answers here.

  Note that HTTP basic auth sends the username and the password unencrypted as part of the request. While using it on localhost is fine in our opinion, using it across an untrusted LAN or the Internet is not secure. Hence, you should take further measures in such cases, such as wrapping the connection in a secure tunnel. For further details, read this.

So it sounds like i'll have to build a PHP wrapper myself, or use a SSL tunnel. (Not excited at all)


Do transactions including CHECKLOCKTIMEVERIFY get mined immediately?

Taking a stab at answering my own question.

Both the transaction using OP_CHECKLOCKTIMEVERIFY in its output script and the one spending OP_CHECKLOCKTIMEVERIFY can be mined immediately in most cases. The output script will probably be used in a P2SH (pay to script hash) so no one will even know that CLTV is even used--only the hash will be visible.

On to spending that CLTV output...

The goal of CLTV is to lock up funds until a certain time. For instance, I want to have a joint account with a business partner that requires two signatures to spend, but after a certain time the funds are spendable by just one signature (in case one of us disappears).

So I was expecting to see a comparison between the CLTV time and the current block time, but all I found was a comparison to nLockTime:

if (nLockTime > (int64_t)txTo->nLockTime)
        return false;

Traditionally, there's no reason to create a transaction with nLockTime set (non-zero) because that transaction would only be spendable in the future. In the case of a CLTV input past its expiration, I can spend it immediately:

Create a transaction that sources the CLTV output (that's already been in the block chain for some time).
Set the nLockTime to the current block time. We're basically using nLockTime to pass in the current block time.
Set the seq number to something other than the max. This handles a special case where max'd seq numbers allow transactions with nLockTimes set earlier than the current block time to be mined.
The transaction will pass verification because txTo->nLockTime > nLockTime (the CLTV time in the script).

Note that a transaction with OP_CHECKLOCKTIMEVERIFY in a scriptSig input may have nLockTime set to 0, because it's not using that code path in the script. Many protocols have logic like

  spendable with 2 signatures or just 1 signature after x date.

So 2 signature might be used rather than waiting for the date.

For instance: https://api.blockcypher.com/v1/btc/main/txs/7b8846797d9c43c7c89543dda13ad5f8742f0068c56c0fa884692a62fe81a79c?limit=50&includeHex=true has a script with OP_CHECKLOCKTIMEVERIFY, but its nLockTime is 0, and seq is max. (2^32 -1 ).

For reference: locktime and sequence specification: https://bitcoin.org/en/developer-guide#locktime-and-sequence-number


How do you exactly earn bitcoins... ive been confused frankly

You acquire Bitcoin one of two ways. You either buy it or earn it.

If you want to earn Bitcoin you are looking for Bitcoin mining unless your boss wants to pay your salary in BTC.

There are also websites where you can earn Bitcoin for completing tasks.


bitcoin node startup daemon with created wallet

You load a wallet using the loadwallet command.

To load the wallet named 1, do

bitcoin-cli loadwallet "1"

In order to have that specific wallet always loaded, add to your bitcoin.conf file:

wallet=1


Is it feasible to derive the root key of an HD wallet from a large sample of child public keys?

According to Mastering Bitcoin chapter 4 Hardened child key derivation, the master key is protected.

  As a best practice, the level-1 children of the master keys are always derived through the hardened derivation, to prevent compromise of the master keys.

So special care is made by wallets to protect that key specifically. Knowing the child indices, entropy, and child keys don't expose the master key as long as you keep the master key itself secure.

The chapter goes on to explain the normal child derivation's associated risks, but those are xprv keys.

Edit:

HMAC-SHA512

index   -->|HMAC-  |
master  -->|SHA512 |-->lt 256 bits --> + index + master --> child key
chain   -->|       |-->rt 256 bits -----------------------> chain

This is how I reimagined the diagram from chapter 4:

  The parent public key, chain code, and the index number are combined and hashed with the HMAC-SHA512 algorithm to produce a 512-bit hash. The resulting hash is split into two halves. The right-half 256 bits of the hash output become the chain code for the child. The left-half 256 bits of the hash and the index number are added to the parent private key to produce the child private key.

This didn't show the resulting addresses, but the text describes their
behavior as identical to random addresses.

Source Code

https://github.com/btcsuite/btcutil/blob/master/hdkeychain/extendedkey.go

170 starts comments describing how the IsPrivate flag is assigned.
 For a hardended child, it must derive from extended private key.

https://github.com/btcsuite/btcwallet/waddrmgr/wallet.go

2029 shows the BIP0044 HD structure
 being defined by using the 44 + hdkeychain.HardendKeyStart (upper 2^31 range) value

m/44'/<coin type>'/<account>'/<branch>/<address index>

https://github.com/btcsuite/btcwallet/blob/master/waddrmgr/address.go

316 newManagedAddressFromExtKey we know IsPrivate is true and calls newManagedAddress
 on 286 which generates the pub address using the same logic from public key at 301:

ripemd160( sha256( publickey ) )

where the publickey is elliptic-curve paired to prv

I believe the EC property is still what makes the resulting addresses irreversible.
Looking at the identifier notation, you can make guesses about common values:

m/44'/0'/1'/1/1

Assuming this is a very common HD wallet identifier, the other inputs are the root
seed and the pass phrase.

Collecting Significant Pool of Addresses

With the EC property, no amount of addresses collected can be reversed-hashed, then
reversed-EC'd to obtain the private keys.

So then the work could be to iterate through all possible inputs (seed, pass-phrase)
with the common
BIP0044 HD identifiers, and compare results to the collected addresses. Not trivial task.

Another layer of protection I can see, is to fan out at the child of the index:

m/44'/0'/1'/1/1/<here>

Import that public key to the online wallet. At each branch, you are increasing the
possible addresses by 2B. If the online wallet in turn generates a child per user,
that person only ever "collects" addresses for his/her branch; 2B addresses and
still they will not see addresses for a sibling user.
Reversing here only reveals the public key, another deterrent.


Cannot access blockchain.info through Tor browser?

This has been an issue with their TOR service for over a year.  They claim that they're trying to fix the problem, but I don't believe them anymore.  They can't be this incompetent.  Their service is pretty much unusable.  If I knew of a decent alternative, I'd switch immediately and never use blockchain.info again.


There is a program called CudaMiner that can be compiled to run on Linux.
https://github.com/cbuchner1/CudaMiner/
I've also written some more notes about compiling CudaMiner here
http://www.fractured-state.com/2014/03/scrypt-mining-on-aws-nvidia-gpu-with-cudaminer/
UPDATE:
The second link is dead already, but a similar tutorial is detailed in this thread:
https://www.reddit.com/r/dogemining/comments/1y3ygr/dogecoin_guide_for_mining_on_linux_ubuntumint/


What is the meaning and application of the apostrophes in derivation paths of BIP32 / BIP44?

The apostrophes show whether or not that particular derivation is hardened.

The difference been hardened and non-hardened keys is described in BIP32.

See the wiki for some further detail. https://bitcoin.org/en/glossary/hardened-extended-key


What are the chances of hitting VALID mnemonic phrase out of bip39, if someone picks 12, 18, or 24 words from the word list randomly by himself?

If you mean "valid" being the valid checksum word at the end of the phrase,
A valid pneumonic is defined as:

The checksum is then the first n / 32 bits of the SHA256 hash of the entropy. This is just concatenated to the end of the entropy. The mnemonic is then encoded by dividing the entropy into groups of 11 bits and using the resulting 11 bit number as an index into a list of 2048 words

So I would think getting a valid checksum for any arbitrary input would be 1/2048


How to quickly find the private key from Segwit P2SH address?

As per today, it is impossible to find the private key from any public key or address. Also from a SegWit P2SH address. There is always hashing involved, which is a one way function.

I think you maybe wanted to ask, how to come to the public addresses (see below), so that you can extract corresponding priv key from bitcoin wallet...

I think there is no quick way :-(

But with some programming and web page links, this might get you to your goal:

  I have a very large list of Segwit addresses for bitcoin, starting
  with '3' and do not know the corresponding legacy '1' address for
  them.

The way the type 3 addresses are composed includes once again a hash value, so you cannot easily "go back" - it is a one way function. The way how they are composed is described here, and here is a description in bitcointalk forum.

  How can I quickly find the corresponding legacy address to export the
  private key from Bitcoin Core?
  The Seqwit addresses have not received any transactions, yet.

And here it gets difficult: unless there are some transactions spending with the redeem script of this segwit address (which usually reveals the redeem script in clear hex format), there is no way to get to the root data. But then again if you have the redeem script, it is a structure like this:

OP_0:    00
Length:  14
keyhash: (20 bytes)

again with the hash of the corresponding "type 1" key.
In this link Pieter said you can't, and shouldn't.

So best for your work is to extract all priv keys from the wallet, and do "the reverse work". Take a priv key, and create the type 1 address from it (never expose your priv keys online, you will loose the funds! You need to do this offline!). A good page on how to do is here.

After having the "type 1" address, you may convert it to segwit address, and use again the same pubkey to go through this.