text:
How do you get a job in the Bitcoin/Blockchain industry?
I'm 18 and would like a job working in the Bitcoin/Blockchain industry but I wouldn't know where to start.  Economics degree?  Perhaps working for the fin-tech branch of a bank?
I'm interested to know about how people in this industry got there, what they think about it, and any advice.

you should start with math and physics

Look at the backgrounds of the top Bitcoin core devs.

Possible duplicate of Where can I find a Bitcoin-related job?

I've voted against this duplicate, because the linked question asks about job opportunity, while the one here seems to ask about required skills.

Look at the backgrounds of the top Bitcoin core devs.
Here are the top 3:

Wladimir J. van der LaanUniversity of Groningen
Institute for Mathematics and Computing Science (IWI)
Pieter Wuillecomputer science degree at U. of Leuven
Gavin AndresenBachelor's degree in computer science from Princeton


text:
Bitcoin Recovery Email or Hard Drive
I received 100 bitcoins from a donor around 2009 but do not remember name of donor, their email address or password etc to recover the bitcoins! Any suggestions or advice?
I am seeking someone to assist.

When you say you "received" the money, what do you mean?  Did someone transfer the money to a wallet that you control?  Right now, you are being too vague for anyone to be able to help you.

Even if you had the donor's name and email, it would not help you recover the bitcoins. You need to get access to the private key.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Is the blockchain crossplatform?
I have the full client running in a local Windows machine but I want to move it to a VPS with Linux.  Will I need to download the whole blockchain again or can I just upload the copy I have on the pc?

I believe the blk*.dat files are just the raw block data, so they should be the same on all platforms.  You'll probably have to regenerate the databases (-reindex) which may take quite a while.
Note that Bitcoin Core needs a couple gigabytes of RAM to run well, which is more than most cheap VPSes come with.  And of course the 120+ GB of disk space for the blockchain data itself.

The database should be compatible across platforms too.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Why can't you just tell the blockchain that your bitcoin was stolen so that nobody can use it?
They evangelize about The Blockchain. It cannot be changed or tampered with. It's TRUST without needing to actually trust any person. So, tell me. Why is it that when I watch Youtubes of how to set up a Bitcoin Wallet, I get dire warnings of: "You have to do it THIS way and take THESE precautions OR ELSE your Bitcoin might get STOLEN!" I mean, if the Blockchain is so pristine, why not just TELL IT that your bitcoin got stolen... and, therefore, no one can use it?

Welcome to Bitcoin SE!  To make your question attract more readers, and therefore better answers, try to include the question in the title of the post.  It helps people who are skimming questions to understand what you are trying to find out.  Keep posting great questions!

The short answer, is because "the blockchain" has no idea whether your bitcoin got stolen, or whether you actually intended to spend it. The blockchain sees a legitimate spend and a theft as the same thing: A transfer from one account to another.
What the setup instructions are trying to protect you from is losing the private key to your wallet. If somebody learns your wallet private key, then they can spend your money. The catch is, you don't know whether somebody else has a copy of your private key until your bitcoins are gone.

Bitcoin allows you to transact with a system that works without relying on any others. You can be financially independent from banks to safeguard your money or inflation.
This comes with a huge responsibility, however. You become your own bank, and security failures in your computer setup (preventing either theft or loss) become entirely your own fault.
I don't expect that most people will make this choice, and instead will still rely on others. That is fine. The power Bitcoin gives is to at least have a choice to be independent, and hopefully allowing easier competition.

Two excellent answers! Thank you! I am encouraged! It's great to get cogent answers so quickly. My original query at Google was " Get bitcoin answers to questions from people who know and CARE." Looks like I found a few. Thanks again.


text:
Bitcoin Trading
How can we trade Bitcoins? Please suggest any procedures that could I follow. I am a newbie in this field. I have just started researching about bitcoins. I don't know much about them, like how to earn them, what is the right place to find bitcoins, etc.

Welcome to Bitcoin SE.  This is a very broad question.  How to trade will depend greatly your legal jurisdiction.  On top of that, you will want to learn about storing and transferring bitcoin.  This site is a great place to start, but you are unlikely to get a single answer that covers all of your questions.  I recommend figuring out the specific questions you have, searching the site for existing answers, and posting new questions if you can't find them.  Best of luck exploring the world of Bitcoin!

Thank you for help, however I just wanted to earn Bitcoins and trade them.

You might be interested in this related topic: I am new to Bitcoin, how can I get started?

Thank you for this suggestion. I got good knowledge regarding Bitcoins.

You can purchase bitcoin from various locations. As you're just starting out, I recommend coinbase. Coinbase is mainly used to easily purchase bitcoins by using credit card or bank transfer. Coinbase owns another website called GDAX, which is used for crypto-currency trarding. I recommend using this as well and get the hang of things like looking at charts to get to know the market. Once you have done so, you can do everything on GDAX, including buying and selling of bitcoin with USD. The good thing is, funds from coinbase and GDAX can be instantly transferred from one to the other.
I should mention that cryptocurrency is very volatile. Before you trade, I recommend you keep up to date with bitcoin news by going to certain places like reddit.com/r/bitcoin and you paper trade.
I hope this helps.


text:
What is bitcoin mixing/laundering for?
What is the difference if I'm using bitcoins that were given me by somebody I sold product to, or by some mixing bitcoin service?
After all, aren't I using those bitcoin at the same place and ordering what I want with the same name and address?

Bitcoin transactions are traceable, public and are recorded permanently. Although, there are some ways to minimize that, by not reusing addresses and have multiple wallets for different purposes. But even that is not foolproof because there are analysis services that can group addresses through data crunching.
Now imagine you get coins from someone that got them from someone, etc. Nothing wrong with that right? Unless, those coins are part of a bunch that were hacked from an exchange or traced back to a payment for some illegal activity.  And some exchanges start blacklisting them.
A mixing service tries to remove that linkability/traceability.
IMO you would be better off just using a crypto currency with unlinkability and untraceability built into the protocol in way of a mixer.

To expand on this, it is possible that markets may form that trade those bitcoins with "bad history" at a discount. Thus, different bitcoins could have different value, based on their origin. There was already a company buying directly from miners (and thus clean history) and selling them at a premium to the normal bitcoin rate. From there, it becomes difficult consider bitcoin to be a currency, as it behaves more like a non fungible barter token (ie, I sell you this item for 4 oxen, but not this ox here, it looks anemic). The point of currencym fungibility, is lost with the ability to trace.

For the record, US dollars aren't 100% fungible either.  Anyone who has ever tried to put a crumpled bill in a vending machine knows this firsthand.  In the financial world, underwriters for FHA loans look into where down payment money comes from, and will reject money from certain sources (for example, financial aid).

Saying one would be better off using a different currency is irrelevant to the question, and not likely to be useful advice anyway since more often than not the market dictates the currency that must be used.

@Carey, I agree.  That's my only real misgiving with this answer.  It feels both irrelevant and like poor advice.

The idea was hoping on and off the alternative crypto currency instead of using the mixers. Not instead of Bitcoin. Of course you should also be careful doing that to avoid amount or timing correlations, for example.


text:
How to make a CryptoCurrency (preferably using Scrypt) in depth
I'm looking for a proper guide to creating a CryptoCurrency. I know this probably won't be easy, but I'm really determined, and do know how to code in some languages. (C++ Beginner).
I've heard a link say to apply a new genesis block to the code, don't even know where to start with this stuff.

You can follow the discussions at How To Clone Scrypt Based Altcoins for Fun and Profit
Direct Link:
How To Clone Scrypt Based Altcoins for Fun and Profit ?

Thank you, read a bit and its looking good. I have actually been searching for this exact article.

Theres an error while downloading the essentials in linux. Im guessing its a general linux issue but i thought i should just say.

I've set a bounty here if you could go in detail http://stackoverflow.com/questions/19742969/hi-i-am-trying-to-make-a-cryptocurrency-altcoin-for-fun-but-i-hit-a-few-errors


text:
Could cryptocurrency "insurance" slow Bitcoin adoption?
Does the concept of cryptocurrency "insurance" undermine the purpose of "being your own bank"? Recently I have seen more Bitcoin related companies offer some sort of insurance for Bitcoins stored in their custody and am concerned with its unintended effects.
Nobody likes the financial losses than result from hacking, but I always thought that the decentralization of control of our own money was one of the primary benefits of Bitcoin.
Education (of best security practices) and the rise of multisignature transactions and decentralized exchanges such as Bitsquare can greatly reduce the need to entrust 3rd parties with your Bitcoin.
Insurance adds cost to the system (negating part of the financial advantage Bitcoin has over Visa and Western union) and encourages trusting 3rd parties with Bitcoin safekeeping (increasing centralization of control) over learning how to safely secure it yourself (retaining full control).
Could cryptocurrency "insurance" slow Bitcoin adoption? If so how can we encourage educational efforts as a better solution. Are regulators or the free market the primary promoters of cryptocurrency insurance?

If so how can we encourage educational efforts as a better solution. I think it's disingenuous to say that there's no risks involved in running an exchange. ShapeShift was hacked three times from one initial breach, losing $200K in total. Even technically competent people struggle to build systems that are secure against insiders.

The key to this is that insurance is not MANDATORY. You can still be your own bank if you want, but it's perfectly reasonable for someone that isn't comfortable securing digital assets to outsource that to someone else. As far as whether this will have a significant effect on adoption is at best speculation.
There are many reasons why someone would buy bitcoin, from using it to send money abroad to buying amazon things at a discount. A lot of use cases actually don't require any holding of the money for a significant period of time, which is the use case for insurance. As far as insurance services, the option expands the use cases, so it probably expands the number of people that would adopt.

Regulation may require exchanges to purchase insurance in order to operate in certain jurisdictions, so it indeed may be mandatory for some.

If anything, I believe the ability to buy insurance on cryptocurrency investments would speed up adoption by making it less risky to traditional investors.  Simply having insurance available doesn't mandate that everyone buy it; we'd all still have the choice whether we opt-in or not.
Traditional investments tend to have insurance policies on the insurance policiy of the insurance policy of the initial investment.  While it's a somewhat yucky business, it's also a standard practice in today's financial ecosystem.  Having these options available for bitcoin only strengthens bitcoin's value proposition and familiarity to traditional investors.

Insurance is one of many methods to transfer risk from one party to another. It adds cost because there is a price to pay for some third party to bear risk. If there information was perfectly symmetrical where everybody has access to same information then Insurance would be a zero-sum game.
There is always risk in everything you do. In the context of being your own bank maintaining your own private key for your Bitcoins. There are always potential accidents (e.g. your storage device containing your private key might break due to some erroneous error, the information in your USB key in some bank vault getting wiped as a consequence of an EMP). That's where Insurance comes in, it is for some person who wants to eliminate any possibility of loss to transfer this risk to some third party who is happy to carry this risk at some price.
Therefore, there's no reason to think why Insurance might slow the adoption of Bitcoin. Insurance should be available for anything where there is any risk whatsoever.


