Segwit with Multisig I was analyzing a Bitcoin transaction that works both with Segwit and non-Segwit for multisig Scripts.
Here is the transaction: https://www.blockchain.com/en/btc/tx/80975cddebaa93aa21a6477c0d050685d6820fa1068a2731db0f39b535cbd369

Note that on indexes 0, 1 and 2 we have the unlocking script in the scriptsig filed and on index 3 it is using witness program. No problems until now.

What is bugging me is why when I get the redeem script from indexes 0, 1 and 2 and execute the ripemd60, sha256, create checksum and encode to base58 it generates the Public address as we can see in the screen of blockchain.com. But when I do the very same thing using the redeem script which is in the witness section, it returns to me a completely different address, why is that happening?

Also, what is the scriptSig on the index 3? How it is generated?

Example:

Redeem Script of index 0:

522102194e1b5671daff4edc82ce01589e7179a874f63d6e5157fa0def116acd2c3a522103a043861e123bc67ddcfcd887b167e7ff9d00702d1466524157cf3b28c7aca71b2102a49a62a9470a31ee51824f0ee859b0534a4f555c0e2d7a9d9915d6986bfc200453ae

The address generated from index 0 using my script:

3JUJgXbB1WpDEJprE8wP8vEXtba36dAYbk

It is the same as the transaction.

Redeem Script of index 3 (Segwit):

5221021e6617e06bb90f621c3800e8c37ab081a445ae5527f6c5f68a022e7133f9b5fe2103bea1a8ce6369435bb74ff1584a136a7efeebfe4bc320b4d59113c92acd869f38210280631b27700baf7d472483fadfe1c4a7340a458f28bf6bae5d3234312d684c6553ae

The address generated from index 3 using my script:

36aKiVksQRLKwByBYVz3KwquFcvHZkwroP

Address from the transaction recovered from blockchain.com

3CYkk3x1XUvdXCdHtRFdjMjp17PuJ8eR8z

You are computing just the P2SH address for the segwit script. However it is not just P2SH, it is a Segwit script wrapped inside of a P2SH. You actually have to first take the witnessScript (the multisig script or segwit redeemScript) and make a P2WSH output script with it. Then this script becomes the redeemScript for the P2SH script.

So given

5221021e6617e06bb90f621c3800e8c37ab081a445ae5527f6c5f68a022e7133f9b5fe2103bea1a8ce6369435bb74ff1584a136a7efeebfe4bc320b4d59113c92acd869f38210280631b27700baf7d472483fadfe1c4a7340a458f28bf6bae5d3234312d684c6553ae

as the witnessScript, you produce

002044c55c1da36a576217259c3bc21b0c3943f7eb3ff4e3c381d9fd3502434b9e87

as the redeemScript. This is a P2WSH output script. This is then hashed to create the hash in the P2SH script:

a914771962306e72e479245d48e879dd2a1862225b4c87

which has an address of

3CYkk3x1XUvdXCdHtRFdjMjp17PuJ8eR8z


Why bech32 address always starts with bc1q? I understand that it starts bc1.

But 'q' is not what I understand. Can someone explain to me?

q is the Bech32 encoding of the number 0. For a segwit address, as defined in BIP 173, the number immediately following the separator is the witness version. In this case, bc1q, the q means it is a witness v0 address, which is the only type currently used but allows for easy future addition of new versions


Bitcoin Cash API similar to BlockCypher Is there any Bitcoin Cash API that has similar features as BlockCypher? Important is the ability to create new addresses and create transactions.

Following are API’s, that provide wallet creation, transaction
  management, withdrawing coin etc. Each one have their own
  specifications.

https://block.io/docs/basic

Widely used
Multi signed i.e. Require two signatures for all withdrawals.
Currently we can trade only Bitcoin, Litecoin and Dogecoin.
We can create address
Send coins to other wallets as well as Withdraw coins etc
Get last/All/specific address transactions
Good Documentation.

https://accounts.blockcypher.com/

Multi featured
Currently we can trade only Bitcoin, Litecoin and Dogecoin.
We can create address
Send coins to other wallets as well as Withdraw coins etc
Get last/All/specific address transactions
Good Documentation
More Features avaible than above. i.e Analytics, events & hooks for notifications much more

https://github.com/Overtorment/Cashier-BTC

Self-hosted Node.js Bitcoin payment gateway.
Open Source & free.
Less Documented hence Hard to implement
No 3rd parties (works though Bitcoin Core node)
Transactions are signed locally. No private keys leak
How much coin we can trade: Working on it.
May be payable in future.
Battle-tested in production
SegWit compatible : Working on it.

https://chain.com/

Specially built for Financial services
Permissioned network access
Multi-signature accounts: Secure, multi-asset account management for individuals, businesses, and institutions
Instant settlement
Transaction privacy
Awesomely documented.
How much coin we can trade: Working on it.

https://github.com/bitpay/insight/

Provided by well known BitPAy
Descent Documented
Multi-signature accounts: Secure, multi-asset account management for individuals, businesses, and institutions
Fees : Working on it.
How much coin we can trade: Working on it.
Secure


Mexican Pesos and bitcoin Are there any exchanges that convert bitcoin or other crypto currencies to non major fiat currencies like the Mexican peso?

On https://bitcoin.org/en/exchanges, you can find exchanges of many countries. For Mexico, https://bitso.com and https://www.volabit.com are listed. Both allow for conversion between MXN and BTC.


C-Lightning update 0.6 doc How do you update safely to 0.6 the working C-Lightning node?

You should be able to just stop the old version, download the new binaries, unpack them, and run them. On the first start lightningd will take care of updating the database if necessary and

Alternatively you can also compile the binaries yourself, like you did before the release:

git clone https://github.com/ElementsProject/lightning.git /opt/lightning
cd /opt/lightning
./configure --disable-developer --disable-valgrind
make
sudo make install

Afterwards lightningd and lightning-cli will be in your $PATH and available from everywhere.


bitcoin-cli deriveaddresses always returns an error I am copying and pasting the example from the bitcoin-cli help:

deriveaddresses "wpkh([d34db33f/84h/0h/0h] xpub6EuEBhzm7KD3yxmt9wFHisymSNmK8w2CFmfgUgXi74ChFa79YouJ1w3hpZmFAWiuLezZqD38fY6K8PkxUfPifzSEB35skuBBNf1efmSp12K/0/*)#trd0mf0l" "[0,2]"

And copying in a valid xpub.

However I always get an error:

Invalid descriptor (code -5)

Even if I copy in the exact bitcoin-cli call from the bitcoin github page here deriveaddresses pull request

deriveaddresses "wpkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/0)"

I still get the same error.

I am entering the commands directly in the console. What am I doing wrong?

Im using mainnet bitcoin core 0.18.0, mac OS 10.13.6

There are multiple things you are doing wrong.

