Why do transaction fees exist in the Bitcoin blockchain if miners get rewarded with newly created bitcoins? My question is why transaction fees exist, even though the miners would still get rewarded with the newly created bitcoins when/if they mine a block. Miners will rather verify transactions with a higher transaction fee to eventually receive the fees themselves, but what if there were no fees involved and all the transactions would be verified without other considerations. The only reason I can think of is that with no transaction fees, when all the bitcoins are mined, there will be no more incentive for the miners and the network will fail. Is there another reason or is that it?

The block subsidy in Bitcoin serves as a decentral initial distribution mechanism and incentivizes the bootstrapping of the Bitcoin network. As you may know, the block subsidy halves every 210,000 blocks (approx. 4 years). Due to this reward schedule, more than 80% of all bitcoins have already been discovered, and in a decade, it'll be more than 95%. As the number of new bitcoins being added to the money supply dwindles, another mechanism to fund the security of the network will need to take over.

The source of that funding is meant to be transaction fees. This seems feasible, especially in light of us seeing the first block with transaction fees greater than the block subsidy last year.

  via smartbit.com.au

The transition to a fee funded mining market is tightly coupled with the blocksize debate. For example, Princeton's Weinberg et al have shown that a fee-funded mining market may become unstable unless there is a constant backlog of transactions waiting to be confirmed. Some Bitcoin clients explicitly lock new transactions to the next block's height to encourage mining of a new block in contrast to miners attempting orphaning attacks on the current blockchain-tip for fee sniping.

The described dynamic is also cause for speculation that altcoins with oversized (and thus empty) blocks may need to transition to a constant block subsidy in the longterm to maintain a stable mining market.

Finally, the limited availability of blockspace and presence of transaction fees creates a fair market for users to signal the urgency of their transactions. This allows more valuable use of a limited resource to displace frivolous or inefficient use. The fee market especially discourages spam and business models that depend on abundant blockspace. Early acceptance of the inherent limitedness of blockspace is a prime driver for innovation and investment in sound second layer technology such as the Lightning Network.

People have been speculating for years, why Bitcoin was designed with the abrupt halvings of the block subsidy instead of a smoother payout or even a constant reward. There even was an attempt to turn the initial block subsidy of 50 bitcoins per block into a constant subsidy around the first halving, but the broader network rejected the miner's attempt to increase the money supply.


I've forgotten my Electrum 12 word pass phrase, I have full access to the wallet - can I recover or generate new one? I've forgotten my Electrum 12 word passphrase, but I have full access to the wallet. Can I recover or generate a new one?

I can't find anything online about this.

The passphrase can be viewed from Wallet > Seed option


How to send bitcoins by email? How would you send bitcoins to a person by email supposing my bitcoins are stored locally on my machine?

The email is supposely not seen be any other person than the reciever (by using GPG for instance).

You can but you have to use American wallet provider Coinbase but than you have to register and login into their website.

For clarification, your bitcoins are not stored locally on your machine, they are stored on the Bitcoin network which means they are also on my computer and on every other peer's computer. The difference is, you have the access to your bitcoins (you own the private key) and I don't.


Where can i get all the commands with descriptions for Bitcoind on my linux server? Just installed bitcoind on my server and wanted to find a cheat sheet for the bitcoind commands. Where would i find them with a description and example of what each command does?

These days the most thorough and handy guide for the Bitcoin Core RPC commands is the bitcoin.org developer reference page.


How to change bitcoind 0.8.1 bind settings? I would like to setup bitcoind to run in the background but not have live bindings.

I have tried the following:

bitcoind
bitcoind -server
bitcoind -daemon
bitcoind -daemon -server
bitcoin.conf (server=0)

0.8.1 seems to bind to 127.0.0.1:8332, 0.0.0.0:8333, ::1:8332, :::8333

How do i disable all bindings and have bitcoind respond via command line, while maintaining new blocks?
OR
How do i bind only to 127.0.0.1:8332?

Goal: duplicate mysqld behavior.

it seems the following is the answer to both questions:

// bitcoind.conf, v0.8.1
irc=0
listen=0
rpcpassword=<hash>

this results in a 127.0.0.1:8332 and ::1:8332 listen only. i was unsuccessful in locating a command that disables ipv6 listens. the onlynet= command limits peer connection types, not listen types.

listen=0 disables live listens, but does not affect localhost binds.
the bind= command only works if listen=1
note that rpcuser= is set default to root if omitted and only accessible by a user with said credentials. disabling all listens would make the daemon inaccessible by command line. the server= command only works for bitcoin-qt.


Failing to build bitcoin-core v0.13.1 on debian stretch I have recently set up a new machine on debian stretch:

$ uname -a
Linux front 4.8.0-1-amd64 #1 SMP Debian 4.8.7-1 (2016-11-13) x86_64 GNU/Linux

I am now attempting to install bitcoind. I have already set up a directory db4 in my build directory for the Berkeley database version 4.8.30. I have installed all the dependencies as per doc/build-unix, including boost from the distribution:

$ sudo apt-get install libboost-all-dev
$ apt-cache show libboost-all-dev
Package: libboost-all-dev
Source: boost-defaults
Version: 1.62.0.1
...

$ ./autogen.sh
...

$ ./configure LDFLAGS="-L..bitcoin/db4/lib/" CPPFLAGS="-I..bitcoin/db4/include/"
...

$ make
...
CXX      wallet/test/test_test_bitcoin-wallet_tests.o
CXX      wallet/test/test_test_bitcoin-crypto_tests.o
wallet/test/crypto_tests.cpp: In function ‘bool wallet_crypto::OldEncrypt(
const CKeyingMaterial&, std::vector<unsigned char>&, const unsigned
char*, const unsigned char*)’:
wallet/test/crypto_tests.cpp:45:20: error: aggregate ‘EVP_CIPHER_CTX ctx’
has incomplete type and cannot be defined
EVP_CIPHER_CTX ctx;
                ^~~
wallet/test/crypto_tests.cpp: In function ‘bool wallet_crypto::OldDecrypt(
const std::vector<unsigned char>&, CKeyingMaterial&, const unsigned
char*, const unsigned char*)’:
wallet/test/crypto_tests.cpp:69:20: error: aggregate ‘EVP_CIPHER_CTX ctx’
has incomplete type and cannot be defined
EVP_CIPHER_CTX ctx;
                ^~~
Makefile:8232: recipe for target 'wallet/test/test_test_bitcoin
crypto_tests.o' failed
make[2]: *** [wallet/test/test_test_bitcoin-crypto_tests.o] Error 1
make[2]: Leaving directory '/home/john/Libs/bitcoin/src'
Makefile:8370: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/john/Libs/bitcoin/src'
Makefile:680: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Any suggestion is gratefully appreciated.

EDIT: adding the option --disable-wallet to configure leads to a successful build.

EDIT2: however, even with the --disable-wallet , the command make check fails with:

make[4]: Entering directory '/home/john/Libs/bitcoin/src/secp256k1'
  CC       src/tests-tests.o
src/tests.c: In function ‘test_ecdsa_der_parse’:
src/tests.c:3561:52: error: dereferencing pointer to incomplete type
‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
valid_openssl = !BN_is_negative(sig_openssl->r) &&
!BN_is_negative(sig_openssl->s) && BN_num_bits(sig_openssl->r) > 0 &&
BN_num_bits(sig_openssl->r) <= 256 && BN_num_bits(sig_openssl->s) > 0 &&
BN_num_bits(sig_openssl->s) <= 256;

This error relating to the C library secp256k1 on debian stretch has already been reported on this post and it seems to be related to some openssl API change (a work around put forward by Andrew Poelstra is to configure secp256k1 with the option --enable-openssl-tests=no. However, this is not an option available for bitcoind configuration)

This is due to some incompatibility between Bitcoin-Core 0.13 (and below) with openSSL 1.1. openSSL 1.1 has some significant API changes: https://wiki.openssl.org/index.php/1.1_API_Changes

The pull request (patch) #9326 should fix this problem (will very likely be in 0.14).
https://github.com/bitcoin/bitcoin/pull/9326

Until this has been resolved, you should use an openSSL version below 1.1.

EDIT: this has been fixed in the bitcoin-core's MASTER branch


Is it possible to discover the set of bitcoin addresses from a public key? I'm trying to find the set of bitcoin addresses from a public key associated with a user just to analyse this user transaction. Is there any way to derive/find all the addresses that have been generated by this public key so far?

Expanding shesek's comment as an answer:

The "SIN" key you're looking at, on a profile on bitrated.com, is a particular feature of that site.  These keys are not directly used for Bitcoin transactions at all, so you certainly can't discover addresses from them.