text:
How to put QR Code whenever I generate a unique address? block.io API
Hi guys as the title says. how can I generate a QR code whenever the block_io.php generates a unique address? I seem to have a problem when calling $newAddressInfo or $newAddressInfo->data->address whenever I'm echo-ing it. Please disregard the missing characters as per it's perfectly working.
so this is the whole script.
Bitcoin Address validator from Kyle : HIS YOUTUBE CHANNEL
QR GENERATOR FROM : TERRAGON
I just tweaked kyle's script.
SCRIPT :
require_once ("block_io.php");

$apiKey = "myAPIkey";

$version = 2; // API version

$pin = "myPin";

$block_io = new BlockIo($apiKey, $pin, $version);

if(isset($_POST['submit'])){
    $newAddressInfo = $block_io->get_new_address();
    $address = $_POST['addr'];
    $decoded = decodeBase58($address);

    $d1 = hash("sha256", substr($decoded,0,21), true);
    $d2 = hash("sha256", $d1, true);

    if(substr_compare($decoded, $d2, 21, 4)){
        $message = "Invalid Bitcoin Address";
    } else {
        $message1 = "Valid Address";
        $message2 = "Your Receiving Address : ";
    }
}

function decodeBase58($input) {
    $alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

    $out = array_fill(0, 25, 0);
    for($i=0;$i<strlen($input);$i++){
        if(($p=strpos($alphabet, $input[$i]))===false){
                throw new \Exception("invalid character found");
        }
        $c = $p;
        for ($j = 25; $j--; ) {
                $c += (int)(58 * $out[$j]);
                $out[$j] = (int)($c % 256);
                $c /= 256;
                $c = (int)$c;
        }
        if($c != 0){
            throw new \Exception("address too long");
        }
    }

    $result = "";
    foreach($out as $val){
            $result .= chr($val);
    }

    return $result;
}

</form method="post">
    <input style="width: 100%;" name="addr" type="text">
<input name="submit" type="submit">

if (isset($message)){ echo $message; }

 if (isset($message2)){ echo " Your Unique Deposit Address: " .$newAddressInfo->data->address."
"; }

 if (isset($message2)) $str = "Your Receiving Address : ";
 $str ; echo $address = $_POST['addr'];

 if (isset($message2)){ echo img src='qr/qr_img.php?d=$newAddressInfo->data->address'> ; }

</form>

The address validation script is actually from RosettaCode https://rosettacode.org/wiki/Bitcoin/address_validation#PHP
All you need to do is create the new address and then put the address in a QR Code. You could use the Google Charts API
<?php
 require_once("block_io.php");

$block_io = new BlockIo($apiKey, $pin, $version);
$createAddress = $block_io->get_new_address();
$address = $createAddress->data->address;
?>

This is your new address:

<img src="http://chart.googleapis.com/chart?chs=125x125&cht=qr&chl=<?php echo $address; ?>">

Hi Kyle thanks again for the rescue, your scripts works well as usual! I have a question, how do I put the block.io real time notifs? I'm having trouble understanding their docs. lets say I received 30 transactions on block.io, how do I put that in my page? TIA Kyle!


text:
What would be the Internet Usage For 100 Antminer S7?
I am planing to set up a mini farm with 100 S7 Miners, but am little concerned about the internet usage and speed.  What speed do I need and how much bandwidth it will consume per month?

Mining in a pool setting actually doesn't require all that much bandwidth. This is because you get block templates sent to you and that single template can be used by all 100 miners. A block template isn't very big, it's less than 1k and looks something like this:
{
 "error": null,
 "result": {
   "coinbasetxn": {
     "data": "0100000001000000000000000000000000000000000000000000000000000000
0000000000ffffffff1302955d0f00456c6967697573005047dc66085fffffffff02fff1052a01
0000001976a9144ebeb1cd26d6227635828d60d3e0ed7d0da248fb88ac01000000000000001976
a9147c866aee1fa2f3b3d5effad576df3dbf1f07475588ac00000000"
   },
   "previousblockhash": "000000004d424dec1c660a68456b8271d09628a80cc62583e5904f5894a2483c",
   "transactions": [],
   "expires": 120,
   "target": "00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
   "longpollid": "some gibberish",
   "height": 23957,
   "version": 2,
   "curtime": 1346886758,
   "mutable": ["coinbase/append"],
   "bits": "ffff001d"
 },
 "id": 0
}

You'll get that maybe once every few seconds, so from a downloading perspective, you only need about 20k/min download and that's sufficient to keep all your miners busy.
For upload, you'll need to submit shares to the pool. Depending on the pool, each share has to be below a certain target and the share targets are adjusted normally so that it doesn't take up much upload bandwidth. The actual upload for each share is on par with a get-block-template call. In addition, if you're using stratum, there's very little overhead in terms of requests since the same connection is used for both uploading and downloading (unlike http which incurs a large overhead).
Depending on the pool and the policies they have, though I'd guess that they normalize to reduce the number of shares submitted to be less than 100k/min. Again, depends on the pool and what shares they accept. But basically, the network bandwidth should not be the limiting factor even with a normal home internet connection.


text:
Ways to monitoring BTC trading profit and loss?
Does anyone have recommendations when it comes to monitoring BTC trading profit and loss? I find it confusing when taking into account the transaction fee the exchanges impose (ie- GDAX). I use Coinigy for charts and entering orders.

This spreadsheet does the calculations for you, you just need to input your buys and sells: https://github.com/alanhett/coin-cost-basis

No need for fancy scripts and databases:
[what you put in] - [what you got out] = [your profit]
All you need to know:

the price of BTC at the beginning of the period
the price of BTC at the end of the period
have a list of all USD deposits/withdrawals
have a list of all BTC deposits/withdrawals (and the value of BTC in USD at that moment the deposit or withdrawal was made)

I will try to explain with an example:

Starting balance = $0 + 1 BTC
Deposit $1,000 (balance = $1,000 + 1 BTC)
Buy 1 BTC @ $900/BTC 1% fee = 0.01 BTC (balance = $100 + 1.99 BTC)
Sell 0.5 BTC @ $920/BTC 1% fee = $46 (balance = $555.40 + 1.49 BTC)
Withdraw $500 (balance = $55.40 + 1.49 BTC)

For a certain period in time the profit
= ([value of all assets at end of period] – [value of all assets at beginning of period]) + ([value of assets withdrawn] – [value of assets deposited])
= (($55.40 + 1.49BTC) - ($0 + 1BTC)) + (($500 + 0BTC) - ($1,000 + 0BTC))
= (($55.40 + 1.49BTC x $920) - ($0 + 1BTC x $900)) + (($500 + $0 x $920) - ($1,000 + $0 x $900)) // convert BTC to USD for the price at that time
= (($55.40 + $1,370.80) - ($0 + $900)) + (($500 + $0) - ($1,000 + $0))
= ($1,426.20 - $900) - $500 // My assets is worth $1426.20 at the end of the period, it was worth $900 at the beginning of the period but I added $500 from external sources (deposit - withdraw)
= $26.20 // Total value of my assets increased by $26.20

Even if I made zero trades for the month and the BTC price increased while I had BTC "stock", I would have made "profit" from a USD perspective as my total assets' value increased in USD terms.

If you're concerned with privacy, checkout my app Coinfox, cryptocoin portfolio tracker. It stores all your data client side in localStorage, and is fully open source

You could use a script that gets executed every day that connects to your exchange using their API and requests your balances.
If you were calculating your profit and loss using USD as your base currency you could take the current market price for BTC/USD and multiply that by the total number of BTC you have on balance, then add that to your USD balance to get your total USD balance. Then store your total USD balance for that day in a database.
Now your database should have records of your daily USD balance, from which you can calculate your daily P&L. You could obviously use another script to generate a PDF or webpage showing your P&L graphically.
If you're looking to track per trade P&L, that's just a matter of utilizing the API to get a list of your trades and then calculate the P&Ls individually based on first in first out accounting.
I hope I was able to give you some ideas.

I made a site to use the Coinbase API to keep track of your net gains/losses. Check it out at profbit.info


text:
How to run the bitcoin client so as to only accept blocks?
I read somewhere that running a full node at full functionality requires 200 GB/month bandwidth. Since that is too uneconomical in my country, I would like to run the client such that it simply adds the accepted blocks and does not take part in the rest of the p2p network activity. So is there an option to do that in Bitcoin-Core ?

I believe what you would like to run is an SPV client.  If you are running a full node, such as Bitcoin Core, you wouldn't want to only get updated blocks without transactions.  The point of running a full node is to independently validate the blockchain.  Blocks can't be validated without knowledge of the transactions in them, so full nodes need to receive both blocks and their transactions in order to independently validate the blockchain.  Otherwise, your client would never know if a block contains an invalid transaction (such as more bitcoin in its outputs than inputs).
UPDATE:  As suggested in the comments by Pieter Wuille, the -blocksonly command line option (https://bitcointalk.org/index.php?topic=1377345.0) can reduce the bandwidth significantly.

Perhaps OP is asking about receiving just blocks (including their transactions), but no other P2P activity (i.e., no unconfirmed transactions)?

In that case, perhaps setting the minimum relay fee to an unreasonably high level.  I don't think that would prevent the client from receiving unconfirmed transactions, but it would at least prevent the bandwidth from relaying them.

We have -blocksonly...


text:
Can Bitcoin full nodes pinpoint the true source of a transaction which they've relayed?
Assume I'm running a full node and that I've relayed some transactions. As a full node owner, can I pinpoint the true source of the transactions I've relayed?

Without knowing what you mean by "true source", this question is not really possible to answer. Do you mean what machine introduced it to the Bitcoin network or where it was formed/signed?

In the bitcoin data directory there is a file called debug.log.
This file as noted in the bitcoin documentation:

May contain IP addresses and transaction ID's.

This does not indicate that a transaction originated from a specific IP address but it does indicate that your node received a transaction from that IP address.  If someone were to have a wide enough view of the network and controlled enough nodes then it could be inferred that the creator of a specific transaction was using a specific IP at the time.  This is not always considered conclusive evidence at this time.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Who issues the transaction of reward when a miner solves the block?
I know that when I send money I create a transaction.  The transaction is unconfirmed, and then gets confirmed and the address owner gets the money in his wallet by summing up all the transaction of his public key address.
But what about the miner?
Suppose I am a miner with address x213123abcah23 and I solve a block and propagate it.  Who issues the mining reward to me?
Does Mr. Satoshi with his address send money to me or what?

related: What is the coinbase?

The miner itself includes a special transaction in the block called generation transaction. Every block only has a single generation transaction.
This generation transaction transfers the block subsidy plus the fees of the block to an address controlled by the miner.
For intance, if you look at block 434868, there is a single generation transaction that transfers 12.96 to address 17ggdTQzKFwrKP1zgqb5Kjuw6CpGKaE6Jrw.


text:
Bitcoin hash calculation
Best regards
I have been doing a lot of research about bitcoin and blockchain. A lot of informacion across the Internet can be found where many people explains the basics of bitcoin an it´s underlaying technology, but I have a question that I can´t quite find the answer and beg for this community help
If one searchs in Google Almighty one can track down bitcoin to the first block issued which is told  to have the hash:
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
on Blockchain.info the transaction info made is available:
https://blockchain.info/block-index/14849
And I even found a blog where the original block data containing the now famous ¨The Times 03/Jan/2009 Chancellor on brink of the second bailout for banks¨ is given
https://en.bitcoin.it/wiki/Genesis_block
But, to which data I have to apply SHA256 in order to get the given hash?
Many people say that is to block header copossed by Version - Previous block hash - Merkle Root - Timestamp - Difficulty Target - Nonce in the block structure, but another question arises for me:
When a pool is mining, does it receives the block info and its hash? From who receives that data?
Hope you can help me, any readings/books/videos/resources you can recommend will be appreciated or threads where this question has already been answered!
Thanks in advance!

Blockchain.info is not the official website of Blockchain. it is just blockchain viewer

But, to which data I have to apply SHA256 in order to get the given hash?

You need to apply recursive hashing to all the transactions in the block(in a correct order) to create a merkel tree, and then hash the final hash from the merkel tree with infos that you mentioned

When a pool is mining, does it receives the block info and its hash? From who receives that data?

When mining, the miners get the hash of the previous block. Transactions are read from the Mempool. And try to create a valid block(that satisfy the difficulty target) by doing trillions of trillions of hashing (POW)
I would recommend Mastering Bitcoin by A.Antonopoulos. It's my reference to everything in the Bitcoin space
PS: answering by email is definitely against stackexchange policy


text:
What is the smallest possible size of a bid/ask on Mt.Gox?
I've successfully done .01 of a bitcoin for both bid and ask, but I'm wondering if someone knows the real limit?
I cant seem to find it in their documentation.

From the (unofficial) MtGox API documentation:
The minimum trade size to buy OR sell is 0.01 BTC

I believe you can make orders of less: http://i.imgur.com/cGjIS9x.png but maybe MtGox has fixed this now?


text:
What permissions should wallet.dat have to be as secure as possible and still work?
I would like to restrict the permissions on my wallet.dat file but but I don't want to stop the bitcoind daemon from functioning.
What are the bear minimum permissions that need to be on wallet.dat to make it functional, while making it as secure as possible?


text:
Negative volumes returned from MtGox websocket api request
I am using MtGox's websocket api to construct an order book. The trouble I'm having is that every once in a while, the depth event will return an JSON object with negative volume and negatie volume_int
{
  "channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe",
  "depth":{
    "currency":"USD",
    "item":"BTC",
    "now":"1323644358437819",
    "price":"14.43",
    "price_int":"1443000",
    "total_volume_int":"849766000",
    "type":1,
    "type_str":"ask",
    "volume":"-2.71",
    "volume_int":"-271000000"
  },
  "op":"private",
  "origin":"broadcast",
  "private":"depth"
}

What does this mean? I'm wondering if it could perhaps be to indicate an order has been canceled

So I ran a test where I placed an order that I knew would be unique and then promptly canceled it, the whole time logging all depth objects to my terminal
The result was
{ price: '66',
  type: 2,
  type_str: 'bid',
  volume: '6.66',
  price_int: '6600000',
  volume_int: '666000000',
  item: 'BTC',
  currency: 'USD',
  now: '1370548662105838',
  total_volume_int: '37301280846' }

and
{ price: '66',
  type: 2,
  type_str: 'bid',
  volume: '-6.66',
  price_int: '6600000',
  volume_int: '-666000000',
  item: 'BTC',
  currency: 'USD',
  now: '1370548667379328',
  total_volume_int: '36635280846' }

Which leads me to conclude that negative volumes are in fact the result of a canceled trade


text:
Trouble with mtgox's withdraw bitcoins api call
I have been trying to transfer bitcoins via mtgox's withdraw bitcoin api call with this http address
https://data.mtgox.com/api/1/generic/bitcoin/send_simple
and when I log the response to console I get
{ result: 'success',
  return: { trx: 'a748ee68583a1cedbdde694a5716909cad8feea1545e946145f48f95ced15037' } }

yet the number of bitcoins in my account remains unchanged.
What could possibly be causing this?
and I'm positive my api key has the correct permissions (unless it's merchant)

The problem I was having had to do with formatting. In the api documentation there is an amount_int param which needs to be passed with the http request. I had forgotten that mtgox requires anything with _int postfixing to be in the form amount * 10 ^ 8
so for example if you were trying to send 0.01 bitcoins for the amount_int field you would put
0.01 * 10 ^ 8 = 1000000


text:
Placing price bounds on MtGox market depth api request
I'm making an order book for MtGox, but the market depth file is huge and I'm really only interested in values near the inside prices.
Is it possible to place price bounds on the mtgox market depth request http://data.mtgox.com/api/1/BTCUSD/depth/fetch and if so how?


text:
Stratum from pool 0 detected new block
I'm trying to mine litecoin on litecoin-pool with cgminer
./cgminer --scrypt -u username.1 -p password -o stratum+tcp://lite.coin-pool.com:3333

and it keeps on returning
[2013-10-05 14:24:28] Stratum from pool 0 detected new block
[2013-10-05 14:25:16] Stratum from pool 0 detected new block
[2013-10-05 14:27:05] Stratum from pool 0 detected new block
[2013-10-05 14:27:22] Stratum from pool 0 detected new block

and I'm using the correct username and password.
What could be causing this?

I have the same problem. It keeps repeating that but it doesnt do anything else.It says my hash rate but doesnt mine anything. Im trying to mine bitcoin and im just testing my new ASIC out. It's only 11GHS

@Jojo: The Bitcoin hashrate is now 6 exahash/s. 11GH/s are 0.000000001833333 of the network's hashrate. It's probably not enough to register as work for the mining pool.

It is not an error that new blocks are detected.
You should check other parts of the output to see if you are correctly connected, you are hashing and submitting shares.
If you want us to check what's wrong, please, submit some other part of the cgminer's log.

That is a normal response - It's just letting the miner know that there's a new block to be working on. You should also be getting shares accepted, but that all depends opn your hashrate. Considering you're mining LTC, if your hashrate is low the shares you get could be pretty infrequent or nonexistent. What are you mining with and what is your hashrate?


text:
What is the genesis block?
What is the genesis block? In which ways is it important or different from other blocks?

possible duplicate of How do you make a Genesis block?, which asks as a secondary question "What makes it different from the other blocks in the chain?"  I assume you are trying to create the "canonical question" on this subject, but it seems like we already have questions whose answers address it.

There are many questions and answers that mention the genesis block. I thought this question might serve as a good entry point for beginners. For instance the one you refer to doesn't mention that the genesis block coinbase is special.

It is important, because it is used to seed the block and chain databases before syncing can occur (you need a block to build on). It's the root of the tree of blocks, forks, and ultimately the chain tips that represent the chains your software is tracking.
It is imported differently to others, as it's coinbase transaction is not included in the UTXO set (it's unavailable to be spent)
Changing the genesis block is a way to definitively fork yourself away from the bitcoin blockchain, ie, start a new network with it's own separate history.
However, some coins do share a common genesis block (Fluttercoin IIRC, shares Litecoins for whatever reason), but the network is forked by the use of checkpoints (genesis might be the same, but block 1 is checkpointed to Fluttercoins, instead of Litecoins).