Firstly, in your first descriptor, you have a miscellaneous space between the origin info (the stuff in square brackets) and the xpub. Secondly, this descriptor is also invalid because you have not computed the correct checksum for it. The checksum is the stuff that appears after the pound symbol (#) at the end of the descriptor. The checksum you have there is the checksum for the one from the help text which is only valid for that descriptor.

In order for your descriptor to be valid, you need to remove the space and recompute the checksum. Remove the checksum, including the pound symbol separator, and pass the non-checksummed descriptor into getdescriptorinfo. This will give you a descriptor with the correct checksum. Please note that it will change the hs in the origin info to single quotes (') which may need to be escaped.

Furthermore, because you are changing the xpub in your descriptor, the origin info in your descriptor is incorrect (although Bitcoin Core does not know this). You should change the origin information to match your xpub, or remove it entirely.

The reason the second descriptor you are trying does not work is because it does not have a checksum. The PR for deriveaddress was written before descriptors had checksums. The RPC was updated and changed when checksums were introduced.


What is the P2P technology/protocol used by Bitcoin to find nodes and distribute messages across them? I am wondering if there is a standard/de facto P2P library/implementation/spec used by Bitcoin Core and other implementations of Bitcoin?

Bitcoin has its own custom wire protocol using TCP. Peer discovery is by address rumoring, where connected nodes gossip about other potential available peers. When a node is new and has nobody to gossip with, they make a DNS lookup of specific hostnames which provide a number of known-good peers to make an outgoing connection to. If DNS seeds fail and none of the known peers are good, Bitcoin Core nodes fall back to a set of hardcoded peers as a last resort.

https://bitcoin.org/en/developer-reference#p2p-network

Bitcore, BitcoinJ and python-bitcoinlib all have basic implementations of the wire protocol in JavaScript, Java and Python respectively. It is fairly simple to interact with nodes but misbehavior (such as sending invalid data) will cause the remote peer to ban you.


Cryptocurrency Wallet Seed - mental backup? Ok, so let's say I use a wallet that gave me a 12 word string as a seed.

And I want to do a paper and "mental" backup - will write it down and will memorize the words.

Where is the itch?
Well, the seed file that my wallet created is still on my disk and exposed to hack danger.

If I deinstall the wallet and delete the seed file - am I more safer than?

And I won't have any issues using the seed with other wallet when I choose to use my cryptos?

Uninstalling the wallet will not make anything more secure. Deleting the wallet also does not guarantee that the wallet file is gone; it is usually still on disk for some time after it has been "deleted". You will be exposing your seed to a computer anyways any time you want to send Bitcoin and get new addresses to be receiving Bitcoin at. By only remembering your seed, you may be a little bit safer than if you had let the wallet do its thing (where it encrypts the wallet file and is still on your computer). I don't think you will actually a significantly more secure. All you are doing is just increasing the risk that you lose all of your coins (by forgetting the seed) and making it more of a hassle to send and receive Bitcoin.

  And I won't have any issues using the seed with other wallet when I choose to use my cryptos?

Not all seeds will work with other wallets or altcoin wallets. It depends on how addresses are derived, what standard the seed follows, etc.


How to claim Bitcoin Cash from Block.io Initially Block.io stated they would support Bitcoin Cash in September and that never happened.  :(  After reaching out to them they stated:

"The Bitcoin Cash network seems to be dying in favor of the new Segwit2x fork its proponents want to push. While we continue to index the Bitcoin Cash blockchain, we do not believe full support for this network is merited given its low adoption.
If you wish to use your addresses to claim your Bitcoin Cash equivalent in the mean, see block.io/dashboard/settings -> Access Private Keys, and then claim your Bitcoin Cash from a service that supports that network."

At this point I attempted to transfer Bitcoin Cash to Btc.com with their tool but it is stating that no funds were located so they probably are not compatible with Block.io.

Does anyone have a service that will support the transfer of Bitcoin Cash from Block.io with my private keys so I can get it off their exchange and into my wallet?  Any thoughts or assistance is appreciated!

It's possible! But it's complicated :]
The main reason is block.io are using multisig addresses, meaning that it's not the usual address that you can redeem funds with only one private key, but here we require two private keys to sign every transaction.

EDIT - This solution used to work for some time, but it doesn't work at the moment

It seems that blockdozer.com changed their API and their AJAX/CORS policy in some way that makes it impossible to query outputs and to submit transactions. I was able to overcome their AJAX by disabling security on the browser, however the raw transaction that's being generated contains special characters such as "|" and the API doesn't support that. It did work about a month ago though, but not any more

Since Ik'm no expert on this I submitted a comment to the developer that implemented bitcoin cash support in Coinb.in, I'll update here once I get a response. Here's the PR and comment in Github:

https://github.com/OutCast3k/coinbin/pull/113

Phase one - Acquire your private keys

First phase is to your private keys from Block.io - Log into your wallet, go to "Settings", then press "Private Key Access". You'll get an email with instructions how to proceed. At the end of this process you should have a file that contains something like this :

* Address: 3ET4FuXvHahN4WwrJ3dyCLsoVbDVZtVEUU
* Address Type: P2SH
* Required Signatures: 2
* Redeem Script: ....
* Redeem HEX: 5221039960aa771270362b7e49400433e103c59e12c6a43a946d4b048f7efcc68bc0bf21028825d729387c6b0aafae1c47802c62d7f965de1800d6122143c681044c50700452ae
* Public Keys: ["039960aa771270362b7e49400433e103c59e12c6a43a946d4b048f7efcc68bc0bf","028825d729387c6b0aafae1c47802c62d7f965de1800d6122143c681044c507004"]
* Private Keys: ["KyubGochD3MkXW4KkT95K6FXbZSrtHg6creF6xaRDc9C3qkyidza","KxFLJ2n76i2W9WB2YdJd1zCL2Kmgpk1vfB2XEynSpQWsYCe4bfqn"]

Phase two - coinb.in

I tried to do it the easy way using Electron Cash - there's an option there to import multi sig addresses but it doesn't work. I had to sign the transaction manually and broadcast it to the BCH main network. coinb.in is an awesome tool to do that, however at the moment the pull request for using BCH isn't merged yet, I deployed a version of the tool here :

http://galed.codus.net/coinbin/

Alternatively, If you want to be extra cautious you can run the tool on your local machine by running these commands :

git clone https://github.com/dabura667/coinbin.git
cd coinbin
git checkout bitcoincash
open index.html

Phase three - signing a transaction and braodcasting

PLEASE PLEASE PLEASE WATCH THE INSTRUCTIONS in this youtube video to get a better sense of what needs to happen: https://www.youtube.com/watch?v=oUSVmLegj8k - If you're dealing with large sums of BCH you could end up losing everything, so please be careful!

The one difference is that you need to be careful to choose the bitcoin cash network, otherwise you'll be broadcasting transactions on the BTC network:

Click New -> Transaction
Enter the redeem HEX that you received from block.io in the first box (Address, WIF key or Redeem Script)
Click on "Advanced options" and change the network to "Bitcoin Cash mainnet"
Put in the amount you want to transfer and the address, make sure that the fee is not too high
Click submit, you will get a long HEX string. copy it
Go to "Sign" , paste the string, paste the first private key from the file that block.io sent you, click "Submit", Copy the string
Paste the string into the second box, copy paste the second private key from the block.io file, click Submit, copy the output
Go to "Broadcast", paste the string and submit.


How do miners/clients prove a transaction is valid? To prove a transaction is valid, you must prove that the source address has a balance at least as much as the transaction. How does one prove this in a performant manner? The block chain of bitcoin last I checked is 16G. Surely miners don't scan through 16G of data to check every block to track all transactions that address has ever had.

How do miners and clients speed this up to a fast and cheap operation?

Bitcoin doesn't work on balances, it works on transaction inputs and outputs. A transaction's inputs must specify unspent transaction outputs (UTXO) of previous transactions. And clients maintain an index of UTXO to easily find the referenced outputs.


Can I add inputs from different accounts coming from the same Bitcoin HDWallet? Say I have 1000 users, each one with its own account with paths m/49'/0'/{user.id}', and I am controlling received/sent funds.

Could I collect all the funds (i.e. inputs) in a sole fat transaction output even though they belong to different accounts of the same HD Wallet?

Yes. Each input has its own signature with which to sign, so as long as you possess the private keys (or a master private key above the account level), you can add those inputs into any transaction you want.


What if 0 value SHA256d block is mined? I've been wondering about this for a while. It might even be impossible due to hash value of block being SHA256 value of SHA256 value of the block data, as far as I know (or is this only for Bitcoin addresses?) and there simply might not be a SHA256 value that produces 0 when it's hashed again, unless SHA256 outputs are very well distributed, which they might be in this case.

I have seen on some blockchain explorers that for the genesis block the previous reference block is 0. I thought that perhaps this would mean that Bitcoin blockchain might loop unexpectedly, but I figured out that coinbase transaction has 50BTC as an output, which would I guess make it invalid now that the block reward is bellow that.

Would there be any special problems with this?
Obviously if the difficulty gets too high, block hashes will start overlapping which could create these loops, right?
But I do understand that it is very likely that difficulty would have to grow quite unreasonably high for this, which it never might.

The probability of a block hash being all zeros is the same of all being ones, and the same of odd digits being ones and even digits being zeros, and the same of being every other number.

So the problem created by a future block having the same hash as the genesis block or the block the genesis block points to as its previous block is the same problem of any future block having the same hash as any existing block today. It would not be a special problem.

It's currently believed this have a very low probability to happen, as there are not known SHA256 weakness.

In the practice, however, if something so unlikely happens, maybe some software like wallets or block explorers use the 'zero' value to identify the genesis block and present some bug or erratic behavior. Maybe some miner even mines another block on top of it, and then it broadcasts the new block to the network, where it may be rejected as a sibling of the genesis block, being regarded as part of orphaned chain.


Installation instrucion the for bitcoin core (tar.gz file from bitcoin.org in Linux/Ubuntu Desktop 18.04.) There are many discussions going on as there is a lack of a simple tutorial as to how to install Bitcoin Core (GUI) on Linux distributions, i.e Ubuntu 18.04.
Bitcoin.org offers the tar.gz file (i.e. available here: https://bitcoin.org/bin/bitcoin-core-0.20.0/bitcoin-0.20.0-x86_64-linux-gnu.tar.gz) which can be installed in Linux, i.e. Ubuntu Desktop 18.04 or 20.04.
It would be great if someone could provide such instruction to reach out to a broader user base.
Not all users wish to use the Snapstore.
See also here: https://www.reddit.com/r/Bitcoin/comments/hka0qc/why_are_there_no_packages_for_bitcoin_in_linux/
Is there anybody who could write up a tutorial or just post a video for a safe & quick installation of the tar.gz file which is downloaded from Bitcoin.org?

Not gonna write a 'tutorial', but here's a couple things that should be mentioned:

As you imply, ubuntu provides a standard 'snap' for bitcoin. easily installed via apt. Agree they are a PITA to use, so ...

if you use the tar.gz, just extract it somewhere, then (using the appropriate version number):

2a) check the signature on the hash file:
gpg --verify SHA256SUMS.asc
2b) and confirm the hash for the downloaded file matches the appropriate hash in the hash file:
sha256sum bitcoin-0.17.1-x86_64-linux-gnu.tar.gz
2c) Then the trick is to use this to get the files where they need to go (links included):
sudo cp -vR bitcoin-0.17.1/* /usr/
2d) Not sure what the 'right' way to start it is, but this works for me. I put it in the automatic startups:
bitcoin-qt&


bitcoin payment high fees I am using bitcoin-rpc and everytime i create an invoice for the client to pay, i create a new address. Payment is ok, i get the money after a cron.php sees that all confirmations are above 3, but then when i try to send my money back to my big wallet i see 200 300 usd in fees
bitcoin-cli sendtoaddress "MY_WALLET" 0.1 "" "" true
I see on blockchain that everything was sent from each and every address that i have created
ADDRESS1 ... 0.05
ADDRESS2 ... 0.08
ADDRESS2 ... 0.028
... and so on
How can i send everything from one big address and pay only 20$ usd fee?
I think i pay per vbyte for what i have read ... but i want to send internally with low or no fees or something. Can i send coins internally to one big wallet?
I mean don't think that big payment gateways that do the same thing and create an address for every invoice but pay such amounts of fees.
Thank you.

Can i send coins internally to one big wallet?

No.
By internal you mean without communicating with the Bitcoin network and without involving external miners.
All Bitcoin transactions which move money from one set of Bitcoin addresses to another Bitcoin address are external in the sense that they must be recorded on the blockchain and therefore must incur transaction fees.


Bitcoin Core change derivation path with getnewaddress cmd 0.17 As I'm building a simple HD wallet, I would like to use bitcoin core regtest. My goal is to setup a testing flow where I could have constant seeded address each time I use bitcoin-testnet-box, so that I could cross-check derivated addresses amongst other tests.

Using bitcoin-cli sethdseed and getnewaddress is the way, but I can't figure a solution to derivate child keys using another path than the default bitcoin core's one which seems to be m/0'/0'/i'.

Is there a way to change derivation path in a custom way ?

No. Bitcoin Core currently does not allow you to use a different derivation path.


How does mining pool ensure the miner works on the problem? I understand that the header given to some miner contains hash of Coinbase that goes to servers address. Thus the miner cannot take the reward.

Also in the simplest setup the server gives miner a range of nonces to check and the range that miner checks is proportional to his hashing power and proportional to the reward.

How does server ensure miner checked that range?

Miners regularly send "shares" to the pool server. The shares are solution to a low-difficulty bitcoin puzzle. Each share stands some chance of being a solution to the current bitcoin puzzle, of much higher difficulty.

By sending shares, miners show that they are working on the problem, and may potentially reveal its solution to the pool server. They are often remunerated based on the number of shares they find, and of their difficulty.


Why does my BIP32 implementation throw different results than other web implementations? They also disagree with each other tho I am implementing bip32 for my wallet as a project to learn Bitcoin.

I am following this documentation:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki

Since I am not implementing bip39 yet, I am getting the master private key and code chain from the BIP39 Root Key from this web:
https://iancoleman.io/bip39/#english

using a random set of words which are:

praise vague cruise stem test gesture twin long donate violin special hamster horror rough loan

which throws:

xprv9s21ZrQH143K2E7weJFDreP9A8dFkx18swFoAJ6DBdsVuSPoFBLzekLca8vEG1i6ikCcvzZb79joaEZAjeM8Nz1DZ549aCnv3YFXy33mLoW

Comparing this output with another web implementation here: https://iancoleman.io/bip39/

These two outputs match. However, after this point they don't. And my implementation doesn't match with any of those implementations!

Here is my python code where I deserialize the BIP32 extended key. This matches perfectly with the master private key and chain code from the second web app:

def deserialize_xprvk(s):
    version = s.read(4)
    depth = s.read(1)
    fingerprint = s.read(4)
    index= s.read(4)
    chain_code = s.read(32)
    s.read(1)
    privkey = s.read(32)
    return [version,depth, fingerprint,index,chain_code,privkey]

decoded =deserialize_xprvk( BytesIO(decode_base58_extended(xtprvk)))

printing "decoded" I get:

0x488ade4
0x0
0x0
0x0
0x10e85c06826fdcd006c244ff6c44200044c1418bdd82cc088c33e48ae7b4c2ca
0xf214c0afd9b311544fdb686cae5100f1ac0ac8aba2b6c55719ba41ac2d4f2d12

which matches perfectly with the 2nd implementation (the firs one doesn't show the master private key or chain code).

Then I try to follow the instructions from here:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
to derivate the child PRIVATE KEY with index 0 for this master key and chain code like this:

#The order of the ciclic group in the finite field of the ecliptic curve
N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141

#creates a string to emulate the index in a 4-byte hex format.
def str_i(i):
    i_str = hex(i)[2:]
    while len(i_str)<8:
        i_str="0"+i_str
    return i_str

pub_key = PrivateKey(int.from_bytes(master_priv_key,"big")).point.sec()

#I put an extra "0" because every public key begins with a "02" or "03" but
#the hex() function commits this character.
#The str_i(0) means I am trying to get the index 0.
msg=("0" + hex(int.from_bytes(pub_key,"big"))[2:] + str_i(0)).encode()

I= hmac.new(
            key = hex(int.from_bytes(chain_code,"big"))[2:].encode() ,
            msg=msg ,
            digestmod=sha512).digest()

I_L, I_R = I[:32], I[32:]

child_privkey_int = (int.from_bytes(I_L,"big") + int.from_bytes(master_priv_key,"big"))%N

child_privkey = PrivateKey(child_privkey_int).wif(compressed= True)

child_chain_code = I_R

If I run this code and try to get the child private key for path m\0\0\ I get:

"L29Rc5PyDkbUr2z1VcL2DuAhTQkNo3qwF7ENgRotS86ADUkiXPJF"

But in the first web app they get:
"KwuPS3DGMnCc3jMJWtqVVzkCoMyhybxGZrf68fPBEBtFfujBdPGs"

And in the second one they get:
"L1TcvgkPZFa6DyXhv9vYWceTXZhoAR7ZQMdt5rqV6LW3Zutpsqr8"

Is it ok to disagree on different implementations?? or am I doing something really wrong? I am starting to pull off my hair trying to find out where I am messing up.

Thanks.

This line:

msg=("0" + hex(int.from_bytes(pub_key,"big"))[2:] + str_i(0)).encode()

is incorrect. You are converting the bytes of the pubkey and index into a hex string which you are then hashing. That is not correct. You are supposed to hash the bytes directly, not the hex string.


Script_sig for coinbase transaction afbff1130b6fcbdceebbadfc48a842af1f03ee08a79e042b37fc467518b49a0f I am currently developing a blockchain parser in Python, and it has been crashing in the file blk00006.dat for the coinbase transaction with the hash afbff1130b6fcbdceebbadfc48a842af1f03ee08a79e042b37fc467518b49a0f in the block 0000000000000a46714e1b03e5e0693e9ecaa3ec1853f1cdf34e9ca52e13f1ff. The reason it was crashing is because it has an OP_PUSHDATA2 in the script signature with a value of 28265. However, there are only 21 bytes left to read according to the size of the script.

I fixed my code to avoid crashing in this script, but I am still curious about how this script_signature got accepted by the network.

Scripts are not parsed. From the protocol perspective they are byte arrays, and their contents is irrelevant for transaction deserialization.

Scripts are executed however, at the time they participate in spending. For outputs, that is when they are (attempted to be) spent. For non-coinbase inputs, that is immediately. Coinbases never participate in spending, so for almost(*) all purposes, they are just byte arrays.

(*) There are two partial exceptions to this. BIP34 requires the coinbase to start with a push of the block height. The 80000 vsigops limit also counts CHECKSIG operations in coinbases (treating them as scripts, but it stops counting at the first invalid opcode).


Property based tests have been added to Bitcoin Core. What are they and could they replace some of the unit tests in Bitcoin Core? Property based tests have been added to Bitcoin Core.

This Dev article describes property based tests as randomized unit tests that in some cases could replace unit tests.

"Generally speaking, property-based tests require only a few lines of code (like unit tests), but unlike unit tests they test a different set of inputs each time. Because of this, you end up covering more domain space with roughly the same amount of test code."

Is this a good summary? Could we phase out some of the unit tests in Bitcoin Core and replace them with property based tests?

I think this is a fair summary. I would hesitate to phase out unit tests, rather supplement them with property based tests. In a library I maintain called bitcoin-s we use them in tandem.

Concepts

There are two primary concepts in property based testing systems.

The first one is a Generator. The point of a generator is to generate values you want to run through your tests. Think of a generator as specify the boundaries of what random values you want to be generated for your test.

The second concept is the test itself. In english, property based tests say that

"Given a generator X, i want to generate random values from X and run them through my test case. My assertion should always hold true for the value generated from my generator".

An example

I'm going to pull an example from this PR i've had open for a long time now. If you want to see some more extensive tests I recommend taking a lookg at it.

The "property" we are going to assert is that

"If we generate two random private keys in bitcoin, they should NOT be the same"

If this property fails, we have an indicatin that something is probably wrong with our pseudo random number generator.

Here is what that test case looks like in C++ with bitcoin core:

/** Check CKey uniqueness */
RC_BOOST_PROP(key_uniqueness, (const CKey& key1, const CKey& key2))
{
    RC_ASSERT(!(key1 == key2));
}