As for Bitcoin public keys, one public key generates one address; you cannot use a public key to compute other addresses belonging to that user.  (Though you might find other addresses that participate in transactions with the first one, and guess that they belong to the same person; but that's not proof.)

If someone is using an HD wallet, there is a concept of a master public key, from which one can determine the public keys for many different addresses that the user might be using.  People usually don't share those if they value their transaction privacy.


Decode Input-Script Number You can divide on some pages the input script number in R and S. Now I wanted to ask if someone can tell me a Python code how to divide the input script number into R and S or can define, so I have only R and S.

Thank you

example Number:4830450221008377df63977c2b3212f11ffbf098b328b4f246a86d131faa75effe53cef8568a02200c7187e5898f4dc605819bb6cdb7e357ec6993ce1ad11a87a621a7a579fe6d92014104a2b3aef09705da98696f357dfa78605f6490f4115d55a8e0a5ada4152f77a50e4faa479b0ed241bb8699e356644dbe8de5058c2bbb739e42f8928e95ad8d7a18

I have no ready-usable python code, and doubt there is. But here is the transaltion and details, which I generated with a set of shell scripts. This explains, and should help you to get started. More details can be found by searching the web for "ECDSA signature" and "ASN1-DER structure".

    48: OP_DATA_0x48:        push hex 48 (decimal 72) bytes on stack
    30: OP_SEQUENCE_0x30:    type tag indicating SEQUENCE, begin sigscript
    45: OP_LENGTH_0x45:      length of R + S
    02: OP_INT_0x02:         type tag INTEGER indicating length
    21: OP_LENGTH_0x21:      this is SIG R (33 Bytes)
        008377DF63977C2B:3212F11FFBF098B3
        28B4F246A86D131F:AA75EFFE53CEF856
        8A
    02: OP_INT_0x02:         type tag INTEGER indicating length
    20: OP_LENGTH_0x20:      this is SIG S (32 Bytes)
        0C7187E5898F4DC6:05819BB6CDB7E357
        EC6993CE1AD11A87:A621A7A579FE6D92
    01: OP_SIGHASHALL:       this terminates the ECDSA signature (ASN1-DER structure)
    41: OP_DATA_0x41:        length uncompressed Public Key (X9.63 form, 65 Bytes)
        04A2B3AEF09705DA:98696F357DFA7860
        5F6490F4115D55A8:E0A5ADA4152F77A5
        0E4FAA479B0ED241:BB8699E356644DBE
        8DE5058C2BBB739E:42F8928E95AD8D7A
        18


Which exchanges still accept USD wire transfers? (Oct 2012) Are there any exchanges left accepting USD wire transfers? I heard mention of sending to Dwolla and then transferring to Intersango, but only for U.S. citizens.

Dwolla is only for this in the U.S. and the type of bank transfer they do is ACH, which is specific to banks in the U.S.

As far as exchanges that accept wire transfers directly, there are many, including:

Mt. Gox (Japan)
BitStamp (EU)
BitFloor (U.S.)
BTC-E (Russia)
Bitcoins Direct (U.S.) (bulk sales, minimum $500)

Many various methods here:

http://en.bitcoin.it/wiki/Buying_bitcoins


Police raid home of bitcoin 'founder' Recently, WIRED released an article about an alleged creator of Bitcoin being raided by the police. Briefly, the article mention the following:

  Police raid home of bitcoin 'founder' Craig Steven Wright
  09 December 15

  Police have raided the home of a 44-year-old Australian alleged to be
  the creator of cryptocurrency bitcoin.
  Craig Steven Wright, a tech
  entrepreneur living in Sydney, was labelled by WIRED US as the
  mysterious 'founder' of the digital currency -- that has previously
  only been known under the pseudonym Satoshi Nakamoto.
  Since Wright
  was named as being the potential originator behind bitcoin police have
  raided his home and office, although the Guardian reports the raids
  surround tax issues and not the bitcoin revelations specifically.

1) What crimes Satoshi Nakamoto has done in order to be chased by the police? This applies only to Australia or around the globe?
2) Nowadays there are several hundreds of other cryptocurrencies. All those developers are also liable of such punishments?

According to yesterday's article about this in The Guardian, the Australian Federal Police released the following statement about the raid, stating that the raid was not related to any involvement that wright may (or may not) have had in inventing bitcoin:

“The AFP can confirm it has conducted search warrants to assist the Australian Taxation Office at a residence in Gordon and a business premises in Ryde, Sydney. This matter is unrelated to recent media reporting regarding the digital currency bitcoin.”

The article goes on to reference the Australian Tax Office's involvement in the raid, and a recent interview between the ATO and Wright which focused on Wright's bitcoin holdings.  Capital gains on the sales of appreciated bitcoins are subject to tax in Australia, so some are speculating the raid could be about back taxes that Wright may be subject to from his bitcoin holdings.


Is there a reward or penalty for validators in proof-of-stake (PoS)? In PoW consensus, if a miner could solve the puzzle, they receive some monetary reward (some coins) to incentive miners, since mining process has a considerable monetary cost for miners including providing hardware and energy/electricity cost.

However, in PoS, participation in transactions validation has not a significant monetary cost for validators (i.e. stakeholders) (I hope I am right), and if so, is there any incentive to motivate stakeholders for participating in transactions validation?

Also, what is the penalty of a validator who ex. confirm a double-spent transaction?

Thanks

To give an example i know, in Tezos which has a variant of POS called LPOS (liquid proof of stake), at high level and without giving too much details:

the incentive to participate is offered by block (and endorsement) rewards which act de facto as a form of inflation
in order to keep bakers in check to avoid bad behavior (confirm bad transactions, double baking etc...) there's a bond/penalty system where the network locks some amount of your capital (the bond which is equal to 32x the block reward) for a period of time (2 weeks in practice). During this period if some other node can show evidence (through the protocol) that the baker was behaving bad then the bond is forfeited.

More details about LPOS is available in this medium article

https://medium.com/tezos/liquid-proof-of-stake-aec2f7ef1da7


Legacy blockchain after upgrade to SegWit Let's suppose I run a legacy (non-SegWit) node after SegWit gets activated. My blockchain doesn't store any SegWit data. What happens when I upgrade my node? Will I have to re-download the blockchain to include the missing SegWit data?

Indeed.

Bitcoin Core will, after upgrade to a SegWit-compatible version (0.13.1 and later), rewind to the latest non-SegWit block and then fetch the later blocks again.


How do I scan my bitcoin receipt into my wallet? I bought Bitcoins from the Robocoin ATM (I'm told it's the only one) and it gave me a receipt with a QR code to scan into my wallet. I downloaded Blockchain, but don't see where in the app I can scan the receipt to add to my wallet. Help!

Using the blockchain.info app go to your address book (menu button in top left).. then when in the address book click the same top-left menu button and you'll see the import private key option. Scan the QR, job done.

Alternatively use a QR scanning app such as QRDroid and then you can copy & paste the resulting private key into anything you like.


How do I securely update Bitcoin Core? I am currently running a Bitcoin Core wallet 0.18.1.
What do I need to do to update it to 0.19.0.1 version?
Would be very grateful for instructions as I am relatively new to this.

There are multiple ways in which you can update Bitcoin Core to the latest version. Each one has its own advantages and disadvantages:

Build from source code: You can always update your software by cloning the git repository. This way you can verify the code and build the binary yourself. However, it is a resource intensive task and you will need to compile it every time a new version is released. It is also the slowest of the update options.
Update using pre-built binaries: Bitcoin Core developers build the binaries inside a deterministic build environment and sign them for verification. You can just download these binaries, verify their signature and replace the old binaries with it. This is a better, easier and the most preferred way to update.
Update using a third party PPA: You can use third party packages like the Bitcoin PPA for Ubuntu. It is the easiest method to update Bitcoin Core however, it involves trusting the launchpad and the PPA owner. Moreover, I'm seeing that the PPA does not offer the latest versions (latest release available is v0.18.0; so it's missing v0.18.1 and v0.19.0.1).

Updating using prebuilt binaries:

Visit the Bitcoin Core Download page and choose the operating system for which you want to download the pre-built binaries. After downloading the main file, click on the the verify release signature to download the signatures associated with the hosted file. Ensure that you check that the release signature is correct so as to be sure that you have downloaded the correct file. Read more about why signature verification is essential. Below are the steps for Ubuntu.

# Download the binaries for Ubuntu OS
$ wget https://bitcoincore.org/bin/bitcoin-core-0.19.0.1/bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz

# Download the signature file
$ wget https://bitcoincore.org/bin/bitcoin-core0.19.0.1/SHA256SUMS.asc

# Verify that the hash of the downloaded file matches the hash in the signature file
# This ensures you have downloaded the correct file for which the developers have signed
$ sha256sum bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz
732cc96ae2e5e25603edf76b8c8af976fe518dd925f7e674710c6c8ee5189204  bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz

$ cat SHA256SUMS.asc | grep bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz
732cc96ae2e5e25603edf76b8c8af976fe518dd925f7e674710c6c8ee5189204  bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz

# Verify the signatures. If you have not imported the signature, you would need to do so for verification
# The key is mentioned in the box: "Bitcoin Core Release Signing Keys v0.11.0+ 01EA5486DE18A882D4C2684590C8019E36C2E964"
$ gpg --recv-keys 01EA5486DE18A882D4C2684590C8019E36C2E964

# After importing the key you can now verify the release. You should get the below result.
$ gpg --verify SHA256SUMS.asc
gpg: Signature made Sun 24 Nov 2019 09:14:42 AM UTC
gpg:                using RSA key 90C8019E36C2E964
gpg: Good signature from "Wladimir J. van der Laan (Bitcoin Core binary release signing key) <laanwj@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 01EA 5486 DE18 A882 D4C2  6845 90C8 019E 36C2 E964

After verifying the result, you can extract the file and copy-paste the binaries. Mostly the binaries are in /usr/bin/ or usr/local/bin file. You can check it for Bitcoin by running the command: which bitcoind.

Build from source code:

You can remove the existing binaries and build the code from source. You can follow the following commands on ubuntu:

$ git clone https://github.com/bitcoin/bitcoin.git
$ cd bitcoin
$ git checkout v0.19.0.1
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

While running the ./configure step, you can enable or disable certain features of bitcoind through the use of --enable-FEATURE and --disable-FEATURE flags. You can run ./configure --help to check the features available.

Update using third party PPA

If you have installed Bitcoin using third party PPA, then you can just run the command sudo apt-get update.


how check bitcoind default values How can I see which values bitcoind is using for eg. dbcache, or other memory and connection params ? If the value is NOT set in bitcoin.conf. Is there a bitcoin-cli command to check all the params ?

You can see all available command options by running the command bitcoind -?.
Similarly, in the GUI you can check out "HELP" -> "Command Line Options" in the task bar.

This will return a list of all available commands, as well as their default values (when applicable). Note that this just returns all possible command options, not specifics about what you have set. Default values will be used unless you specify otherwise, and I believe the hierarchy for specifying a command option is:

An option passed on command line when starting bitcoind
(takes precedence over)
an option passed in .conf file
(takes precedence over)
an option set in the GUI

(Information pulled from here)


Restarting Vanitygen I want to create a bitcoin address which starts with a certain passphrase (1mathias, case insensitive). That idea came from this question, and I quite liked it. After some trouble making the file on my Mac, it finally worked.
mbpssd2:vanitygen-master mathias$ ./vanitygen -i -t 4 1Mathias
WARNING: Built with OpenSSL 0.9.8y 5 Feb 2013
WARNING: Use OpenSSL 1.0.0d+ for best performance
Difficulty: 26838491360
[235.42 Kkey/s][total 2888131518][Prob 10.2%][50% in 18.5h]