The genesis block is the first block in a blockchain.  Every blockchain based crypto currency must have a blockchain, which is the ledger for the currency.  For example, Litecoin has it's own genesis block which is completely different than the Bitcoin genesis block.
Every block in a blockchain has a parent block, except the genesis block which has no parent block.


text:
How can you check the amount in your blockchain or bitcoin address online?
How can know or check your blockchain or bitcoin account address to know amount on it?

Just to be clear, are you asking about how to see if you own any bitcoin on the bitcoin blockchain, or are you asking about the company "Blockchain.info"?  The term "account" is often misused when talking about Bitcoin, so it's difficult to tell what people mean when using it.

You can look up an address on a block explorer such as http://blockchain.info.  Just paste the address into the search box, and you will see a list of all transactions going in and out of that address, and its current balance.


text:
Can I claim Segwit2X with a blockchain.info wallet?
I have a blockchain.info wallet, but I am not sure whether I would be able to claim segwit2x?
Thanks in advance.

I edited your title to make your question more clear.  Always make sure the title of your question is a brief summary of the question.  It will help attract more and better answers.

You just need the private key. A wallet (irrelevant which wallet) stores your private keys. You will probably not be able to send segwit2x with the blockchain.info-wallet, but you will be able export your private keys of your blockchain.info-wallet and then you can import them into a new segwit2x-wallet.

Well, that is good news. So I don't have to move my btc to the websites which are partners of Segwit team?

No. You do only need control over your private keys and that seems to be the case. If they were on an exchange, the exchange had the control over them. By the way: Attention: There are scammers at the moment who try to "save your S2x or your bitcoins". Don't fall for this.

@Alpha which exchange support Segwit2X? How can I look them up and move my BTC to them so that when it hapens I dont have to worry about private keys and all that stuff?

As Segwit2X was/is very disputed, I think there is no supporting exchange at the moment. Normally, you must wait at least a week until the first good wallets are realeased or exchanges offer it.

Exchange and wallet supporting b2x but its late already.

late? What do you mean "late"?


text:
Bitcoin Cash - Trying to implement Explorer in Linux server but getting error
I have tried to setup bitcoin cash explorer in my Linux server and server start working for 5 minutes but after 5 minutes it is returning an error and I have configured explorer-API and it is not working properly in the background.
Error Facing:
[2018-02-09T13:32:31.589Z] info: Using config: /home/kiran/bchnode/bch-node.json
[2018-02-09T13:32:31.590Z] info: Using network: testnet
[2018-02-09T13:32:31.591Z] info: Starting bitcoind
[2018-02-09T13:32:31.592Z] info: Using bitcoin config file:
/home/kiran/bchnode/data/bitcoin.conf
[2018-02-09T13:37:26.959Z] error: Failed to start services
[2018-02-09T13:37:26.960Z] error: RPCError: Bitcoin JSON-RPC: Request
Error: connect ECONNREFUSED 127.0.0.1:18332
    at Bitcoin._wrapRPCError (/usr/local/lib/node_modules/@owstack/bch-
node/lib/services/bitcoind.js:447:13)
    at /usr/local/lib/node_modules/@owstack/bch-
node/lib/services/bitcoind.js:779:28
    at newCallback (/usr/local/lib/node_modules/@owstack/bch-
node/node_modules/@owstack/bitcoind-rpc/lib/index.js:52:16)
    at ClientRequest.<anonymous>
