Mining algorithm in vb.net I wanted to convert the following bitcoin mining python code to VB.net (2012) and I tried to convert it's functionality, but it throws some errors and I'm stuck as I even can't get the resulting value of "header" variable.

and the final hash result should be 0000000000000000e067a478024addfecdc93628978aa52d91fabd4292982a50, but I'm no where near that.

why this produces errors, converting from hex to byte is not the correct method?

in python L is used to format it to long right?, so what does the <L & <LLL in the python code do? and is this ::-1 used to prevent overflow when reading the hex string?

and, in exp = bits >> 24 what does it do, bitwise operations?

import hashlib, struct

ver = 2
prev_block = "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717"
mrkl_root = "871714dcbae6c8193a2bb9b2a69fe1c0440399f38d94b3a0f1b447275a29978a"
time_ = 0x53058b35 # 2014-02-20 04:57:25
bits = 0x19015f53

# https://en.bitcoin.it/wiki/Difficulty
exp = bits >> 24
mant = bits & 0xffffff
target_hexstr = '%064x' % (mant * (1<<(8*(exp - 3))))
target_str = target_hexstr.decode('hex')

nonce = 0
while nonce < 0x100000000:
    header = ( struct.pack("<L", ver) + prev_block.decode('hex')[::-1] +
          mrkl_root.decode('hex')[::-1] + struct.pack("<LLL", time_, bits, nonce))
    hash = hashlib.sha256(hashlib.sha256(header).digest()).digest()
    print nonce, hash[::-1].encode('hex')
    if hash[::-1] < target_str:
        print 'success'
        break
nonce += 1

The VB.NET code I've been coding up until now is,

Public Class Form1
Dim version As Long = 0
Dim time As Integer
Dim pblock As Byte
Dim mklroot As Byte
Dim header As String
Dim nonce As Integer = 856192328

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Textbox1.Text = "2"
    Textbox2.Text = "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717"
    Textbox3.Text = "871714dcbae6c8193a2bb9b2a69fe1c0440399f38d94b3a0f1b447275a29978a"
    Textbox4.Text = "0x53058b35" '2014-02-20 04:57:25
    Textbox5.Text = "0x19015f53"

    Dim n As Int32 = T2.Text.Length - 1

    version = CLng(Textbox1.Text)
    'pblock = CByte(Textbox2.Text)
    pblock = Convert.ToByte(Convert.ToInt32(Textbox2.Text, 16))
    mklroot = Convert.ToByte(Convert.ToInt32(Textbox3.Text, 16))
    time = CInt(Textbox4.Text)

    header = version & pblock & mklroot & time & nonce
    Textbox6.Text = header

   End Sub
 End Class

Chech this explanation..
OR
TL;DR version
Assuming you came accros this site bitcoin-mining-hard-way-algorithms.
I'll show you in C# and you can convert to VB, using the same logic.
Here is the deal:
All information in a bitcoin block is hexadecimal.
So the header you are formming is compounded by:
var header = $"{ver}{prev_block}{mrkl_root}{timestamp}{bits}{nonce}";

Let's calculate each:
ver = 2

Must be converted to a 8 byte hexadecimal, but afterwards must be reversed. ( when reversing a hex string you reverse the pairs so "00-00-02" become "02-00-00";
A simple function to reverse can be as:
string reverse(string hex)
{
   char[] reverted = new char[hex.Length];
   for (int i = hex.Length - 1, j = 0; i > 0; i -= 2, j += 2)
   {
       reverted[j] = hex[i - 1];
       reverted[j + 1] = hex[i];
   }
   return new string(reverted);
}

So:
var ver = 2.ToString("X8"); // Returns a hex representation: 00000002
ver = reverse(ver); //02000000

Then:
prev_block = "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717"

Its the previous block hash of the chain, and must be reversed too.
var prev_block = reverse("000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717");

Then, the mrkl_root is calculated from 99 transaction hashes. The resulting Merkle root is (If you don't know MerkleRoot take a look in this repo: diegomary/bitcoin-merkle-root-netcore):
mrkl_root = "871714dcbae6c8193a2bb9b2a69fe1c0440399f38d94b3a0f1b447275a29978a"

And again you reverse it:
var mrkl_root = reverse("871714dcbae6c8193a2bb9b2a69fe1c0440399f38d94b3a0f1b447275a29978a")

Then the timestamp is a unixtimestamp to the date "2014-02-20 04:57:25", the timestamp value of that date is 1392872245, so you convert to hexadecimal value 53058B35, and REVERSE IT = "358b0553" (I wont put the code but you get the picture, ^^)
var timestamp= "358b0553";// # 2014-02-20 04:57:25

Then the number of bits as you can see here (https://blockchain.info/block-height/286819), is 419520339, convert to hexadecimal and you get 19015F53; And reverse it: 535f0119
var bits = "535f0119";

The nonce is a arbitrary value that you will iterate over until you get the desired final hash, in this examples was a integer value 856192328. You convert to 8 bytes hexadecimal and reverse it.
var nonce = reverse(856192328.ToString("X8"));

And that's it, if you apply the SHA256 two times over this header will give you the desired result:
var header = $"{ver}{prev_block}{mrkl_root}{timestamp}{bits}{nonce}";
byte[] a1 = Enumerable.Range(0, header.Length)
                     .Where(x => x % 2 == 0)
                     .Select(x => Convert.ToByte(header.Substring(x, 2), 16))
                     .ToArray();
var c = a1.ToArray();
SHA256 sha256 = SHA256.Create();
byte[] firstHash = sha256.ComputeHash(c);
byte[] hashOfHash = sha256.ComputeHash(firstHash);
Console.WriteLine(BitConverter.ToString(hashOfHash).Replace("-", "").ToLower()); //Output: 0000000000000000e067a478024addfecdc93628978aa52d91fabd4292982a50


What technology will supersede the BerkleyDB format? What are the current scalability limitations? How scalable is the BerkleyDB format (the technology used within a wallet), and what are its limitations?

What technology would replace or supplement BerkleyDB to address those scalability challenges?

In the next major release (probably 0.8), the reference client will most likely switch to LevelDB instead of BDB for blockchain data. For wallets, a different solution is needed, but we'll most likely move away from BDB for those too.

BDB has several problems - that's not to say it is bad software, but our use case simply doesn't match what it's designed for. BDB is intended to provide databases with extremely high reliability, in complex multi-proces environments, on high-end systems where database logs are backed up and where upgrades are performed manually by a database administrator. BDB doesn't even guarantee compatibility between its environment files between minor releases.

LevelDB - an open-source rewrite of Google's own database system - was designed for efficiency and consistency on commodity hardware, and outperforms BDB by an order of magnitude in some settings. Preliminary tests with LevelDB show very good results.

For wallets, LevelDB would be overkill and a burden. LevelDB uses an entire directory per database (instead of a single file), and wallets are effectively a simple key-value store that's loaded entirely in memory anyway. I assume wallet.dat will be replaced by some simple but solid hand-rolled format.


How do we know that a user owns multiple private keys? I am reading a data analysis paper on bitcoin, and there is a phrase I do not get:

  We use the Bitcoin transaction data set obtained from Stanford Network Analysis Project. All Bitcoin transactions are documented in a public ledger and are in the currency unit called the Bitcoin(BTC). The data set contains all Bitcoin transactions beginning from the network’s creation until April 7th, 2013. For each transaction, there can be multiple sender and receiver addresses. Furthermore, multiple addresses can belong to a single user.

I do not get this last sentence. Yes, surely a user can create multiple private keys. However, how do we know that a user created multiplie private keys if we are not that user?

The dataset given in this paper is very large (6,336,769 users), so they must apply some algorithm to group private keys belonging to each user. What it would be?

There are multiple articles available in internet which contain that paragraph. For example: http://cs229.stanford.edu/proj2014..., https://arxiv.org/pdf/1611.03942.pdf, etc
Each one seems to attribute the origin of the data to different sources, but the numbers act as a fingerprint (6,336,769 nodes and 28,143,065 edges), so it can be traced back to a work by Ivan Brugere which seems to have been available in the past, but not now, at compbio.cs.uic.edu, and from which some docs remain at github.
From them he refers to the work "An Analysis of Anonymity in the
Bitcoin System" by Fergal Reid and Martin Harrigan:

Suppose U is, at first, incomplete in the sense that each vertex represents a single public-key rather than a user and that each directed edge between a source and a target represents an input-output pair of a single transaction, where the input's public-key corresponds to the source and the output's public-key corresponds to the target. In order to perfect this network, we need to contract each subset of vertices whose corresponding public-keys belong to a single user.
... as noted by Nakamoto:
"Some linking is still unavoidable with multi-input transactions, which necessarily reveal that their inputs were owned by the same owner. The risk is that if the owner of a key is revealed, linking could reveal other transactions that belonged to the same owner."

And closing the argument, in an extensive work covering the same dataset:
Analyzing the Bitcoin Network: The First Four Years - Matthias Lischke and Benjamin Fabian, Institute of Information Systems, Humboldt-Universität zu Berlin, Spandauer Str. 1, 10178 Berlin, Germany (CC BY 4.0):

The user information is organized by the second group of files [...], where a “user” is a grouping of public keys that were used as inputs into a single transaction (user owns the private key to each address) as proposed by Reid and Harrigan. Each line [...] is a grouping of public keys as illustrated in Figure 3:


Is there any paper wallet printing tools which can print many QR codes? I'd like to print many paper wallets which have bitcoins in them. Are there any tools for it?

There are many paper wallet tools which can create and print one paper wallet.

If you use bitaddress.org, click on paper wallets, you can hide art and generate and print 7 per page on standard paper or 3 per page with art - up to the amount you need.  You would then need to xfer btc to these new accounts AFTER printing though.  For extra security, you could also use this bitaddress.org solution on a computer with no internet.  Just save the entire webpage to a thumbdrive and run it from the non-connected computer. Hope this helps.


Setting up remote bitcoin server control PHP I'm pursuing an idea for a web app I had and I've hit a road block. I've worked with many other JSON APIs using php but I've never been introduced to this RPC side of things. I've done reading but still stuck.

I've set up a local bitcoin server using the bitcoin-qt.exe -server command in windows and I've used the resulting console to receive api responses. I'm now confused about how I go about connecting my web app to that server so I can make those calls from my php file and this let users interact with the bitcoin network from the webpage.

The Bitcoin wiki is going to a great source for developing your web app. This page describes the process and makes everthing generally less confusing when using PHP.

PHP Developer Intro

You're going to need this library. To start you first connect to your node like so, the following should also print out some basic info about your node.

require_once 'jsonRPCClient.php';

$bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');

echo "<div>\n";

print_r($bitcoin->getinfo());
echo "</div>";

And to do stuff like get a new address:

$sendaddress = $bitcoin->getnewaddress();

For other commands check out the API reference.


Restore old multibit wallet I just found an old backup of a bitcoin wallet on a USB stick containing 4 folders:

key-backup - empty
rolling-backup - contains a .wallet file stamped with a date from 2014
wallet-backup - empty
wallet-unenc-backup contains a .info file and a .wallet file

The info file includes this

multiBit.info,1
walletVersion,2
property,walletDescription,Your%20wallet%20description
property,walletBackupFile, *path to the .wallet file*

Is it possible to recover this wallet? I've tried downloading multibit, but the new version needs a phrase (which i don't have) and one of the older versions needs a .key file

I run a service to crack wallet files and, yes, it is possible to recover funds from MultiBit wallet files.

Usually users password-protect their MultiBit wallet files and if this is the case and you have no idea what the password is, then typically the effort brute-force is too high.

Since this is a wide topic with many tools to use, I advice to start looking at https://github.com/gurnec/btcrecover and then google for more details. PM me if you get stuck in the process.


Why are `update_add_htlc` and `commitment_signed` separate messages? BOLT #2 indicates that a node will send one or more update_ messages before a subsequent commitment_signed.
Since it seems like sending a payment over a channel involves update_add_htlc followed by commitment_signed (without needing a response from the peer in between), why do these need to be two separate messages?

The  commitment_signed message is also used at other places to move forward channel state. The entire process is not only described in BOLT02 but also in Mastering lightning
https://github.com/lnbook/lnbook/blob/366a65b33045cbb9e95a3d4060005c240f1f1778/channel-operation.asciidoc
There you can see that after Alice sends and update_add_htlc message and a commitment_signed message Bob will later in the protocol also send a commitment_signed message so that Alice can also move forward her state. Remember Bob and Alice both have an asymmetrical version of the commitment transaction for each state and both need a signature from the other side. It would be strange if Bob replied with an update_add_htlc message to send over signatures even though he does not want to add an htlc.
So yes while signatures could have been included in the update_add_htlc message we still would have needed the  commitment_signed for Bob to reply. Also when stetteling htlcs the commitment_signed messages are needed again. I guess in that way it seems more reasonable to make the exchange of signatures explicit with its own message instead an reusing it. But of course that was a choice that could have been taken differently.


Doesn't creating a masterkey password on Kraken void the protection of 2FA? Kraken allows users to create a masterkey that is just a password. Wouldn't creating a password to bypass 2FA completely negate 2FA?

Yes. Your right.

A lot of 2FA/U2F enabled websites/webservices have such "recovery" methods.
2FA/U2F only works in the right way when you can't recover your login credentials if your second factor has been lost/not-available.


Lost money with Bitcoin Core wallet I was sent $750 worth of BTC on 11/29/17. On 1/7/18, I finally got to 11/29/17 while syncing the blockchain to the core wallet and my coin arrived. However, on 1/7/18 I tried to send part of it to the Bread wallet and the rest to an online site. The Core wallet debited the coin and I was expecting that when it synced to 1/7/18 the money would arrive to those places. However, the blockchain has passed 1/7/18 and my coin has not reached the receivers.

These are the transactions that have not arrived:

https://blockchain.info/address/15x75nezMGZvF9KS4DxnSoJ33gdDy8C72a
https://blockchain.info/address/1FymHcBdWnoHtecA2qEkbwYpTzAJqDiNjc

You linked adresses. Not transaction ID's.

It seems to me that you A. either failed to broadcast your transaction, or B. you broadcasted it with a fee that was so low that nodes eventually dropped your transaction.

( Or maybe your coins got double spend?)

A is much more likely. Are you sure you are spending the right outputs? I can't really give a solution other then that you should try to simply rebroadcast your transaction with the information i currently have.


Why is there going to be only 21 million bitcoins in circulation? Bitcoin production will stop at 21 million bitcoins. Why 21 million and why was the limit put in place?

By limiting the amount of bit coin in the market one can hedge against inflation and avoid the firey demise coming to the rest of the world's fiat currencies. Though bit coin is not backed by any "hard money" it has a natural scarcity that will help keep its value consistent.


How to upgrade a Trezor device without wallet.trezor.io? How to update a Trezor device without the Trezor backend?

The Trezor backend at wallet.trezor.io is suboptimal from a privacy perspective. Many people choose to use Electrum, Wasabi or any other wallet that offers more privacy.

The Trezor Android app may be able to upgrade a Trezor wallet this but it didn't do anything for me plus it's unclear whether it sends your XPUB to Trezor's servers anyway. So is it possible to update a Trezor hardware wallet without going to wallet.trezor.io or the Trezor Android app, and if so, how?

It is possible to use the trezor command line client trezorctl available here to install a firmware you downloaded from trezor as described in the developer docs here.

BE SURE YOU HAVE A BACKUP OF YOUR SEED

"1) Pick version of firmware binary listed on https://wallet.trezor.io/data/firmware/1/releases.json
2) Download it: wget -O trezor.signed.bin https://wallet.trezor.io/data/firmware/1/trezor-1.6.1.bin
3) Use trezorctl dry-run mode to get the firmware fingerprint:

trezorctl firmware-update -n -f trezor.signed.bin

Step 3 should produce the same fingerprint like your local build (for the same version tag)."

Then it can be installed from the command line:

WARNING: This will erase the recovery seed stored on the device! You should never do this on Trezor that contains coins!

Build with MEMORY_PROTECT=0 or you will get a hard fault on your device.

Switch your device to bootloader mode, then execute:

trezorctl firmware-update -f path/to/firmware.bin


How do I get BTC out of my Multibit wallet? I have BTC in an old Multibit wallet.  Multibit is no longer support and the problem is you cannot set TX fees.  The standard fees are too low given the current state of the network.  What can I do to get my BTC out?  Is there another software wallet that will let me import my Multibit key?

Also, I tried to send via Multibit a few days ago, but it's not showing up on blockchain.info or blockexplorer.com.  If I do import my private key to another software or online wallet, will it mess anything up being that there is a pending send tx in my Multibit wallet?

You will need to move your coins to something like Electrum. Give these tutorials a try perhaps:

https://www.youtube.com/watch?v=E-KcY6KUVnY
https://www.youtube.com/watch?v=LaijbTcxsv8


How can some exchanges/services afford to pay for customers transaction fees? Some exchanges and services (e.g. CoinBase, Bitstamp) pay for the transaction fees for their customers when the customers send bitcoins from their wallet/account.

They might have tens of thousands of transactions going out of customers wallets everyday. The 0.0001btc fees might add up really quickly and become a large cost to them.

Are they making transactions wait so that they can send to many at once? If they have enough transactions going out this might work as the customer won't feel a few seconds of delay.

Or do they create a unique transaction for each? If so, how can they afford it?

They can avoid the fees in two ways.

First, they can choose to batch multiple small transactions together into a single transaction with multiple outputs.

Second, since they have a large pool of bitcoins, they can more easily form transactions that qualify to be free transactions, for payouts over 0.01 BTC.

The most efficient way to form these free transactions would be to make a transaction that's nearly 1000 bytes, and is sent from inputs that destroy 4 Bitcoin days (e.g. a 4-day old 1 BTC input, or 2-day old 2 BTC input). This will ensure that it meets the priority requirements.


Can somebody provide me with the $price per GHps in mining since the old CPU days til present pre-orders? Can somebody provide me with the $price per GHps in mining since the old CPU days til present pre-orders?
I don't mean energy usage or price vs price of btc.. simply hardware costs relative to how fast they hash.

There isn't really a good way of measuring that in the early days. When CPU mining was actually doable, people would just use hardware they had. It didn't necessarily "cost" them anything. Even with GPU mining it's hard to estimate GH/s/$ because these weren't made for mining.


How can I import the Mini Private Key of a physical coin? I have a physical Litecoin based on a Casacius Bitcoin. I have the public key and see that the Litecoins are there.

Peeling back the seal/sticker revealed a Mini Private Key, but I'm having trouble importing it into Litecoin Core, importprivkey(…) gives me the error message Invalid private key encoding (code -5).

What do I need to do to import the Mini Private Key?

You must convert the mini-private-keys to regular private-key format before being able to import them in wallets such as Litecoin-core. If your keys are based on "Casascius" then you could use liteaddress.org (fork of bitaddress.org) to do the conversion. Follow these steps:

In order to be safe download the source code from https://github.com/litecoin-project/liteaddress.org and run it on an offline and clean computer. That way you can be sure that the code you are running is actually what was shown on GitHub and running offline helps to keep your private keys safe from malwares, keyloggers,...
Run the file called bitaddress.org.html (it is not renamed to liteaddress!)
Move your mouse around (you have to, then you can ignore the result)
Click on the tab called "Wallet Details" and paste your minikey in the first box can click "View Details" button.
Depending on which address has balance (compressed or uncompressed) copy the respective private key at the bottom and import that in litecoin-core


When I specify wallet in bitcoin.conf for testnet3, it gets ignored I have a question about specifying wallet for testnet3. My bitcoin.conf file is located in the root of the Bitcoin folder with the line 'wallet = receiving.dat as well as testnet=1. Whenever I run 'getwalletinfo' tho it still shows no name for the walletname and if I delete the default wallet.dat, it autoregenerates. This is on version 0.18.0.

This is answered by Can't specify rpcport for testnet but it comes from an issue in the 0.17.XX change where options need to be specified by network type.


Lightning networks revocable commitments: unilaterally closing could cause funds lost forever? If I understands correctly, A and B will exchange their revocation key once they are ready to move to the next state. What happens if B received the revocation key and decided to close the channel unilaterally without broadcasting the transaction. This way B can never get his funds, but A can never get his funds as well. Because A can not broadcast his transaction since B has his revocation key. Isn't it a huge risk for A?

What happens if B received the revocation key and decided to close the channel unilaterally without broadcasting the transaction

By definition, channels are only closed once a commitment transaction or the closing transaction is broadcast. So B cannot close the channel; he simply withholds data from A.

Your scenario is not possible because A will only give B the revocation key once both B has given A his new commitment transaction. So if B refuses to give A the revocation key to his commitment transaction, then A can close the channel by broadcast the previous commitment transaction which has not yet been revoked.


Genesis block coinbase transaction without confirmations Why the coinbase transaction, comming from the genesis block, don't have confirmations?