It is running for quite some time now, and I want to stop it, and continue with finding an address tomorrow. For what I understand, is 1 in that number addresses that fit my passphrase. So if I would choose '1' as passphrase, there would be 1. The percentage showing in terminal is the current generated (and rejected) addresses, compared to the total amount. So reaching 100% doesn't have anything related to finding an address. I can happen at 0.01%, or at 70% or at 8012%, if you are really unlucky (right?)
From the creator of vanitygen I found the following:

If I stop vanitygen when it reports 60% complete, how do I have it restart where it left off?
You don't need to.  The percentage displayed just shows how probable it is that a match would be found in the session so far.  If it finds your address with 5% on the display, you are extremely lucky.  If it finds your address with 92% on the display, you are unlucky.  If you stop vanitygen with 90% on the display, restart it, and it finds your address with 2% on the display, your first session was unlucky, but your second session was lucky

But that does not make sense. If I reach 100%, I am not completely sure that an address has popped up, fitting my passphrase. Is this correct? If I let the program run, and generate a billion addresses, not stopping when (or if) it hit my passphrase, it is even likely that it finds a correct one in the first thousand, as in the last thousand?
I'm quite sure I am right, but I might be missing something. I tried to bold the two areas where I am not sure of.

Vanitygen works like this:

Generate a random 256-bit integer to use as an ECDSA private key
Compute the corresponding public key
Compute the hash of the public key to find the address
Check if it matches the requested pattern (1Mathias in your case)
If yes, halt and output the private key; if no, start over at step 1

Notice that there is no state saved in this process, so you lose nothing in stopping and starting as much as you want.  Each random private key has an equal probability of success; it doesn't matter how many you have already tried.

For a given number N of random private keys tried, one can compute the probability that (at least) one of them would succeed.  This is the "percent" number that Vanitygen reports - it's not a percent completion!  In the excerpt you show, it says that it has tried 2888131518 keys, and that mathematically, trying 2888131518 keys has a 10.2% chance of finding one that works.  It also says that in 18.5 hours, it will have tried enough keys that the chance of success is 50%.  This does not scale linearly!  If you are unlucky and don't find a key for 37 hours, it won't say 100%; it will say 75%.

As an analogy, suppose you have an ordinary 6-sided die, and you want to roll it repeatedly until you get a 6.  Your chances of succeeding with one roll are 1/6 (16.6%); your chances of succeeding within 10 rolls are 83%; your chances of succeeding within 100 rolls are 99.9999987%.  But this number never gets to 100%; there is no number of rolls that will guarantee success.  There is always some chance that, of all the rolls you made, none of them came up 6.

So the "percent" number reported by Vanitygen is never going to reach (much less exceed) 100%.  It is simply intended to give you an estimate of how long the process might take, but since it is random, there can be no guarantees.  If it gets very close to 100%, all you know is that you have been very unlucky; but your odds of success with each new key are exactly the same as they always were.


Bitcoin's change back I'm starting a new project that uses bitcoin. I'm afraid some feature can't be done, or aren't safe. I'd like to validate some ideas:

I'll create a wallet/address and publish it on the project's website. All customers are supposed to pay/transfer BTCs to the same address (identify the payment is not a problem).

Eventually, I'll need to refund a customer.

1) Is it safe to refund the customer using the same address he/she used to pay me?
2) Can I continue using the same address for receiving BTCs after a refound?

I know that, when you send money to another address, the change back is sent to another address (still yours).

3) Can I send a % of a wallet to an address and the remaining/change back to a new address (totally different wallet/private key) in the same transaction.

1) No, I wouldn't. Alot of bitcoin users use adresses from exchanges such as bittrex/poloniex, where you do not have control of the adress from which the coins are spent from.

2) I'm not really sure what you mean by this, I don't see why you would use the same adress multiple times in the first place, but as you previously stated this is not an issue for you, so why would it be after a refund?

3) Not sure about different wallets, but in electrum for example you will be able to sent the changeback to an adress you choose, or, completely disable it. So yes, this should be possible.

On bitcoin core -> to remove change adresses or set custom ones, Follow:

  It is highly recommended that you do not do this as address reuse is not recommended.
  If you are sure that you want to reuse change addresses, go to Settings > Options and then the Wallet tab. Check the box for "Enable coin control features". Then click OK. When you go to send, you will now see a box for Coin Control. Check the box for "Custom Change address" and then enter the address that you want to use as your change address. Then send your Bitcoin and the change will go to wherever you specified.


How does one make multisignature transactions with the bitcoin client? With the release of bitcoin version 0.6.1rc2, it is now possible to do M-of-N required signature transactions in the main network. But how does one actually perform such a transaction?

I've been trying to piece together how to do this mostly from the BIP 11 and API calls list pages on https://en.bitcoin.it/wiki/

I guess you can use 'addmultisigaddress' call to bitcoind to add a multisignature address to your wallet and then send coins to that address. This is the part you set up, say, an escrow.

However, I can't find the bitcoind call to create a transaction for multiple signing or the call to sign such transaction.  In other words, how do you send coins from a multisignature address? How do you release the tied-up coins?

Bitcoin version 0.6.1 doesn't have useful multisignature support yet, either in the GUI or via the RPC interface, because there is no support for partially signing a multisignature transaction.

What is supported:  creating a multisignature transaction (using addmultisigaddress), and sending to a multisignature address (either your own or somebody else's).

Testing spending of multisignature transactions-- if all of the private keys required to spend a multisignature transaction are in the wallet, then those coins are added to the wallet's total bitcoin balance and that transaction will be spent if the normal coin-selection code decides to use them for a spending transaction.

Pull request 1456 adds low-level support in the RPC interface for multi-device/multi-person multisignature transactions.


70% of nodes accept Bloom filters, despite DoS attack vector? Could someone explain why so many Bitcoin nodes allow Bloom filtering given that DoS attacks exist [1], [2] for such nodes?

According to bitnodes.21.co, right now 3879 nodes out of the total of 5515 Bitcoin nodes have Bloom filtering enabled.

Is it that these DoS attacks are not made any worse by Bloom filtering, as documented here by Mike Hearn? I quote:

  Thus you can easily trigger exactly the same DoS attack by just using
  regular getdata requests on large blocks over and over. You don't need
  Bloom filtering. If you don't want to actually download the blocks
  just don't TCP ACK the packets and then FIN after a few seconds ....
  the data will all have been loaded and be sitting in the send buffers.

  So even if I refine the attack and find a way to actually deny service
  to someone, the fix would have to apply to regular non-filtered block
  fetches too, which cannot be disabled.

So I guess the answer is "Yes, nodes accept Bloom filters because filtering does not make existing DoS attacks any worse nor do they introduce any new DoS attacks."


Nxt: TCP, HTTP, or both In the NXT documentation it says that the Peer protocol uses TCP.  But looking through the code all I see is HTTP.  Does NXT use HTTP or TCP for the Peer protocol?

I was able to answer my own question through the Nxt dev forum.

https://nxtforum.org/general/peer-protocol-tcp-or-http/msg181766/

Adding it  here for others that may have the same question:

Up to version 1.4 Nxt used HTTP for peer communication. Starting with version 1.5 they are moving to WebSocket for peer communication


Is my 2FA not working, or do I not understand it? I have one wallet on Coinbase.  They say that I enabled 2FA on it and that if an attacker somehow accessed my account, they would not be able to spend because they would not be able to enter the code sent to my phone.

But I have made made two purchases, one spend, and many logins without ever receiving such a code or being asked to enter it.  When I said that, the Coinbase person claimed to not know either and gave me a URI to consult.  Unfortunately, I forgot to copy the URI before closing the chat window.

Go to Account Settings, Security.
The default is to ask for 2FA only over $100/day.
Change it to ask every time.


Why does the beginning of `git log` for the Bitcoin source on github say 'sirius-m' was the first committer? Satoshi Nakamoto is widely spoken of as being the first committer to bitcoin.

Yesterday I ran gource on the bitcoin repo for fun and was surprised to see that the first commits were by 'sirius-m', or Martti Malmi.

Was there a previous repo in another svn tool and did Martti just do the first commit in git?

It really looks like Martti is the initial committer if you look at the git repo on Github...

The source code was originally hosted in a rar file on Bitcoin.org. It did not use any Source Control Management. Later, when more people began working on it, one of the earliest developers, Sirius, moved everything to SVN on Sourceforge. That was later moved to the current Github repository and switched to using Git.


Is there a service that alerts about attempted double spends for merchants accepting 0-confirmation transactions? I often come across merchants accepting payment in bitcoin, who require several confirmations on transactions, but where the probability of a successful double spend doesn't justify the waiting time for the user. A good example is membership payment for adult sites, where the membership can easily be withdrawn in case of a double spend, and not much is lost if a double spend is successful.

A part of the reason they do this, I think, is that they don't have a good way of knowing if a user is attempting to double spend coins sent to them.

Is there a service available that allows merchants to be notified of double spends of coins sent to them, so that they can be notified in case this happens, and take action - for example by banning the user, or just temporarily removing the deposit to an account until the transaction has 6 confirmations?

A simple service could be one where the merchant enters their deposit address at a web service, and the web service simply responds with the amount of attempted double spends, ie. if any of the inputs to the transaction that sends funds to the merchant's deposit address are attempted spent in another transaction, the request will return a number above 0.

Does such a service exist?

Because of the way the Bitcoin protocol with the distributed and decentralized P2P network is architected, monitoring the way you describe would do more harm than good.

If a merchant is expecting to learn of double spends, then the monitoring service needs to know of each transaction.   A race attack double spend attempt might, however, communicate one transaction that reaches the merchant but a different transaction that reaches the miner that happens to include that transaction in a block.    If the monitoring service sees what the miner sees, then the monitoring service would never know that the merchant had received a transaction that eventually became invalid due to the later transaction from a mined block.

So a merchant that is following the DIY route has further exposure to double spends.

Some payment processors will deliver if a 0/unconfirmed notice was sent and then later that transaction becomes invalid due to a double spend.  BitPay is, I believe, one of them that will do this.

There is a need for some more utilities for aiding merchants, including transaction re-broadcast.  So for example if a merchant accepts a 0/unconfirmed transaction that transaction gets rebroadcast sufficiently even if the original sender fails to re-broadcast it.  Also needed might be a service that tries to ensure that if there is a blockchain fork (two or more chains both at the same height) that the confirmed transactions from one side are relayed to miners still working on the other side of the fork.

The reason these haven't already been built is that there are so few merchants currently who accept payment on 0/unconfirmed transactions.  There will need to be some double spending thefts to raise awareness that this is a risk not to be ignored, especially for those merchants following the DIY path.


How to import old wallet to Multibit? I had 2 Bitcoins on my old PC and got a virus so did a format.
But I also did a backup of my bitcoin wallet.
Now I want to sell these bitcoins but when I went to the site, the official client was different and very heavy. And the site was showing as first option Multibit.

So, I got Multibit. But I couldn't import the old .dat wallet.
Am I missing something? Is there any way to convert the wallet for Multibit?

Is this safe?
https://blockchain.info/wallet/import-wallet

Yes, blockchain.info's wallet import is safe. It encrypts things in such a way that not even blockchain.info can access your private keys. You can make transfers from there (it's a sort of online wallet), so you don't even necessarily need to transfer them to MultiBit before wanting to sell them.