(/usr/local/lib/node_modules/@owstack/bch-
node/node_modules/@owstack/bitcoind-rpc/lib/index.js:136:7)
    at ClientRequest.emit (events.js:160:13)
    at TLSSocket.socketErrorListener (_http_client.js:389:9)
    at TLSSocket.emit (events.js:160:13)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at process._tickCallback (internal/process/next_tick.js:152:19)
[2018-02-09T13:37:26.961Z] info: Beginning shutdown
[2018-02-09T13:37:26.961Z] info: Stopping @owstack/bch-explorer-api
(not started)
[2018-02-09T13:37:26.962Z] info: Stopping web (not started)
[2018-02-09T13:37:26.962Z] info: Stopping bitcoind
[2018-02-09T13:37:26.962Z] info: Halted

bch-node.json file
{
  "network": "testnet",
  "port": 3007,
  "services": [
    "@owstack/bch-explorer-api",
    "bitcoind",
    "web"
  ],
  "servicesConfig": {
    "bitcoind": {
      "spawn": {
        "datadir": "./data",
        "exec": "/usr/local/lib/node_modules/@owstack/bchnode/bin/bitcoind"
      }
    },
    "explorer-api": {
       "rateLimiterOptions": {
         "whitelist": ["::ffff:127.0.0.1"]
       }
     }
  }
}

bitcoin.conf file
server=1
whitelist=127.0.0.1
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.2:28332
zmqpubhashblock=tcp://127.0.0.2:28332
rpcallowip=127.0.0.1
rpcuser=bitcoin
rpcpassword=local321
uacomment=bch

Installation Process:
npm install -g @owstack/bch-node
bchnode create -d <bitcoin-data-dir> mynode
cd mynode
bchnode install https://github.com/owstack/bch-explorer-api.git
bchnode start

It should run "http://localhost:3007/bch-explorer-api/" but it is not returning anything and it is getting error after 5 minutes in my linux terminal.
Please help me about this error related bitcoin cash block explorer.
I am trying to configure https://bch-insight.bitpay.com this explorer in my local server If you have any reference github link then please share with me because I m not able to find it.

Can you please try replacing bch-node.json file with this:
{
  "network": "testnet",
  "port": 3007,
  "services": [
    "@owstack/bch-explorer-api",
    "bitcoind",
    "web"
  ],
  "servicesConfig": {
    "bitcoind": {
      "spawn": {
        "datadir": "./data",
        "exec": "/usr/local/lib/node_modules/@owstack/bch-node/bin/bitcoind"
      }
    },
    "explorer-api": {
       "rateLimiterOptions": {
         "whitelist": ["::ffff:127.0.0.1"]
       }
    },
    "fee": {
      "rpc": {
        "user": "bitcoin",
        "pass": "local321",
        "host": "127.0.0.1",
        "protocol": "http",
        "port": 18332
      }
    }
  }
}

Because Bitcore won't be able to connect to your node without knowing your RPC username and password.

Can you explain what changes have been made to fix the problem?  It makes it easier for everyone to see what the problem was, and what the solution is.

@MCCCS  Facing same issue after editing bch-node.json file.

@kiranmalvi Try asking it here: https://github.com/bitpay/insight-api/issues

@MCCCS: Solved issue as you suggested


text:
Regarding Stellar as an Alternative currency transaction manager
I am working on an alternative currency.
We are not wedded to any particular software, but have definite term and conditions for participants.
Our own dispute resolution system, and standard of value.  One credit equals the median hourly wage for your community. We also impose a transaction fee of 2.5% to each party to support the institutions to manage dispute and legal documents and promote  the exchange.   We also are based on the lets system with equal positive and negative balances.
Could we potentially use your Stellar system to manage the transactions in a system such as this ?
Andrew Hill

(Full disclosure:  I work for Stellar.org)
I'm not quite sure what you mean by "We also are based on the lets system with equal positive and negative balances.", so I cannot comment on how that effects Stellar's viability for your problem, but I can talk about the transaction fee you would require.
As of now (December 2015), the stellar network itself only has support for the native transaction fees used for spam prevention.  This means that you would have to implement your own support for transaction fees.  Let me describe how one such system might work on the stellar network:
Since the stellar network doesn't have support for collecting a transaction fee at the time of payment, you must instead collect transaction fees after the fact.  Members of this system would be invoiced by you with their billed fees, and they would pay to keep their account in good standing.  When an account is not in good standing, your system would revoke access to your currency (see "Controlling asset holders" at https://www.stellar.org/developers/learn/concepts/assets.html for details) that would prevent the account from making or receiving payments in your currency until you restore access.
Now, such a system is definitely more complicated than if the stellar network handled custom transaction fees natively, but our intention is to keep the core stellar network as simple as possible, and one of the features that got chopped was support for asset-based transaction fees.  Luckily, this is a great opportunity for a group of developers to build a helper service to support this use case.  Tracking payments on the stellar network and managing an account's standing based upon a set of customizable business rules seems like a generically useful tool to have available for developers and could benefit a large range of use cases, from custom currencies to e-commerce systems, to even something crazy like a stellar-funded metered power grid.  I'd be happy to discuss such a solution further if you're interested.

Well,  LETS is a "Local Exchange Trading System" in which everyone starts with a zero balance. The first transactions require someone to have a trusted credit line, they can then purchase something on credit putting them into a negative balance, while the other person receives an equal but positive amount into their account.  These credit lines  are interest free.

At any moment if all accounts are totaled they will sum to zero.  Proof that there has been no fraud.  At some point everybody's accounts will return to zero.  In this way the currency is not meant to be a commodity in itself, only a medium for exchanges. A secondary medium like gold or silver will be a more tangible for of wealth. This has certain legal advantages

The other requirement was to have a transaction fee go to a third party arbitrator.  This also has certain legal benefits.  For almost all alternative currencies, what happens if you have a dispute ?  I goes to the government courts, right ?  Well this is one reason why the alternative currency gets taxed by that government. Therefore, we need to set up our own courts.

In regards to your question, I would be interested.  I currently have a third party barter exchange, taking on the role of transaction management, but in the future would like to offer a more sophisticated and self managing system.


text:
Why can't I spend my reserve XRP and delete my address from the network?
I understand the Ripple reserve system. You need some XRP in order for you to preserve your account into the Ripple network and additional XRP to assign trust line to your account. I also understand that you cannot spend this reserve because otherwise your account will be removed from the network and forgotten.
However, what if I want to recover the XRP from an account because I don't need the account anymore? Shouldn't it be possible to spend the reserve XRP on your own risk?

"8c" is 8 cents or USD 0.08, the current value Gracchus calculated for the 20 XRP account reserve.

The issue is that for safety reasons Ripple currently has no way to remove the account root ledger node to completely remove a Ripple account. Since the reserves exist to help limit the size of the current ledger, any un-deletable ledger node requires a non-refundable XRP reserve (although if the XRP reserves are lowered, as they have been in the past, the difference becomes spendable again). Note that a Ripple account can use all of their XRP in transaction fees, just not in payments or trades.
There is a good discussion on why Ripple doesn't allow for account deletion on the Ripple forums. Basically, doing so would make it possible for a user (or client) to in error re-create the same Ripple account/address (e.g. if someone uses an old Ripple secret to "recover" their account). That would make old transactions signed by that account now be potentially valid against this "new" account (since Ripple uses a simple sequence number per account to prevent replays).

Changing the Reserve Requirements
The XRP Ledger has a mechanism to adjust the reserve requirements for long-term changes in the value of XRP. Any changes have to be approved by the consensus process. See Fee Voting for more information."

Basically, give it some time and they will change the requirement.


text:
Are there minimum transaction fee, and is it based on the number of input transaction (UTXO)?
I know probably everyone give an extra transaction fee, but are there minimum transaction fee that one must pay, and is it based on the number of input transaction (UTXO)?
And I have read that wallet developers tries to eliminate small UTXOs when preparing a new transaction. So is there harm for having too many small/dust UTXOs?

The miner fee is .001 BTC/KB. Median transaction sizes are around 226b.

@bitsabhi thanks! is the max number of txn a miner can put in a block limited by the block size, or limited by a pre-defined max txn number?

Block Size. Since the block size is hardcoded to 1mb, and let's assume all the transactions are of  226b. So the total possible transactions would be around 4.5k. But usually that's not the case as after a block is mined, no more transactions can be added. I have seen 1000-1500 txns in some blocks.

@bitsabhi that seems an inefficiency of the mining program, seems like the block will no longer change after the hashing has started, shouldn't it be more efficient that the block can be updated during hashing. And because hashing is by definition random, modifying the block does not reduce the chancing of mining a block. What does it harm?

@bitsabhi Oh do you mean a block is found before it could be filled?

are there minimum transaction fees?

No, you could also pay no fee but your transaction will probably not be included in a block then. This is a pretty old example-transaction with no fee paid: https://blockchain.info/de/tx/8131ffb0a2c945ecaf9b9063e59558784f9c3a74741ce6ae2a18d0571dac15bb

and is it based on the number of input transaction

Not on the number but on the size in Bytes.

So is there harm for having too many small/dust UTXOs?

Yes. You can see it at the moment. People pay around 1.80$ for a "one address to one address"-transaction. More inputs/outputs means a bigger size. Bigger size means higher fees.

Can you elaborate why "Bigger size means higher fees"? Is it because the block size is fixed, so bigger size transaction means the miner can fill in less transaction in a block, thus it needs more fee to be included?

Yes. the maximum is fixed. A miner mines a block which has a limit of around 1 Mb. So if the miner includes a big transaction into a block, he can maybe not include 4 smaller ones with better fees. If you pay 2 dollars for a 1000 bytes transaction but 4 other people with 250 byte transactions pay 1 dollar per transaction, the miner can choose between getting 2 dollars from you for 1000 bytes or getting 4 dollars for the other 4 transactions (also with 1000 bytes in total).


text:
Sendrawtransaction error on Bitcoin Core Version 0.16.0
I updated my bitcoin core to version 0.16.0, previously I was using v0.15.1.
I created an application to send some BTC using listunspent -> createrawtransaction-> signrawtransaction -> sendrawtransaction
I got this error on v.0.16.0 while using sendrawtransaction :

64: non-mandatory-script-verify-flag (Signature must be zero for
  failed CHECK(MULTI)SIG operation)