All the others coinbase transactions have confirmations, but not in the Genesis block.

Transaction confirmation is an external concept which tells you how difficult it is (in terms of probability) to remove that transaction from  the block that contains it due to reorganization of the blockchain.

Genesis block transaction is a special one as it is hardcoded in the source code and the entire Bitcoin blockchain is built on top of the Genesis block. Confirmation concept does not apply because you cannot remove this transaction from the Genesis block, as you will be building a completely different chain if you do so.

As a side note, the coinbase transaction is also not spendable.


Ironically, encryption is not an important part of bitcoin (?) The above statement is taken out of a book which I've been reading: Mastering Bitcoin 2nd Edition.

  ...as its communications and transaction data are not encrypted and do
  not need to be encrypted to protect the funds...

Just started about bitcoin, going through the third chapter and when I come across the above lines, I merely struck by one question, and that is, if the communication happens between (peers' / wallet to bitcoin network) is not encrypted...then I am just thinking a scenario

X is sending BTC to Z (obviously by mentioning Z's address in txn)

Y (bad guy) cuts in the communication which is not encrypted (as per the above reading) and tampers the transaction that X has been sent ( by Just putting his address in beneficiary )

I mean, honestly, it is a very naive scenario that anyone could think of and I know there would be something in bitcoin (which I am not aware of) could prevent this from happening, so, giving clarification on how this kind of attacks being handled or mitigated in Bitcoin would be much helpful for this post.

Cryptography and Encryption

In the wider world, cryptography is used for a variety of security related purposes:

Authentication (proof of identity, or proof of ownership)
Non-repudiation (author cannot later deny authorship of data)
Confidentiality (secrecy - third parties can't see the data)
Integrity (proof that data has not been changed or tampered with)

When we say "encryption" without clarifying further, we are usually talking about the use of cryptography to ensure confidentiality (secrecy of data, but not secrecy of a transmission having occurred - the latter might involve steganography or private channels etc).

Bitcoin's peer-to-peer protocol doesn't need secrecy but it does need a form of authentication and integrity proof that is provided by digital-signatures.

Traditionally digital-signature algorithms used RSA which involves encrypting a hash of data but not encrypting the data itself. Bitcoin uses Elliptic Curve cryptography which produces digital signatures without involving encryption of a hash.

So the author is perhaps pointing out that the data sent by Bitcoin peer-to-peer protocols is not encrypted for confidentiality and does not involve encryption.

Terminology

The word crypto-graphy literally means hidden writing. There is a certain irony in using this term for elliptic curve cryptography which cannot directly be used for hiding the text of messages - what many people mean by encryption is the process of converting normal readable plaintext into unreadable ciphertext.


How much testing is done on each pull request before it is merged? Frequently after one pull request is merged, multiple other pull requests follow to clean up a problem created by the first PR

Recent example:
https://github.com/bitcoin/bitcoin/pull/7957

https://github.com/bitcoin/bitcoin/pull/8164
https://github.com/bitcoin/bitcoin/pull/8171

Normally no real harm is done. Is this no big deal or a sign that more testing should be done before Bitcoin pull requests are merged?

Each pull request usually isn't that big, so it's not hard to look through every line of code. Each pull goes through meticulous testing, in case of any malicious code or an unintended flaw. Why do you think it takes usually more than one month after the pull is made to get added, even though there is alot of discussion in the comments?


Spending BTC from an Electrum watch-only paper wallet? I've an old BIP-38 paper wallet, and I imported that address into an Electrum (version 3.3.6) watch-only wallet.

I now want to transfer that BTC to an Exchange. I have the relevant password for the Electrum wallet and private key for the paper wallet and I've checked on a block explorer that the balance at that address is correct and it is.

Question: How do I spend from that Electrum watch-only wallet?

If I open Electum I'm only given an Export option (and from there select amount, select fee, preview, copy display where I end up with a type of report on amount sent, size of transaction, fee, locktime, inputs and outputs

I followed this option, but nothing is happening. Btc is still at my address and not at the Exchange's address and its been a while and the fee was set to max.

Where to from here? Any advice?

(PS: I see advice here to sweep the paper wallet address into the Electum wallet but I understand that would incur a transaction fee, and seeings that I'm going to send that BTC to an Exchange and that transaction would also cost fees - so I don't want to go that route :) )

ty

As you know, it isn't possible to spend money using a wallet that doesn't contain the relevant private-key. Your watch-only wallet cannot be used for spending.
See https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/
In brief it says

These instructions are for Electrum 3.0 and later.
You cannot import private keys into an existing HD wallet.
Start new electrum wallet file
Click on next to see the wallet type selection window:
select “Import bitcoin addresses or private keys”.
Enter one private key per line. Electrum supports mini private keys and full sized keys in Wallet Import Format (WIF).

You may need to convert your BIP-38 data into WIF first.
It is worth reading their notes on why you might prefer sweeping to importing despite the transaction fees involved.


What is the correct use of the term "validating"? First, in the Bitcoin context what does validating mean?

Second, is it incorrect to say something like

  " the average time it takes to validate a block by the network is 10 minutes."

The way, I understand it,  validating is a split second procedure. Or am I confusing things. What is incorrect?

A bitcoin transaction is valid if it conforms to all of the bitcoin protocol rules. Likewise, a block is valid if it conforms to all of the bitcoin protocol rules (including: all of the transactions it contains are valid).

‘Validation’ of a block or transaction happens at the level of each individual node (miners and regular nodes alike). Validating a transaction or block is not that computationally expensive, in fact the protocol is designed so that fairly inexpensive hardware is capable of being a node (ie, your average computer can validate hundreds, or thousands of transactions per second).

Upon hearing about a new transaction or block, each node will quickly validate that it conforms to the network’s rules. If it is valid, that node may relay the transaction/block to its peers. If it is not valid, the node will reject that transaction/block, and not add it to the node’s mempool/blockchain.

  the average time it takes to validate a block by the network is 10 minutes.

This is not quite technically correct, I would rewrite it to say:

  the average time it takes for miners to find a new block on the network is ten minutes. Each block ‘confirms’ all transactions it contains. As the new block is transmitted across the network, each node will check it (and all of its transactions) to ensure they are valid according to the protocol’s rules.


Are there any cryptocurrencies with no mining beyond participation? I mean something where just participation in the decentralized network gives you coins somehow and you cannot do anything beyond (excluding more participation, of course, by having multiple PCs and IPs, for example) to increase the rate of achieving those coins. At the moment I have completely no motivation to leave my bitcoin or litecoin client on, because it doesn't gives me anything back for using me as a node in this network of hardcore miners. I'd rather find some ways to use it occasionally only when I need to do some transactions (few times a month, for example). I'm newbie in this topic, but doesn't this harm the network, when lot of people become using it this way?

On Bitcoin and Red Balloons suggests a method to incentivize network nodes, however no cryptocurrency implements it.


connect watching wallet with blockchain i have created watch wallet
Wallet wallet = Wallet.fromWatchingKeyB58(params, tPub, DeterministicHierarchy.BIP32_STANDARDISATION_TIME_SECS);
How can i link this with block chain
i am using WalletAppKit class

kit = new WalletAppKit(params, walletFile, APP_NAME);
kit.startAsync(); kit.awaitRunning();

after that i add wallet in PeerGroup kit.peerGroup().addWallet(wallet)
after that i print address of a wallet System.out.println(kit.wallet().currentReceiveAddress());
but this address and System.out.println(wallet.currentReceiveAddress());
this is not same.
i am using bitcoinj for this, i have sent multiple transaction on wallet.currentReceiveAddress()
but did not receive any of them, i don't know what i am doing wrong here, kindly help!

i have done this by overriding methods of WalletAppkit and its working fine now,
here is code sample for this.

  kit = new WalletAppKit(params, walletFile, APP_NAME) {
            @Override
            protected Wallet createWallet() {
                System.out.println("I am here");
                Wallet wallet = Wallet.fromWatchingKeyB58(params, tPub, DeterministicHierarchy.BIP32_STANDARDISATION_TIME_SECS);
                return wallet;
            }
@Override
        protected void onSetupCompleted() {
            super.onSetupCompleted();
            System.out.println(kit.wallet().currentReceiveAddress());
            System.out.println(kit.wallet().getTotalReceived().toFriendlyString());
            txHistory();

            kit.wallet().addEventListener(new AbstractWalletEventListener() {
                @Override
                public void onWalletChanged(Wallet wallet) {
                    System.out.println(kit.wallet().getTotalReceived());
                }
            });
        }


What is the queue position? I have an unconfirmed transaction. (As an experiment, I didn't add a transaction fee, and the transaction is taking a lot of time to confirm.) This is some information from blockchain.info regarding the transaction:

The info "queue position 427" caught my eye. What exactly is the queue position?

It is most likely (blockchain may figure this out differently) the priority of the transaction compared to others. Nodes add highest priority transaction and repeat until they reach the block size limit.

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

priority = sum(input_value_in_base_units * input_age)/size_in_bytes


How do I import an Electrum wallet into BitcoinJ? I'm trying to create a BitcoinJ-based app that watches an existing wallet (created in Electrum) and does things when transactions come through against that wallet.

As I understand it, I need to create a BitcoinJ wallet by feeding it my Electrum wallet's "Watching Key", and it appears that, to do this, I need to somehow load my Electrum wallet into BitcoinJ so that I can call getWatchingKey() on it.

The problem is that I cannot sort out how to import my Electrum wallet into BitcoinJ - I have BIP32-formatted public and private keystrings (from testnet, so they start with tpub and tpriv respectively), but I simply cannot sort out how to convert these strings into a Wallet object in BitcoinJ. Any help would be greatly appreciated.

EDIT

Alternatively, I could import the Key by using the Seed...but I'm supposed to supply the Seed's creation time (in Unix form)...what is that information used for? I don't have it, so I've been working under the assumption that I cannot use the Seed.

As stated in https://bitcoinj.github.io/working-with-the-wallet:

"The “watching key” in this case is the public form of the BIP32 account zero key i.e. it’s the first key derived from the master."

I also thought it was the master public key, but it is the first (or 0th) derived key.

Hope this helps.

EDIT:

To answer your last question, the seed's creation time is used as a hint to BitcoinJ as to when it should start searching for transactions. If you have access to your first transaction on your Electrum wallet, use that approximate time.


"Relay fee" error when sending funds from one account to another I have a problem with bitcoin in sending payments from one user to another user. When I try to send, I get the error txfee cannot be less than min relay tx fee (0.00001000 BTC/kB).
Please help with possible solutions

You need to increase your transaction fee to meet the minimums required by the node you are connected to. If you use a fee below that, the node (and other nodes on the network) will refuse to broadcast your transactions, preventing them from reaching miners.


Bitcoind --reindex vs starting allover again I setup a Bitcoin Daemon on a VM hosted on an OpenStack cloud. VM has 8 Cores and 32GB of Ram and 20GB of storage. I mounted a 1TB volume into the .Bitcoin/blocks folder. I started bitcoind and it downloaded about 139GB of the chain.
I was working on the web stuff when i accidentally restarted the VM.

"error: Could not locate RPC credentials. No authentication cookie could be
found, and no rpcpassword is set in the configuration file
(/home/ubuntu/.bitcoin/bitcoin.conf)"

bitcoind -rescan
: Error loading block database.

and bitcoind -reindex takes really long time and is still processing. The 138GB are untouched but it looks like --reindex is changing the files in /index.

What will be faster? deleting the 138GB of blockchain and starting bitcoind -daemon all over or bitcoind --reindex

bitcoind --reindex will be faster because starting over from scratch would not only do all the work bitcoind --reindex is doing, but it'd also have to go out and re-download all those blocks too.


How can I move BTC wallet and funds from Block.io? Unfortunately I can't access dashboard on block.io for some unknown reason. I get the following message from block.io

  We're sorry, but something went wrong. If you are the application owner check the logs for more information.

I have private keys from block.io. I want to transfer the funds in block.io to another address.

That error message suggests that there may be a short term problem inside the systems operated by Bitcoin.io, in which case I would just retry every day or so.

Clause 5.1.2 of their user agreement says

  When you create a Wallet, the Wallet software generates a cryptographic private and public key pair that you may use to send and receive any supported Virtual Currency via the relevant Virtual Currency network. You are solely responsible for storing, outside of the Services, a backup of any Wallet, private key or transaction information that you maintain in your Wallet or otherwise with the Services. If you do not maintain a backup of your Wallet data outside of the Services, you will be may not be able to access Virtual Currency previously accessed using your Wallet in the event that we discontinue or no longer offer some or all of the Services or may otherwise lose access to Virtual Currency. We are not responsible for maintaining this data on your behalf.

If you have the private keys in a known format, you should be able to import them or sweep them into a normal Bitcoin wallet

How do I import a private key into Bitcoin-Core?
Electrum 2.x sweep feature

etc.

Please read about the advantages and disadvantages of importing vs sweeping and differences between full-node and SPV wallets.


Bitcoin spend before received When browsing the blockchain.info I came across this address. It seemed peculiar to me, that the amount of 0.6 BTCs has allegedly been spend before received.

Is it because the "receiving transaction" somehow occurred in a side-chain and has only afterwards been merged into the Blockchain? Or what other explanations might there be for this behavior?

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

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

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


In what year and in which Bitcoin improvement proposal Opcodes such as OP_MODE have been disabled? On Bitcoin wiki several opcodes are listed as "disabled".
My question is simple: which Bitcoin improvement proposal proposed to disable them, and when they have effectively been disabled in the past?
I'm particularly interested in the OP_MOD arithmetic opcode.

It appears many unused opcodes were disabled in 2010 for security reasons (at least OP_CAT) or as a security precaution (many others).
Pseudonymous commented that the first BIPs didn't start until 2011 - a year later.


Was the time warp attack the only reason it was not safe to compare chains by length? One of the weaknesses of bitcoin listed on that wiki is that it was once vulnerable to the time warp attack. This attack lets a miner with >50% of the hash power to solve many more blocks in a short amount of time, essentially gaining a higher than appropriate reward. It can also be used to create a chain that is extremely long very quickly while keeping the difficulty low.

Was the time warp attack the only reason it was not safe to compare chains by length? Asked a different way, if the time warp bug was fixed in bitcoin, would comparing chains by length always produce the same result as comparing by work done?

Relevant: Theymos suggests in this answer:

  Satoshi didn't initially realize that choosing the correct chain by just counting blocks allows for some extremely easy attacks. Version 0.1 just counted blocks. That's why the paper just says "longest". The idea of "chain work" was added a little later.

If the time warp bug was fixed in bitcoin, would comparing chains by length always produce the same result as comparing by work done?

No.  It's easy to create a chain with more chainwork but fewer blocks.  For example, lets say we have a chain with 2,016 difficulty 1 blocks.  This chain is created in 20,160 minutes so the difficulty doesn't change next period, meaning that by block 4,032 we have 4032diff chainwork:

  2016 *  diff1 == 2016diff
+ 2016 *  diff1 == 2016diff
--------------------------
  4032 blocks with 4032diff

Then somebody mines an alternative chain with mining equipment that's 4 times faster, producing the first 2,016 blocks in 5,040 minutes.  Difficulty increases to 4 and by block 2,521 this chain has more chain work but less blocks than the first-described chain.

  2016 *  diff1 == 2016diff
+  505 *  diff4 == 2020diff
--------------------------
  2521 blocks with 4036diff

I assume you're more interested in practical attacks against Bitcoin's mainnet chain if that chain still used longest-is-best logic.  Here's an easy one:

The Genesis Block is dated 3 January 2009.  If you mined only difficulty 1 blocks from then until now (144 blocks a day), you'd have about (144*365*6)+(30*144)==319680 blocks.
The "real" block chain has 342,908 blocks, a 23,228 block difference.
Because difficulty can only increase 4x in a single 2,016-block period, mining 23,228 blocks would only requiring going from difficulty 1 to difficulty 4**(23228 / 2016) == 4194304.
Although difficulty 4,194,304 sounds high.  Current mainnet difficulty is 44,455,415,962.  So, if I did my math right, you can create a chain longer than mainnet with roughly 0.001% of the current network hashrate.


Sensitive information stored in contracts Is it a good idea to store some sensitive data on the blockchain contracts? For instance, i want to make a contract that stores vouchers (that cost real $$) and once the user pays to the contract for the voucher, the voucher is sent to the user. Let's imagine that the vouchers are just random numbers. Are the vouchers secure on the contract in this case?
I'm asking this because i've seen some controversial claims about sensitive data posted on blockchain. First one being the public image that everything is public on the blockchain, hence how the blocks are being validated. The second being that data is secure and strongly hashed which makes me wonder if this type of contract can work out. Thanks in advance, I'm new to blockchains and very interested in learning about this technology.

Data in the blockchain is public and everyone can see it.

It is "secure" in the sense that it is computationally very difficult to modify the data later, without making it obvious that you have done so.  It is also unlikely to be deleted, since a large number of computers store the entire blockchain.

The hashing provides a certificate that a large amount of computation was done using this particular data.  Someone who wants to claim that they have the authentic data would have to do even more computation.  But the hashing does not encrypt the data in any way; the data itself remains perfectly readable (in fact, this is essential to being able to verify it).

So such data is "secure" against tampering or loss, but not against being read.


Bitcoin script example Is there some good example on how to process a basic tx's scriptsig and get the recipient's address from the raw transaction?

In the output there is a field "scriptPubKey" that for a standard transaction looks like this:

OP_DUP OP_HASH160 62e907b15cbf27d5425399ebf6f0fb50ebb88f18 OP_EQUALVERIFY OP_CHECKSIG

The hex number is what you get the address from; this is the result of step #3 in https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses. To get the address continue the process in that example. (Though, arguably the hardest part is calculating Base58Check, for which an example is not given.)

Also relevant is https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address.


Why is Script needed? As I see it, the script feature is one of the most complicated features in the entire protocol. It features

$ cat src/script.h|grep '^ *OP_'|wc -l
118

instructions, and requires a stack to calculate.

The most important limitation, it makes it complicated to answer a simple and common question - "how much bitcoins does my key have".

With a complicated script, a bug in the script engine is more likely, and thus, it is possible that the network will split (50% client accept this transaction, 50% do not, before you notice, you have two long block chains. One longer which is considered invalid by 50% of the clients, and one shorter, considered valid by both).

What's the rational behind such a system? Why can't any transaction be simply "move X BTC from key K to key I signed by private key K"?

(If indeed you want anything complex - do that in a different system, and not inside bitcoins block).

Why can't any transaction be simply "move X BTC from key K to key I signed by private key K"?

Then you couldn't (easily) do the P2SH stuff being implemented right now without getting everyone to upgrade. You also couldn't do escrow, multisig, secure cross-chain trading, secure high-frequency trading, etc. These features are very valuable; Script-based escrow, for example, will be the first escrow system ever which requires no trust in third-parties.

Script is, in my opinion, one of the greatest innovations in Bitcoin. I would prefer a much more powerful, Turing-complete version of Script in Bitcoin, actually.


Are there any "slow" sidechains? What are the tradeoffs? Are there any examples of sidechains which target a block time much longer than bitcoin? Could a sidechain be made "slow enough" such that the size of a proof (SPV proof?) for it could actually fit into and be verified by a mainchain bitcoin transaction with the currently-in-effect mainchain protocol rules?

I'm interested in learning more about how a sidechain with a targeted time between blocks of, say, 1 week, might work and/or if such a chain, if it existed, could be useful.

I'm specifically interested in proof-of-work sidechains that do not rely on any sort of federation (as such, Liquid and RSK would not meet this criteria at the moment, but I'm unaware of any other current examples of bitcoin sidechains), and I'm most interested in "slow sidechains," if any exist.

Are there any "slow" sidechains?

Softchains fit this definition. Softchains are a type of sidechain that are verified by all mainchain users in a slow but extremely resource-efficient way, by only validating the blocks for which forks occur. It's slow, because you can't assume these forks will occur right away. People who want to actively use the softchain perform full validation, which means consensus will be fast for them.

What are the tradeoffs?

These softchains are not fully decoupled from the mainchain. Creating a new softchain requires a soft fork, and softchain consensus could negatively affect mainchain consensus under some scenarios (software bugs, one-year reorgs). Furthermore, mainchain validation cost goes up by roughly 100MB per softchain per year (which could be compensated for with a mainchain block size decrease).
The above is just a high-level overview.
For a relatively easy-to-follow explanation, I recommend listening to this podcast:
https://youtu.be/4c7cwTts3fo?t=1m45s
And the full details are in this write-up:
https://gist.github.com/RubenSomsen/7ecf7f13dc2496aa7eed8815a02f13d1


Gridseed Mac OSX software Where can I find information on running a Gridseed miner on Mac OSX? Either BTC and/or LTC.

I'm looking for rather consistent information, by this I mean instructions with links that point to the software that works with the instructions or at least specifies the version of the software. One problem I see is that instructions are created and then the software is updated and no longer matched the instructions.

You can use MacMiner, either the CPU miner window for scrypt mode or the FPGA/ASIC window for BTC mode and the GPU window for dual mode - the last two both use bfgminer
There's more information here and Mac mining forums here with lots of detailed info in some of the gridseed posts.


Is there an altcoin that is only feasible to mine by CPU? I'm interested in mining altcoins, mainly to turn some servers into (literal) space heaters, since it's winter. One thing that really interests me is if an altcoin has been designed to only be mineable by traditional CPUs. The big thing I can think of to cause this is large memory requirements. A large memory requirement for hash processing would cause current GPUs to be slower than CPUs (due to the individual "cores" of the GPU not having enough direct memory). It would also cause ASICs and FPGAs to be very difficult to develop to be faster than CPUs, and expensive. This is because you effectively reduce the mining complexity so that it bottlenecks at the memory bus (which is much harder to significantly speed up)

I'm sure I'm not the only one to have thought of such a scheme. Is there an altcoin out there that is designed with this kind of ideal behind mining?

Litecoin is the 2nd most popular currency in the same family as Bitcoin, and:

  It is based on the Bitcoin protocol but differs from Bitcoin in that
  it can be efficiently mined with consumer-grade hardware. Litecoin
  provides faster transaction confirmations (2.5 minutes on average) and
  uses a memory-hard, scrypt-based mining proof-of-work algorithm to
  target the regular computers with GPUs most people already have.

https://litecoin.org/

The intention was to allow CPU mining to be viable, but according to Wikipedia it hasn't quite met this goal:

  Litecoin uses scrypt in its proof-of-work algorithm: a sequential
  memory-hard function first conceived by Colin Percival.[14] The
  original intended benefit of using scrypt was to avoid giving
  advantage to GPU, FPGA and ASIC miners over CPU miners, which occurs
  in the Bitcoin protocol. However, this turned out to be an incorrect
  assumption: GPU mining in Litecoin's implementation of scrypt is
  currently ten times more efficient than CPU mining

http://en.wikipedia.org/wiki/Litecoin


Is there a way to disable a blockchain validation? I installed Bitcoin Full Node on Raspberry pi 3b+. Blockchain sync is dead slow because of less CPU. I Guess blockchain validation is time/CPU consuming thing. Is there a way to disable the validation and just download the chain? I understand the consequences. If my peers send wrong data, I will end up using wrong data. But I don't have an alternative. RPC calls are dead slow right now. I just need data to write some code.

It you just want to test your code with the Bitcoin Core RPC calls, you can use regtest mode by starting Bitcoin Core with -regtest. This mode sets up a private testing network so there is no need to sync the blockchain or connect to other peers unless you set up other peers to connect to. You can mine your own blocks in this mode too so blocks are produced when you want them.


How could an inflation bug be spotted in grin? Looking at the transactions within the block explorer I can't see any transaction amounts. How could an inflation bug be detected if all transactions are private?

Range proofs for CTs demonstrate that output amounts are positive and within an allowable range, and that no inflation is occuring in a non-coinbase transaction.

The range proofs (eg bulletproofs) are computationally binding.

If the discrete log is broken, range proofs can be generated for values outside the correct range without any way to detect this. This includes correctly validating proofs for a tx with inflation.


'The node is not in a connected state' error when trying to execute OP_RETURN transaction with NBitcoin This is my first time trying out the NBitcoin library to create a transaction. I am trying to create an OP_RETURN transaction, but every time I try to execute the Version Handshake with the node I get the error: The node is not in a connected state.

This is self explanatory, but I've tried a number of what are considered reliable nodes.

I guess this is a four part question:

When attempting an OP_RETURN transaction in NBitcoin, is it necessary to add the miner fees into the TransactionBuilder manually?
Is there a way to use Node.Connect so it will just search for available nodes, rather than specifying a specific node?
Is it an issue that I have the OP_RETURN and not anything else? Do I need to create another output with no value and add the miner fees in order to send it? There are libraries in PHP, Python, and Javascript to do this, but I am trying to figure out how to do this with NBitcoin.
If I wanted to store the incoming hash in the OP_RETURN script, am I doing it correctly? The byte stream seems to be too long.

Heres my code, which is in a .NET MVC4 Controller Action:

[HttpPost]
public ActionResult NewTransaction(string hash)
{
        var paymentSecret = new BitcoinSecret("//Private Key");
        // Example hash is "45e114a7f2c6122c9c1dabbd4df187e66545c17ca0bd28de732499dbee476811"
        var message = hash;
        var bytes = Encoding.UTF8.GetBytes(message);
        var blockr = new BlockrTransactionRepository();
        var fundingTransaction = blockr.Get("60db94bfb43dd0d98ba7fdfbbg4f29a850f7s5ea7d79a32c4r954096f2945b04");
        var payment = new Transaction();

        payment.Inputs.Add(new TxIn()
        {
            PrevOut = new OutPoint(fundingTransaction.GetHash(), 1)
        });

        payment.Outputs.Add(new TxOut()
        {
            Value = Money.Zero,
            ScriptPubKey = TxNullDataTemplate.Instance.GenerateScriptPubKey(bytes)
        });

        payment.Inputs[0].ScriptSig = paymentSecret.ScriptPubKey;
        payment.Sign(paymentSecret, false);

        using (var node = Node.Connect(Network.Main, "67.221.193.55", new NodeConnectionParameters()
        {
            IsTrusted = true,
            IsRelay = false
        }))
        {
            // Always fails on the handshake
            node.VersionHandshake();
            node.SendMessage(new InvPayload(InventoryType.MSG_TX, payment.GetHash()));
            node.SendMessage(new TxPayload(payment));
            Thread.Sleep(500);
        }
        return View("Index");
}

EDIT

I tried to actually use the TransactionBuilder, but still came up with the same error. This time I am actually setting the fee amount. I am also using a different node and specifying the port. Here is the attempt:

var paymentSecret = new BitcoinSecret("//Private Key");
// Example hash is "45e114a7f2c6122c9c1dabbd4df187e66545c17ca0bd28de732499dbee476811"
var message = hash;
var bytes = Encoding.UTF8.GetBytes(message);

var funding = new Transaction()
{
    Outputs =
    {
        new TxOut("0.01", paymentSecret.GetAddress())
    }
};

var coins = funding
                .Outputs
                .Select((o, i) => new Coin(new OutPoint(funding.GetHash(), i), o))
                .ToArray();

var txBuilder = new TransactionBuilder();
var tx = txBuilder
            .AddCoins(coins)
            .AddKeys(paymentSecret.PrivateKey)
            .Send(TxNullDataTemplate.Instance.GenerateScriptPubKey(bytes), Money.Zero)
            .SendFees("0.00001")
            .SetChange(paymentSecret.PubKey)
            .BuildTransaction(true);

txBuilder.Verify(tx);

using (var node = Node.Connect(Network.Main, "67.221.193.55:8333", new NodeConnectionParameters()
{
    IsTrusted = true,
    IsRelay = false
}))
{
    node.VersionHandshake();
    node.SendMessage(new InvPayload(InventoryType.MSG_TX, tx.GetHash()));
    node.SendMessage(new TxPayload(tx));
    Thread.Sleep(500);
 }

Could anyone help out. There is a lack of documentation specifying how to conduct an OP_RETURN transaction. Thanks.

I think the problem is that there is only OP_RETURN, I remember seeing in the Bitcoin code that only OP_RETURN without anything else is forbidden.

Except that, your code looks like what is in my book
https://blockchainprogramming.azurewebsites.net/ so I'm almost sure it is the problem.

EDIT : You are crashing during Handshake, can you check Node.DisconnectReason ?


How is 'scrypt' pronounced? Please help me end this argument.

How is 'scrypt' pronounced?

Could it be pronounced "script"? "Es Crypt"? "skriped"?

Thank you.

The most common pronunciation I have heard is /skript/


How does the network know the legitimate chain in a double-spend attempt? Apologies if this has been covered, but there's one area of the Bitcoin network that is not clear in my head, and it's intimately linked to the double-spend problem.

Suppose Person A is purchasing an item in a store.  They "pay" Person B 1 BTC for a good and broadcast this transaction to the network, which Person B sees as unconfirmed.  The transaction is included in a block (Block 1) whose Proof of Work is now being found/solved.

Suppose Person A controls 30% of the Bitcoin mining network (arbitrary high proportion), and has his miners instead mine a different block (Block 2) containing a transaction spending the same BTC to a different wallet controlled by Person A.

Suppose the Proof of Work for Block 2 is, against the odds, obtained first, and the "corrupt" miner who finds the requisite hash broadcasts it to the entire bitcoin network.  This is where my understanding breaks down.  What exactly happens when the remaining 70% see this transaction?  Do they stop mining Block 1?  At what point can Block 1 be orphaned?

Imagine the blockchain as... a chain of blocks

The situation is:

A -> B -> C
      \-> C'

But some nodes see it as  A -> B -> C and mine over the block C

and some other see A -> B -> C' and mine over the block C'

If node sees something like this:

A -> B -> C -> D -> E...
      \-> C'-> D'-> E'...

it should select the chain with larger cumulative difficulty (longest) and forget anything about orphan chain


Is there a logical reason to buy bitcoin for more than it costs to mine it? For the sake of this question let's assume bitcoin was useful and had value beyond speculation.

Why would you ever buy bitcoin above mining price?

I have heard various estimates of what it costs to mine a bitcoin.

One answer on the topic on quoara suggests the electricity costs around 400$ (this is from late August 2017).

  Source:
  https://www.quora.com/How-much-does-it-cost-to-mine-1-Bitcoin-in-the-US

Let's say with equipment investment and increased difficulty it now costs 1000$ or even 2000$ to mine a bitcoin.

Given that it is relatively cheap to mine bitcoin and there are even managed server solutions you can rent, is there any logical reason to buy bitcoins at a higher price, than they cost in production? Why are people mortgaging their houses in order to buy bitcoin at 17.000$ per coin when they could simply buy computers and electricity and pay only a fraction per coin?

Shouldn't the price of bitcoin be very closely tied to the price of producing bitcoin?

Mining:
It's a lot of trouble and expensive to set up a proper rig and the return on investment can take a long time when mining. It's not as cheap or profitable to mine the coins as you make it seem.

This online calculator:

https://www.cryptocompare.com/mining/calculator/btc?HashingPower=12&HashingUnit=TH%2Fs&PowerConsumption=1300&CostPerkWh=0.15

allows you to enter electricity cost, energy consumption and hashing power of specific rigs to figure out how much you'd make. It takes into account total network hashing power, average block time etc.

For example:

An antminer S9 (currently viewed as being the best pro-sumer miner on the market) has a hashing power between 12 and 14 TH/s and consumes between 1200 and 1400 Watts of power. at an average electricity price in the US of $0.12 per kW/h (and Europe's avg price is between 12 and 18 cents) you can expect to profit just a little under $500 per month on the machine.

Those machines are sold out direct from the manufacturer but you can find them from resellers on amazon or eBay for between $5000 and $7000 depending which batch they were from. It would take you a year to make your money back on your investment, and since the nature of that playing field is that a piece of equipment's yields reduce over time it will most likely take a lot more than one year to break even from the purchase of that miner.

Most miners are pretty much the same or take even longer to pay back; feel free to play around with that calculator and input different mining rigs you find on the internet.

Renting Servers: this site, the top result in a google search,
https://www.nicehash.com/buy will rent you 50TH/s of hashing power, for 24 hours, for ~$94USD (they charge in Bitcoin). Using the calculator I linked above 50TH/s and an electricity cost of $0 would yield $2447/month worth of bitcoin or just over $81/day. So you'd be giving them $94 for $81 worth of Bitcoin.

Bottom Line: the reason people don't easily mine it for a tenth of the cost is because it's neither easy nor much cheaper to mine it.


Distributing 1 satoshi to every user on stack exchange or some other online community I'm curious if there have been any coins that has distributed coins to an entire online community like an air drop. Currently many online communities like stack exchange have public profiles and public User IDs. If someone was to catalog every one of these users and generate a bitcoin address for them, then sent them 1 satoshi on the lightning network, it would be an interesting distribution model.

Has any coin done something like this?

A few projects have done this (although more recently with EOS and Ethereum). The only notable one I can remember off the top of my head is Clamcoin:

  Every person who had Bitcoin at block 300,377, Litecoin at block 565,693, or Dogecoin at block 218,556 was given ~4.6 CLAM.

This has spawned a few digging services over the years, where you can upload old LTC, BTC, or Doge wallets (after removing those coins, of course) and get Clamcoin out.

On Ethereum, 0x31a240648e2baf4f9f17225987f6f53fceb1699a distributed 0.000000007777777777 ETH to some 174,655 addresses as a marketing gimmick for an ICO called Safe. Many other Ethereum ICOs conduct air drops, usually with some rules like "Any address that sent or received ETH between X and Y blocks".

More recently, some EOS projects have been "spamming" free 0.0001 EOS to various accounts

I do believe that Clamcoin is the only major example of distribution based on community participation at that scale, though.


First of all you need to tail your $BITCOIN_DATADIR/debug.log and search for clues. You might solve your problem by just looking at the messages there. Here's a sample:

2019-10-13T18:17:11Z socket recv error Connection reset by peer (104)
2019-10-13T18:24:48Z socket recv error Connection reset by peer (104)
2019-10-13T18:28:17Z socket recv error Connection reset by peer (104)
2019-10-13T18:29:10Z socket recv error Connection reset by peer (104)

In my case I had several peers drop their connection but the syncing soon restarted with fresh peers.

The blocks you're stuck on are from August 2017, right after the Bitcoin Cash fork. Are you running the most recent version of Bitcoin Core? Have you tried clearing the blockchain altogether and restarting sync from zero? (Note: do not delete your wallet.dat file, just the files under blocks/ subdirectory.)

Is there other software running that could be connecting to peers' port 8333? Peers might be banning your IP for some reason. Is this PC clear of malware that could be scanning for port 8333 of network peers? This could cause your IP to be blacklisted.

Finally, have you tried forcing a IP address change? If this is network-related then rebooting your gateway to force a new IP could solve the problem.


Blockchain.info wallet terms Is the wallet ID you use in your blockchain.info wallet the same as your public address where others can send bitcoins?
And the 'Backup Phrase' is the same as your private key?
Maybe if someone could explain all the levels of authentication in the Blockchain.info wallet?

No, your wallet ID is only used for logging in, keep it to yourself. Your backup phrase is used to generate your private keys, but it is not the private key itself. It uses the phrase as a seed to generating a Heirarchical Deterministic wallet as per BIP 32, 39 and 44. So backing it up is equivalent to backing up all private keys in your wallet.

People send BTC to a bitcoin address, which you can generate when you log in.


How do I load money into my bitcoin account I don't understand how I load money into my bitcoin account so I can send it to someone

Bitcoin is an asset that you can purchase, more like an electronic version of a precious metal coin than like a payment service that you load money into.

To get Bitcoin you need to buy it from someone else or have someone pay you with it for providing some product or service.

To buy Bitcoins you can use services like Bitcoin exchanges (Popular exchanges in the US today are services like Gemini and Coinbase) or you can meet people in person and trade for bitcoin peer to peer (a popular service is localbitcoins).  The set of services available to you will be different depending on where you are.

As always, beware of scams online.  If you have any friends that use Bitcoin you can ask them for advice about what services they use.


How can we know our "from" address in advance? This website ask me to enter the address FROM where I would be sending BTCs.
But every time a send some BTC it seems to be sent out from a different address...
Should I use the one I always see when I say I want to "receive" some BTC? Is it my "main" address?

There is no from address in Bitcoin.
https://en.bitcoin.it/wiki/From_address

Each transaction reference an unspent output (UTXO) that was sent to you in a previous transaction.

About the address, you need to generate a new one for each payment:
https://en.bitcoin.it/wiki/Address


Blocked transaction wallet on my phone Ok I have a wallet on my phone that I put bitcoins in on monday, They have been blocked now for a week. How do I unblock them and the wallet I am using I can get it on my mac. Its called bitwallet by sollico software. at this point I am so confused I really just want to get the bitcoins I put in the wallet and use them to put ads up and I cant cuz its still blocked. PLEASE HELP ]1 Thank you so much in advanced !

EDIT:

When I go to pay it won't let me send. It keeps saying "insufficient funds." Maybe I'm doing it wrong.

I'm not sure what you mean that they've been "blocked" ?

That screenshot shows the "block" number that the transaction was mined in, which means that it has been confirmed on the Bitcoin network and is available for you to spend.

Have you tried to use that wallet to pay for something and you're getting an error? Because as far as I can see it seems fine:)


Why can not use an exchange address for p2p mining? Most p2p mines (like this one) have the following norm:

"Don't use an exchange address!"

I am mining alt cryptocurrencies but I do not have a real interest in maintaining a separate wallet for every kind of currency. Why they do not admit addresses from exchange sites?

Many exchanges don't have a fixed deposit address for each client.

This means that when you want to make a deposit, it will give you an address and it will log that you are depositing to it. However, when they don't receive anything on the address, the address expires and might be reused for another client.
So when you use the address for mining, it's possible that the coins you get from the pool and are send to that address will never end up in your wallet.


How can I sell Bitcoin for GBP? I'm a bit of a dunce and just not getting it - I was persuaded to buy a bitcoin a few years ago and would now like to sell the thing to do up my kitchen. I have a bitstamp account and a blockchain wallet, but can't figure out for the life of me how to get my coin into my bank account as GBP - do I need the blockchain wallet, or should I/can I do it direct from bitstamp?

I'd really appreciate some pointers. TIA.

You haven't said whether your bitcoins are in your bitstamp account (risky over the long term!) or at an address in your own personal wallet, so I shall assume the latter.

When you log in to your bitstamp account, you should be able to find
a "deposit" page with instructions for various ways of depositing
into your bitstamp account. On of those ways will be “bitcoin” —
the “bitcoin deposit” page will tell you what bitcoin address you
need to send your bitcoins to in order for them to be credited to
your bitstamp account (they give you the address as a string of text
and as a QR code).
Having found out your bitstamp deposit address, you then go to
your own wallet (you haven't said exactly which wallet you're using,
but I mean the thing that you're calling your “blockchain wallet”).
You instruct your wallet to send your bitcoins to your bitstamp
deposit address.
Some time later, your bitcoins will be credited to your bitstamp
account (could take a few hours for them to show up). Keep an eye on
the BTC balance of your bitstamp account.
Once your bitcoins have appeared at bitstamp, you can sell them for
Euros or US Dollars. Bitstamp don't support GBP. I tentatively
suggest you sell for Euros because a SEPA transfer into a British
bank account is usually cheaper than a USD wire transfer (but check
what fees/exchange rate your bank charges!). You can either use
a market trade to sell them at the going rate, or use a limit
trade to offer them for sale at a price that you hope someone will
be willing to pay.
Having sold your bitcoins (on bitstamp) for Euros (or perhaps US $), you then have
to go to bitstamp's "withdrawal" page and tell bitstamp where to
send your money (i.e. the details of your GBP bank account).
Obviously, you need to follow bitstamp's SEPA instructions if you
sold for Euros, or their USD wire instructions if you sold for USD.

If your bitcoins have been sitting in your bitstamp account all along, then you can omits steps (1) to (3) above — your should be able to figure out from your bitstamp balance if this is the case.

EDIT: If you bought your bitcoin before the hard fork, don't forget that you should now also own a BCH (especially if you kept your bitcoin in your own wallet),


Are bitcoin testnet addresses taxed? Here is a testnet address I've been experimenting with,

Here is some test BTC leaving the address,

I didn't initiate the transfer though, is this a feature of the testnet to keep the faucets stocked perhaps?

My wallet is provided by TP's bitcoin faucet from here.

Thanks in advance :)

No, even in Testnet, there is no legitimate reason for coins to be leaving your address without you initiating it.

It's possible you somehow sent the transaction by mistake, or that someone else (perhaps a virus or Trojan) gained access to your private keys.


Can a malicious Internet Service provider launch a double spend attack? If a malicious internet service provider completely controls a user's connection, can it launch a double-spend attack against the user? How much computational effort would this take?

Everything sent over the Bitcoin network is public so you have nothing to worry if your ISP monitors your connection (only related to bitcoin transactions; your privacy is compromised in other cases). The only thing which is private are your keys, but that is not sent over the network. Now, if your ISP controls everything that moves through its servers, it can definitely change the components of the transaction. However, when you create a transaction, you sign the entire transaction with your private key. So, if any component of the transaction is altered, that signature is rendered invalid and hence the entire transaction becomes invalid. So, no even if your ISP controls your entire network, it cannot alter your transaction without invalidating it. Just ensure that you keep your keys safe (cold storage like hardware wallets or paper wallet).


Different Wallets and ScriptSig does it help obfuscation? my question is this if you have coins that you are looking to break an identity link (not using mixing services)

does using multiple wallets if you send different amounts of bitcoin help obfuscate the funds etc

so I have three HD Wallets
i have 5 btc send 1.33 BTC to each wallet

when the funds are spent they all use different scriptsigs to unlock the funds right?

so on the blockchain it will show different scripts spent the inputs.

Does this do anything?

Last question, do HD Wallets use a new script sig for each transaciton since they are using a new Pub and Priv Key for the transaction.

Am I Missing anything?

The way transactions are associated with one another has to with the transaction's inputs.  When you send bitcoin, you are usually using multiple inputs, each with an address you control.  Anyone looking at the blockchain now knows that the same person controls all those addresses.  Now they can cross reference those addresses with addresses identified as "change" addresses from other transactions, and can be reasonably sure that the inputs to those transactions are also controlled by the same person.  This process can be repeated, which gives is a reasonable guess at which addresses are controlled by a single entity.

A wallet can only combine inputs that it controls, so using three wallets will show up as three controlling entities with blockchain analysis.  However, it will also reveal a lot of cross payments between these wallets, leading someone to assume they are somehow connected, possibly being controlled by the same person.

As for your other questions, as long as the addresses change for each transaction, so will the scriptPubKey and therefore the scrpitSig of the spending transactions.

Just remember, it's not the similarity of the scripts that allow blockchain analysis, but the association of the inputs and outputs.


Is there any relation between the block version field and the one of the transaction? I am struggling to validate my custom miner against the testnet network and I can't seem to add a block of mine to the chain. I've noticed that all the other miners are appending version 2 blocks, so I decided to do the same. As I've read the block height should be included in the coinbase transaction script. So my question is if there is any relation between block version and transaction version because that's the only thing (in my opinion), that I could be doing wrong. I would appreciate an example of how should my block look like as byte array so it would be accepted by the network (testnet).

I would send your solved block to a core node of your own and then check the debug.log file to see why it wasn't accepted.

But, no, in general there is no necessary relationship between the version of the block and the version of transactions. Version numbers just give a signal to other nodes if there is any special way to handle new blocks/transactions.

As per BIP34, version 2 blocks now have the block height put into the scriptSig of the coinbase input so that no one can make a transaction with a duplicate transaction id (hash).


Migrate from Bitcoin Core Wallet to somewhere else before sync completed I created a Bitcoin wallet yesterday using Bitcoin Core Wallet application and bought some bitcoin via buy.bitcoin.com to the address mentioned in File>Recieving Address in my Bitcoin Core Wallet. They sent the money but I can't see if I received it or not because I did it before synchronization complete and it seems it takes at least 2 weeks for my bitcoin core wallet to finish synchronization (I think the number is increasing):

Is there anyway I can move my wallet to some other bitcoin client and start using it instantly? I paid a lot of money to but bitcoins and it seems I can't use it until this app finish its synchronization.

If so, then which client and how?

Any help/guide will be appreciated.

Following these 3 easy steps helped me:

Download & Install Electrum
Extract your private key from Bitcoin Core Wallet
Import your wallet using the private key


Would it be possible to send money through the Lightning Network to an offline address? My understanding is that the current Lightning Network spec requires an address receiving money to sign things with its private key - which requires the owner of that key to be online. Are there any techniques that would allow some 3rd party to accept money on your behalf without trusting that 3rd party?

I can imagine a situation where the sender delegates sending to a 3rd party, just like posting anti-cheat transactions can be delegated to a 3rd party that watches the blockchain. For example, maybe the sender gives a 3rd party the proper transactions needed to authorize sending lightning btc to the destination once the destination comes online. I don't know if this is possible with the current functionality in Bitcoin, tho. Is this possible?

This sounds like a web wallet, where the keys were managed for you and you simply interact through a website.  You'd have to trust the third party, but as we've seen on the main network, this is acceptable to a great number of people.

Just like with the existing Bitcoin network, you have to run things yourself to be trustless, but there are more convenient options if you are willing to trust (and pay fees to) other parties.


Why I can't transfer from BTC trading wallet to my BTC wallet? using Blockchain I am trying to transfer bitcoins on Blockchain from BTC trading wallet to my BTC wallet, all I get is "insufficient funds" eventhough I have enough funds in the BTC trading wallet. Any solution?

First, make sure there isn't a "hold period" on your recently deposited funds. Many exchanges that do business in the USA put a 7-day "hold" on all your deposits, meaning you can trade cryptos on that exchange all you want, but until those 7 days are over, you can't withdraw anything, or transfer crypto to an outside wallet.
Also, as mentioned in the comments, make sure that you have enough funds in your trading account to cover your transfer PLUS the transaction fee, and 5hat you are not trying to transfer less BTC than whatever their "minimum transfer amount" is currently set to.


UAHF implementing sighash, specifically, how are scriptCodes serialized? I have managed to get correct sighashes for situations in which there are no OP_CODESEPARATOR ops in the code.  However, I cannot figure out, based on the UAHF documentation nor on the C++ code in the Bitcoin-ABC repository, how I am supposed to serialize the scriptCodes with the codeseparator OP.  Here is my serialization function (from the Picocoin C library):

void uahf_ser_scriptCode(cstring *s, const cstring *scriptCode){

    if(scriptCode == NULL){
        cstr_append_c(s, 0);
        return;
    }
    struct const_buffer it = { scriptCode->str, scriptCode->len };

    struct const_buffer itBegin = it;
    struct bscript_op op;
    unsigned int nCodeSeparators = 0;
    struct bscript_parser bp;

    bsp_start(&bp, &it);
    while (bsp_getop(&op, &bp)) {
        if (op.op == OP_CODESEPARATOR){
            nCodeSeparators++;
            fprintf(stderr,"code separator\n");
        }

    }

    if(nCodeSeparators == 0){
        ser_varlen(s, scriptCode->len);
        ser_bytes(s, scriptCode->str, scriptCode->len);
        return;
    }

    //ser_varlen(s, scriptCode->len - nCodeSeparators);
    it = itBegin;
    bsp_start(&bp, &it);
    int count = 0;
    cstring *x = cstr_new_sz(1024*10);
    while (bsp_getop(&op, &bp) && count < nCodeSeparators) {
        if (op.op == OP_CODESEPARATOR) {
            count++;
            //ser_bytes(s, itBegin.p, it.p - itBegin.p - 1);
            /*if(count == nCodeSeparators){
                ser_bytes(x, itBegin.p, it.p - itBegin.p - 1);
            }*/
            itBegin  = it;
        }
    }

    if (itBegin.p != scriptCode->str + scriptCode->len)
        ser_bytes(x, itBegin.p, it.p - itBegin.p);

    ser_varlen(s,  x->len);
    cstr_append_buf(s,x->str,x->len);
    cstr_free(x, true);

}

I probably was too eager to ask this question, though perhaps someone can take a look at how I implemented the solution in this pull request.  Here is the relevant code:

// from bp_tx_sigserializer function
void uahf_ser_scriptCode(cstring *s, const cstring *scriptCode){

    if(scriptCode == NULL){
        cstr_append_c(s, 0);
        return;
    }
    /** Serialize the passed scriptCode, skipping OP_CODESEPARATORs */
    struct const_buffer it = { scriptCode->str, scriptCode->len };
    struct const_buffer itBegin = it;
    struct bscript_op op;
    unsigned int nCodeSeparators = 0;

    struct bscript_parser bp;
    bsp_start(&bp, &it);

    while (bsp_getop(&op, &bp)) {
        if (op.op == OP_CODESEPARATOR)
            nCodeSeparators++;
    }
    cstring *x = cstr_new_sz(1024*8);

    it = itBegin;
    bsp_start(&bp, &it);

    while (bsp_getop(&op, &bp)) {
        if (op.op == OP_CODESEPARATOR) {
            ser_bytes(x, itBegin.p, it.p - itBegin.p - 1);
            itBegin  = it;
        }
    }

    if (itBegin.p != scriptCode->str + scriptCode->len)
        ser_bytes(x, itBegin.p, it.p - itBegin.p);

    if(0 < nCodeSeparators){
        cstr_free(x, true);
        x = cstr_new_sz(1024*8);
        cstr_append_buf(x,scriptCode->str,scriptCode->len);
    }
    ser_varlen(s, x->len);
    cstr_append_buf(s,x->str,x->len);
    cstr_free(x, true);
}


I bought a bunch of 2009 Bitcoins the actual coin. How can i cash the coin in? I bought several 2009 Bitcoins and they came in a nice case but that is all the info I have on them.  How do I cash them in?

It seems that you have what many people would call physical bitcoins. There are several kinds, but I am not aware of any from before 2011 that actually take the shape of a coin. The probably best known type is made by Casascius. Is there any additional information you could provide? Maybe a photo?

Anyways, if this is what you have, then be aware that none of them are in any way official. They are merely someone's personal invention. To link them to bitcoin, they usually contain the private key, with some more or less effective tamper-protection (e.g. hidden behind a self-voiding seal or the like). If printed, this private key is a long string of alphanumerical characters starting with 5. With this private key you can, using a bitcoin client, take possession of the actual bitcoin(s) associated with the coin. Look out if anyone has done that before you! The coin should also display a bitcoin address, without being hidden behind a seal or the like, which you can use to check if there actually are real bitcoins associated with it using web services such as blockexplorer.com or blockchain.info. You recognize the bitcoin address by starting with 1 if given as a string of alphanumeric characters. Sometimes bitcoin addresses and private keys are additionally shown as QR codes for easy scanning by bitcoin apps for smartphones.

As Jannes pointed out in an earlier answer, do check if your coin has collector's value. Particularly if it is true that you got a physical bitcoin manufactured by someone as early as 2009, it may really be special.

For instance, this post on Bitcoin Forum list the different types of known physical criptcoins, with some info about their mintage and sales history. The Series-1 1BTC Casascius Coin is the one with seems to attract the highest collector interest, since it was the first physical criptocoin ever to be released to the world. In the Bitcoin Forum, some of those coins were reportedly sold for 8 BTC, even though they are only loaded with 1BTC.


How do bitcoin exchanges set prices? What do exchanges base their Bitcoin and alt currency prices on? What makes them say that they will sell bitcoins for certain amount? Do they increase and decrease their price based on what other exchanges are selling for?

An exchange doesn't set a price at all. It provides a framework for customers to buy and sell coins to each other, at whatever prices the buyers and sellers find mutually agreeable. The exchange itself does not buy or sell, and the prices it quotes are just a report of what its customers are doing  right now.


Where does MultiBit keep its data directory? Where does MultiBit keep its data directory? What is the wallet inside called?

Windows
Type %APPDATA%\MultiBit into the address bar of File Explorer.
If that doesn't work, try

Windows XP: C:\Documents and Settings\<your name>\Application Data\Bitcoin
Windows Vista and later: C:\Users\<your name>\Appdata\Roaming\Bitcoin

Mac

Open Finder, then open the Go menu.
Click "Go to Folder..."
Type ~/Library/Application Support/MultiBit

Linux
Open your home directory. Look for the MultiBit folder.
Wallet name
The wallet is always called multibit.wallet. It's the equivalent of wallet.dat in Bitcoin-Qt.


What hardware requirements does a SPV client have? I read about SPVs here that:

[A SPV] client downloads a complete copy of the headers for all blocks in
the entire block chain. This means that the download and storage
requirements scale linearly with the amount of time since Bitcoin was
invented.

but being new to Bitcoin, I don't know how to quantify this in terms of :

bandwidth
storage
ram

requirements I need for running a SPV (on an embedded device).
Can someone please help?

Bandwidth - You need to receive an 80-byte header about every 10 minutes. In addition, if you want to spend, you will get SPV proofs that range about 500-1000 bytes per utxo. In other words, the bandwidth requirements are really tiny.

Storage - Each block header is 80 bytes, as of this writing, there are less than 430,000 blocks, so 80 * 430,000 = 35.4 MB. 100 MB should last you another 15 years.

RAM - The main usage of RAM is to do SHA256 and ECC signing/verification operations. A minimal CPU with not much RAM (512 MB) can do both without a problem.


Bitcoin Core 0.19.1 RPC "Move" command I want to move some coins from a wallet to an other, so I found move command which is supported in Bitcoin Core 0.17.0 RPC but not in 0.19.1. Is any other command has been added instead of move?

The previous account system has been deprecated and removed. Current versions of Bitcoin expect you to either manage address<=>account links in your own software, or use different wallets for things you previously used accounts for.

If you are managing it in your own software, it is a simple matter of making an off chain transfer from one account to another in your own database.

If you are using multiple wallets, you will have to make an on chain transaction to send Bitcoin to an address in the destination wallet.


Do all consensus algorithms aim to solve the Byzantine generals problem? Can I clarify my understanding:

Byzantine Fault Tolerance is a characteristic of a system to tolerate a class of failures belonging to the byzantine generals problem.

Byzantine Fault tolerance is also the name of the consensus algorithm that solves the byzantine generals problem?

I see Ripple as being BFT. Does it mean it uses some custom algorithm, that solves BFT?

I also see Stellar uses BFT, does this mean that Stellar and Ripple Both use different algorithms that solve BFT?

Edit:

Can all Proof of Insert word algorithms be seen to be a part of BFT? Because POW uses a probabilistic model to solve the generals problem, but it is not seen as BFT.

To answer your question, no.

BFT-class consensus algorithms seek to solve the Byzantine Generals Problem.

Other consensus algorithms, generally the Nakamato-style consensus algorithms) including PoW (Proof-of-Work, used by Bitcoin) and PoET (Proof of Elapsed Time, used by Sawtooth) do not seek to solve BFT.


Can I transfer bitcoins generated in regtest mode to a friend? I am running Bitcoin in regtest mode. Is it possible to send bitcoins generated in regtest mode to a friend ? (I only want to test it). Is it possible ?

Yes, sort of.

In regtest mode, mining is made much easier, and by default it doesn't attempt to connect to any peers to exchange blocks or transactions.  But your friend can run another client in regtest mode and explicitly connect to yours, and then you will share the same block chain and can exchange transactions.

You will need to ensure that your firewall allows incoming TCP port 18444 from the Internet (or at least from your friend's IP address).  You'll also need your external IP address; say it is 1.2.3.4.  (DNS also works if your machine has a DNS name.)  Then you can run your client with -regtest, and your friend can run hers with -regtest -connect=1.2.3.4.  Once you have synced your blockchain with each other, you can send transactions to each other just like you were on the real Bitcoin network.  (Of course, nobody will see them except you.)
Note that in order for the transactions to be confirmed, one or both of you will have to use setgenerate to mine some more blocks.

Note also that if both of you are mining, a temporary network failure could lead to you quickly making a big fork in your block chain.  This will make the Bitcoin client unhappy.


Is PAN or ID card verification necessary to buy Bitcoin in India? There are many Bitcoin exchanges in India but all of them require PAN or others documents to validate identity. However, the Central Bank of India i.e. RBI has not given Bitcoin the status of a valid currency so the exchanges shouldn't ask for PAN Cards or other details but they do.

That's my other question, are these exchanges authorized to ask for PAN card or other documents to verify identity since I am paying through my debit card or bank cccount so additional verification should not be necessary.

Is PAN card or ID card verification mandatory for buying Bitcoin from exchanges in India, even through the RBI hasn't issued any such notification?

The is the only notification by the RBI related to Bitcoin I was able to find find:  https://www.rbi.org.in/scripts/BS_PressReleaseDisplay.aspx?prid=30247

No authority in India expressly authorizes other entities to use PAN or other unique ID cards for customer verification purposes. The entity itself takes such measures since Government issued identities carries trust and uniqueness.
No unique identity of any nature is required for transacting Bitcoins.
Now, as for the Bitcoin exchanges and other trading platforms requiring the use of PAN or other ID cards, these entities have valid reasons to ask for such details, such as:

to avoid legal hassle for the entity when a customer engages in illegal financial activities or anti-national activities  such as tax evasion, money laundering and terrorism. PAN is a must for surveillance, tracking and investigation;
to show itself as a responsible corporate entity engaging with legit customers only and maintaining transparency at their end.

You are most likely to reach this conclusion if you read T&C, Privacy Policy or KYC/AML policy of the entity concerned. For example, CoinSecure has it mentioned here:

No Legal Requirement
Although Coinsecure is not required by the law to follow any Know Your Customer (KYC) policies or implement any Anti Fraud mechanisms, however Coinsecure believes in total transparency and adherence to the law and discourages any of illegal activities while using Coinsecure’s services. In order to discourage and prevent any person from indulging in illegal activities using its services, Coinsecure has made the following KYC and Anti Fraud Policy purely as a measure of prudence and on an entirely voluntary basis.

You must know that there is no standalone data protection law in India and currently, misuse of unique identifiable information is a punisable offense under Section 66C, IT Act 2000 (Amendment 2008), but the punitive punishment has failed to deter many criminals from committing identity fraud, so you must weigh your risks carefully before divulging such critical details.
Side Note: Do read Privacy Policy before sharing any critical information.


When the last bitcoin is mined will everyone know it? The total number of possible bitcoins is limited. This means that at some point the last bitcoin is mined and no more bitcoins will be mined after that moment.

When this happens will we notice it and how?

Some time in around year 2100, blocks will only be worth 0.00000001 BTC or less. But a long time before this, miners will earn their bitcoins by the transaction fee. And when blocks no longer can generate bitcoins, then the miners will earn their bitcoins only from the transaction fee (versus earning 99.99% from the fee). Miners can still generate blocks, even though blocks no longer generate new bitcoins.

The bitcoin-qt client does not have any "popup window" when this happen, if that's what your asking?


I am new to bitcoin, and GUI miner won't work on slush's server I am new to using bitcoin, and I don't have any mining hardware, just my computer. I got GUIminer, and set the server to other, and the host name to http://api.bitcoin.cz, port 8332. I entered my username and worker name, and it's now mining (very slowly, as expected) but still mining, however, it says on slush's server that i don't have any active workers and I'm not mining, anybody know what the problem is? I also have 1 stale share, what is that, and how did i get it?

Your hashpower is magnitudes too low. It is so low, that the pool doesn't accept your work, because it will never amount to any use. You are competing with a teaspoon in a world of Bucket-wheel excavators. You will be expending energy and never gain any revenue. Please check out In the ASIC-age, is it worth starting mining Bitcoin at home? for a more comprehensive overview of the mining situation.

Shares are simpler portions of work at a lower difficulty than blocks. They are used by mining pools to gauge the contribution of miners. You apparently found a single share, but it was found after the pool had started working on a new block. When your guiminer told the pool about it, it was already outdated.


Looking For Bitcoin Communities in New York I'm Interested In Knowing Is there Any Bitcoin Communities that meet Up to Purchase Products Exclusively with Bitcoin In The New York Area?

You might want to look on meetup.com for these kinds of groups.


Block chain api support - Im unable to seperate the credit and debit transactions using blockchain api I'm using blockchain api to display transactions of credits and debits seperately, I'm using the below procedure for displaying credit and debit transactions. But credit transactions are showing in debit transactions... I mean the credited transaction which need to display in "inputs" index showing in "out".

Clear explanation :

Taking an address as an example: 12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR. If you can the compare transaction list in blockchain.info url https://blockchain.info/address/12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR and json format url https:// blockchain.info/address/12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR?format=json&limit=5, first 2 transactions are showing fine in 'out' index json. But when you see the 3rd transaction in https:// blockchain.info/address/12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR it is incoming transaction, This 3rd transaction is showing in "out" index.

My moto is to show my website users a clear transactions of their address.

Here I need to show list of Incoming and Outgoing transactions from blockchain api seperately, Procedure I'm following as suggested by the blockchain.info support team.

Procedure:

1st api call https:// blockchain.info/address/12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR?format=json&limit=5 . From this api call I'm taking "hash"  index value and passing the to 2nd api call --> https://blockchain.info/rawtx/$hash in the foreach loop . Showing "inputs" index as incoming transactions received to address 12RpKRwx7AevwTDJYF94MVDx6vEduF and "out" as outgoing transactions from 12RpKRwx7AevwTDJYF94MVDx6vEdu.

You can check if transaction is incoming or outcoming if you check "spent" boolean value:

{"spent":false,"tx_index":64117670,"type":0,"addr":"18TXxNNt5qQWiNsCb6vLhUud8wjqehHWYN","value":496364,"n":29,"script":"76a91451cd88fd726d2f2085e86fd242873c6ab6f5485d88ac"},
{"spent":true,"tx_index":64117670,"type":0,"addr":"1FvfNCiqGF9sCFoJqcNCExv34UM1KfpXiu","value":464214,"n":30,"script":"76a914a3b7d538dac93dd995e01069e44be13bdebd7baa88ac"}