To quote a previous answer with instructions on importing and then exporting to MultiBit:

  Visit https://blockchain.info/wallet/import-wallet. Drag the Bitcoin-Qt wallet.dat file into the dotted area. Follow the
  instructions.
  Login to the new wallet. Under the Backup heading click download.
  Open multibit choose Tools -> Import Private Keys. Now import the wallet.aes.json file just downloaded.
  Delete the keys from the blockchain.info wallet.

If you don't trust blockchain.info (despite their claims), you could extract the data entirely offline using pywallet and then import it into MultiBit.

It should also be possible to dump the private keys from the official client without downloading the whole blockchain (which is the "very heavy" part of it). See How do I import private keys from Bitcoin-qt to Multibit client? for help with that.

Once you have access to your bitcoins again and want to sell them, you could sell them on LocalBitcoins. In the US, I can also recommend Coinbase.


Script - true and false values In the Script, when one is checking whether a value is true of false, should the length of the expression be checked? For example, 0x01 is evaluated as true, but can the same be said  about 0x0001, 0x000001, etc?

Anything that doesn't encode a form of zero is considered to be true. Here's the code Bitcoin uses:

bool CastToBool(const valtype& vch)
{
    for (int i = 0; i < vch.size(); i++)
    {
        if (vch[i] != 0)
        {
            // Can be negative zero
            if (i == vch.size()-1 && vch[i] == 0x80)
                return false;
            return true;
        }
    }
    return false;
}


Diffrent transactions in different block sync problem Consider that miner A and B both try to solve its block, A's block has transactions (T1,T2), B's block has transactions (T1,T3). A solved its block then synced the block to B. Does B will discard its block which contains T1 and continuely create a next block contains T3? and how to check T1 is confirmed but T3 not?

Once A solves the block containing T1 and the new block reaches B, B will cease to mine for (T1,T3). When B receives A's block, it will be validated. As part of this validation process, B will check each transaction in the block, and notice that T1 has been mined in that block.

B will then construct a new mining template, including T3, and possibly other transactions that were recently broadcasted, or previously didn't make the cut due to space constraints. Mining will then commence on this new template for B.