But my app working normaly on version 0.15.1
What is actually going on on version 0.16.0 that makes my transaction error
I decoded my raw transaction, to see if anything is wrong, I am using BTC testnet
array:2 [
  "status" => true
  "result" => array:8 [
    "txid" => "261c30c9c167b079c45c5ea706617635eb477b9cb601b7c7addbd6fedc2c14d9"
    "hash" => "261c30c9c167b079c45c5ea706617635eb477b9cb601b7c7addbd6fedc2c14d9"
    "version" => 2
    "size" => 197
    "vsize" => 197
    "locktime" => 0
    "vin" => array:3 [
      0 => array:4 [
        "txid" => "d4fcae2238c7edde389c3e1d28ddd67570931c72982312fbae3292c6eb7b7620"
        "vout" => 0
        "scriptSig" => array:2 [
          "asm" => ""
          "hex" => ""
        ]
        "sequence" => 4294967295
      ]
      1 => array:4 [
        "txid" => "5e759bcccc5123e9fbad740b57a1571a5950e867619dfd4cbbe6786dd50ab054"
        "vout" => 0
        "scriptSig" => array:2 [
          "asm" => ""
          "hex" => ""
        ]
        "sequence" => 4294967295
      ]
      2 => array:4 [
        "txid" => "d1be0d65d5338c9bc4b51b14f6adee7f88e56d0f9625c92646e16aa86e7c6a71"
        "vout" => 1
        "scriptSig" => array:2 [
          "asm" => ""
          "hex" => ""
        ]
        "sequence" => 4294967295
      ]
    ]
    "vout" => array:2 [
      0 => array:3 [
        "value" => 1.0
        "n" => 0
        "scriptPubKey" => array:5 [
          "asm" => "OP_HASH160 7ba3562975f6203987c03b40dd84e010948af2e4 OP_EQUAL"
          "hex" => "a9147ba3562975f6203987c03b40dd84e010948af2e487"
          "reqSigs" => 1
          "type" => "scripthash"
          "addresses" => array:1 [
            0 => "2N4WxmhixnDF6x2gmJSjgoX28RMSd6oCaMr"
          ]
        ]
      ]
      1 => array:3 [
        "value" => 6.01032205
        "n" => 1
        "scriptPubKey" => array:5 [
          "asm" => "OP_HASH160 b449a4b595e856c16eba7d7168ac5fdcc552fbbf OP_EQUAL"
          "hex" => "a914b449a4b595e856c16eba7d7168ac5fdcc552fbbf87"
          "reqSigs" => 1
          "type" => "scripthash"
          "addresses" => array:1 [
            0 => "2N9gVqeSJnLKPGRJJa2gKXUPy5bT331sxNo"
          ]
        ]
      ]
    ]
  ]
]

That error just means the signature is invalid. Did signrawtransaction succeed and produce a fully signed transaction?

yes it's succeed on raw transaction. And I forgot to mention, v.0.16.0 need redeemScript on signrawtransaction, on v.0.15.1 I don't need that, it's that the culprit ?

If you're spending outputs on P2SH-P2WPK addresses (which are default on Bitcoin Core 0.16) you need a redeemscript to sign, yes. Are you perhaps supplying an incorrect one?

I am sure I supplied the correct one, can you check my decoded rawtransaction above ? I provide one using testnet transaction

The scriptSigs of your transaction are completely empty which means that no redeemScript was provided nor are there any signatures.

I encountered the same issue, to resolve I resorted to starting the bitcoind daemon using the following flag:

-deprecatedrpc=signrawtransaction

I am now looking for a better solution.

In v0.17 / master, signrawtransaction was split into signrawtransavtionwithkey and signrawtransactionwithwallet. This is not OP's problem.

@peterwuille signrawtransactionwithwallet there is a typo in your comment (the v should be a c) (it won't let me suggest an edit)


text:
Address final balance is 0 after receiving 0.003 BTC
I generated a new BTC address (address A). I tried to send 0.003 BTC to address A. After sending them from my coinnomi wallet, the balance of address A remains 0 and from output seems that 0.003 BTC was send from address A to a mysterious address B. This action was not performed by me. Can somebody explain to my what happened. Thanks in advance for your time
https://www.blockchain.com/btc/address/1ECcv4vKES17iJFPVQ5Uoah5H5CzNJRXUo
EDIT: Problem solved. A good lesson learned. I used the mnemonic found on the code online without changing it. I am really angry with myself for being so stupid.

Which wallet software generated your new address? I'm predicting that your new wallet software is hacked and not genuine.

Then bip39.generateMnemonic is trustworthy, I don't know what could've gone wrong. (BTW I'd call the function as bip39.generateMnemonic(256) to increase entropy to 32 bytes from 16)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How to sign Raw Transaction with Multiple Inputs
What is the procedure to sign a raw transaction with multiple inputs, i have some doubts, this is what i am doing:
Step 1
First I serialize 1 unsigned tx for each input.
INPUT 1

02000000 // Version
02 //In Count
d444d165b2aa04fcf9074eb1a0e5b6d528663a80d1732092f5a62fbdb175378c
00000000
19 // Sig Length
76a914c29b169112aa249e5ada916d8e259ed7d16cf58688ac // Temporary Sig
ffffffff
f6dd8d85c831a2f196cc5e4c43792bf25a6d2b119d59b8f430edaa8d20dedc5c
00000000
00 //Empty Sig
ffffffff
02
7485010000000000
19
76a91451e9f768d4ca9a7a36084b0138a154d0b98b53c688ac
6400000000000000
19
76a91451e9f768d4ca9a7a36084b0138a154d0b98b53c688ac
00000000
01000000

INPUT 2

02000000
02
d444d165b2aa04fcf9074eb1a0e5b6d528663a80d1732092f5a62fbdb175378c
00000000
00 // Empty Sig
ffffffff
f6dd8d85c831a2f196cc5e4c43792bf25a6d2b119d59b8f430edaa8d20dedc5c
00000000
19
76a914c29b169112aa249e5ada916d8e259ed7d16cf58688ac //Temporary Sig
ffffffff
02
7485010000000000
19
76a91451e9f768d4ca9a7a36084b0138a154d0b98b53c688ac
6400000000000000
19
76a91451e9f768d4ca9a7a36084b0138a154d0b98b53c688ac
00000000
01000000

Step 2 For each input, i double sha256 and then reverse it.
Step 3 I sign each hash:
6b4830450221008d998e1d6c91ef14d76934a818731d58328ad97ed2c78f092d86750da5d28635022013d827ca2ab96bd8e7f069cffb6b80def6f4243a9dcca54e730de5d05306d03e0121036bc7427b751bd05d172178dbe3193f02a57615cdd8e079ad46bde44b5a96379e

6a47304402202569958de7a0d45052e651ed7b5c97b8d6bb04deef5d588099026a1298a18a0802204339ae2438436b2d90cdbd41cd1d19028ddfc8eaa490298e0a1c93d33da608640121036bc7427b751bd05d172178dbe3193f02a57615cdd8e079ad46bde44b5a96379e

Step 4 I serialize the final Transaction:
02000000
02
d444d165b2aa04fcf9074eb1a0e5b6d528663a80d1732092f5a62fbdb175378c
00000000
6b
4830450221008d998e1d6c91ef14d76934a818731d58328ad97ed2c78f092d86750da5d28635022013d827ca2ab96bd8e7f069cffb6b80def6f4243a9dcca54e730de5d05306d03e0121036bc7427b751bd05d172178dbe3193f02a57615cdd8e079ad46bde44b5a96379e
ffffffff
f6dd8d85c831a2f196cc5e4c43792bf25a6d2b119d59b8f430edaa8d20dedc5c
00000000
6a
47304402202569958de7a0d45052e651ed7b5c97b8d6bb04deef5d588099026a1298a18a0802204339ae2438436b2d90cdbd41cd1d19028ddfc8eaa490298e0a1c93d33da608640121036bc7427b751bd05d172178dbe3193f02a57615cdd8e079ad46bde44b5a96379e
ffffffff
02
7485010000000000
19
76a91451e9f768d4ca9a7a36084b0138a154d0b98b53c688ac
6400000000000000
19
76a91451e9f768d4ca9a7a36084b0138a154d0b98b53c688ac
00000000

The problem that I have
I get this when broadcasting the TX: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)
What I am doing wrong?, should i put the SigHashType at the bottom of each TX 01000000, exactly what i need to put on the Temporary Sig, i am putting my Script Public Key Hash

Start by removing "Timestamp" bytes, they don't exist in a transaction!

I forget to mention that i am using a Bitcoin fork that has timestamp (Emercoin), but it should work the same as Bitcoin, i already get working a single input TX. But i will remove it on this post to dont cause confusion, thanks

Your second step is also strange, we don't reverse SHA256 result before signing.

This is what i was doing wrong thank you very much, post this answer to give you the reputation if you want!


text:
Miniscript exercise for 3of4 multisig that turns into a 2of4 where 2 specific keys only can spend
I was trying to write this script (miniscript)
or(multi(3,pk(key_1),pk(key_2),pk(key_3),pk(key_4)),and(older(12960),multi(2,pk(key_3),pk(key_4))))
where it's a 3of4 multisig which turns into a 2of4 (only key 3 and key 4) after 90 days..
it gives a "compile error" on bitcoin.sipa.be/miniscript/
I also wrote this:
or(9@thresh(3,pk(key_1),pk(key_2),pk(key_3),pk(key_4)),and(older(12960),thresh(2,pk(key_3),pk(key_4))))
but it gives "duplicate keys" error
what am I doing wrong ?
also, what the correct code would look like?

The second branch is a 2-of-2, not 2-of-4, is that what you want?

yes I want 2 of 2 but specifically only key 3 and 4 must sign

@Ziya_Sadr If you get a compile error, you're not writing Miniscript, but policy language (the compiler on my site compiles policy to Miniscript). "multi" does not exist in the policy language.


text:
How long does it take for a transaction to be included in a block?
If I understand it correctly, a transaction must be included in a block and broadcasted to other nodes before the transaction is accepted as valid. But it takes time to create such a block which only miners create.
How much time does it take before the transaction is registered as valid?

You should post those as separate questions and first check if it is already answered somewhere before.

Ok how long time does it take before the transaction is registered as valid?

Depends on the transaction fees, the no. of transactions at that time, etc.

And how much is the miner rewarded for creating that block?

The block reward right now is 12.5 BTC and the transaction fees.

How many transaction can there maximum be in a block?

Varies w.r.t. the transaction. On average (as of Nov 2017) 11K+ per hour (Source)

The difficulties increases all the time. Will we reach a point where it is impossible to create blocks (=The end of bitcoins)

The difficulties increase because the mining power is increasing. If there comes a point where the miners drop out due to increase of difficulty, then the difficulty decreases within 2 weeks. It will decrease in such a way that to make it an average of 10 minutes to mine a block.

Time between mining the blocks is around 10 minutes. Bitcoin protocol adjusts itself to keep that 10 minutes target.
But the transaction is not necessarily included in the next block. It depends on the number of transactions and fee you provide to incentivize the inclusion of your transaction. If the fee is too low transaction will never be mined (put in the block and added on blockchain). If the fee is reasonably high it will be included in the next block (so less than 10 minutes time).
The party receiving the money should not consider transaction valid up until it is "buried" under a number of other blocks (let's say 6 - so another 60 minutes after your transaction is added on the blockchain).

This is a better answer IMO because it recognises the OP's desire at how long it takes a transaction to be "valid" - a term that has a large degree of subjectivity within a block-chain. For some people/companies, even transactions 10 block levels deep might not be valid if they have only 1 confirmation (unlikely scenario but nonetheless possible!)


text:
How Segwit makes transactions smaller? What about the witness?
I have seen similar questions without a clear answer. So, how does Segregated Witness make transactions smaller? I understand it removes data from the transaction hash and solves malleability ... But it adds a field called "witness", so, how does this save space?
Also (this is related and helps understand the question), how is block size calculated? Does it include the witness?

SegWit doesn't save space, per se.
What it does do is:

From the perspective of a non-upgraded node, it makes transactions seem smaller. The witness part is not recognized or considered by pre-fork nodes, so more of them can fit in a block.
From the perspective of an upgraded node, the block size is calculated differently. Less weight is assigned to witness data than to non-witness data. So for the purpose of the calculation, a SegWit transaction is considered lighter than a non-SegWit transaction. So more of them are allowed per block - but the physical data size of the block increases as a result.

SegWit was to be introduced anyway because it solves malleability etc. But it also offered an opportunity to increase the block size limit (to allow more transactions) without requiring a hard fork, and this opportunity was seized, resulting in the feature described above.

Hello. Thanks for the answer, you write "Less weight is assigned to witness data than to non-witness data", this is kind of confusing, can you elaborate? how is block size calculated? I will update the question to include this.

Blocks are no longer limited by size in bytes, rather they are limited by the number of "weight units" which are an arbitrary unit based upon bytes. Each byte of a transaction that is not witness data (so everything that a non-segwit node would see) is worth 4 weight units. Every byte of witness data is worth 1 weight unit. Blocks are limited to 4000000 weight units, which, if full of non-segwit transactions, is 1 MB.


text:
How much bandwidth needed for bitcoin bigger blocks
If the Bitcoin blockchain would support 2000 transactions per second, how big would the blocks need to be (with segwit at 100% lets say), and most importantly, how much bandwidth would be necessary for a miner to propagate the blocks to 8 peers?

The very question is, "Bitcoin can be support the 2000 transactions per second?" so I think to exist other component work on bitcoin for improving transaction speed

If you consider that Bitcoin currently does 2000 transactions each 10 minutes, you'll need blocks 600 times bigger, or more-or-less 1.2 GB each. Now you need bandwidth sufficient for that peer to transmit 9.6 GB each 10 minutes (1.2 GB * 8 peers -- I have no idea of what you meant by "necessary" bandwidth).
That's doable if you only have one miner in the entire network.


text:
What are those bitcoin mining hardware doing 24/7?
What are those hardware doing? Which open-source or closed source software to use on those? I want to buy one of those hardware for my learning and programming.
Any advise?

Latest technology of Antminer or rather do your research for the new ones.

I went to a demo room, they had lot of those machines i could not figure out yet what are those doing and which software is used. I want to make an open-source software using my C++/Qt/C# skills on that. Looking for where to get started

I suppose this is what you are looking for - https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp
it's already written in C++. but as far as I know it's open source so you can tweak it in whatever language you like.

I am very curious to get started, my main goal is to make something free for community using rasperry pi or open-source CentOS/Ubuntu/ArchLinux. Step 1) should i be first requiring a Antminer hardware? or i can without get started with regular 64-bit PC's? Step 2) Programming wont be any issue but how do you make official wallets to make the networking or connecting to shares for getting inside the business?

in my own opinion you should get your own antminer first since you're gonna tweak it's software (not budget friendly, look at the price)
secondly, you can use bitcoin-core and install it into Ubuntu/CentOS server in order for the users/clients to generate their own addresses.

@YumYumYum I think your idea is generous on behalf of people who are gonna use your Open source code, if ever. but I think it'll be a waste of time since Bitcoin itself is open source.

Buy antminer (hope it has software already to use and learn and then think how to improve it) 2) Get open-source framework that is available here https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp and then update into custom requirements? CORRECT?