That test case can be run N number of times (by default 10 in the rapidcheck library.

The next logical question would be "where do key1 and key2 come from"? The answer: They come from the generator! The beauty of property based testing is leverage the framework to do the generation of values for you.

Here is what the generator for CKey looks like:

/** Generator for a new CKey */
template <>
struct Arbitrary<CKey> {
    static Gen<CKey> arbitrary()
    {
        return rc::gen::map<int>([](int x) {
            CKey key;
            key.MakeNewKey(true);
            return key;
        });
    };
};

This gives rapidcheck the ability to generate arbitrary valid CKeys to pass in as a parameter to the properties that we are asserting holds true.

You can see more complex generators and assertions related to Script in that PR too if you want to see non trivial generators/assertions.

Summary

It's really useful to have multiple runs of a test case with newly generated values every time. Typically in software testing, you write a unit test asserting that your code works as expected for one or two values. This is a really limited approach to testing as you want your code to work for a range of values. With generators, you can get the computer to generate a range of valid values that your property should assert true on.

I think this is particularly useful for consensus systems like bitcoin where we need to reason about a wide range of values being fed as input into the consensus system. Property based testing is a great tool to use to offload some of that cognitive load when reasoning about corner cases.


Do private blockchains need consensus protocols? My understanding is that in a private blockchain, the participating nodes verify and agree that the block is valid and only then add it to the blockchain.In this scenario, are consensus protocols (such as RAFT, PAXOS, etc.) needed? Am I missing anything here?

TL;DR Yes, consensus protocols are always needed in distributed systems where there could be multiple writers to the same data. When it is possible for multiple participants to simultaneously update their local state, it can result in two inconsistent versions which can't be merged together into a globally consistent state.

In the context of a blockchain, publishing a block is analogous to reading and writing to balances, and we wish to enforce the constraint that every account balance >= 0 to prevent double spending.

Imagine that in the ledger state of block 4, I had 10 coins. Then in Branch A, I sent Alice 8 coins, but in Branch B I sent Bob 8 coins. If we tried to reconcile these two updates into one state then either I would have a balance of -6 coins, violating the balance >= 0 constraint, or coins would have to be illegally created.

Consensus algorithms are designed to ensure that each node has a valid state consistent with other nodes. As explained by CAP theorem, during a network partition a consensus algorithm must either make the service unavailable (Read Only) or allow for the two partitions to potentially become inconsistant. This means that when designing or choosing a consensus algorithm, one must decide between either consistency of the data (e.g. preventing double spend) or availability (e.g. making a transaction).

Nakamoto consensus prioritizes availability such that during a network partition it will continue to process transactions, and after a network partition, the global state will eventually be consistent. It quantifies each state's total proof of work to decide which state is the correct state. If our node had previously only observed branch A but then received the blocks from branch B, it would calculate the amount of work done in each state to decide which branch to accept. This means that during a network partition, the state is still available to be updated at the expense of it becoming inconsistent. After the network partition is resolved, the inconsistent states are resolved by reverting some of the updates and applying the ones that lead to a state with more proof of work.

Other consensus protocols such as the proof of stake variant used in Tendermint will prioritize consistency, meaning that during a network partition attempts to update the state may fail, making the service unavailable. To ensure consistent updates to the state (i.e. creating a block) nodes that controll at least 2/3 of the stake, must agree to a proposed block within a timeout period. If too little stake agrees to the proposed update, it will fail and revert and a new proposal will begin. This is somewhat comparable to a 2 phase commit, but differs in that it can tolerate the failure of nodes controlling up to 1/3 of the stake.

Even in a trusted environment where all machines are behaving correctly, inconsistent states can arise due to network latency, as asynchronous messaging is comparable to short-lived network partitions. Keeping state consistent becomes somewhat more difficult where we have more complex constraints to uphold (e.g. ensuring consistent smart contract execution)

Other non-blockchain private distributed systems, must make the same trade-off between Consistency and Availability, Google's BigTable maintains availability and replicates updates to other nodes making it eventually consistent throughout their data centers, for coordination within a BigTable cluster it relies on a fault tolerance lock distributed service named Chubby which uses paxos during leader elections. However, It seems that due to the reliability of Google's private WAN  (>99.9995% availability) and very accurate time-keeping, they have also built Spanner, the accuracy of their timestamps allow for updates to be ordered (or delayed if there is uncertainty about the order) such that an application's view of the data is consistent with the application's constraints and other invariants.

I highlight CAP theorem to explain how Nakamoto Consensus will always be available but subject to the eventual consistency, potentially allowing for a 51% attack. Other consensus protocols can provide finalization, but may not always be available opening them up to a system-halting DDoS attack. In the context of a private system, control of the hardware means that the distributed system can be virtually always available and shielded from DoS attacks, leading companies like Google to prefer the provision of consistency.


What is the name of the procedure of downloading and checking the ledger for a new node? When a new node connects for the first time to the Bitcoin network, it first needs to determine what is in the ledger, and what is not. As far as I understood, it does so by connecting to the Bitcoin overlay network, downloading the blockchain and checking all the proofs of work. In case of multiple blockchains found, it just selects the longest and commits its transactions on top of that one.

Now, I wonder: does this process have a name? The process to start from scratch and determine what the state of the ledger is? I usually call it bootstrap but I am not sure whether or not it is the correct term to use.

The state a full node is in while it is aware it is significantly behind the rest of the network is called initial block download, or IBD. Being in IBD makes the node make different tradeoffs, like preferring bandwidth over latency, and more aggressively batching operations.

While downloading blocks, getting a node closer to the most-work chain tip, block validation happens. This includes sanity checking the received data, verifying its difficulty and proof of work claims, checking that all coins spent by its transaction inputs exist and haven't been spent already, verifying the scripts and ECDSA signatures, and marking the inputs as spent and remembering the outputs created as being available for spending.

The whole process of learning and downloading and validating new blocks to get to the same knowledge other nodes have is called synchronization.


How does using a Turing-complete programming language compromise the security of the network? I have read many places that the decision for Ethereum to use a Turing-complete programming language sparked a lot of concerns over security. From my understanding, not using a Turing-complete programming language leads to a more secure network. Why is this the case?

It is much easier to formally verify the behavior space of Bitcoin script vs. Solidity.

For example, the DAO project suffered from reentrancy vulnerabilities, given that one could not predict the behavior of anonymous smart contracts when they were called/sent funds to (fallback function, now deprecated).

There are formal verification efforts for Solidity, but this increases the design difficulty tremendously, and one must ask whether it is worth the turing-completeness.


Are there wallets that provide access to different HD wallets from the same masterseed using different passphrases? I have a well-protected masterseed that I have not memorized, and memorizing it won't help since it could already be compromised.  My solution is to use a clever passphrase on top of that masterseed.  I've been looking around in Mycelium because I read somewhere that you can appear to access your bitcoin wallet and show any bad guys that it's empty by using an incorrect passphrase.  This makes so much sense that I want to do it, at least just for fun.

As I understand it, the masterseed encodes an integer which is the private key for a bitcoin address, and also a chunk of entropy that is used to generate the paths in the resulting HD wallet.  When a passphrase is used, the effect is to change the masterseed so that an entirely different HD wallet is the result.  So with one masterseed, you can have as many (invisible!) HD wallets as you want.  The feature required is the ability to restore from the masterseed plus passphrase.  Indeed, if the wallet is locked with the passphrase, then entering the wrong passphrase gives you a new wallet (and you'd have to realize on your own that you entered the wrong passphrase).

That is my dream: to be able to run Mycelium in front of a bad guy, enter my passphrase, and show that I have zero-balance.  An additional feature would be the option for old transactions to show up so that it still looks real, but like everything has been spent.

I have an Android with Mycelium, and I've looked at the cold storage and backup features (and the "Advanced" add-a-key feature) and I can't find a place where I can enter my 12 masterseed words PLUS passphrase and get a new wallet.  The only place I found like that is for cold-storage spending, and then it says "no funds found" (as expected).  It could at least give me a btc address so I could send some funds to my special secret passphrase address.

Yes! You can absolutely do this.

Trezor has this exact ability, on top of that you can actually use the device with your phone in Mycelium.

https://shop.trezor.io/

The setting must be activated, last firmware did not have it activated by default. This may have changed though.


Lite-wallet transaction confirmation procedure BTC lite-wallet sends a bloom-filer request to bitcoin node about what is the current balance of the particular address. After that wallet will have a Merkle-tree prove that transaction is indeed on a blockchain.

The question
Do lite-wallets store all headers since genesis block? A block header is just 80 bytes, however, 80 bytes *6 blocks/hour *24h*365d*9y ~37M which is a lot for a lite wallet.

No, lite wallets can function just fine without storing all the block headers. Instead, what wallets usually do is confirm if there is a new tx involving one of the wallet addresses, and then download that specific tx. They will then only store the tx, and not the rest of the information.

As their UTXO set expands, they will check new blocks to see if they contain a new UTXO, or consume an existing UTXO that the wallet cares about.

Additionally, many wallets these days keep track of when an address was created, and will not scan blocks before that.


Best p2pool software I'm pretty new to Bitcoin. This will be my second question at this site and I'll try to make it less verbose than the first while still containing what seems to be important detail.

I'm still in the middle of synchronizing my Bitcoin Core client with the network. But while that's working, I'm considering mining. I dislike centralized pools for all the good reasons that many people do. It seems decentralized is something that many are beginning to recognize serves the best interests of everyone in the community which I guess is why p2pool was written. Thank you to everyone involved in that. And so if I do start mining, then p2pool seems like the best choice for me.

But what's the difference between these two projects?

https://github.com/forrestv/p2pool/graphs/contributors

https://github.com/Rav3nPL/p2pool-rav/graphs/contributors

Are these just different implementations of the p2pool protocol?

It looks like the forrestv project's last release was in 2013, so 2+ years ago?! Does that indicate stable/finished application or does that indicate an abandoned project?

Rav3nPL's project seems to have more recent activity. Which project is better and why?

If it matters for the answer, I'm using Linux for my Bitcoin node.

forrestv stopped updating the version, but he's still adding features.

Anyway, the Linux installation instructions say to just get the latest master:

sudo apt-get install git # if git is not installed
git clone https://github.com/forrestv/p2pool.git
cd p2pool
make


Is there are written code for mapping public address to an user? I read about 2 theoretical ways we can do it

1) When a single transaction has multiple input addresses, we can assume that those addresses belong to the same wallet, thus to the same user. We should bear in mind that users do not share private keys. In fact many users may use web wallets which have pools, so those services will be treated as a single user.

2) Secondly, you can exploit the change mechanism in transactions. The entire value of unspent output should be sent back to the user as change. Bitcoin, in order to improve anonymity, produces a shadow address which collects back the change that results from any transaction. So when a single transaction has 2 outputs, you have to predict which one of the output addresses is actually belonging to the same user that initiated the transaction. If one of those two outputs has never appeared before in the blockchain, while the other has, then we can assume that the one that never appeared before is the shadow address.