Setting up my BFGMiner with two AMD GPU's I have two AMD Radeon 7770's in my rig. I am able to get the command prompt of BFGMiner to run fine up, to the point where I need to add my devices (GPU's). I am not sure what commands to use or where I can find the instructions I need. Any advice would be helpful. Thanks.

Have you read the Readme - GPU?

I have pasted the contents at pastebin, if you wanna check it out?


How do I know how many confirmations a transaction has? This is my first transaction and it's been since yesterday that I sent it. The website said wait for 4 confirmations then check email, but I haven't gotten any email so I don't know if it's gone through or not. Here's the transaction number and a screenshot of the transaction:
  2daf1bea238137e5db00cd12074a93f181bf86a759f1963fd92197671f32a463

As you can see at the bottom of your screenshot, or on any block explorer similar
(https://blockchain.info/tx/2daf1bea238137e5db00cd12074a93f181bf86a759f1963fd92197671f32a463),
you can see that it has 84 confirmations as of the time of writing, well over the 4 you said was needed.


Can a node exit the bitcoin network and return to his address and transactions? I have read in Wikipedia that "Messages are broadcast on a best effort basis, and nodes can leave and rejoin the network at will " in bitcoin network. what does it mean that a node can leave the network-what will happend to its transactions? Can he get back to the same address and claim his transactions again (its bitcoin)?

thank you

Transactions are not directly sent to the node that holds the private keys for the addresses involving it. Rather transactions are broadcast to all nodes on the network and then recorded on the blockchain. When a node rejoins the network, it downloads and verifies the blockchain from its peers. When it does that, it scans the blockchain for transactions that pertain to it.

The process of receiving is completely passive; there is no direct sending to the receiver (the sender does not have that information) nor is there a claiming process.


Are there any attempts at creating ASIC for bitcoin mining? I take reference to the Question here which compares ASIC with FPGA. In this question someone quotes a company called Largecoin that is said to be at the development of such an ASIC. However their web page does not really look promising. It rather looks like some investment seeking attempt. (Quote from the only content on the web page: "For more information about LargeCoin, visit largecoin.com")

I would like to know if there are any other attempts at building ASIC for bitcoin mining?

The closest thing to ASIC seems to be the BitForce series which has just been released and customers it seems are just begining to receive their first orders.

From the website:

  Is your system based on FPGA or ASIC technology?

  The BitForce processor card is a proprietary implementation of both
  FPGA and ASIC technology.

As far as I'm aware, the actual chip design won't be released, but it seems legit now that people have begun testing the potential.

http://www.butterflylabs.com/


Why didn't Satoshi make the nonce space larger? I know Satoshi isn't around to ask anymore, so this might be futile to ask, but I'm hoping someone might have some insight about this.

Bitcoin mining typically utilizes an extraNonce (bnExtraNonce in the coinbase tx's scriptSig) and a nonce field (32 bits). Why didn't Satoshi just make the nonce field larger, and then there wouldn't even be a need for the bnExtraNonce? Is there some reason why the nonce field needed to be kept to 32 bits? Seems like it would have been simpler to have a 64 bit integer in the block header. Even if he was worried about having an integer that was more than 32 bits, the header could have just been interpreted as two 32 bit integers nonce1 and nonce2.

There were many good answers to this question. After reading through them, I'm going to take a stab at the answer as well.

The coinbase field of the coinbase transaction (as it is called) is really just a scriptSig which doesn't have to pass any validation about its contents (except that it is less than 100 bytes, and the newer BIP34 requirements). Satoshi knew you could put arbitrary contents in here, and so he put a timely news headline in the genesis block's scriptSig: "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks". A message like this also helps confirm that no pre-mining was done, as the message could not have been put into the block before the date that the article was published.

I think that Satoshi thought that a 32 bit nonce-space was overkill. A standard computer, like the one I am writing this on, can get about 3 MH/s, which is about 0.07% of the way through a single nonce-range before you can increment nTime and get a whole new range of nonces. That's not to say that Satoshi thought that there would only ever be single computer CPUs mining (this post shows he didn't), but I bet he thought that each miner would have it's own address in this case.

I don't think Satoshi envisioned pools happening, especially in the fairly centralized way that they exist today, and the flexibility of the coinbase field was just utilized by mining pools (as somewhat of a hack) when hash power became large enough to go through more than a single nonce-range per second.


Transfer Btc to bcc problem I have transfer bitcoin from zepay to BCC with the bcc receive address . BUT the BCC is not updated with the transfered amount.
Is there any way to track the transaction??

If you have sent BTC to a BCH address your coins are lost.

BCH is not bitcoin it is an altcoin with it's own blockchain, it has been deliberately created by its creators to deceive people into thinking it is bitcoin.

This is not true, and is only the case if you do not own the private keys for the wallet you sent your BTC to.

BTC / BCH adresses are exactly the same.

Unless you've sent them to an exchange which is not willing to co-operate to get your funds back, you should be fine. Simply open up a support ticket, and ask them to get your BTC back you sent to their BCC adress.


Why are there so many recipients when I send money from one exchange to another? So I sent BTC from my Bybit wallet to Coinbase wallet.
The transaction was successful and I was looking at the blockchain explorer and it had one sender address with an amount different to what I sent and it had so many other recipient addresses listing different amounts. I saw my transaction amongst the various transactions listed in the hash.
Why am I seeing so many transactions with different amounts and is the senders address my address or Bybit?
I am new to BTC and a total noob, please help me make sense of this.
Thank you!

When you bought bitcoins on Bybit, Bybit added the corresponding Bitcoin balance to your account. Your request to withdraw your funds to your Coinbase wallet caused Bybit, in the role of the custodian of your funds, to issue a payment that sent the funds to your wallet (and reduce your balance with Bybit accordingly).
Bitcoin transactions may perform multiple payments at once by assigning funds to multiple recipients in separate transaction outputs.
Presumably, Bybit is a large enough service that many other users requested withdrawals around the same time, and this allowed Bybit to batch together all those payments in a single transaction. As every transaction needs at least one transaction input, a transaction header, and usually a change output to assign the remaining funds back to the sender, payment batching is more blockspace efficient and allows the service to reduce their cost per withdrawal.


Calculating the balance of xpub I have a bitcoin cash xpub

I can derive Internal and external addresses
I have a full node so I
can check each individual addresses

My Question

01 - how do I calculate the balance ?

02 - do I need to combine the external and internal unspent amount ?

Please advice

Regular nodes, by default, only maintain a balance tally for addresses in its own wallet. Your options are to either add every address to the wallet as a watch-only address, or to build your own index on top of the node by scanning each block and extracting the data from it.

There are patched versions of nodes available, such as the ones backing insight explorers, that also maintain an address index to speed explorer operations up. However, these versions are rarely up to date.


Can't connect Electrum to a Network so that I can receive my bitcoins I've looked everywhere for an answer but can't find the right one for my situation. I'm using the linux based tails OS with persistent setup with my electrum wallet. Everything works fine and LBC shows my (test) funds of 0.0011 transferred, yet there's nothing in my wallet even after 45 minutes. Blockchain shows my transactions as complete with 17 confirmations yet still nothing in my electrum wallet. I'm guessing this is because my electrum wallet cannot connect to a network for some reason. I read similar stories but am not sure if it's particular to my problem since I'm using Tails.

Any advice would be welcome!

It sounds like you need to tell Tails to allow the Electrum client to connect through Tor.

There are very good guides already here and here.


How to develop and then sell my own Bitcoin Hardware Wallet? Okay so basically I have a good idea for a bitcoin hardware wallet, i'm just looking for information on how to go about creating it?

Do I need to create my own programs/programming for literally everything? Are there open source type things I can use? Would it be illegal to use another wallets programming or whatever? I'm just really confused as to how all of this works out. I'm not the engineer involved with the product, I'm on the finance and business side of things. So forgive me if I sound dumb! Basically, what all can I use that currently exists to make this process as simple as possible without getting any law suits lol. Thanks so much!

There's not a lot from a electrical engineering perspective inside a hardware like the Trezor. It's a small microcontroller, a very cheap OLED screen, some miscellaneous buttons and connectors. The entire bill of materials is likely under $10 USD for per unit.

The difficulty comes from the software and integrity perspective. You've got to ensure that the software doesn't lose other people's money, that it protects in the ways it intends to, and resists tampering. The hardware should be able to be produced with some confidence that the software written to the devices is secure, that nobody can replace them in transit with identical, but malicious devices. You've got to be sure nobody engineering the devices has their own backdoors to steal money from the device, that there's not ghost runs being made by a producer.

If there's a large theft relating to hardware you've produced, you'll be the one immediately blamed as responsible for backdooring them, so this is an existential threat for the producer if they get it wrong. Are you willing to take this personal risk? Most people would not agree the benefits outweigh the costs, if producing secure hardware seems like a easy idea you've probably not considered all the modes of failure.


Why connected node count have dropped since august 1st? before 1st august i used to connect to 55+ nodes on my bitcoin-core, even if i kept the bitcoin-core running for 12 hours.

but after 1st of august, the connected nodes count is not going above 15-23

why is that ?

what changed on august 1st ?

i  got that number when i do

bitcoin-cli getinfo

A common cause for a node's connection count going down and staying down for a while is IP address changes: It can take a while for knowledge of the new address to percolate in the network.

Otherwise, your prior high count could just have easily been caused by an attack or spy-peers that have since stopped.

It's a bit hard to say since the expected number of peers of a listening node depends on how many other peers are in the same /16.


Any books about Bitcoin? Thanks for any link/author+title. I prefer max. 2 years to the past if possible. If you know about some book that will be published in the near future, you can mention it too.

Bitcoin was barely around 2 years ago;).

Currently to my knowledge the closest thing to a Bitcoin book is my master thesis on Bitcoin. It focuses on analysing the security of Bitcoin software and the ecosystem, but a lot of people find it to be a good read even for beginners. It is in English, but wasn't published anywhere but a couple prints for my studies and online.


Does descendant size affect transaction fees? While calculating the transaction fee miners usually take ancestor size into the account. But does the descendant/output also affect the transaction fee calculation? Is descendant count correlated to transaction fee in any way?

While calculating the Transaction fee miners usually take Ancestor size into the account. But does the descendant/Output also effect the transaction fee calculation?

The descendant transaction(s) do not restrict the inclusion of the examined transaction in a block, while the ancestor transaction(s) do. Hence, it would seem rational for the miner to only do extra computation for ancestors (in addition scanning both ancestors and descendants for each transaction means walking through each transaction twice).

  Are Descendants Count correlated to Transaction fee in any way?

"Any way" is pretty broad :

Regarding miner incentive no
Regarding mempool logic and relay policy yes


Financial Department Bitcoin I wanted to send bitcoins to my wallet from my trading account and did not receive anything. A short time later I got from
Fiancial Department Bitcoin received the following message:
Your payment of BITCOINS is ready to be processed and is already on BLOCKCHAIN.
This department wants to pay me bitcoins for a fee and I don't know if this is real? Has anyone ever had anything to do with it and can you trust this depatment?

It doesn't seem right. I wouldn't trust them. I would suspect fraud.

  Financial Department Bitcoin

As I'm sure you know, The Bitcoin currency and Bitcoin network is peer to peer and has no departments. So no financial departments.

In normal English, or business English this phrase doesn't make much sense. Some kind of business would have a financial department but those sorts of departments are not usually split by currency. Generally there would be an accounting department that might communicate with creditors and debtors, there might be some kind of sales department or customer services department that communicates with retail customers.

  my trading account

If you have an account you are dealing with one of the many thousands of businesses that make money by selling services to people who want to invest or trade in Bitcoin. There are lots of fraudulent businesses that are just invented to trick people out of money. There are also some genuine businesses of this sort but many people find it hard to tell genuine businesses from fraudulent ones.

Finance departments are usually different, here's one definition:

  Finance Department is the part of an organization that is responsible for acquiring funds for the firm, managing funds within the organization and planning for the expenditure of funds on various assets.

So in most businesses - the finance department mostly manages internal matters - it is generally not one that routinely interacts with retail customers.

For example a car manufacturer would have a finance department that might obtain funds for a new factory. They might not routinely be involved in selling cars to distributors and certainly not involved in selling cars to car-drivers.

Of course businesses are free to organise themselves as they wish and can name their departments whatever they want.

  This department wants to pay me bitcoins for a fee and I don't know if this is real?

If the fees were not made very clear right at the start, before you placed any money in this trading account -- then you are very likely the victim of fraud.


What are the hashes that miners need to do to create a block? I’m bit stuck in the concept of mining.

What are the hashes that need to be created in each block and the chain? Let’s say that we have block A - B - C forming a chain.

One source said that we need to come up with the hash of A and combine it with previous block’s hash forming another has, in other words: hash(A + previous block’s hash).

Another source just says that it’s just hash of the block itself, and in that block we specify the hash of the previous block’s hash.

The concept of Proof of Work is that you have X and you have an output of Z, what is the Y needed, so hash(X + Y) = Z.

If that's the case, can we say that X is the previous block's hash, and Y is the hash of the current block? Or am I looking this wrongly?

Sources:
https://www.investinblockchain.com/what-exactly-is-blockchain/
https://www.youtube.com/watch?v=SSo_EIwHSd4&t=1sAnd other sources.

Another source just says that it’s just hash of the block itself, and in that block we specify the hash of the previous block’s hash.

This is correct. The others are varying degrees of correct and incorrect. But this is the only one that is absolutely correct.

The concept of Proof of Work is that you have X and you have an output of Z, what is the Y needed, so hash(X + Y) = Z.
If that's the case, can we say that X is the previous block's hash, and Y is the hash of the current block? Or am I looking this wrongly?

Kind of.

The block consists of multiple fields. It can first be broken down into two major parts: the block header, and the transactions themselves. All of the block is hashed in some way.
The hash of the block header is what we call the hash of the block. The hash of the block header is also what is used for the proof of work. When you interpret the block header's hash (also known as the block hash) as a 256 bit little endian integer, it must be less than a calculated target (also a 256 bit integer).
The block header itself can be broken further down into multiple parts. It contains the block version number, the previous block's hash, the hash of all of the transactions in the block, a timestamp, a compact representation of the target value, and a nonce.
Since the block header includes the previous block's hash, the block header's hash is really just the hash of the block (as it contains the hash of all of the block's transaction) in which the previous block's hash is specified within it.
In order to mine blocks, miners will tweak the fields in the block header until they get one that meets the target. Typically they change the nonce value (it's just a number) and the hash of all of the transactions in the block (by changing the coinbase transaction, choosing new transactions, and changing the order of transactions). Miners may also change the timestamp and the version number.


How can I generate a Dogecoin address from a Litecoin private key? I'd like to do the following:

I use dumpprivkey to get the private key from Litecoin wallet.
I import this private key into Dogecoin wallet
Which will generate a new Dogecoin address. Both will share the same private key.

The most related post I found is: What happens if you send Bitcoin to a Litecoin address?

However, when I try to directly import, it will give me  the
error:
{"code":-5,"message":"Invalid private key encoding"}

So now, how can I dump the private key and decode into hex and move the prefix from "L" to "D" and regenerate a WIF for dogecoin?

Is there any existing solution for it?

Let's assume we have this compressed Litecoin WIF private key:  T4DRLwPgnkg9jyivjbbnmqJZjHRxeYTy4idAV5uwEuFdyJBGuxXE.

% echo T4DRLwPgnkg9jyivjbbnmqJZjHRxeYTy4idAV5uwEuFdyJBGuxXE | bx base58check-decode

wrapper
{
    checksum 625264444
    payload 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501
    version 176
}

ANSWER for Doge WIF Key:

% bx base58check-encode -v 158 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501

QPn542uVdzBgCfV6nEViShboFTpDd1at8mQpQugEQHgpuLbsgcZe

VALIDATION CHECK:

% echo QPn542uVdzBgCfV6nEViShboFTpDd1at8mQpQugEQHgpuLbsgcZe | bx base58check-decode

wrapper
{
    checksum 2298567751
    payload 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501
    version 158
}

Examine 158, base58check-decode and base58check-encode for more details.


OP_HASH160 and number of bytes of public key When creating a raw transaction, why after the OP_HASH160 the number of bytes of the hashed public key should be included if it's always 20 bytes (that's what RIPEMD160 throws)?

Does this happen with every OP_CODE value in scripts?

Please explain. Thanks.

Are you refering to the pay-to-pubkey-hash script (https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address_.28pay-to-pubkey-hash.29)?

In that case it is the hash of the public key, which is 20 bytes. It is NOT the public key itself.

Every op-code correponds to a byte-value in the raw transaction script. All operations are preformed on a stack onto which values can be pushed. The public-key-hash must therefore first be pushed onto the stack, before it can be compared to another value on the stack.

To first push the public-key-hash to the stack we prepend "the number of bytes" which is 20, because this value is itself just an op-code that pushes the next 20 bytes of data to the stack. (See https://en.bitcoin.it/wiki/Script#Constants)

This makes the scripting language more flexible.


What if you're not given an option for a transaction fee? I purchased some Bitcoin through a local bitcoin ATM. When I purchased the Bitcoins I was not given an option to ad a transaction fee and currently it sits unconfirmed.

I also have a app on my iPhone that I have just started using to manage my Bitcoin called Bitwallet and in its 'Pay' screen it also does not offer an option to include a fee.

What are you meant to do to confirm transactions if no option for a transaction fee is ever offered?

As Nick says, there really isn't anything you can do by yourself. The transaction fee has to be included when the sender creates the transaction.

There is a provision for transactions to be confirmed without fee, based on a "priority" measure that depends on  the size of the transaction, and the length of time since those coins were previously spent. As such, the priority increases over time, so the transaction should eventually be confirmed, though the length of time depends on the size of the transaction. (The size may be larger than the amount due to you, if it includes payments to other people or  an amount being returned as "change".) If you have the transaction ID, you can look it up on a block explorer like blockchain.info  and see the priority.

If it doesn't confirm in a reasonable length of time, all you can do is take it up with the ATM operator. In principle, they can try to retract an unconfirmed transaction (by double spending) and issue a replacement or a refund.


Bitcoin protocol allows a chain to be undone by a longer chain In Mastering Bitcoin, page 196, it says "While the protocol always allows a chain to be undone by a longer chain and while the possibility of any block being reversed always exists, the probability of such an event decreases as time passes..."

How and when will a chain be undone? How and when a block be reversed? Does Bitcoin core actually allow/support such operations?

Bitcoin is a distributed system. At any given time, there are n different representations of the network, where n is the number of nodes participating in the network. These nodes have a consensus protocol (defined by the Bitcoin specification) which allows each of the nodes to maintain a state consistent with all of the other nodes on the network. The consensus mechanism in Bitcoin is related to the chain of blocks (hence the namesake, "blockchain"), essentially, the longest chain wins.

Blocks can be created by any miner participating in the network, anywhere in the world. When a block is created it needs to be propagated across the entire network, to all n nodes in the world. This can take time, and there is a chance that a new block is created before this process completes. That new block could then get propagated to nodes which haven't heard of the prior block (think network locality). When this happens your network has a fork.

The way the consensus protocol deal with this fork is by seeing which version of the chain the next block is built on top of--that chain will then be 1 block longer than the other and the nodes that see this will consider this the main chain, and the true representation of the Bitcoin ledger.

Interesting cases can come in where there is a major segmentation of the network (say an intercontinental cable is severed and India drops off the internet). Different segments of the network will have a different understanding of the state of the Bitcoin ledger, and thus, could begin building a diverging set of chains. When networks are rejoined, nodes again regain consensus by comparing chain length and choosing the longes; the shorter chain's blocks become invalid.

As time goes on, the ability of a network segmentation unseating a chain is reduced--the likelihood your transactions are on an invalid chain (i.e. the likelihood there is a longer chain being mined by a different portion of a segmented network) goes to zero.


rPi & ASICMiner Block Limit? So I am thinking about getting back into bitcoin and I recently discovered the ASICMiner Block Erupter. And I see that just about everyone has them running on a USB3 hub. Lets say that I ran 8 of these Block Erupters on a single hub that was connected to the rPi. Now I know that the hub is USB3 and the rPi has only a USB2 connection. Would that be okay? And would the rPi be able to handle or process the bitcoin mining application? Or would I need to use a little better PC to handle it?

I chose the rPi because it consumes low power itself, and I can have it run 24/7 than a PC.

I have used both Debian and Arch Linux on an rPi to run Butterfly Labs mining equipment; the rPi was able to handle up to 9 SC Singles with CPU to spare using recent versions of both bfgminer and cgminer. So I suspect that it would not have any difficulty driving eight Block Erupters.

Be sure to take some care in choosing your USB hub (it will need to be powered) and you may find MinePeon to be a useful package for getting things set up.


Importing BTC/BCH into Ledger Nano S Can and how does one import a paper wallet (private key) that contained BTC before the hardfork and now BCH as well into a ledger nano s to split them? Or do they have to be split in another wallet first and then tranfered separately? I've contacted Ledger support but it takes weeks to get a response.

The Ledger Nano S doesn't support importing private keys because that would defeat the purpose of it being a hardware wallet:

  (ie: your computer might have had malware at some point, and your keys could have been compromised without your knowledge)


what is the macaroon max length In an LND node, what is the max size, in bytes, of a macaroon. If there is no explicit max length, what can you reasonably expect to be the size of your macaroon?

A macaroon consists of three parts:

The header: Identifies the macaroon and contains three fields.

The version: 1 byte, always set to 0x02 in lnd
The location: variable length string, always set to "lnd" in lnd
The identifier: variable length binary data, contains protobuf serialized data in lnd containing the permissions of the macaroon. More on that later.

The caveats: Restricts the capabilities of the macaroon. This is a variable length list of strings. lnd currently only implements two possible restrictions, the time-before and the ipaddr restriction.

Example with maximum characters:
["time-before 2006-01-02T15:04:05.999999999Z07:00", "ipaddr 255.255.255.255"]

Which is roughly 70 bytes plus some encoding overhead.

The signature: An HMAC-SHA256 hash, so 32 bytes plus encoding overhead.

The permissions
As mentioned above, the macaroon identifier contains a list of permissions. Currently this just contains a protobuf serialized list of {Entity string, Action string} pairs that correspond to permission sets in lnd. For example, the pair {Entity: "info", Action: "read"} would give a user read-only access to informational calls.
These permissions make it a bit tricky to estimate the maximum size of a macaroon in lnd. At the moment, the maximum number of distinct entity/action pairs that exists is 17, which is given to the automatically created admin.macaroon. That admin macaroon currently is around 280 bytes in size.
But soon, you will be able to customize the permissions of a macaroon even further by specifying individual URIs that are allowed to be accessed. A user could could then, for example, add a permission pair of {Entity: "uri", Action: "/lnrpc.Lightning/ExportAllChannelBackups"} to a custom macaroon.
Just for fun, I went ahead and created a maximum-sized macaroon with all currently available URIs which turned out to be 4041 bytes in size.
From that, I would summarize that limiting user input when uploading a macaroon to 4096 or 5120 bytes should cover almost all cases of custom macaroons.


New copay on Windows 7 How can I install new Copay wallet to my Windows 7?
I cannot use the microsoft app store.
Thank you.

Download the pre-compiled windows versions from the releases tab on the github page.

https://github.com/bitpay/copay/releases


How is someone not able to steal my bitcoin with Dumpprivkey command? In an online course the instructor told us that anyone can find the private key of a wallet by using dumpprivkey(address), address being the address that is created from the key (which is public in a transaction on the bitcoin chain).He said that this command returns a WIF object. I assume that is not true because then anyone would steal anyone's bitcoin by looking up the addresses in tx's on the cahin and running the command. Can someone enlighten me about this dumpprivkey command please ?

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.


Non-standard transaction scripts broadcasting I'm developing an application on Bitcoin blockchain, and I use output transaction scripts that are not standard according to the classic payment methods.
However, even so, on Tesnet everything works fine but I recently read on Bitcoin site the following:

So, appearently, Tesnet may relax some restrictions on transaction scripts, but it doesn't specify much more. So, now, I have no way of knowing if such output transaction scripts could be accepted on the Mainnet, except by buying some Bitcoins with money that I really don't have, and I'm also starting to wonder what is the purpose of the Testnet if its behaviour doesn't reflect the one of the real net and, even worse, what is the purpose of having a script language with such multiple instructions when you can actually use just a few of them.
Is someone able to give me more informations about all this?
Thanks in advance.

Standard output scripts are defined by IsStandard() (which calls Solver() to perform the actual script matching). The standard output scripts are as follows:

P2PKH
P2PK
P2SH
P2WPKH
P2WSH
A script beginning with an OP_RETURN and only pushes at most 80 bytes data to the stack
Bare multisig up to a 3-of-3 multisig

Any other script will be non-standard and the entire transaction will be rejected as being non-standard.

Instead of trying to include a non-standard output script, you can instead use P2SH or P2WSH. Your output script will become the redeem script or witness script which can be anything. P2SH and P2WSH allow you to do exactly the same things as if the script were in an output script.
If you still insist on wanting your non-standard script to be in the output, then for your transaction to be broadcast and mined, you will need to find a miner and give them your transaction through some other means. Non-standard transactions will not be relayed and most nodes will not accept them. You will need to give your transaction to a miner who is accepting non-standard transactions, and it is highly likely that you need to do this out of band, i.e. over some form of communication that is not the P2P network.


Transaction id from a multisig address Suppose Alice sent some coins to a multisig address. Even if that address is assigned to my wallet I will not see the transaction as it doesn't really belong to me. That's fine, Bitcoin-Qt has no way to show "money in your account but locked by multisig" GUI.

Now, I need the txid in order to sign it (via the API) but how do I find that txid when I am a third party (like an escrow for example) and don't have a trace of the transaction via my wallet like Alice would?

I guess I could monitor the blockchain but that sounds foolish, there has to be a better way.

So: given the multisig address xxx give me all transactions registered for that address.

It seems that you figured it out yourself so I just want to add that we are going to add multisig support for mainnet as well in a few days and you will be able to use that as well.

BUILDING means that the transaction has been included in a block and it's confidence is "building". There is also a field confirmations which you can use as well.

The multisig functionality is pretty new to the site and that's why we haven't documented it yet. It will be done asap.


Is there a Bitcoin service that works like Western Union? I am very new to using Bitcoin.  I have never actually used it yet.  My goal is to send a payment of $100 to a trustworthy individual in China.  I was given some sort of address by this individual when I asked how/where to send payment.

Is it possible for me to simply go to a physical agent location near my address to make this payment, then have the agent send my payment to the recipient (similar to how western union and money gram work)?

I am very intimidated by how this all works.  I would love to simply do this on my own computer, but even creating a credible "wallet" has been confusing for me.

Any comments or help are greatly appreciated!!

Thanks

I don't think you'll easily find a service of the kind you describe.

But using Bitcoin directly shouldn't be too difficult. You can install a wallet on your computer such as https://electrum.org/. Then you can buy some bitcoins (the best way will depend on your location), and send them to the recipient.


Validate a payment using bitcoind and json rpc I need to implement a BTC payment system on my web-store. But I'm still not sure about the mechanisms I'm supposed to use for payment confirmation.

For example, a user registered on my store and I created a new address for his account by using getnewaddress('user-name').  I also generate a new address for every new transaction. How can I track the status of a payment made to this address?

I would start by looking at the mempool. See getrawmempool, getrawtransaction, decoderawtransaction api calls.  Once you see the transaction your looking for in the mempool you could consider that status #1

Once this transaction is confirmed in a block it will show up as part of the getbalance for that account and other RPC calls like listunspent etc..  You could consider that status #2

Then it's up to you how many confirmations you want for the payment to be considered confirmed.


Majority attack no drawbacks (unlike bitcoin wiki suggests) In the bitcoin wiki article on Majority attack (https://en.bitcoin.it/wiki/Majority_attack) it says:
"No amount of confirmations can prevent this attack; however, waiting for confirmations does increase the aggregate resource cost of performing the attack, which could make it unprofitable [...]"

Taking into account that the attacker miner will impose his block-chain branch (he has over 50% of hashrate) eventually, won't the bitcoin reward for mining these blocks make up for this aggregate resource cost, thus making the wiki statement false? Am I missing anything (I probably do)?

One thing to consider is that if tomorrow some attacker dumps his year long alternative chain on us, basically reversing a years worth of confirmations: that will likely cause panic and would cause a big drop in price of Bitcoin. So even though he got a lot of rewards in his blocks, if the price halves, the rewards will be worth less than if he had just used his mining power honestly to begin with.

Another thing to consider is that it would be fairly easy for the community to decide to completely invalidate the attacker's chain. For example by blacklisting the hash of his first block in a hard coded manner. Yes that is a centralized decision and yes that will still be a very messy and damaging situation where some wallets get confused and pick the wrong chain. But it is possible to make the attacker's chain completely worthless and should be therefore be a deterrent against such attacks (with long chains at least).


What happens when tx is broadcasted whose input is not yet received by mempool or are unknown? lets say, there are 2 transactions

tx1
address1 -> address2

tx2
address2 -> address3

our mempool doesnt have the tx1 yet, but i try to create a tx2 and broadcast it.

what will happen ?

will tx2 get included in mempool ? and relayed to other nodes ?

or

tx2 gets rejected. and wont be included in mempool  and wont be relayed to other nodes ?

what is the actual flow ?

what are such tx are called ?

What happens when tx is broadcasted whose input is not yet received by mempool ?or not in the old blocks i.e. missing/unknown.

Such a transaction is called an orphan transaction.

When you announce a transaction to a peer who misses one or more of its inputs, the transaction will be placed in the orphan pool - where they are temporarily held in the hope that their dependencies arrive. A request will go out to fetch those dependencies from whoever sent us the transaction.

The transaction won't be relayed until it can be validated. Once all dependencies arrive, they will all be subject to normal validation and relay policies, and if acceptable, relayed in dependency order.


Questions about blockchains, network trust and why becoming a node? everyone,

I'm a software developer and I'm striving to understand the concepts behind blockchain and the projects running on them. I'm not sure if this is the correct place to ask these questions, but here I go:

obs: just in advance, I'm not developing a smart contract software. I'm just using it to compare

1- How many blockchains should exist? I mean, I understand that if I create my own blockchain then a new blockchain exist. But conceptually speaking, how many of them should exist for a good global environment?

For example, smart contracts could exist in ANY blockchain? What about the actions that should occur when an event is fired and what would fire these events? The answer for these questions are a new blockchain inplementation with their own features? That would drive the answer to "as many blockchains as necessary".

Complementing this question nowadays there are more than one big blockchain out there, right? Etherium and Bitcoin, maybe?

2- What are the nodes that compose the bitcoin blockchain network? Am I one? The miners? Who are they?

If I create a blockchain for a smart contract solution, who would be the nodes in this network?

Why would someone become a node? What is the reward?

3- I read that the size of the Bitcoin blockchain is very very big. Anyone know the current size? It is entirely stored in the nodes machines? If not, how does it work?

4- I had a wallet in my computer, though I transferred my money to an exchange. What is stored in an offline wallet? Just a hash? A wallet is relevant for other kinds of implementations, like smart contracts? What would be stored in it?

5- I've been reading a lot about the motivation of the use of blockchains, because it decentralize the data. So I don't need to trust the government in the case of cryptocurrency. That, in the case of smart contracts, there aren't a third party.

But I still need to trust the organization behind the cryptocurrency, and there is a third party when it comes to smart contracts, that is the organization behind the software, right?!

When it comes to smart contracts with money exchange, I have to send my money to someone. This entity is still the man in the middle. Am I wrong?

If the organization behind Bitcoin just shut doors, turn their servers off (if there are any) what would be the impact in the environment ?

Lastly what is the blockchain.info?

please, be kind

Welcome to bitcoin.SE, Victor. There are too many questions, and mostly at a very generic level. We prefer specific questions, that can be answered in a 1-to-1 fashion. This is less of a forum here. Maybe bitcointalk.org is better suited. Also: there is the webpage "bitcoin.org", and Andreas' book "Mastering Bitcoin". It is an amazing book that'll definitely get you some answers. It's freely available online here.

I'll provide a short shot at some of the questions, if it is insufficient, just create a new one and insert a web link to here.

  1- How many blockchains should exist?

For every use case it's own blockchain, or for everyone wanting to quickly get rich, or, or, or .... This is mostly opinion based, and not easy to answer. Better for a discussion forum.

  Smart Contracts

Bitcoin has smart contracts, since inception, and many people do not understand what this means. There is a "mantra" that only Ethereum  has smart contracts (with it's solidity language), but that's not true. In the crypto space, there are several technologies now with smart contracts, and this deserves a whole discussion chapter. Again, have a look at bitcointalk.org, and search for smart contract. Amazing discussions there!

  2- What are the nodes that compose the bitcoin blockchain network? Am
  I one? The miners? Who are they?

Before explaining the details, I reference again the book from Andreas. Generally speaking, every full node is part of the bitcoin network, and does very important verifications steps of the transactions sent into the network. The miners would make sure, that the transactions are collected into a block, which then goes into the blockchain. These are mostly the same full node clients. So you can be a miner, or you cannot. Both options are required in the bitcoin eco system.

  3- I read that the size of the Bitcoin blockchain is very very big.
  Anyone know the current size? It is entirely stored in the nodes
  machines? If not, how does it work?

Roughly 200 Gigabytes. Think about a clock, that creates every 10minutes a block of ~ 1Megabytes in size (if blocks are full as currently), then you get 6 per hour, or 144 per day, or ~50.000 blocks per year. So 50gig per year is the growth factor in bitcoin. Data is only stored in full nodes, there are SPV nodes, that do not store the full chain (like on your mobile devices).

  4- I had a wallet in my computer, though I transferred my money to an
  exchange. What is stored in an offline wallet? Just a hash? A wallet
  is relevant for other kinds of implementations, like smart contracts?
  What would be stored in it?

That highly depends. You need to be much more specific for us to answer this. There are many crypto currencies out there, and many wallets... Basically the wallet contains only the private / public keypairs, and some software, that is required to create transactions. (Hint: Andreas book has a separate chapter on wallets).
A wallet has very little to do with smart contracts, I'd say for bitcoin world: nothing.

  5- ... and there is a third party when it comes to smart contracts,
  that is the organization behind the software, right?!

yes and no. At least in bitcoin world there is no organization. That is the whole deal about bitcoin. There is open source developers around the world,  and everyone can contribute. Even you :-)

  When it comes to smart contracts with money exchange, I have to send
  my money to someone. This entity is still the man in the middle. Am I
  wrong?

Yes, the exchange is your level of trust. It's all about trust: either you believe in mathematical proven code (and trust in the developpers behind, unless you are a genie), or you go to banks...

  If the organization behind Bitcoin just shut doors, turn their servers
  off (if there are any) what would be the impact in the environment ?

The whole point of bitcoin is, that there is no organization. Look into the links I provided. Such a statement would be the worst misconception... You will find answers in the links.

  Lastly what is the blockchain.info?

This is a company that runs a webpage with information from the blockchain (and much, much more). Their service is free of use, and very valuable if you are a developper in doing your first steps to see "inside" the blockchain.


what is Create wallet using blockchain api (PHP) Im wondering to know, what is use of Create wallet programitically Block chain API  Block Chain api here

What it will provide?

Where can i get the api code? Any tutorials ?

Can i provide my website users to Create Block Chain wallet. And provide funds transfer?

This API allows you to create a new Wallet on Blockchain.info. It's the same as if you are registering on the webside but programmatically. On Blockchain.info you can do all thing either of the website or programmatically, which can be very usefull.

If you want to call the api from PHP, you need to send a JSON-Request to https://blockchain.info/api/v2/create_wallet. For a tutorial of JSON-Request in PHP look here

For sending and receiving Payments you need to use this api:
https://blockchain.info/api/blockchain_wallet_api
There are also some examples in PHP on this site.

Blockchain.info does not offer a referral programm, so there is no reward for providing new users.


Hashcash proof of work bitcoin sha256 I'm looking for a program or something to run from the terminal in mac.
That does the same thing as the program found here. http://www.blockchain-basics.com/HashPuzzle.html?nonce=221

What I'm looking for is the ability to check how many times a hash using the same hash- Noucing up has two leading zeros. I want to be able to list each hash for 20 hashing of two leading zeros.

Eg. "HI 183" hashed has two leading zeros
Eg. "HI 2121" hashed has two leading zeros.


Does a blockchain.info My Wallet have a key pool? Does a wallet in blockchain.info My Wallet contain a pool of extra keys as in bitcoin-qt?

Should the wallet be backed up after every new address is created, or only after several are created?

It doesn't (or, at least, didn't).

Email backups will be sent to you every time you create a new address.


'Deposit account' for repetitive bitcoin payments I am looking for something that would allow me to offer a general "deposit" address (like for payments through my website, services I offer etc.).

I am using Electrum as cold storage solution (with a watch-only copy created on an online computer). Can I just create 1 'Receiving address' with Electrum and display this address on my website for payments of any kind, or would I have to create an address for every indivicual payment? I just don't want anything to go wrong...

As mentioned in a comment to your question, reuse of addresses is discouraged. It's considered good practice to generate a new address for each receive transaction.

This question has a detailed answer that discusses how Electrum generates its initial keypool, and how generating additional addresses should be handled.

As outlined in the Electrum docs you can generate a new address in the Electrum console with:

wallet.create_new_address(False)

Be aware of the gap limit issue (discussed in the same document).

If you would like to automate the process you could write your own script or use one of the many open source utilities available on GitHub to generate a new private key and associated address. Let your web page display this unique address for each new transaction. Later, import this address's private key to a non-seed Electrum wallet. Of course, a seed (HD) wallet will not accept addresses that were not specifically generated by it.

Alternatively, and for greater security and control, you could run an instance of Bitcoin Core. It can provide your web server with a unique address via an RPC call. There would then be no need to manually request a new address or to later import the private key.


A Wallet for many blockchains (not just the bitcoin blockchain) In terms of the future of the trust network where there will be an increasing number of fit-for-purpose blockchains such as ones for proof of asset, proof of identity, proof of ownership etc., will there be a wallet to store all of an individual's blockchain needs?

Much like our conventional wallet now storing our cash, driver's license, credit cards and affinity cards. Is the BIP32 "standard" moving in this direction?

The Exodus Project might be of interest: http://www.exodus.io
It's a multi-currency desktop wallet with shapeshift (altcoin exchange) already built-in. You can already download a beta version of it, official launch is going to be this summer according to the projects homepage.

I can't find an example better than https://www.omniwallet.org right now, but I think there have been other multi-currency online wallets around for a while. Exodus however is the first dektop multi-currency wallet I know of.


Can I still claim BCH from BTC core wallet after the 'BCH November 13' fork? I run a full BTC core node and use the bitcoin-qt core client wallet.

I have BTC in this wallet from before BCH was created. I have not yet attempted to claim my BCH.

After the upcoming bitcoin cash BCH November 13 hard fork upgrade activates, will I still be able to claim bitcoin cash (sweep or import from BCC to BCH wallet) from my bitcoin-qt (BTC) wallet?

I assume I can, but have not been able to find an explicit answer to this. I want to be certain I can claim BCH after Nov 13.

It depends on what exactly is changed in the upcoming hard fork, however the devs would not make previous outputs unspendable intentionally.  Your private keys corresponding to UTXO that you controlled at the time of the first fork should still control the same amount of BCH going forward.  If not, users would reject this upcoming fork.


Replace-by-fee and re-sending to another address In Bitcoin Core (or Electrum)
When sending a transaction with "Enable Replace-by-fee" checked, is it possible to resend the transaction (before it was mined) with a higher fee AND to another address?

Such a transaction is standard and would relay. However neither the Bitcoin Core wallet (via the bumpfee command) nor the Electrum wallet (via the GUI) would create such transaction.
More information about fee bumping in the Bitcoin Core wallet can be found here.


Mining a transaction with a 0 BTC output It is possible to mine tx that has a 0 BTC output?
In theory it is non-standard but valid, so it is not relayed but it can be mined.
How to mine it in practice? Are there nodes that accept it? I tried Eligius' 192.3.11.20 but it rejects it.

EDIT: i want to do p2pkh transaction

Do you want to create p2pkh output and send zero satoshies on it? Such output is non-standard (dust) and will not be relayed and mined (but it is possible)

Or may be you want to create nulldummy (OP_RETURN) output? This is possible

BTW, sometimes miners confirm non-standard transactions, for example https://blockchain.info/tx/b4ea693a9d2d7e32b66777964fce13da302bed024bd9fd4651919da650fb1c40 (it is p2pk output)


How do I know which exchanges are serious actors? How do I find bitcoin exchanges?
How do I know if the exchanges can be trusted?

For finding Bitcoin exchanges, check here (exchanges are ordered by volume):
https://www.cryptocompare.com/coins/btc/markets/USD

There are two types of Bitcoin exchanges to consider:

Centralized
Decentralized

With decentralized exchanges, users keep their assets local, and so there is no need to trust a central authority. At the present time, it is harder for decentralized exchanges to build up liquidity. This means that the trading volume is lower and the bid/ask spread is wider.

Here are couple of resources regarding decentralized exchanges:

0x Protocol for building decentralized exchanges for Ethereum
assets
Waves platform DEX - decentralized exchange
https://www.cryptocompare.com/exchanges/guides/what-is-a-decentralized-exchange/

Now, with centralized exchanges, the central authority running the exchange must be trusted. The process of deciding who to trust is less straight forward. Here are some attributes to consider when evaluating a centralized exchange:

The people running the exchange or company
The country where the exchange is subject to regulations
The security practice the exchange uses to protect customer assets
The insurance policy offered by the exchange
The history of customer issues at the exchange, reviews etc.
The transparency the exchange offers
The communication facilitated by the exchange with its customers

I have put together this YouTube playlist discussing some of these attributes with respect to GDAX, Coinbase's exchange: GDAX and Coinbase cryptocurrency exchange - Overview


Who came up with pooled mining? What was the first implementation of pooled mining? Who came up with it?
What protocol did they use and where can it be found?

Slush on December 16th 2010

http://mining.bitcoin.cz

https://en.bitcoin.it/wiki/History

Was that what you were looking for?


Why is attacker revenue in the selfish mining disproportional to its hash-power? It's not clear to me why attacker can gain more revenue if it does "selfish mining" attack than its revenue when it behaves honestly.

I'm aware of this paper.

Selfish mining is based on delaying the propagation of the blocks a selfish miner (or pool) has mined. Following such approach, other miners continue mining on the top of an old block, wasting their time and  hash power.

There are different situations depending on how many blocks a selfish mining pool is able to mine in a row before any other node mines one (all the possible cases are described in the paper you cited). Moreover, selfish mining also requires fast block propagation through the network, since in some of the situations they try to take advantage of other nodes mining on the same block as them, virtually extending the hash power of the selfish mining pool.

Block propagation speed matters since when the blockchain forks in two branches of the same length, nodes start mining by default on the top of the first block they hear about.


How do I get bitcoins in the first place? I have no bitcoins at all. But how do I get them? Can I deposit money through my credit card and convert them to bitcoin currency or something?
Also, say I have 10 BTC. Can I acquire that in physical money?

You can use buy BitCoins on exchange market like Mt.Gox.

You can get BitCoins by mining process. But this second option is very slow and hard. You can join some mining community to create blocks and get bitcoins for it. It takes couple of hours of your computer to make calculations worth 0.0001 bitcoins.

You can find quick intro here: How to Get Bitcoins.


In an event when nobody mines the next block in the blockchain, how are the transactions supposed to get published into the blockchain? I understand that miners are never gonna stop mining given the transaction fee reward for each block. But just in case of an event when nobody is able/willing to mine the next block in the blockchain, what happens to the new transactions, how are they supposed to get published? And also, how is it going to effect the blockchain consensus?

They don't.  The blockchain is by definition a chain of mined blocks.  If nobody mines the next block, then the blockchain cannot grow, and no further transactions can be included in it.  Transactions will cease to be confirmed until somebody does mine another block.

Transactions can still be relayed over the peer-to-peer network, and nodes will verify their signatures and store them in their mempools, but there will be no real protection against double spending.  Someone might create two or more transactions which conflict; some nodes may store one and others may store the other.  No consensus will necessarily arise as to which one should be accepted as the "right" one.

If this state of affairs becomes permanent then the currency is effectively dead.


How to get statistics about Bitcoin users? Because each Bitcoin user can operate multiple Bitcoin clients and wallets, and not every user runs the client constantly, it seems very difficult to gather data about the Bitcoin community.

It's clear that many people in the community will want to remain anonymous (for good reason, if they hold a large amount of value in their wallet), and that collection of statistics in the Bitcoin client app would not be a popular option. Having read about malware that mines bitcoins, it's even possible that botnets may run a bitcoin client too. Even if such a collection technique was palatable, it couldn't be depended upon.

If statistics were gathered on a per-user basis rather than a per-client basis, a whole new data set could provide valuable information to the community, such as growth, feature popularity/desirability, usage preferences etc. Is there any mechanism with which a substantial quantity of real user data could be (or is being) collected reliably? Facebook comes to mind as a possibility, but even Facebook is easy to create fake accounts in.

The closest thing I'm aware of is RowIT's Bitcoin Stats Page which counts listening hosts, unique IPs and several other statistics which come closer to, but still does not directly equal, a count of users. It is, at least, less likely for one user to run a client from two IP addresses than to simply run two clients from the same address, so unique IP statistics might be somewhat more useful to you.

Realistically, Bitcoin was explicitly created with privacy in mind, so as much data mining as we are capable of, there are certain statistics you're simply unlikely to ever lay hands on.


what are the dangers of transfering bitcoins between addresses? So I heard stories about people losing bitcoins because their wallet didn't support a cerain feature.. or bitcoins getting sent to wrong address etc.. how does that happen?
As a software developer I'll be using bitcoin in my application for payments.
What should I be looking for? security wise..
I see that sending between legacy and segwit addresses is not a problem...

The dangers are minimal.

There is no restriction on which addresses can send to which other addresses.

Most common issues arise from wallets failing to support different address encodings (many wallets still do not support bech32), which results in them rejecting valid addresses.

Other, rarer, issues include mixing up address types - a few wallets in the past have interpreted p2sh addresses as p2pkh addresses and sent coins to the correct HASH160 value embedded in an incorrect locking script, effectively burning them.