yes, but the answer is up to you, again, buying antminer just for tweaking it's sofware isnt budget friendly. you are just going to waste money.


text:
Android Bitcoin Wallet freshly installed, two addresses. Why two?
First off, I am rather new to Bitcoins — will be obvious after I asked my question I guess. I have read some theory about it, like it's a distributed crypto-currency based on the Bit Torrent protocol, but I still have some difficulty putting everything together.
I have freshly installed Android Bitcoin Wallet on my phone, just wanted to start somewhere. I opened the preferences and I see I have two addresses without a label — which I guess I shall define. My first question is : why are there two addresses?
I understand an address is like an SSH private public (EDIT: sorry for the confusion, seems obvious indeed) key and I think I understood it's best to have one address for my phone, one for my computer... whatever. Since I read an address shall be a single-use token, is one of them for giving and the other for receiving bitcoins?
Since an address is a single use token does that mean I should create an address each time I want to pay using bitcoins? What about receiving bitcoins then? How do people send bitcoins if change my addresses constantly?
And what if I delete an address? Will it have an effect on bitcoins I'd eventually "collected"?

Bitcoin is not based on the BitTorrent protocol. Has nothing to do with it. Bitcoin uses a peer 2 peer network, BitTorrent has one too. But neither were the first or are all that similar.

You are asking multiple questions, which is not how this website works. Also: all of them have been answered several times already if you search a little. I'll try to answer some anyway, to take away some of your misconceptions, which should help you back on the right track.
Misconception: Bitcoin is not based on the BitTorrent protocol. It has nothing to do with it. Bitcoin uses a peer 2 peer network, BitTorrent does too. But neither were the first or are all that similar.
Misconception: An address is NOT like an SSH private key. An address is "like" a public key (not exactly, but that distinction is not important right now). An address is what you give to someone else to have them pay you.
Hidden inside the wallet is the private key or more precisely in current wallets: the Master key from which multiple private keys are generated. If you make a backup of your wallet (which you should do!) you will get to see that master key: it's simply a list of 12 or 24 English words.
The address is used to receive bitcoins. The private key is what you need to be able to spend them. But the private is pretty much invisible to you, you don't need to care as long as you have the Master key backed up (and protected!) properly.
Address re-use is very much discouraged, for privacy reasons. Once you "use" an address, the wallet will automatically prepare a new address for the next use.
The specific wallet app you are using generates two addresses in advance to get you started.
I don't think you can delete an address in this app.
It is possible to have multiple devices use the same Master key, but it will mean that if one of those devices gets compromised and someone steals your Master key, you will lose ALL your money. It's probably better to keep things seperate until you're ready for more advanced setups. (multi-signature for example)

Thanks for the clarification and for putting up with my multiple questions in one go. Since addresses cannot be deleted manually, do they disappear on their own? Otherwise the risk is to pile up loads of no-longer-useful addresses in the long run.

@Jannes Just to clarify, we're only meant to use each receive address once?

Yes that's the ideal situation. No bitcoins are lost if two payments accidentally use the same address, but it ties the payments together for outside onlookers "aha! These two people made a purchase at the same shop!"


text:
My Bitcoin Transfer is unconfirmed and its 2 days
Can anyone help me please? I tried withdrawal money via yobit to another wallet but I see no issue on Yobit's side. Can anyone tell me how to get it done right away? My withdrawal BTC is really lesser like $200 so I can't pay $150 for the transaction to accelerate :/
This is not duplicate since I have paid much fee $0.0008 already for transaction.

It's a duplicate again. You could give us the transaction id so that we could tell you if the fee is ok or too low.

I don't think fee is the issue here please see the 2 transactions I did and it's stuck
827af3bb0c34637c7d0f689a82e6a47fab9af7daacc8632910af4a779e20b267

f21ccdfac78d9adc9686e8fb2ca54ac1a8504fa4a54a6c31a87f9125bd6eff46


text:
Compiled version of bitcoind 0.18.1. "Could not connect to the server 127.0.0.1:8332"
When I use the official installed bitcoind 0.18.1 everything works fine. I can use the bitcoin-cli with any comands and don't get any errors.
After that when I compiled 0.18.1 myself I can't use any bitcoin-cli comands and I get:

error: Could not connect to the server 127.0.0.1:8332
  Make sure the bitcoind server is running and that you are connecting to the correct RPC port.

I use bitcoin-cli without any options, just a: bitcoin-cli.exe getbalance or bitcoin-cli.exe stop
Here is my simple bitcoin.conf which I use with the both versions:
server=1
rpcuser=username
rpcpassword=password
rpcallowip=127.0.0.1
rpcport=8332
datadir=F:\BitcoinData

I compile it with MinGW-w64-i686-posix-sjlj on Win7 target platform and with boost 1.57, libdb 4.8.30, openssl 1.0.1, libevent 2.0.22 as a dependent libs. I tried to compile 0.16.1 verion with the same stack but error is a similar:

error : couldn't connect to server : unknown (code -1) (make sure server is running and you are connecting to the correct RPC port)

What is wrong with compiled version? I can't realise what I missed. The compilation went without any errors. May be I missed some ./configure options?

I tried to replace bitcoin-cli from installed version. When bitcoin-cli getbalance I get another errors: error: Could not connect to the server 127.0.0.1:8332 (error code 2 - "error while reading header, or invalid header") but  bitcoin-cli stop works fine in this case.

The problem was in libevent 2.0.22. It spoiled HTTP response from bitcoind every time. libevent 2.1.11 fixed this issue.


text:
Why is the rate of reindexing chainstate not constant?
What determines the speed of the reindexing-chainstate in the different times?  I spend a few days (2 week) for reindexing locally on my new HDD, and I noticed one thing: the speed of reindexing is not constant and sometimes it takes 1 second to execute 10 blocks, blocks flyes through your screen, your CPU is 100% loaded , but sometimes it takes 30 seconds for one block and your CPU take 10-20%. It can happen the same way in earlier or later blocks, it doesn't matter. I know reindexing to exeсute locally and this is not the fault of a weak Internet connection. The blocks are in most cases the same size. Why the reindexing speed is not constant?

Updates to the UTXO are write cached, you will see pauses when this is flushed to disk periodically.

Thanks, but in most cases, reindexing is slow and only occasionally accelerates to good speeds and lasts for hours. This is not pauses.

Due to the design of the UTXO cache in Bitcoin Core, you generally get significantly reduced performance just after flushing, as it involves wiping the cache. Depending on the size of your dbcache and the speed of your disk, this effect can be pretty extreme.


text:
Mining Theory: GPU/ASIC Computation vs Co-processor Computation
I am very new to bitcoin and I am trying to understand a bit about mining theory. I do not dispute the convention of using ASIC based computation for bitcoin mining, but rather I'm curious about why they outperform co-processors like this for mining. Maybe a nuanced discussion of a few of the various trade-offs would be the easiest and clearest way to understand things. Let me break it down like this:
Parallelism: Co-processors are mostly used for task parallel code (non-vectorized code) whereas GPUs are adept at data parallel (vectorized) code. Two questions come to mind:

Are all mining codes in vectorized languages?
Can there ever be a benefit to mine in task parallel code? It seems like with bitcoin mining, there is only 1 task: crunching numbers. Am I oversimplifying it though? Perhaps with task parallelism one could run other algorithms to assist with the number crunching (such as compression, flush to zero, ect).

Calculations: Speaking of flush to zero, GPU's tend to perform better than co-processors with floating point calculations. However, co-processors perform better in logical as well as arithmetic calculations.

Is floating point calculation more important than logical/arithmetic in bitcoin mining?

Latency:
Since GPUs run in sync, the whole dataset has to be transferred at the beginning and end of each task, but co-processors can move all the data from RAM to Host RAM in a fraction of a second. I'm not sure if this is true of ASIC processors, maybe it's different.

Would the issue of latency ever warrant the use of co-processors for mining, or is latency not a big issue?

Main Question Could there ever be a pure co-processor mining machine? What about a hybrid system using an array of co-processors and GPUs for the best of both worlds? Or would GPUs beat co-processors every time? Why or why not?
You may approach this question from any angle as per the content above. The answer doesn't have to answer all questions, I thought I would just include a few interrelated questions for robustness/comparison purposes.
I want to stipulate some assumptions to make sure the answer is mostly from a theoretical standpoint. I want to make the logistics of it all mostly out of scope.
Assumptions

Power consumption is out of scope
Unit price of GPUs and co-processors is out of scope (obviously
co-processors are ungodly expensive)
Cost of electricity is out of scope

You may want to rethink this question because you are basing it off the assumption that people mine bitcoin blocks with GPUs, which hasn't been the case since 2013. Look up ASIC processors

This and a followup were going around recently.
"Last week I posted on my latest toy, a rig that used eight Xeon Phi 7220 cards in a single 4u-server to achieve a total of roughly 24kH/s for cryptonote coins"

hmm, that's cool. I figured someone would want to experiment with scientific-grade co-processors. They seem slightly cost-prohibitive, but maybe they compensate somehow as per my OP (latency, calculations, ect)? Or maybe this guy built one to be solely a novelty item. Pretty cool either way, thanks!


text:
Lightning: why don't balances add up to capacity?
I've created a brand new lightning channel with two nodes.
I loaded the channel with "capacity": "1000000", but "local_balance": "999056". I know that "commit_fee": "614" accounts for some reserved sats for channel closing. But that still leaves about 330 sats unaccounted for. Where are these sats visible? Thanks
"channels": [
        {
            "active": true,
            "remote_pubkey": "0340b6591708a3bc385aef0c69e6e618e5e3de0f66d923607f55ea035b71dedd47",
            "channel_point": "6ac2d8f922b0d1f2d5de39d2819777cb8bc40b6d8f6226211bbba34eada55965:1",
            "chan_id": "2582377880184815617",
            "capacity": "1000000",
            "local_balance": "999056",
            "remote_balance": "0",
            "commit_fee": "614",
            "commit_weight": "772",
            "fee_per_kw": "253",
            "unsettled_balance": "0",
            "total_satoshis_sent": "0",
            "total_satoshis_received": "0",
            "num_updates": "0",
            "pending_htlcs": [
            ],
            "csv_delay": 144,
            "private": false,
            "initiator": true,
            "chan_status_flags": "ChanStatusDefault",
            "local_chan_reserve_sat": "10000",
            "remote_chan_reserve_sat": "10000",
            "static_remote_key": false,
            "commitment_type": "ANCHORS",
            "lifetime": "24",
            "uptime": "24",
            "close_address": "",
            "push_amount_sat": "0",
            "thaw_height": 0,
            "local_constraints": {
                "csv_delay": 144,
                "chan_reserve_sat": "10000",
                "dust_limit_sat": "573",
                "max_pending_amt_msat": "990000000",
                "min_htlc_msat": "1",
                "max_accepted_htlcs": 483
            },
            "remote_constraints": {
                "csv_delay": 144,
                "chan_reserve_sat": "10000",
                "dust_limit_sat": "573",
                "max_pending_amt_msat": "990000000",
                "min_htlc_msat": "1",
                "max_accepted_htlcs": 483
            }
        }
    ]

But that still leaves about 330 sats unaccounted for

You are probably missing the anchor output contained in the commitment transaction in your calculation. Its value is exactly 330 sats.

Note: this answer previously incorrectly assumed it was due to the reserve not being part of the balance. It was entirely re-written.

"This is called the reserve. Your node will not show you the reserve as part of your balance (since you can't spend it)." This part is a bit confusing. My local balance shows 999056, but my local_chan_reserve_sat is 10000. My local balance is not missing 10k sats from capacity, only less than 1k sats.

Hmmm right. I'm wrong, the reserve appears to be part of your balance here. Maybe you just made a mistake in computing transaction fees. I'll delete my answer to not mislead anyone else.

Oh, you probably just forgot to account for the anchor output! I'll update my answer instead.


text:
Is there an address format for P2WPKH or P2WSH?
Is there an address format for P2WPKH or P2WSH? If P2WPKH uses the same address format as P2PKH, how does a sender's wallet know which one to use?

Yes. The format used for encoding native version 0 Segwit scriptPubKeys (P2WPKH and P2WSH) is bech32, defined by BIP173. The format used for encoding Segwit scriptPubKeys version 1 and above is bech32m, defined in BIP350.

Is there an address format for P2WPKH or P2WSH?

No.  BIP142 would have provided an address format for these output scripts, but it is in "deferred" status and expected to remain that way.  Wallet developers are being encouraged to discuss a new address format on the bitcoin-dev mailing list, and it is my understanding that one proposal may be coming soon.
In the meantime, BIP70 supports paying to arbitrary outputs, so it can be used for the native segwit outputs, as can any other software that communicates using its own protocol (such as payment channel software like that being used for various Lightning Network implementations).

If P2WPKH uses the same address format as P2PKH, how does a wallet know which one to use?

Although the new address proposal will probably not use base58check like the current address formats for P2PKH and P2SH, the now-deferred proposal in BIP142 explains how this could easily be done by changing the first byte of the address (which is a version number):
"For P2WPKH address, the address version is 6 (0x06) for a main-network address or 3 (0x03) for a testnet address.
"For P2WSH address, the address version is 10 (0x0A) for a main-network address or 40 (0x28) for a testnet address."

There is one now - https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki


text:
How were the secp256k1 base point coordinates decided?
79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 seems very random to me. I see how this point is on the curve, but how exactly was this specific point chosen to be the base point? Could other base points have worked?

Does this answer your question? How is the generator point G chosen in the secp256k1 curve used in Bitcoin?

Since the secp256k1 curve order is prime, every point on the curve except the point at infinity is a generator.
Nothing is known about how the designers of the curve chose this specific generator.
However, there is one tell-tale sign that hints about its construction. When the chosen generator G is multiplied by 1/2 (i.e. multiplied by the multiplicative inverse of 2 modulo the curve order), the resulting X coordinate is an exceptionally low number. This very likely means that G was created by picking that X, finding a corresponding Y on the curve, and then doubling the resulting point.

Can you share this low number X?

G/2 = (0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63, 0xc0c686408d517dfd67c2367651380d00d126e4229631fd03f8ff35eef1a61e3c).

Is there a reason why it needs to be random and large like this? It seems like y^2=x^3+7 is a nice "nothing up my sleeve" curve, but I can't say the same about this base point. Is security compromised in any way if the X coordinate of the base point was chosen to be a tiny number like 3 or 7?

@lurfjurv To the best of my knowledge, the choice of the generator is not relevant to the security of ECDSA.

I see, so the choice is irrelevant. Is this not suspicious then? Why not pick a trivially small number for x to remove any concern that this base point has some fatal flaw or backdoor?

Pieter, to get a exceptionally low number, could you share the exact math ? I found a couple of different values of "curve order" and none of them are giving the exceptionally low number.

@lurfjurv You'll have to ask the people who designed secp256k1 and wrote it up as a standard, I'm afraid. Other elliptic curve standards sometimes use non-random-looking base points.

secp256k1's curve order is 2^256 - 432420386565659656852420866394968145599. The multiplicative inverse of 2 modulo the curve order is 2^255 - 216210193282829828426210433197484072799. So multiplying a point with that number is the reverse operation of doubling a point. If you do that with the generator point, you obtain a point with X coordinate 86918276961810349294276103416548851884759982251107 (a 166-bit number, which is extremely small; most X coordinates are 256-bit numbers).

Not only secp256k1, but also the generators of secp160k1, secp192k1, secp224k1 were created using this scheme. And even more interestingly the x coordinate of these G/2 points all look very similar.
See: https://bitcoin.stackexchange.com/a/113495/109728
And here a gist with a Sage script to calculate these values: https://gist.github.com/johnzweng/863f412689ee383cc41ac7c709ca662c


text:
Can we avoid third party trust for mobile / desktop wallets with respect to lightning network channels?
Mobile and desktop wallets are nodes that are not connected 24/7 (when the application is closed, computer is powered off, etc...).
The fact that they are not connected 24/7 creates mainly one problem: if a fraudulent node closes a channel with you and sends an outdated CSV transaction, you won't see it and can't invalidate it in time if you don't launch your wallet periodicaly.
A solution to this problem is to send all your CSV transactions to a service (connected 24/7 to the blockchain) and trust him enough to broadcast theses transactions in case a fraudulent node decides to close one of your channels.
And you must really trust this service because if he is affiliated with the fraudulent node you either need to send him a higher fee than the value of the transaction or he will prefer to keep the fraudulent transaction.
The conclusion is that you can't trust such a service.
Is there an other solution to avoid having to trust a third party in such case?

One solution that have been found by the eclair android wallet is to forbid relaying or receiving payments (i.e. you can only send payments). That way an outdated transaction is always in defavor of the fraudulent node. This is obviously not satisfying if you want to have the full functionalities of the Lightning Network.