But is there any public code available which is able to achieve this in an optimum and optimise algorithm, I wrote an algorithm but its O(n^2), and the dataset currently is just too huge for such algo to work.

You can write both of those queries in a way that takes nearly linear time and space.

Make a hash table that maps addresses to "neighbor addresses." A neighbor address is an address that was used as an input alongside another address. To find the addresses a user owns, query the hash table for the address. Add all of the addresses that are neighbors of that address. Recurse for all of the neighbors.
This can be created in O(n*k) time and space. (n = number of transactions, k = average number of inputs from distinct addresses per transaction)

Make a hash table that maps addresses to the block they were first seen in. For each address of each transaction, you check the hash table to see if it has been seen yet. If not, you create an entry for it, pointing to the current block and transaction. Then, while querying, you can quickly tell if a transaction contains addresses that have been seen for the first time.
This can be created in O(n) time and space. (n = number of inputs)

(It doesn't need to be a hash table specifically. Other approaches would work too.)


Buying BTC with PayPal, preferably automatic, mid 2015 Does anyone know if the Virwox method (buying "linden dollars" with USD from PayPal, and then exchanging linden for BTC) still works, and what are the limits, and cost? (in late 2013, if I recall correctly, there was a $300~$400 USD monthly limit, and the effective cost was really high, around ~16%).

Also, does anybody know of any other reliable method, preferably automatic (hence, not localbitcoins) of buying BTC with PayPal? (by automatic I mean not depending on direct interaction with some other user).

I know similar questions have already been asked, but they're old and some methods no longer work.

I don't know of any services, especially automatic, which accept PayPal. LocalBitcoins will rarely have vendors accepting PayPal, and even then, it's going to be very much a reputation based judgement call. A vendor accepting PayPal has everything to lose (the Bitcoins and the PayPal money), so I'd be highly doubtful any service would even accept PayPal, let alone without identification or oversight. (Which begs the question, if you want privacy why are you using PayPal?)

Maybe try Bitcoin-OTC or BTCJam if you don't like LocalBitcoins


Understanding getchaintips in terms of chain reorganisations I'm trying to get an understanding of the chain reorganisations my node has experienced by looking at bitcoin-cli getchaintips.

The "status" of the different branches tells me the following:

1.  "invalid"               This branch contains at least one invalid block
2.  "headers-only"          Not all blocks for this branch are available, but the headers are valid
3.  "valid-headers"         All blocks are available for this branch, but they were never fully validated
4.  "valid-fork"            This branch is not part of the active chain, but is fully validated
5.  "active"                This is the tip of the active main chain, which is certainly valid

However I'm not 100% sure what each of these mean in terms of a chain reorganisation. Would I be correct in saying the following:

valid-fork - My node performed a chain reorganisation. I downloaded and validated the blocks in the branch and had them as part of my active chain, but later deactivated them after receiving a new longer chain.
valid-headers - My node observed a possible chain reorganisation. I heard about a competing longest chain, however I did not download the full blocks and activate them as the branch never became longer than my current active chain.
headers-only - My node observed a possible chain reorganisation. I received some (but not all) of the block headers for a competing branch?

Does that sound about right?

I'm trying to get a more practical understanding of what my node is doing when it hears about a potential chain reorganisation. I'm most unsure about the difference between headers-only and valid-headers.

valid-fork means that the blocks were fully downloaded and validated. It is likely that they were part of the active chain but were reorganized after a better chain was received.

valid-headers means that the blocks were fully downloaded but not fully validated. Only the headers were validated to have a valid Proof of Work before the block was written to disk. Tips with this status could have been valid-fork, but they never had the chance to become part of the active chain and thus never actually fully validated.

headers-only means that the node only has the block headers but not the full blocks themselves. This could happen for a variety of reasons - maybe a node announced those headers but failed to provide the block itself.

One notable headers-only entry you may see is the Bitcoin Cash fork. This is listed as headers-only your node may have received the block headers for that fork (up until the PoW changed) but did not download the blocks for those headers after it found that the first block in that fork was invalid.


How does one set up and configure a Butterfly Jalapeño for mining? I just got some awesome new ASIC miners (2 Butterfly Jalapeño 5GH/s) and set them up, started running them, and only one of them was actually working. Yes I have all my cables correctly plugged in to a good power source. Can someone please tell me how to connect them so they can mine together?

I figured this out. A simple computer restart and software re-download fixed the problem.


Can I sell bitcoin worth five million dollars or more and how can I? I bought 200 bitcoin in the year 2012 and I've come to the point where I feel I need to withdraw some of it. But I'm having some difficulty doing that. How can I withdraw a large sum of bitcoin and where? An answer preferably includes a step by step guide.

The first fifteen exchanges here are famous and credible. Choose one of them, open an account, verify your ID (KYC would certainly be required), add your IBAN number, deposit Bitcoin, sell it, withdraw it to your account.


Running lightning in prune mode I am running lightning with the LND implementation and a full node. Nevertheless, I heard that it is possible to use Lighting in pruned mode.

How is this possible?

I read in the LND install documentation that you need the -txindex flag:

  In order to run lnd with a bitcoind back-end, the bitcoind instance must be configured with --txindex just like btcd above.

In the Wikipage of Bitcoin it says for pruned mode:

  This mode is incompatible with -txindex

I also read here and here the same arguments.

Is this outdated or is it not possible to use prune mode in lightning?

It is possible to run Lightning (both LND and c-lightning) with bitcoind pruned mode.

There are already packages turning the pruned mode on when disk space is limited: Lightning Power Node Launcher (works with LND) and BTCPayServer docker (works with c-lightnig).

There is a lot of conflicting information online, because it became possible only after Bitcoin Core 0.16.0 was released.

Update from the official lnd documentation:

  We don't require --txindex when running with bitcoind but
  activating the txindex will generally make lnd run faster.

  NOTE: WE DO NOT FULLY SUPPORT PRUNED OPERATING MODES FOR FULL NODES.
  It's possible to run a node in a pruned mode and have it serve lnd,
  however one must take care to ensure that lnd has all blocks on disk
  since the birth of the wallet, and the age of the earliest channels
  (which were created around March 2018).


How secure are current deterministic wallets? Can someone explain how secure the deterministic wallet implementations of Electrum and Armory are? As far as I know, Electrum uses a 128-bit seed to generate all the addresses. I don't get this because since even a single bitcoin address consists of 256-bits. why not make this seed something much larger? And electrum uses something called "root key" and "chain code" which I can't find any explanations about.

Any ideas on how secure these implementations are?

It is secure.

128-bit seed is at this time very secure. It is lower than a regular bitcoin address which is actually RIPMED-160(SHA-256), giving it 160 bits of entropy.

Brute forcing a 128 bits of entropy at this time would take around 1,440,000,000 years if every computer ever made was working on this single problem.

Like most of these algorithms brute forcing is not the issue. Side channel attacks are usually the danger or if an error is found in the implementation, which none have been yet.


What is a good resource to help newbies choose their first wallet/s? While editing the Bitcoin Newb Guide, I realized I can't find a single page that covers all major clients in a Newb-friendly manner.

bitcoin.org doesn't seem to mention web wallets such as My Wallet
The wiki page is not IMO newb-friendly ... one big table, no clear way for a newb to decide which wallets he should try out. Yes, the features are listed in the table, but a newb won't understand them.

What is the best objective resource to help newbs choose their first wallet/s?

Requirements:

Objective source (as much as possible)
Updated Frequently, preferably user editable / reflects user votes
Includes major desktop clients
Includes major web wallets / mobile wallets
Noob Friendly - just dumping all clients in a big table will scare off noobs. I want a page that, while giving out sufficient information, is well structured and will not scare noobs. The Wiki Page is a good counter example.

Essentially it boils down to the tradeoffs between security and convenience.

Instawallet is incredibly convenient, but not all that secure (as no password is required, and if you lose the URL, you lose the ability to spend the funds.)

Paytunia was a great shared (hosted) EWallet for a beginner, and there is a mobile app (for Android). A new version of Paytunia is in the works for a 2014 release.

Blockchain.info/wallet is a great hybrid (browser-based) wallet and also has a mobile app (for Android, and for Cydia / jailbroken iPhones). Configured properly, with backups sent to your e-mail inbox, this is probably the best combination of security and convenience.

If you only need a mobile wallet, the BitcoinSpinner works well also.

http://en.bitcoin.it/wiki/EWallet
http://en.bitcoin.it/wiki/Mobile_Payment_Apps


Could Taproot or Graftroot enable the execution of complex scripts? From my understanding, Taproot uses a Merkle Tree structure whose root represents the outcome of a script. That representation is in the form of a signature that may unlock the inputs associated with its public key counterpart, which is shared by all participants.

I have two questions related to this:

First, how is the script structured in the tree? Does each path represent a different execution outcome? If so, how are the potential outcomes defined?

Second, if it follows a Merkle Tree structure, is there a limit in terms of the size of the script? I'm inclined to say no, given that this occurs off-chain, but I might be wrong.

First, how is the script structured in the tree? Does each path represent a different execution outcome? If so, how are the potential outcomes defined?

The taproot email doesn't specify how the script is placed into the merkle tree.  It can be that each leaf node in the tree is a different script (BIP114-style) or it can be that a parameter can be passed that allows extracting multiple leaves so that parts of the script can be reused (BIP116-style).

The reason this detail is not in the taproot email is because that email was about rearranging the previous ideas about merklized scripts (MAST) so that the expected default condition (everybody signs) was the easiest and cheapest option to use with no need to actually handle the merkle tree in the expected case.  The ideas about how to organize and use the tree are a separate discussion.

  Second, if it follows a Merkle Tree structure, is there a limit in terms of the size of the script? I'm inclined to say no, given that this occurs off-chain, but I might be wrong.

The merkle root / public key for taproot consumes a fixed number of bytes (say 64), which is trivial, but the spending transaction will have to provide the spending script as well as a merkle proof providing a list of hashes (and a few bits of path information) proving that the provided script connects to the taproot's merkle root.

This information will be subject to the fundamental block size limit of 4 million weight units and, depending on how it is implemented, may also be subject to Bitcoin's current limits on witness size (10,000 weight units for segwit v0).  The good news is that it's impossible for an honest person to create a merkle tree that requires more than about 8,000 bytes to create the merkle proof (not counting the script) even if they had at their disposal all the energy in the universe.  (Assuming we use Bitcoin's SHA256d hash function.)

The above is an illustration from my article about MAST showing how the encoding of alternative scripts (subscripts) into a MAST grows at log2 whereas it grows linearly with the existing mechanism.

For a script with a million possible outcomes (tree depth equals 20) would require about 643 bytes (20 * 32 + ceil(20 / 8)), allowing actual witness script and witness data to be up to about 9,300 bytes.  Of course, if everyone signs, you don't need to provide any of that data---you just push a single signature.


When the last Bitcoin block is mined, how would transactions continue? If transactions are stored in Bitcoin blocks through Merkle trees, when the last Bitcoin block is mined, how would there be future Bitcoin transactions? Where would those transactions be stored on?

A misunderstanding. I do not know what leads you to believe that there will be a last block.

It is true that block rewards have a halving period and will eventually, in many years, reach zero, but, the transaction fees are also paid to the miner so mining will continue.


Can not indentify accounts I am trying to get balance of accounts and when running bitcoin-cli listaccounts I am getting the data look like this

{
  "":0.81234545
}

I wanted to know what is the "" and 0.81234545 and where my real addresses.

Thanks!

Note: The accounts feature is being deprecated from the codebase. Accounts are groupings of addresses, constructed by the wallet software.

You may find that the listunspent or listreceivedbyaddress commands are more useful for you.

  I wanted to know what is the "" and 0.81234545 and where my real addresses

"" is the default name of an account

0.81234545 is the balance of your wallet, in BTC.


Is BItcoin the only truly decentralized cryptocurrency? Is Bitcoin (and likewise Bitcoin Cash)the only truly decentralized cryptocurrency? It appears that all the other altcoins are connected to companies or individuals who control them.

There are many decentralized currencies, you can take a look here:

http://coinmarketcap.com/

Not all coins are connected to a company, the main big ones that are connected to a company are Ripple and Factom. Other coins might just have foundations that is responsible for marketing and other related matters, but they do not control the coin itself as the miners and coin holders do.


Can you delay transactions so that you pay no fees? Online wallets, such as inputs.io, require you to pay a fee, but transactions occur instantly. Is there any way to not pay fees (probably by delaying payments)?

Transaction fees will always be expected by the network unless your order meets these conditions

It is smaller than 10,000 bytes.
All outputs are 0.01 BTC or larger
Its priority is large enough (meaning it has been on hold for a very long time)

you can also mine your own transactions, but as a general rule if your expecting someone to process your order for you, then they expect something in return, even if that something is only 0.0001 BTC.


testnet3 node sync process is very slow My config file is similar to this:

testnet=1
blocksonly=1
rpcport=5000
server=1
listen=0
prune=1000
dbcache=16000
rpcallowip=0.0.0.0/0
rpcuser=someuser
rpcpassword=somepass

I have started the node sync in testnet mode and I tried to check the status by using the command

$ tail -f testnet3/debug.log

Ouput: 2018-04-08 04:09:51 Potential stale tip detected, will try using extra outbound peer (last tip update: 46620 seconds ago)
2018-04-08 04:20:21 Potential stale tip detected, will try using extra outbound peer (last tip update: 47250 seconds ago)
2018-04-08 04:30:51 Potential stale tip detected, will try using extra outbound peer (last tip update: 47880 seconds ago)
2018-04-08 04:41:21 Potential stale tip detected, will try using extra outbound peer (last tip update: 48510 seconds ago)
2018-04-08 04:51:51 Potential stale tip detected, will try using extra outbound peer (last tip update: 49140 seconds ago)
2018-04-08 05:02:21 Potential stale tip detected, will try using extra outbound peer (last tip update: 49770 seconds ago)
2018-04-08 05:12:51 Potential stale tip detected, will try using extra outbound peer (last tip update: 50400 seconds ago)
2018-04-08 05:23:21 Potential stale tip detected, will try using extra outbound peer (last tip update: 51030 seconds ago)
2018-04-08 05:33:51 Potential stale tip detected, will try using extra outbound peer (last tip update: 51660 seconds ago)
2018-04-08 05:44:21 Potential stale tip detected, will try using extra outbound peer (last tip update: 52290 seconds ago)

...and keep on getting the same

Again I tried this command to see the peers info

$ bitcoin-cli getpeerinfo
output:
[
]

It means there are no peers, so I want to know what is wrong.

The syncing is happening from more than 13 hours, but still headers and blocks are 0 only.

$ bitcoin-cli getblockchaininfo
{
  "chain": "test",
  "blocks": 0,
  "headers": 0,
  "bestblockhash": "000000000xxxxxxxxxx",
  "difficulty": 1,
  "mediantime": 1296688602,
  "verificationprogress": 5.667000646249453e-08,
  "initialblockdownload": true,
  "chainwork": "0000000000000000000000000000000000000000000000000000000100010001",
.......

are you running bitcoin testnet3?

put these lines to your conf file, shutdown and restart syncing again

addnode=104.237.131.138
addnode=151.80.205.132
addnode=192.155.82.123
addnode=74.220.255.190
addnode=80.100.203.151


Recieve Bitcoin value notifications on iPhone I would like every day at a set time to receive a notification on my iPhone with the current Bitcoin value in Euros. How can I have this?

The Bitcoin Ticker app seems like it would fit your needs nicely.


How to get private key from litecoin-qt wallet? I want to backup only the private key, not the full litecoin-qt wallet for the reason that the wallet can be used only with litecoin-qt client and if I have to use it after few years or on other machine, I do not want to wait the client to fully download the full blockchain.

Could anyone please let me know how to extract the private key from the wallet file?

Go in the console and type : dumpprivkey litecoinaddress

Use the help if nessassary.

The console is in : Help\Debug Windows


2 nLockTime TXs with same input What happens if I broadcast two nLockTime transactions with different nLockTime but same input?

Is the smallest nLockTime going to be accepted or is it the tx that reaches the network the fastest that will be accepted.

Background info:

In a double spend attempt, how is the valid transaction chosen?

As Nick mentioned, transaction replacement using nLockTime and the sequence numbers isn't currently enabled by the network. In practice, this means that any transactions with an nLockTime in the future and at least one input with non-max sequence number won't be broadcasted because it is not a 'final' transaction.

So, if you:

broadcast TX1 with nLockTime 3 days in the future and then TX2 with nLockTime 2 days in the future, neither will be propagated by the network.
broadcast TX1 with nLockTime 3 days in the future and then TX2 with nLockTime not in effect (or in the past), TX2 will be accepted and broadcasted even though it wasn't the first TX spending its input.

Essentially, the network 'accepts' the first final (ready for inclusion in a block) transaction spending that input that it sees. There are some proposals to alter this method, such as relay-first-double-spend and replace-by-fee.


Why is this script invalid, and how can I generate valid public key/digital signature pairs? Why does the default P2PKH transaction at http://bitcoin-script-debugger.visvirial.com/ return NULL rather than true?  I haven't tried to swallow the gory details of OP_CHECKSIG yet, but everything else looks solid.

Is there a way to manually verify that the example digital signature/public key pair matches, or to generate matching pairs that don't contain or link to my actual Bitcoin addresses, in order to experiment with the Script debugger?

I have played with the tool for some hours, but couldn't get a single signature to work. Here is what I entered for the famous PIZZA transaction:

# <sig>
OP_PUSHDATA1 71 0x30450221009908144CA6539E09512B9295C8A27050D478FBB96F8ADDBC3D075544DC41328702201AA528BE2B907D316D2DA068DD9EB1E23243D97E444D59290D2FDDF25269EE0E
# <pubKey>
OP_PUSHDATA1 65 0x042E930F39BA62C6534EE98ED20CA98959D34AA9E057CDA01CFD422C6BAB3667B76426529382C23F42B9B08D7832D4FEE1D6B437A8526E59667CE9C4E9DCEBCABB

OP_DUP OP_HASH160
# <pubkeyHash>
20 0x46af3fb481837fadbb421727f9959c2d32a36829
OP_EQUALVERIFY OP_CHECKSIG

The script's content would execute correctly the OP_DUP and OP_HASH160, so the results on the stack match the OP_EQUALVERIFY. Then OP_CHECKSIG returns false... Checking with openssl returns true.

  Is there a way to manually verify that the example digital
  signature/public key pair matches, or to generate matching pairs that
  don't contain or link to my actual Bitcoin addresses, in order to
  experiment with the Script debugger?

yes, I usually have OPENSSL to give me a helping hand. But any ECDSA library should do. A normal P2PKH tx is converted into unsigned format, and the input script is replaced with previous tx' output script (and lengths adapted). This raw tx is then double sha256'd, and the result signed. This hash value can easily be checked with openssl, the signature and the pubkey. I posted this ~2 years ago, and got help from Dave.

How to come to the unsigned transaction is explained by @amaclin's answer in the first link (--> How does the ECDSA verification...). Openssl requires a PEM key to verify, so some conversion takes place from pubkey to PEM format. And then bitcoin works with raw (hex) data, not strings. Hence the efforts to convert with xxd on Linux systems, or with sed and [:xdigit:] on BSD type systems. If you are on unixoide systems, I can provide a script.

  how can I generate valid public key/digital signature pairs?

Maybe "generate" is not the correct word here, but one can take any tx from the blockchain, and extract the elements (raw tx, sig, pubkey, prev tx pubkey hash), and push it through the process described above.


I want to block my transaction I made a payment to somebody and now he is not replying me regarding the product I made the payment for and think its a fraud.
So I want to block the transaction.
All I have is the QR code of the person to whom the payment was made.
I also have the QR code detail
Bitcoin:1PNPnadF26twbAxTZTVeEaQKjbYeXDmeNJ

If the transaction has been confirmed there is nothing to do and that is probably your situation. If not (due a small fee) then you can pay yourself with a higher fee to "block" the previous one.


Is there a standard procedure for refunding Bitcoin transactions? I work for an online retailer, and we're currently testing a Coinbase payment implementation for our checkout. One of our big concerns is being able to send a refund in the event that we're unable to ship an item on time, or if a customer cancels an order, or for whatever other reason.

There are a few things that I've managed to find out, but I'm still confused.

Coinbase's API (relevant docs here and here) doesn't seem to have a way for us to find the address of the wallet or account that the payment for an order was sent from.
Even if it did have a "Sender Address" response, this question/answer makes it pretty clear that using that would probably not be a good idea.

So what options do we have for issuing a refund? I can think of at least a few... each has its own downsides though.

If an order can't be delivered on time, contact them and ask for an address to send BTC to.

We do get contact information (Phone, Email, and Address) when they check out - but we can't perfectly verify it.
We may be stuck in limbo if we can't get in touch with the customer.

At checkout, ask for an address to send any refunds to with a "just in case" note explaining why we're asking for that.

As far as I know, nobody does this.
Some users may have privacy concerns when they see us asking for a wallet address.

Mail a check for dollar value of the transaction to the address provided at checkout.

Again, we do get a customer's address - but we can't verify it to be 100% accurate.
Let's be honest, this really doesn't seem like a good idea at all.

Are there better ways? Is there, universe willing, a standard way of refunding transactions?

As of right now, there is not a standard way to return other than to ask the returnee for an address to which the returner can send. You could ask for them to verify the address by signing some text with its private key, however, users of web wallets are at a disadvantage because not all wallets provide this functionality.

It is too onerous to ask for a return address at the time of sale, because a conscientious user would have to create a new address for each sale's return address. Managing these would grow difficult over time.

Issuing store credit with the option to cash it out via a variety of methods is probably worth consideration, as it prioritizes consumer choice. If I'm ordering from a company from which I order frequently (e.g. Amazon) or I know that I'm going to reorder later, I'll take the store credit and save the management time. Otherwise, I'll cash out the bitcoin and find another vendor who can meet my needs.

Update 21 Feb 2014: Bitpay announced today that Bitpay is now supporting BIP70-73 payment protocol, which includes refund addresses.


salvagewallet is not in the Bitcoin Core Console I want to try the -salvagewallet command, but it is not in the console. What is the command line syntax?

-salvagewallet is not a command that is run from the debug console. It is not one of Bitcoin Core's RPC calls. Rather -salvagewallet is a command line option. You set it in the command that is used to run Bitcoin Core or you set it in the bitcoin.conf file by adding salvagewallet=1 to the bitcoin.conf file and then starting Bitcoin Core.

Note that -salvagewallet does not always work and sometimes may result in corruption of your wallet if it is not already corrupted. It is only as a last resort option. You should always make a backup of your wallet file prior to starting Bitcoin Core with -salvagewallet.


Algorithm to go from seed to 20 (or more) addresses I'm currently reading the Electrum sourcecode to figure out how to go from seed (12 words) to addresses (in usual format). Does someone have the big picture of this process in mind?

More precisely I'm looking for Python code (standalone, runnable out of Electrum) that can produce this.

Take a seed s (can be 12 words from the 2048-words dictionary but not necessary)
Let's assume s is a valid seed (i.e. is_new_seed(s) is True, this means that bh2u(hmac_sha_512(b"Seed version", s.encode('utf8'))) has prefix '01'); code for is_new_seed here.
For our goal (get addresses), should we first create the private key from s? How?

or

Should we create a master public key from s? How?
Given 3. or 4., how to create the 20 first public addresses?

Example of input: s = 'x8' (yes this is a valid (unsecure because too simple)  seed, you can try it in Electrum - Create a wallet from existing seed)

Example of output:

1LNvv5h6QHoYv1nJcqrp13T2TBkD2sUGn1
1P6rnf6VUfSUUWES6wTyjfx9dTFqXdrjLM
1AQ6TNtD2eEdQjwpVpkPSdcvJiiLKziKZz
...

Electrum uses BIP 32 to go from a seed value to private and public keys. Addresses are then derived from those keys. Public keys are also derived from the private keys, except in the case for watch-only wallets.

The full BIP 32 specification is available here.


My claim was accepted on MtGox.com - how do I get the cash out? My claim was accepted on MtGox.com - how do I get the cash out?

It lists a Yen figure but it's totally unclear what to do next.

Is it too late to transfer to Kraken and get bitcoin back?

How can I do this, can't find anything online - only options are to view, change password and transfer the amount to another person?!

All information is provided on https://www.mtgox.com/. As you can see, this is going very slow, the latest update was on 8th March and the next update should come after 27th September.

If you read the latest report, you can see that the secured assets are lowering in time (most likely due to payments for investigations and cost of the bankruptcy processing). You can also see that there is a huge gap between assets + bitcoins and liabilities, which means that even if payout was going to happen today, you would get just a fraction of your claim.

The case will likely take many more months (years?) before the payouts are going to happen. And then you should not expect much to get back.


How to find my private key! Please help! Trying to send some BTC payments and don’t know my private key. Can anyone help me and tell me it or tell me how to get it.

If you never had the private key for the bitcoin account you are trying to use, then you can't just recover or "find" it.
This is one-way algorithm: private key -> public key. You can get public from private, but not another way around.


blockchain.com saying I do have enough funds I have had 0.3097 of a BTC in a wallet for a couple of years. Needing to pay for something, I went into blockchain.com and entered the login link and password and the system showed me the balance which was correct. So far so good.

I then called up SEND and entered the balance (I want to send all the money in the wallet to a certain address). No matter what I enter in the amount box, red letters come up saying "insufficient funds".

What do I do ?

When you click send a modal window pops up. Look at the transaction fee in the bottom right of that. Deduct that from your balance and you'll be able to move your bitcoins.


I have more than 20 paper wallets with very little bitcoin in them. How can I combine all of them together? I have a bunch of paper wallets with different small amounts of Bitcoin in them. How can I combine them all into one address without having to pay a fee for sending each paper wallet to my own account? How to do a bulk send and pay a one time fee that would be cheap?

You should import all the private keys and not sweep them.
Wallets like blockchain.info has this function where it will import the private key. In that case the private key will become part of the new wallet.

Import all the private keys into a new wallet. Thats it ! During spending the wallet will combine inputs from your private keys to spend required amount.


Python: Why the addresses and keys generated by pywallet and bip32utils using the same 12 mnemonic words don't match? I tried to generate wallets by using pywallet and bip32utils (Python). But I noted that the addresses/keys of the 2 wallets, namely wallet_pywallet and wallet_bip39 don't match with each other.
I noted that the addresses/keys of wallet_bip39 match with Exodus, but wallet_pywallet doesn't. We have been using pywallet for such a long time so I believe wallet_pywallet should be correct as well. Why is there such a discrepancy?
Below is the code, while the code for wallet_bip39 is obtained from this post.
from pywallet import wallet
import binascii
import mnemonic
import bip32utils

def bip39(mnemonic_words):
    mobj = mnemonic.Mnemonic("english")
    seed = mobj.to_seed(mnemonic_words)

    bip32_root_key_obj = bip32utils.BIP32Key.fromEntropy(seed)
    bip32_child_key_obj = bip32_root_key_obj.ChildKey(
        44 + bip32utils.BIP32_HARDEN
    ).ChildKey(
        0 + bip32utils.BIP32_HARDEN
    ).ChildKey(
        0 + bip32utils.BIP32_HARDEN
    ).ChildKey(0).ChildKey(0)

    return {
        'mnemonic_words': mnemonic_words,
        'addr': bip32_child_key_obj.Address(),
        'publickey': binascii.hexlify(bip32_child_key_obj.PublicKey()).decode(),
        'privatekey': bip32_child_key_obj.WalletImportFormat(),
        'coin': 'BTC'
    }

mnemonic_words = wallet.generate_mnemonic()

wallet_pywallet = wallet.create_wallet(network="BTC", seed=mnemonic_words, children=0)
wallet_bip39 = bip39(mnemonic_words)

print(wallet_pywallet)
print()
print(wallet_bip39)

Derivation paths.
wallet_bip39 is using m/44'/0'/0' while (if I looked at the right pywallet code) pywallet is using m/0'


why ripple currency exchange trading is slow sometimes? Bids Sum BTC Size BTC Bid Price XRP
  30.58995660   30.58995660 6,000.00000000

  Asks Ask Price XRP    Size BTC Bid Price XRP
  6,000.00  29.07743420 29.07743420

while bids and asks match above, why the orders not getting filled? The above are top entries on each side of order book for btc/xrp since last 10 minutes in the ripple client.

Nothing ever happens in Ripple unless some transaction initiates it. Precisely matching orders are permitted under some circumstances to provide enhanced liquidity. The primary purpose of order books in Ripple is to provide liquidity for payments. Having matching offers on the books permits payments in either direction with zero spread.


how Ripple Xcurrent works? As per my knowledge Xcurrent uses blockchain. But how it uses blockchain ? Xcurrent or Interledger protocol talk about ledger entries, I would like to know, do they really use blockchain as a ledgers in bank transfer or they use banks native ledgers like (databases or anything)? What is difference between general and sub-ledger?, is sub-ledger is referred as bank's native ledger ?

Taking a look at the "How it works" document on their website, the first time they mention the word "Blockchain" is in their "About the company" section in the end of the document. So I would be quite sure that their product has absolutely nothing to do with any kind of blockchain technology.


How does a wallet learn of a transaction it has received? I'm curious how a wallet learns of an incoming transaction. Is it constantly searching the blockchain for blocks containing addresses it generated?

A bitcoin wallet application that runs as a full node client contains a copy of every unspent transaction in the blockchain. This allows a wallet to construct transaction inputs as well as quickly verify incoming transactions as having correct inputs. However, most user wallets run lightweight clients that only track a users own unspent outputs. If the wallet does not maintain a copy of unspent transaction outputs it can query the bitcoin network using a variety of APIs. The API's will return all the unspent transaction outputs for an address. Most wallets will not run continuously and so when a user starts up the application it will query the network to synchronize with it.


Would it be possible to pay from the Blockchain app to a Coinbase app in a restaurant? I walk into a restaurant that accepts bitcoins and pull out my phone with a blockchain app to pay with, the waitress then shows me a phone with coinbase app to pay to..

Are there any issues with paying from one company's app to another company's app?

Regards: Beginner bitcoin user

What you really do is to send bitcoins (with a phone app, in this case) to a bitcoin address. So, strictly speaking, Blockchain or Coinbase, if we consider only the send/receive function, are providing you something it's already yours, meaninf that a wallet with its addresses and the send and receive functions are at your disposal for free on the bitcoin network, and you can use them installing one software wallet on the PC.

What is important for them, and is useful for you too, is another function of the app, the one which allows you to buy bitcoins, maybe with no waiting between the payment and the bitcoin "arrival".

All the apps, under the hood, are compliant to the same rules, defined by the protocol. Apps realized by companies like the ones you mentioned must obey those rules: if the don't, are unable to interact with the network, they would be useless. So, all does the same things the same way, as fare as we speak of activities that require to use the bitcoin protol (send and receive the coins)

If you're asking if there is some kind of proprietary/private protocol that makes the use of Coinbase or Blockchain the same as choosing between VISA and American Express: no, as far as I know. It is not possible, because Bitcoin's code is open source, which means everyone can read it and learn how to write its app to send and receive bitcoins. It is not something owned by a company, is something everybody can access for free.

It would be a ruin for Blockchain if you could not send bitcoins away the easiest way possible, wherever you are and to every address in the (bitcoin) world! After all, they earn money because you buy bitcoins from them. The easier and faster you spend your bitcoins, the sooner you'll buy others.

What exists is the opposite. In 2012 was described a way to represent a bitcoin address and to ask to do something with it, all in a line similar to the internet links.

Here you can find the specifications, the document is called BIP21. The simplest example is this:

bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W

An example of use: I send you an email with that URI inside, you click on it on your smartphone, the mail app, that implements BIP21, is aware of the bitcoin URI format, so knows what to do: pops up a requester asking if you want to save the address in the phonebook, for example, under my name, since I am the sender of the email.

Bitcoin took quite a long distance from some of the ways we are all used to relationship ourself with money in general, and with the market, too. Who knows what else will be possibile, given that some big evolutions are not that far.


Why do "financial experts" hate Bitcoin? Why do people who have been in the financial industry for a long time seem to always talk negatively about it?  Does it threaten their livelihood or do they just not know enough and so they speak negatively about it?

I was looking at the quotes from financial experts about bitcoin and almost all of them were fairly negative, but also almost all of their titles were more traditional financial-type jobs:

http://www.tradingacademy.com/resources/financial-education-center/financial-professionals-share-their-opinions-on-bitcoin.aspx

I'm not sure why I understand all the hate from this group.

Financial experts do not hate Bitcoin. Some might hate Bitcoin -for several reasons including a conflict of interest as you suggested, but not all of them.

There are countless financial experts in the world including founders and investors in Bitcoin based businesses. Just do some more in depth research and you'll find them.

I looked at that page you provided the link to. My suggestions is don't take the Expert label for granted. Take a look at who these people actually are. Be vary of anyone who expresses a very strict opinion about something they don't necessarily understand.

I saw evidence of both non-expertise and outright ignorance on that page.


Can I mine cryptocurrency using Javascript? Is it a good idea to mine a Scrypt-based cryptocurrency, like Dogecoin or Digitalcoin, using Javascript instead of having paid ads.

The script would mine using all computers visiting my website.

I see where you are coming from and I wouldn't be surprised on some systems if the user has less of a bad experience than ads (some sites filled with ads are simply unbrowseable for some).

But, Javascript is not a quick language and you wont generate any coins worth generating, no pool will allow you to direct this sort of traffic to them in any significant quantity and if you run your own p2pool the bandwidth and other resources will far outweigh the coins mined.

As a rough but educated guess that you'll probably generate about 1-2kh/s per user while they are on your site, meaning you'd need 250,000-300,000 simultaneous viewers to match a modern scrypt mining rig, take into account overheads and you're probably looking at more like 400-500,000 viewers.

In other words, don't do it. Your users will hate the site, it will lag video and audio and generally create a poor browsing experience meaning users won't stay on your site meaning you wont get the required hundreds of thousands of viewers. You may also get flagged for malware by Google etc. and like I say, pools wont accept it.


Regtest createmultisig Error: Invalid public Key? As shown below, I generated 3 new addresses (Legacy I believe) in RegTest. I then try to create a multsig address from exactly these 3 addresses. What am I doing wrong, or is this unavailable in Regtest?

'''$ bitcoin-cli getnewaddress
2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk

$ bitcoin-cli getnewaddress
2NAqXJMEFzEbhNyy9xRiHHcwWNCyFddFfXH

$ bitcoin-cli getnewaddress
2NEyDQfb85jRExQUnj4wC7fkFh5T1rt5zFk

$ bitcoin-cli createmultisig 2 "[\"2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk\", \"2NAqXJMEFzEbhNyy9xRiHHcwWNCyFddFfXH\",\"2NEyDQfb85jRExQUnj4wC7fkFh5T1rt5zFk\"]"

error code: -5

error message:
Invalid public key: 2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk
.'''

Addresses are not public keys. You cannot give createmultisig addresses because it cannot know what public keys your addresses refer to, if any. To get the public keys, you need to first do getaddressinfo <address>. That will give you a pubkey you can give to createmultisig.


Short-term capital gains taxes for crypto to crypto trades? If I were to profit off cryptocurrency to cryptocurrency trades throughout the year without ever cashing out my crypto position for USD, would I avoid paying any short-term capital gains taxes on all of my crypto to crypto trades? Would I ultimately only pay long-term capital gains tax once I convert my crypto to USD after the one year mark?

It will depend on the tax laws in your country.

Where I live the tax law treats crypto currencies as an asset and requires that my position be reconciled at the end of each financial year for capital gains calculations.

That's not to say I have to do any buy or sells of each year I just have to determine my paper capital gain or loss for the year in order to include it on my tax return.


Mining pools like eligius Can someone provide a list of mining pools like eligius who will accept non standard transactions directly and mine them?

No pool today includes non-standard transactions in blocks.

To be correct, there are a number of conditions and pool options. Some pools have strict rules, some pools - no. But all pools today have their own policy rules for accepting or rejecting transactions to a mempool.

There is no correct answer to your question without knowledge what kind of standardness do you mean. The only thing you can do is connecting to all nodes and broadcasing your transaction hoping someone will accept it.


Sent to wrong bitcoin address Need help I sent my bitcoin cash at the atm to the wrong bitcoin HOW can I use this address to send to the address I want it the money on !!! NEED HELP NOW

Simply put, it is not possible to revert transactions once they are made because it would allow people to scam others by taking back the money they have paid when they bought something. Your money is lost.


What is the default number of transactions a full node have in its mempool? Is there a default limit to the number of transactions a node can keep in its memory pool? Or do we have to explicitly declare maxmempool=xyz to restrict the number of transactions a node can have in its memory pool?

The memory pool (mempool) is not limited to a specific transaction count, but limited by the amount of data the deserialized transactions take up in the node's memory. The default memory pool limit is 300 MB. The limit can be configured by passing -maxmempool <n> where the n is the number of megabytes allowed.


How does Mimblewimble's security model compare to Bitcoin's? In addition to scaling, privacy, and scripting differences Mimblewimble also differs in its security model.  How does Mimblewimble's security model compare to Bitcoin's?  Specifically:

How well will Mimblewimble function in the age of quantum computing?
What trust is placed in miners?
Are possible attacks similar to Bitcoin? (51%, Sybil attacks, DDOS)
Is it possible to trick light clients into trusting an invalid transaction?

Commenting on the overall security model is a much more complex answer as many moving parts are involved, from initial blockchain syncing to cut-through. But to answer your specific questions:

Quantum computing

MimbleWimble is not very well prepared for quantum computing as it's intricately tied to Elliptic Curve Cryptography (ECC). But the full picture is a little more complex.

First, one has to define "quantum computing" further. Shor's algorithm would require several hundreds of qubits to break ECC. Modern quantum computers with higher qubit counts rely on quantum annealing, which is a different "kind" of quantum computer much more limited in function, and can't implement Shor's algorithm.

Second, there's early indication that quantum-resistant algorithms may exist with properties similar to ECC that could be used for MimbleWimble. They're mostly untested in the field, so it will required some time, but the above points shows we do have some time.

Overall, quantum computers that can break ECDSA are still years away. So starting with ECC which is well proven and migrating to quantum resistant algorithms when they're mature seems like a good approach.

Miners trust and "Classic" Bitcoin attacks

MimbleWimble has the same miner trust model as Bitcoin, and the same exposure to 51% attacks and DDOS (although in the case of DDOS resistance is more implementation specific than algorithmic). MimbleWimble is more resistant to Sybil attacks than Bitcoin because it's impossible to fake the current chain state.

Light Clients

At this point, light clients are completely unspecified. However assuming a UTXO set commitment in the header and a few other sane measures, tricking a client into trusting an invalid transaction would be extremely hard.


Dollar cost averaging approach to Bitcoin investing? Are there any services offering a dollar cost averaging approach to Bitcoin investing, i.e. something like an index tracker fund which purchases a set amount on a regular basis? If not, are there any reasons why such a service can't exist:

Are there any theoretical disadvantages, i.e. anything specific about the asset which discourages this style of investing?
Are there technical limitations, e.g. is there some restriction imposed by payment bodies which would prevent making a regular payment from Paypal to Dwolla, from Dwolla to an exchange, then buying coins, in an automated fashion?

This can be done today.

Dwolla lets you send money to Mt. Gox on a schedule:
 - http://help.dwolla.com/customer/portal/articles/164379-multi-payments-schedule

You then can leave an open market order to buy bitcoins, e.g., a bid for 10,000 BTC.

The moment new funds arrive from Dwolla, Mt. Gox will attempt to execute the remaining part of the order using all USD funds available in the account and those bitcoins will be purchased at the market price at the time.

Of course, this assumed the account is not used for any other trading, as that open bid order would be triggered from any BTC sales that occur.


Force sender to include transaction fee According to this article Instant Transaction Fraud: An Explanation, SatoshiDice required all incoming transactions to include fees.  How do they do that?  I assume that they check the "fee" data from the gettransaction() call to the Bitcoin API.  But what happens if the user does not include a fee?  Does SatoshiDice reject the bet and send the bitcoins back?

They simply do not process transactions they receive without a fee. The sender loses their coins to SatoshiDice if they make this mistake.


How to generate Segwit address using bitcoind? I am using bitcoind. It generates the BTC addresses(not segregated). How to get segwit addresses? Do I have to change the settings in bitcoin.conf file?

bitcoin-cli getnewaddress  -- generates address that starts with '1'

Make sure you are using Bitcoin-core v0.16 bitcoin-cli getnetworkinfo then in your bitcoin.conf add

addresstype=bech32

As @Meshcolider comment if you want to get p2sh address you should set:

addresstype=p2sh-segwit

But I would use bech32 since bech32 produces smaller transactions than P2SH segwit transactions.

For Bitcoin-core version 0.15 send

bitcoin-cli addwitnessaddress 1BRo7qrYHMPrzdBDzfjmzteBdYAyTMXW75

to get p2sh address.


Public key for testnet address I'm trying to create a transaction on the testnet (manually). I have the following private key: cQKqSNkEdyLJziQSr4iKTUJC95s9HHFo4bY88gi2i6v2quiVVLZb which belongs to the following public address: mkhn3gfrGHmd4b1ZmHLdMsbQd2eHRKg8wN. When I try to sign the transaction, the public (uncompressed) key that I generate, is: 042d7331345e0da6ab1125eb39488a542a9923f31c585c20114d211a9f6bc9f3bf55d1d843cb7cf1d36b32d1cb00d2f140ef028e726a19a766f6ca7cef7b956583. This turns out to be invalid (because the transaction gets rejected by the network). However, when I tried using a tool for signing the transaction, it generated the following (correct) public key: 040b4a4274222d7239d33c17ce39d753eee97103773b7e5a89e62f0ef0121032d7331345e0da6ab1125eb39488a542a9923f31c585c20114d211a9f6bc9f3b.

What is the difference between these keys? How come the first one is incorrect when signing the tx but correct when I generated the public address for it?

Some observations: the priv key matches with the first compressed address (mkhn3...). It fits to the pubkey in hex, see below.
The way keys are derived is described here - see also the picture.
http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html

Once you have the pubkey in hex, there are 8 following steps to come to the final bitcoin address:

1 - Public ECDSA Key
2 - SHA-256 hash of 1
3 - RIPEMD-160 Hash of 2
4 - Adding network bytes to 3
5 - SHA-256 hash of 4
6 - SHA-256 hash of 5
7 - First four bytes of 6
8 - Adding 7 at the end of 4
9 - Base58 encoding of 8

The first uncompressed pubkey (which fits to the privkey):

  042d7331345e0da6ab1125eb39488a542a9923f31c585c20114d211a9f6bc9f3bf55d1d843cb7cf1d36b32d1cb00d2f140ef028e726a19a766f6ca7cef7b956583

would convert into this bitcoin address:

myfp2YcyYjksxmdfA74yEuBmaUgt9xWCot

and your second uncompressed pubkey

  040b4a4274222d7239d33c17ce39d753eee97103773b7e5a89e62f0ef0121032d7331345e0da6ab1125eb39488a542a9923f31c585c20114d211a9f6bc9f3b

would convert to this bitcoin address:

mmKUwoRgd9YdvRYYXGyumjduRMTAPCnkMz

I am not sure which tools you used to create your keys, it looks like you have somewhere a gap between using compressed and uncompressed keys.
A very good reference is in the online book from Andreas ("Mastering Bitcoin, 2nd edition"), which is also online readable (see chapter 4...).


More than 1000 CPU solo mining = bitcoin? If I have 1000 (or more) machines with CPU (and no GPU) solo mining (12 hours/day), will it be profitable?

Forget about the costs of electricity, etc...

I want to know if doing more than 1000 machines solo mining (CPU) will win any bitcoin?

If those are reasonably decent CPUs, they could be able to mine up to 20 Mhash/s each. Together, that's 20 Ghash/s, or the same as a small ASIC, and using massively more electricity.

As of december 2013, with the difficulty at 707408283, this means that you'd have approximately a 0.85% chance per month to win a block (worth 25 BTC).


When would I change my Ripple client's Web Socket IP and Blob vault URL? What are the scenarios (value-add businesses) that would get users to edit the default ripple client and use a custom

Web Socket IP: Port
Blob vault URL

Why even make this a configuration option?  What is the envisioned benefits?  Is this related to a "gateway"?

The blob vault URL lets you choose who you trust to hold your wallet. While the wallet is encrypted, the organization that holds your wallet could attempt to brute force your password with the only limits being their computational resources.

The selection of web socket IP and port allows you to choose what Ripple server you want to connect to. The plan is to eventually let you have multiple servers saved in your wallet.

These choices have to do with how your client connects to the Ripple network and finds out your account information and annotations. It is not related to a choice of gateways, what IOUs you wish to hold, and so on.


Is there a way to chain calls in Bitcoin core console? Is there a way to chain calls in Bitcoin core client console window like this

validateaddress (getaccountaddress "")

instead of

getaccountaddress ""
validateaddress _address from previous call_

You can use the $() syntax to execute another command and have it return its results:

validateaddress $(getaccountaddress "")

Here's the docs: http://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html#Command-Substitution