(disclaimer: I'm not an expert on Lightning)
I believe the design for Watchtowers (the services which watch for other parties trying to push an old state to the chain) is such that they're not actually given the channel close transaction.
Instead, they're giving half of the txid to watch for, and an encrypted version of the channel close, using the full txid of the watched transaction as key.
This means they are not actually able to dishonestly close your channel. They can only do so when an invalid state update is published.

If you are truly concerned of this, you could make use of a couple of things:

Use a cloud service like Amazon Web Services or Google Compute Engine to run a small instance running a wallet + LN.
Using the Blockstream Satellite to download the blockchain on a desktop computer in your network, which might then send an SMS or other sort of alert to you if it detects a transaction.

Running LN channels assumes you have an internet connection that is 'always' up.

I'm not "afraid" of this. That is a real concern for future wallet users. If a user choose to use a desktop wallet, he expects his funds to not get stolen when he goes in vacations for a weekend without his computer. A non-technical user of a mobile / desktop LN wallet should never need to setup such a service. Otherwise either the LN is sentenced to be confined only to technical users or they will need to trust a third party unless a solution is found to do without a third party. My question was about wether such solution exists or not.

I amended "afraid" into "concerned". I guess one option would be to add a script that prevents the bitcoin in the funding transaction to be spent within n days, which is the lifetime of the channel. Neither party would then be able to settle the channel ahead of time. That said, I'm not sure if this is possible at the moment... (i think so, unsure)

I believe LN channels do require something to be online to watch out for you, but it's sufficient to sync and watch the chain once per day or so - depending on the locktime.


text:
Is it possible to get stuck with a block that nobody can mine?
The hash of a bitcoin block is generated from:

Block version number (partially fixed*, 32 bits)
Previous block hash (fixed, 256 bits)
Merkle root (not fixed, 256 bits),
Time (not fixed, 32 bits),
Bits (partially fixed*, 32 bits),
Nonce (not fixed, 32 bits).

So, the block hash is generated from 640 bits.
You can change 320 bits freely to try to have a hash that matches the current diff, and 320 bits are immutable.
Is there a property on the SHA-256 function that asserts that on these 320 bits of freedom, one combination will give us a hash that is matching the diff requirements?
If not, does that mean that the blockchain could get stuck on a block because nobody can mine on it?

* "Partially fixed" values could be changed by software updates for example. I assume that partially fixed values are fixed to simplify.

The bits value is completely fixed. If you get it wrong, the block will be invalid.

Is there a property on the SHA-256 function that asserts that on these 320 bits of freedom, one combination will give us a hash that is matching the diff requirements?

No.
AFAIK there are in general hardly any research results about the possible SHA-256 output values and their probabilities.
Satoshi Nakamoto probably assumed that you will always be able to find a possible block by modifying the nonce and the Merkle root.

If not, does that mean that the blockchain could get stuck on a block because nobody can mine on it?

Yes (Theoretically, but it is very unlikely which was already pointed out by Alpha)
Let us try to be more precise. If you only change the nonce and the Merkle root there are  bits you can change. So you have  possible inputs for the SHA-256 function ( If you find all  possible Merkle roots, which is also very difficult admittedly. but let's assume you accomplish this because you have many ways to change the Merkle root like changing bytes in the coinbase transaction and you can choose every combination of arbitrary valid transactions from the mempool).
Now take a look at the possible SHA-256 results, there are  possible SHA-256 outputs and  possible inputs. With these you should be able to find atleast one hash below the target. It would then be possible to create a new block.
Remember there are  times more inputs than the possible SHA-256 outputs.


text:
Bitcoin Core wallet sync
Do updated blocks from a sync from a years-old old wallet have an effect on its current use?

Could you clarify the question that you are asking?

Not sure but I guess I am wondering if the blocks just need to get caught up so I can use the wallet. Not sure why the synch was even necessary to begin with.

What would you like to do with a wallet? What is your goal?

Future storage of funds and instant transactions.

Please edit your question to reflect these goals. This will make your question clearer to others so that they can respond with appropriate answers.

With regard to the use of a wallet for storage of funds/transactions, if there is more than one in use, can they be combined?

Do you mean more than one address in a single wallet, or multiple wallets?

Multiple wallets, although I am sure better labeling is key for multiple addresses.

I would advise posting a separate question asking how to combine two separate wallets.


text:
Adding new files to Makefile.am
I need some help with adding files to the code base by adding them to the autotools build system. Other posts that try to answer the same question haven't helped me. I am experimenting with Bitcoin's codebase and I am trying to add new files to the codebase. I am trying to add a static library in the src/Makefile.am by adding these lines:
LIBGLYPH=libglyph.a

libglyph_a_SOURCES = \
glyph/glp.c \
  glyph/glp_utils.c \
  glyph/glp_rand.c \
  glyph/glp_rand_openssl_aes.c \
  glyph/FFT/FFT_1024_65537.c \
  glyph/converter.c
libglyph_a_CPPFLAGS = $(AM_CPPFLAGS)
libglyph_a_CFLAGS =
libglyph_a_CXXFLAGS = $(AM_CXXFLAGS)

    EXTRA_LIBRARIES += \
  $(LIBBITCOIN_CRYPTO) \
  $(LIBBITCOIN_UTIL) \
  $(LIBBITCOIN_COMMON) \
  $(LIBGLYPH) \
  $(LIBBITCOIN_CONSENSUS) \
  $(LIBBITCOIN_SERVER) \
  $(LIBBITCOIN_CLI) \
  $(LIBBITCOIN_WALLET) \
  $(LIBBITCOIN_ZMQ)

bitcoin_tx_LDADD = \
  $(LIBUNIVALUE) \
  $(LIBBITCOIN_COMMON) \
  $(LIBBITCOIN_UTIL) \
  $(LIBBITCOIN_CONSENSUS) \
  $(LIBBITCOIN_CRYPTO) \
  $(LIBGLYPH) \
  $(LIBSECP256K1)

bitcoind_LDADD = \
  $(LIBBITCOIN_SERVER) \
  $(LIBBITCOIN_COMMON) \
  $(LIBUNIVALUE) \
  $(LIBBITCOIN_UTIL) \
  $(LIBBITCOIN_WALLET) \
  $(LIBBITCOIN_ZMQ) \
  $(LIBBITCOIN_CONSENSUS) \
  $(LIBBITCOIN_CRYPTO) \
  $(LIBLEVELDB) \
  $(LIBLEVELDB_SSE42) \
  $(LIBMEMENV) \
  $(LIBGLYPH) \
  $(LIBSECP256K1)

I have tried at least 30 different compilation attempts where I reordered the compilation and/or renamed the library.
Error:
make[3]: Entering directory '/home/joe/glyph/glyphCodebase/BitcoinUnlimited/src/secp256k1'
make[3]: Leaving directory '/home/joe/glyph/glyphCodebase/BitcoinUnlimited/src/secp256k1'
  CXXLD    bitcoind
libbitcoin_common.a(libbitcoin_common_a-key.o): In function `CKey::MakeNewKey()':
/home/joe/glyph/glyphCodebase/BitcoinUnlimited/src/key.cpp:25: undefined reference to `glp_gen_sk(glp_signing_key_st*)'
libbitcoin_common.a(libbitcoin_common_a-key.o): In function `CKey::GetPubKey() const':
/home/joe/glyph/glyphCodebase/BitcoinUnlimited/src/key.cpp:48: undefined reference to `glp_gen_pk(glp_public_key_st*, glp_signing_key_st)'
collect2: error: ld returned 1 exit status
Makefile:3556: recipe for target 'bitcoind' failed
make[2]: *** [bitcoind] Error 1
make[2]: Leaving directory '/home/joe/glyph/glyphCodebase/BitcoinUnlimited/src'
Makefile:9207: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/joe/glyph/glyphCodebase/BitcoinUnlimited/src'
Makefile:670: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

This error occurs despite libglyph.a being made and containing the functions. I have tried to add the library header and C files to common library with no luck either. I have rearranged the EXTRA_LIBRARIES section of the Makefile.am with no luck.

In order to simplify the problem, here is a really simple example that spits out the same error:
Adding 1 .h and 1 .cpp file to 1 already made library: libbitcoin_common
new files: src/testFile.cpp src/testFile.h
testFile.h:
void testFunction();

testFile.cpp
#include "testFile.h"
#include <stdio.h>

void testFunction() {
    printf("I am a test function");
}

added following lines to key.cpp:
#include "testFile.h"

void CKey::MakeNewKey()
{
    testFunction();
     ...
     ...
     ...
}

Then in src/Makefile.am
BITCOIN_CORE_H = \
testFile.h \
...
...

and the testFile to the common library, where key.cpp is, as mentioned by Pieter Wuille here
# common: shared between bitcoind, and bitcoin-qt and non-server tools
libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_common_a_SOURCES = \
  amount.cpp \
  base58.cpp \
  chainparams.cpp \
  coins.cpp \
  compressor.cpp \
  core_read.cpp \
  core_write.cpp \
  keystore.cpp \
  netaddress.cpp \
  netbase.cpp \
  protocol.cpp \
  scheduler.cpp \
  script/sign.cpp \
  script/standard.cpp \
  key.cpp \
  testFile.cpp \
  $(BITCOIN_CORE_H)

The error:
libbitcoin_common.a(libbitcoin_common_a-key.o): In function
`CKey::MakeNewKey()':
/home/joe/glyph/glyphCodebase/BitcoinUnlimited/src/key.cpp:23: undefined reference to `testFunction()

Please help me out with this. Thanks a lot

Adding a single source file and header is easier to do than adding a new library.
For a single source file, the file must come before any file that depends on it. So in your example, you should have
...
testFile.cpp \
key.cpp \
...

But you are really trying to add a new library. To do that, you need to add it to bitcoind_LDADD which is further down in Makefile.am. That way the linker knows to link it. For the linker, the dependencies need to be placed after the things that depend on it. So you can just adding $(LIBGLYPH) to the end of that list should work.

Wow thanks for such a quick response! I tried rearranging it and got the same error:
libbitcoin_common.a(libbitcoin_common_a-key.o): In function CKey::MakeNewKey()': /home/joe/glyph/glyphCodebase/BitcoinUnlimited/src/key.cpp:23: undefined reference to testFunction()'

I also added LIBGLYPH to bitcoind_LDADD and I tested adding it to the top and bottom and that also didn't worked

You might need to add it to bitcoin_tx_LDADD too. Can you update your question with the full output of the make command?

Also, did you remember to rerun autogen.sh and configure after modifying the makefile?

I updated the post with all of the changes I made. I left them out at first because I thought it would be too much info. It doesn't work with the addition to bitcoin_tx_LDADD. I also tried the sources and cxx section all with libbitcoin_glyph as the name and glyph_libbitcoin_glyph_a instead libglyph_a and that didn't work. I use ./autogen.sh and ./configure everytime I make a change. Here is the file if you want to see it: https://drive.google.com/file/d/1eB_EnxfSG1erRgDpDNgU_q-PzPQYs0hp/view?usp=sharing

In EXTRA_LIBRARIES, have you tried putting libglyph before libbitcoin_common?

I figured it out! The issue is that the c++ compiler couldn't find where the function definitions were because they were in C. I wrapped the functions in extern "C" {   ...     }  but now I have an error: /usr/bin/ld: libglyph.a(libglyph_a-glp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
libglyph.a: error adding symbols: Bad value.
Which means that I have to use wildcard (like secp256k1 does).

Check out my answer

There were 2 problems with the code:

you cannot compile c code with a c++ compiler without extern "C" in the header files of the C code. https://stackoverflow.com/questions/12066279/using-c-libraries-for-c-programs
-fPIC might have to be used when compiling the C code (add it to the flags). I used liblibraryName_a_CFLAGS = -fPIC and liblibraryName_a_CXXFLAGS = -fPIC

For anyone that wants to see my makefile.am, go here: https://drive.google.com/file/d/1eB_EnxfSG1erRgDpDNgU_q-PzPQYs0hp/view?usp=sharing
Build systems are notoriously frustrating. If you have questions, leave a comment or ask me.