text:
Mining & The Double Spending Dilemma
My understanding of the double spending problem is as follows:
Suppose account A has 1 Bitcoin and sends it to account B and  then creates another transaction which sends the same Bitcoin to account C. Some nodes may be notified about the first transaction first while other nodes may be notified of the second transaction first, leading to a conflict regarding which transaction actually occurred first and is the legitimate one.
If I understand correctly, mining solves this problem by forcing each miner to choose between one of the two transactions. But what happens if two miners receive two distinct transactions (A -> B  vs. A -> C) and produce a hash at exactly the same time  - won't each one still record a different sequence of events?
On a similar note, what happens if miners disagree about who produced the hash first? What happens if two nodes produce a hash at exactly the same moment? Some nodes will say miner x mined earlier others will disagree so how is this issue resolved? How does it end up that all nodes eventually agree unanimously and we don't constantly end up with different versions of the block chain?

You just have to wait. Eventually, another miner will produce a block and it will be on top of one or the other of the two blocks found at about the same time. The probability of again having two miners find blocks at about the same time is very low. The truly paranoid can wait for six blocks to be mined before relying on a transaction.
Persistent splits should be unlikely because the longer the chain you mine on top of, the higher the probability of you getting to keep the mining reward. If you mine on top of a chain that is one block shorter, you only tie the existing chain that other people are already mining on top of.


text:
Get Historical Bitcoin Prices on GDAX in CSV Format
I'm looking for minute by minute historical Bitcoin price data for the past year in format: time, open, high, low etc.
I code in Java and I'm not familiar with other programming languages (such as python and PHP).
I've read this (and this) thread with the following suggestions:

https://min-api.cryptocompare.com - I do not see GDAX listed as one of the supported exchanges (based on this link https://www.cryptocompare.com/api/) (unless the data from Coinbase is exactly the same as the data from GDAX? I know GDAX is the parent company of Coinbase but not sure if trading data is exactly the same..) Also, I tried using this API and it seems to limit the history to several days. I was not able to get a year's worth of minute by minute data for Bitcoin USD pair.
https://github.com/ccxt/ccxt - this seems to be trading library written in python and PHP (but no Java support). Also I'm not sure if this allows you to retrieve historical prices or only place trades via various exchanges.
https://bitcoincharts.com/t/trades.csv?symbol=gdaxUSD&start=1312174800 returns 404 not found error.
http://api.bitcoincharts.com/v1/csv/ - I do see Coinbase listed but not GDAX (unless they are one in the same?). Also this is tick by tick data, not minute by minute correct?

Some of the other threads I read are about mtGox not gdax or only provide daily reports so I'm not including them.
If I missed any other resources I would much appreciate if you could point me in the right direction.

Did you get a good way to get this data? I wrote something quick in mathematica to get the data per minute from the GDAX API, but there are some missing data at random times.

ad 4: GDAX and Coinbase is the same :-) This is fine resolution data for each trade! But unfortunatelly there is no info whether particular trade is buy or sell.

This is my first ever response on any forum so I hope you find this helpful.
I think your question is "is it possible to get one year worth minute by minute data from gdax?". I only recently started trading with gdax via it's API but i have been trading with kraken's API for a while now and my experience with all crypto currencies so far is that you can only get a few days worth of historical data or ticks. However, if you want minute by minute data from the API, then you will have to query the data at some interval (maybe every minute). Note that the frequency of such queries are usually limited by a rate limit often determined by the exchange.
Also, I do not think Coinbase is an exchange in the sense conventional sense. I see coinbase and gdax as different business units of the same enity. Hence, I suspect that whatever trade or tick information you get from either of the two will be the same. However, they function differently and have two different category of people they cater to. Coinbase API is primarily for building phone applications with only basic features e.g. buy, sell, send, historical data.
However, gdax caters to the more sophisticated trader with more advanced features like limit order, margin trading, OHLC data etc.
You should check the links below to see if there are features that may attend to your needs
https://developers.coinbase.com/
https://docs.gdax.com/?javascript#introduction

source: Stack Exchange

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

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

sort: votes


text:
Can a cryptocurrency be "decapitated"
Say the first n blocks on the block chain were mined by the creator of the currency. What's to stop everyone unanimously deciding to ignore those first n blocks at a later date and therefore "bankrupting" the creator. Obviously agreement between a large number of parties to do this is unlikely in practice, but is there anything theoretical that prevents this?

No, nothing stops it.  The rules of the currency are whatever people decide they are.  If there is unanimous agreement on a change - that is, if all users adopt a patch implementing different rules - then the change happens.
Obviously this would be a bit strange if some of those coins had already been spent - they might have changed hands many times and now be held by many different people, who would be punished by such a rule. But still, if everyone adopts the patch, that's what happens.
Such a change might also shake the market's confidence in the currency.  An investor might think "The vengeful community turned on this one guy and wiped out his funds.  What if they turn on me next? I better dump all my holdings right now, before that happens."  If enough people think that way, the value of the currency crashes.
If there is only partial agreement - some adopt the patch and others don't - then the currency forks.  Some people would accept coins that originated with those first n blocks, and others wouldn't.  This situation can be very confusing if you are trying to buy something from a merchant, but they follow different rules than you do; your money might or might not be accepted.  Previous forks (e.g. Bitcoin Cash) have been relatively orderly because both sides were willing to go their separate and independent ways, and make it clear that they were two separate currencies.  (I did say "relatively orderly"; if you browse this site, you'll see lots of "halp I sent BTC to a BCH address" posts showing it hasn't been trouble-free for everyone.)  If both sides insisted that they were "the one true Bitcoin", it would be much more chaotic.

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


text:
How does an anonymous cryptocurrency encode coin values
I'm pretty sure I understand how cryptographic accumulators work to anonymize a coin's history, for example as described here: https://anoncoin.net/Cryptographic_accumulator/ but I have read that ZCash anonymizes the value of a coin as well. Presumably this means that somehow the coin and its value are somehow deposited in the accumulator. How is this done? Is it just an extra hash of the coin serial and the value, or something more elaborate/better?

Suppose Alice has an output with 1 unit of value we'll call AO1 (Alice output 1). And suppose Bob has an output with 2 units of value we'll call BO1 (Bob output 1).
Alice sends AO1 to Charlie, forming CI1 (Charlie input 1), with one unit of value. Bob sends BO1 to Charlie, forming CO2, with two units of value.
Charlie now pulls CI1 (an input of Charlie's that claims CO1) and CI2 (an input of Charlie's that claims CO2) into a single output, CO3, with three unites of value.
Charlie now sends CI3 (an input that claims CO3) to Dave, forming DO1.
If this system provides privacy, nobody can map CI1 to CO1, nor can they map CI2 to CO2, nor can they tell that CO3 belongs to the same person that CI1 and CI2 belong to.
So while everyone can see that CI1+CI2=CO3, this really doesn't do them any good. Even if they can tell that CI1 has 1 unit, CI2 has 2 units, and CO3 has 3 units, this does them no good. They can't map CO3 to CI3, so they can't tell how much was sent to Dave. They can't map AO1 to AI2, so they can't tell how much Alice sent to Bob. And so on.
Once you can't tell which output an input claims, the rest is pretty easy.

If by "anonymizes the value of a coin" you mean "anonymizes the amounts in a transaction", then this answer about RingCT on the monero stack exchange might be helpful:
https://monero.stackexchange.com/questions/880/eli5-how-does-ringct-work


text:
Where to get the data for Transactions, Graphs as a Bitcoin Exchange
Our team is planning to start our own Bitcoin Exchange where an end-user could Register, make transactions(Sell/Purchase bitcoin), keep their wallet and could see live Graph of all the listed crypto-currencies. And yes we do know what are all the legal, financial and technical requirements/challenges for this.
We researched about it a lot and found everytime that there are certain websites/Exchanges like blockchain.info that provide their own API for all such tasks.
However, if we want to create our own Exchange, we can't rely fully on any third party website. So, what my main question is that where do all these websites get their data from, whenever any transaction is made on their website, do they keep this record only to their selves(in their own DB) or is their any central entity of this whole blockchain web where this transaction needs to be registered also?
And where do these websites get data for their live graphs showing the current market value of all the currencies?
Any clarification of my query would be deeply appreciated.

whenever any transaction is made on their website, do they keep this record only to their selves(in their own DB) or is their any central entity of this whole blockchain web where this transaction needs to be registered also?

There is no central entity in a blockchain network. Such a thing would be antithetical to a decentralized cryptocurrency like bitcoin. A user may run a node and participate in the network, without having to trust any of it's peers to provide good information. Instead, the code validates all network interactions, providing cryptographic trust and guarantees.
Exchange services often run as centralized databases, this allows users to initiate many transactions (buying/selling on the exchange), without incurring network transaction fees. The exchange users trade off security (trusting a third party with their coins) for this convenience. However, there are other models that exchanges can use, it is up to your imagination to find a solution that balances trust and convenience in a way that your users will want.

And where do these websites get data for their live graphs showing the current market value of all the currencies?

Exchanges generally define the market price of cryptocurrencies, this is not data you would pull from a third party. The market price would be discovered by users buying/selling on your exchange, if users push the price too high/low compared to other exchanges, then arbitragers will work to balance it back out.

Thanks for this explanation, it really helped me a lot in understanding my query.


text:
Ripple JSON API - Can I use more than one destination while transaction?
In Ripple API,
Is there any apis available to split payment which I can pass more than one destination address in single transaction.
Let me share code:
const RippleAPI = require('ripple-lib').RippleAPI;

const api = new RippleAPI({
    server: 'wss://s.altnet.rippletest.net:51233' // Public rippled server
});

//Payment API:
const address = 'r4Ct32uDZvL9e5GRbPftAnu8rpCg7aXXXX';
const secret = 'shvtBfNDJ3yf9sqGoc7XUgSTnXXXX';
const instructions = {maxLedgerVersionOffset: 5};
const payment = {
    source: {
        address: address,
        maxAmount: {
            value: '1.01',
            currency: 'XRP'
        }
    },
    destination: [{
        address: 'rn8KqzsH7b8fGZYmbaDXinLb8XffneXXXX',
        amount: {
            value: '1.01',
            currency: 'XRP'
        }
    },
    {
        address: 'rn8KqzsH7b8fGZYmbaDXinLb8XffneXXXX',
        amount: {
            value: '2.01',
            currency: 'XRP'
        }
    }]
};
function quit(message) {
    console.log(message);
    process.exit(0);
}
function fail(message) {
    console.error(message);
    process.exit(1);
}
api.connect().then(() => {
    console.log('Connected...');
    return api.preparePayment(address, payment, instructions).then(prepared => {
        console.log('Payment transaction prepared...');
        const {signedTransaction} = api.sign(prepared.txJSON, secret);
        console.log('Payment transaction signed...');
        api.submit(signedTransaction).then(quit, fail);
    });
}).catch(fail);

Currently, I am getting error I am passing designation address in array. But If i will as object then it will work fine. But I need to pass more than one address in single transaction.
Can you please give solution ASAP about it?

for now there is none... you can only use single destination address


text:
Generated new cryptocoin but how to get balance in my account?
I have created new Cryptocurrency from litecoin's fork.
And I can connect more than 2 node with successfully.
But How to pull original balance in my wallet?
Let me share screenshot: https://ibb.co/gci8kn
Balance: 0
Unconfirmed: 0
Immature: 120 MIND.
How to transfer amount 120 MIND in original balance?
I did "setgenerate true" from debug window but it increases only Immature amount.
Please let me know about it. It is very important for it.

Don't you have to mine some blocks first, to create coins?

@OsiasJota No, I don't have any mine. How to mine amount in my wallet? I create wallet from litecoin fork

You should also fork a mining software and mine some blocks. Maybe the fork you did is already capable of doing that, but I never used Litecoin and can't tell how to put it to mine, I don't where to find this command or menu.

Coins that are immature mean that you have not mined enough blocks for them to be spendable yet. If you did not change the COINBASE_MATURITY global variable, then you will need to mine 100 blocks before the immature coins become mature and spendable. Of course the process of mining produces new coins, so your immature balance will increase until you have mined 100 blocks.

@moderator I have changed COINBASE_MATURITY=10 to 100 and again compile my coin using "make" command but still it is display in immature and

as per you told "then you will need to mine 100 blocks" --> How to do this?

You actually have to mine 1 block more than COINBASE_MATURITY in order for it to become mature. To mine blocks, use the setgenerate or generate commands.

@moderator: I have used "setgenerate true" function from debug mode but it is increasing only immature balance Let me share screenshot https://ibb.co/djjV0n

Increasing the immature balance means that it is mining blocks. Just wait a while and eventually those will become mature coins. Use getblockchaininfo and you will see how many blocks are in your blockchain. After a while, when you see your immature balance increase, use getblockchaininfo again and you should see that the blockchain has grown.

@moderator: Is there any other way to do mine my coin? like setup own mining and mine the block? something like that: https://bitcointalk.org/index.php?topic=1762002.0

You can use any mining software that uses the getblocktemplate protocol. Most modern mining software (and even old ones like cpuminer) support that. It won't really matter once the difficulty adjusts though.


text:
While Creating new CryptoCurrency should we create Smart Contract?
I have confusion in my mind regarding create own cryptocurrency.
Questions:
1.) I have created my own cryptocurrency using bitcoin or litecoin fork. So, From where to generate my original balance on initial bases? Because currently, I have created my own currency wallet from litecoin fork then it displays 0.0 MIND balance. So, if I want to transfer 100000 MIND balance while creating new currency then What should I do?
2.) Using fork create new crypto, Should I create a Smart contract for ICO? If yes, then what is the purpose of creating smart contract?
3.) If I am using fork litecoin, Should I generate my own Mining pool for mining?
Please let me know about my confusion. It is very important for me to understand above question's answer.

From your question it sounds like you don't know what the difference between a smart contract and coin is.
First of all, smart contracts are ran by the Ethereum network. If you forked litecoin or bitcoin, it makes no sense on why you are talking about smart contracts.
Second, if you forked litecoin and created a new coin, you still need to mine it. This can be done either by compiling the GUI wallets, or coind in which you will need two peers to run so mining can start (I'd recommend purchasing a VPS). You cannot transfer funds you don't have. If you want to premine you will need to add some code in the block reward function to give a big reward to the first block.
Third, why would you need a pool for a coin that is not popular? The point of pool mining is because it is too hard for a single miner to find a block for themselves. Instead, they can work together and split the block reward to how much work each miner put in. So no, generating pool would not be a good idea unless the coin is popular.


text:
While creating new crypto using fork need to generate smart contract?
I have 2 questions for creating nee crypto currency using fork.
1.) I have created one new crypto coin which is called mindcoin, now should i generate smart contract for deployment my currency in market??
2.) Should i generate smart contract any other languages like php or .net?? I know about solidity but it will be preferable for ethereum..
Can you please let me know about it? It is very important for me if you give answer asap.

Cryptocurrency(a new blockchain) is deployed by distributing/convincing people to use your node software. The genesis block can be considered a type of smart contract. Clever marketing has hijacked the "smart contracts" buzzword to mean hosting your code on a network that works exactly like AWS but with worse performance and higher price.
This is not an ethereum forum and nor are ethereum contracts really "smart". They rather dumbly execute the stored logic in a centralised manner. The beauty of a true smart contract is that it can be written in any language and it auto-deploys itself because it arose from a use-case. Eg, multisig


text:
Zcash configure in ubuntu
I have tried to installed zcash insight ui & api in my local machine (ubuntu OS) and it is completed all the steps but I m facing issue while start services in frontground.
Let me share with you command, config file.
npm install -g zcash-bitcore-node
zcash-bitcore-node create mynode
cd mynode
zcash-bitcore-node install insight-api
zcash-bitcore-node install insight-ui
zcash-bitcore-node start

But getting below error in my terminal:
[2018-01-30T12:33:03.687Z] info: Using config: /home/kiran/zcashnodenew/zcash-bitcore-node.json
[2018-01-30T12:33:03.688Z] info: Using network: testnet
[2018-01-30T12:33:03.688Z] info: Starting bitcoind
[2018-01-30T12:33:03.690Z] info: Using zcash config file: /home/kiran/zcashnodenew/data/zcash.conf
[2018-01-30T12:33:03.691Z] info: Starting zcash process
[2018-01-30T12:33:03.699Z] error: Error: spawn /usr/local/lib/node_modules/zcash-bitcore-node/bin/zcashd ENOENT
at _errnoException (util.js:1003:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
at onErrorNT (internal/child_process.js:389:16)
at process._tickCallback (internal/process/next_tick.js:152:19)

MY Config File  (zcash-bitcore-node.json)
{
  "network": "testnet",
  "port": 3003,
  "services": [
    "bitcoind",
    "insight-api",
    "insight-ui",
    "web"
  ],
  "servicesConfig": {
    "bitcoind": {
      "spawn": {
        "datadir": "./data",
        "exec": "/usr/local/lib/node_modules/zcash-bitcore-node/bin/zcashd"
      }
    }
  }
}

Zcash Config  (zcash.conf)
server=1
whitelist=127.0.0.1
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
rpcallowip=127.0.0.1
rpcuser=bitcoin2
rpcpassword=local321
uacomment=bitcore

Can you please help me with it? What is wrong in which step?

I know it is a bit old but anyway, use this repo to build it for you:
https://github.com/radix42/zcash-block-explorer


text:
Non-Bitcoin blockchain security questions
I've been seeing a lot of stories lately about companies wanting to use blockchain, I've got two questions regarding companies using blockchain networks to store transaction ledgers.

With Bitcoin, users are encouraged to adhere to the correct protocol and to continuously verify the transaction log because they are rewarded through Bitcoin mining.  If a blockchain network is used to store a ledger of contract transactions, for instance, what incentive is there for users to continuously verify the transaction chain, since there's no reward for creating a block and adding it to the chain?  If users aren't continuously verifying the blockchain, won't that make it more likely than a malicious entity can create their own block?
If a company creates their own blockchain network, their computing power is minuscule compared to the total computing power in the world.  If another entity can enlist more computing power (by being a larger company/government or by using a zombie network), won't that larger entity be able to control the transaction ledger?  That not a problem for Bitcoin since the total computing power on that network is huge, but what stops this from occurring on other networks?

Ethereum is one example of the blockchain used to store the contract transactions. Nodes on the blockchain validate the transactions and add it to blockchain. Ethereum also has it's currency and miners are rewarded for doing work. What you think is absolutely right, if you don't have any incentive mechanism in place then only few people will mine and network can easily be attacked.
When companies talk about using blockchain for only themselves, they are referring to private blockchains and not public. Node needs permission before they can join this private blockchain thus not prone to attack. Otherwise in public blockchain anyone with 51% majority can easily alter the transactions. Some attacks are possible even at 33% majority.

Thanks for the response.  It's very helpful.  Regarding point #2 - wouldn't a private blockchain just be an overly complicated distributed database?  Am I missing something that makes a private blockchain more attractive than just using a database?  I guess it would be harder to change historical transactions, but couldn't the administrator of the blockchain organize things such that he keeps enough power to alter the blockchain to himself and keeps it a secret, or write the client software such that there is a backdoor to change history?

Yeah, you are right, if you are planning on keeping your data to yourself then blockchain is not the best fit. But suppose a firm wants to share some of it's data with another firm and wants to have trustless collaboration, then private blockchain as the distributed database is useful. Basically, two or more organizations can share and communicate with each other without any trusted third party and nodes of these organizations are allowed to join private blockchain network.


text:
Bitcoin Speed: 7 Transactions Per Second?
I read somewhere that Bitcoin can only handle 7 transactions per second. This works out to 604,800 transactions per day. Visa currently processes about 1,700 transactions per second (and can handle vastly higher amounts than this). This means that the Bitcoin system can handle less than 1/200 of Visa's current processing output.
Is this correct? I find it hard to believe that so many people would buy into a system that's so inefficient / unscalable.
Also, if my assumption is correct, suppose there are (on avg) 700 transactions per second during a given 10 min period (i.e, 70 times the max output rate) does this mean we will need to wait 70 * 10 min for all those transactions to be confirmed? If yes, why can't some evil actor overwhelm (i.e, postpone) the system by submitting thousands of tiny transactions to the network?
Thanks in advance

I don't know where you got a rate for Visa of 1,700.   Visa's own site says 24,000 per second.

I read somewhere that Bitcoin can only handle 7 transactions per second.

That's roughly correct - only about 7 transactions per second can be confirmed using legacy transactions.  With the recent adoption of segregated witness, it could be closer to 30 transactions per second.

I find it hard to believe that so many people would buy into a system that's so inefficient / unscalable.

Some people might have confidence that a better solution will eventually be found.  The protocol can be changed with community consensus.  Others might find that it is good enough for what they need in the short term (a particular transaction, day trading, etc) and not care what happens in the long term.

Also, if my assumption is correct, suppose there are (on avg) 700 transactions per second during a given 10 min period (i.e, 70 times the max output rate) does this mean we will need to wait 70 * 10 min for all those transactions to be confirmed? If yes, why can't some evil actor overwhelm (i.e, postpone) the system by submitting thousands of tiny transactions to the network?

Transactions are not first-come-first-served.  Miners can decide which transactions will be confirmed, and usually this is done by prioritizing them by  highest fee.  So if the attacker doesn't include competitive fees in those transactions, they will simply never get confirmed and there is no issue.  If he does, then the attack is potentially quite expensive for him.  And even in that case, honest users who really need their transactions confirmed can simply offer an even higher fee.

I find it hard to believe that so many people would buy into a system
  that's so inefficient / unscalable.

Nobody cares about efficienty / scalability. Everyone wants to make a profit :)

again, probably the best comment when people talk about efficiency :-)

The Bitcoin base layer can handle 7 transactions per second but the infrastructure built on top of this base layer can handle vastly greater amounts.
Batching, layer-2 payments, debits/credits within large custodians like exchanges all facilitate a much higher effective tps.

I find it hard to believe that so many people would buy into a system
  that's so inefficient / unscalable.

A lot of people are buying with the expectation that this will improve. Also it is debatable whether or not Bitcoin is trying to compete with Visa. Some people care more about decentralized wealth storage than decentralized cash.


text:
Is it Possible to Program AntMiner S9 or Other ASIC Miners?
Is it possible to program the AntMiner S9 or other ASIC miners?
For example, let's say I only want it to try nonces from 1 to 1 million (instead of all 4 billion possibilities) would it be possible to somehow modify the software on the machine to do this? (please don't ask me why I want to do this, I just want to know if something like this is possible)
If it's possible, what programming language would I use?
Finally, would doing this (significantly) reduce the hash rate of the miner?

Yes it is possible. To do so, you will need to modify the firmware and install your own firmware onto the S9. The source code for the firmware is available on Github. The firmware is really a lightweight operating system and includes software such as CGMiner preinstalled. Those preinstalled software are probably what you will need to modify, and those are likely written in C/C++.
Since what you want to modify effects the data that is hashed, it should not effect the hashrate at all.

In theory, this should be possible. I do not know the specific details of what is required but make the presumption that somewhere running on the embedded Linux there is a configuration file for a program that drives the thing.
I do not imagine that it would negatively affect the hash rate.


text:
Bitcoin Insight API - How to create new address?
I need to create new public address with private key. but there is no way to create new address using insight rest api. If you guys are aware about insight api then please share with me code snippet so, i can update my insight api library and i can create new public address using that.
Currently I have used: https://github.com/bitpay/insight-api

Anyone can help on it? It is Very urgent

You can't "create new addresses" with the Insight API.
The Insight API is for querying the blockchain for information.
You want to use the Bitcore Wallet Service, THAT will manage a list of addresses/wallet for you:
Bitcore Wallet Service on Github


text:
Is it viable to CPU/GPU mine popular cryptocurrencies given that they have dramatically spiked in value recently?
In the past two months the value of bitcoin has dramatically spiked (and fallen and spiked and fallen), with a general upward trend in value. Many websites about cryptocurrency mining give a loud disclaimer that it is not effective to mine coins with your CPU/GPU. I was wondering if this is still the case given that the value of the coins has dramatically risen? Where before 0.001 bitcoin was worth 12 bucks, now it's worth 12000 bucks (I am pulling these numbers out of my ass, but you get the idea). So even just grinding away to get a small percentage of a bitcoin might still pay out a decent little bonus right?

We have just seen that prices were drastically falling (+30%), so the math is a bit endangered. But yes, same as with paying for mining services, you may have the "investors" risk of winning or loosing. Btw: this question has the risk of getting opinion based, or being market value based. Maybe no clear answer can be expected.

Taking Bitcoin as an example, a typical CPU is about 10,000 times less efficient than an ASIC (compare the Mhash/J numbers here vs here), so the cost to mine is roughly 10,000 times higher than the reward.  In the last few months, the price of Bitcoin has maybe doubled or tripled from $5,000 to $15,000, which is nowhere close to enough.  Check back when the price hits $150,000,000.  Assuming the difficulty doesn't go up by then, which it will.


text:
Can I use root used to create multiple BIP32 addresses, to spend transactions belonging to these multiple BIP32 addresses?
I want to accept BTC from different clients during an ICO, for this, I'm planning to use a combination of BIP32 and BIP39.
var bip39 = require("bip39");
var bitcoin = require("bitcoinjs-lib");

var mnemonic = 'praise you muffin lion enable neck grocery crumble super myself license ghost';
var seed = bip39.mnemonicToSeed(mnemonic);
var root = bitcoin.HDNode.fromSeedBuffer(seed);

console.log(root.derivePath("m/0'/0/0").getAddress());
//'1AVQHbGuES57wD68AJi7Gcobc3RZrfYWTC'
console.log(root.derivePath("m/0'/0/1").getAddress());
//'1Ad6nsmqDzbQo5a822C9bkvAfrYv9mc1JL'

Can I use this mnemonic to login into some pre-existing wallet and transfer the funds sent to the addresses generated using the root to transfer funds to any other BTC wallet? Or can someone suggest a better strategy?

A BIP32 master extended private key can be used to derive child addresses, but to spend coins sent to those child addresses, you will need the private key of each individual address. The master xpriv key cannot spend the coins located in one of its child addresses.
Remember that an address derived via BIP32 is otherwise indistinguishable from any other address. In order for a transaction spending any address' balance to be valid, it must be signed by the private key of that address.
That said, good wallet software will take care of key management in the background for you, so as long as the derivation scheme is correct you should be able to spend the funds sent to your master xpriv key's derived addresses using a BIP32 & 39 compatible wallet. Again, this will be done by deriving the child addresses and using their private keys to sign transactions.

Can you suggest some nice wallet?

Will Electrum (https://electrum.org/#home) suffice?


text:
Is there a way to get data on exchange-specific crypto prices using Yahoo finance?
Yahoo finance provides information on country specific cryptocurrency prices, but it seems they don't have information on particular exchange prices like coinbase for example. Is there a way to access this by using their site?


text:
What are the country-specific cryptocurrency prices on Yahoo finance?
I was under the impression that cryptocurrency prices were set by an exchange's currency volume and buy/sell averages, so what exchanges are used to get the Yahoo finance data with country-specific cryptocurrency prices?

There is a note in the footer under the details for BTC-AUD: Data provided by CryptoCompare
On this page: https://au.finance.yahoo.com/quote/BTC-AUD?p=BTC-AUD

Right, but CryptoCompare lists the prices for a number of different exchanges, whereas Amazon lists prices for a currency by country, which doesn't make sense to me.

@TQM I suppose Yahoo Finance just makes use of the compiled data provided by CryptoCompare.I suppose there is nothing much more exciting to find out. On this page there is a drop box to choose what currency. It makes sense that Yahoo Finance can just be pulling live data.


text:
ripple migration issues
i had an old ripple account that has stayed untouched for a long time,  ripple advise that you need to migrate it to gatehub, this process does not work, i have tried to transfer it another wallet and it advised my pass phrase is incorrect, it can be only one of two passwords that i used for all online stuff at the time.
Is there away to re set the pass phrase i still have the walets secert key, i see some old links from 2013 -2015 on just setting up  new account with the secert key, but none of the new walets offer the option to add tge key on registration.
Cany anyone help?

If you have the secret, you can forget about the old wallet. Use the secret in any XRP wallet that accepts a secret. Gatehub does. The old Ripple desktop wallet does. Jatchili's minimal client does.


text:
What type of fork is Litecoin?
Is Litecoin classified as either a hard fork or soft fork? If neither, what is considered as?

It's an altcoin. A fork implies that a split occurs, they thus have a shared transaction history. Litecoin, afaik, started with a completely new genenesis block.

It's considered a source code fork, or an altcoin, neither a hard fork nor soft fork of bitcoin. To be classified as a soft/hard fork, it should share some of the same chain from the genesis block. LN has a completely different chain right from the start so it's not a fork of the bitcoin chain.
Note that even coins sharing the same chain as bitcoin from the genesis block, e.g. BCH, are not considered hard forks by most people because they are not "bitcoin". They are generally termed "forkcoins"

Appreciate the explanation--just to check on the last point--does that essentially mean 'forkcoin' potentially synonymous with something being a soft or hard fork depending on who you ask?

@jlw yes I'm sure some hardcore BCH supporters would call it a hardfork rather than an altcoin, but to most people it's clear it's an altcoin

Litecoin is neither a hard or a soft fork. The codebase is a fork from Bitcoin codebase but it by no means share any history with the Bitcoin blockchain and thus considered as a separate alternative cryptocurrency to Bitcoin.
It is now trading at $179 https://www.coingecko.com/en/price_charts/litecoin/usd


text:
bitcoin: time of block size
I'm trying to figure out the size of the block
and i have trouble calculating the number of bytes of time
one block has time like this:
"time":1516430234
After counting the bytes, the value is :5
This is a mistake, since it should be only 4
Does anyone know the solution?

looking at bitcoin.org, and the blockchain reference, it says: "The block time is a Unix epoch time when the miner started hashing the header (according to the miner). Must be strictly greater than the median time of the previous 11 blocks...". So it is unclear, how you come to 5 or 4, maybe you can explain, what you do?

Have a look into the hex form.


text:
get the real last block
I have this code:
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import logging
rpc_user='-------' #User name is hidden
rpc_password='-------' #Password hidden
logging.basicConfig()
logging.getLogger("BitcoinRPC").setLevel(logging.DEBUG)
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password))
blockcount=rpc_connection.getblockcount()
print(blockcount)

The result:
DEBUG:BitcoinRPC:-1-> getblockcount []
DEBUG:BitcoinRPC:<-1- 94768
94768

Of course this is last block in my device, but I want the real last block.
Is there a "external server or a Web site" i can call instead of Local server '127.0.0.1'? (for sending the bitcoin RBC method)

Instead of getblockcount, you can call getblockchaininfo and read the headers field.
However, while this may give you a lot more blocks than the local block count, you will still only receive a count up to the point where your node has synced headers (which can be limited by time, network, how well synced your peers are)
There is no way to always get the latest block height reliably from an unsynced node.

One could additionally check the timestamp in order to at least know whether this is a recent block.

Of course this is last block in my device, but I want the real last block.

There is no such thing. If there was a "real last block" that was clearly and unambiguously determinable, we would not need a blockchain.
The best you can do is run a node, and ask the node what's the best block it knows about. Or you can trust someone to run such a node and ask them.
Perhaps another way of seeing it: there is no distinction between a synced or unsynced node. Your node is always trying to synchronize with whatever other nodes in the network tell it. It can't know what the actual latest/best block on the network is, as at the very least the speed of light around the globe is limited.

You would have to try to connect live nodes to get that information.
https://bitnodes.earn.com/nodes/?q=United%20States
Lists active nodes of BTC network.
You should find some node which allows RPC connection on the port.


text:
If found a broken link on bitcoin.org - who manages the site?
just a minor issue but yet:
MIT license link has moved from this:
https://opensource.org/licenses/mit-license.php
to this:
https://opensource.org/licenses/mit
Source page with the broken link:
https://bitcoin.org/en/download
Thanks!
Yosi

You can make a pull request on their official Github regarding line 400 and 963 from this file: https://github.com/bitcoin-dot-org/bitcoin.org/blob/master/_translations/en.yml
Line 400

notelicense: "Bitcoin Core is a community-driven https://www.fsf.org/about/what-is-free-software\">free
  software project, released under the http://opensource.org/licenses/mit-license.php\">MIT
  license."

Line 963

footer: "Released under the http://opensource.org/licenses/mit-license.php\"
  target=\"_blank\">MIT license"

Don't forget other translations as well ! :)
Otherwise, if your are not confortable with Git you can just open a new issue.


text:
Lost Private Keys
I have this old wallet which has funds in it. I was a bit out of business and went out of town. I recently try to create get back but poor me I miss place my credentials lucky I was able to fine my wallet address so I read around I find out there is a way to get my funds back by import it into a new account. I did that it work perfectly but I cant access the funds because I don't have the private keys, so I want to know if there is a way I can do to get back the private keys of the old wallet or how I can transfer the account into the new wallet. thanks

the whole security of the bitcoin system (and probably many other crypto currencies) is to not be able to derive the private key from the public key. If so, it would make the whole system useless. Unless you have a seed (usually some 12 words) noted down, or the private key in a file (e.g. "wallet.dat"), there is basically no access to your funds. Whatever other sites or sources told you, they are wrong.

What informations have you backed up? e.g. private key, old wallet, etc.

If you do not have the private keys, you will be unable to spend the coins. Knowing a public key or bitcoin address will not allow you to figure out the private keys to an address. The bitcoin blockchain is a public record, so you can look up any address you'd like, but you will not be able to spend the coins they contain unless you know the private key.
You'll need to get access to your wallet, or use a backup of your wallet to be able to spend your coins again.

that is the issue right now I don't have access to the old wallet, so how do I get the back up of the old wallet @chytrik

Did you make a backup of the wallet? If you didn't, then it sounds like you're out of luck if you can't access your old wallet. Making backups is important! Sorry for your loss :(

i don't remember making backup so if I did a back that i will be able to get back the funds. ok who do i do a backup of the new one so i don't run into further trouble

That's a perfectly valid question. See if it has been asked before here. If not (unlikely) create a new question.


text:
Flow when block is created
I believe I know what is required to create block.

1.get previous hash(previous block is published)
2.collect transactions
3.proof of work(mining)
4.timestamped
5.audit by other nodes

Please tell me in what order these are done.

This was helpful for me. (https://bitcoin.stackexchange.com/questions/12564/can-a-miner-set-the-exact-timestamp-of-a-block)

Welcome to Bitcoin.SE! I see you already have one answer. You may also find the linked question above of value.

The order is 1, 2, 3, 5. There is no timestamping; the block itself provides timestamping via the proof of work.
Also, the step 3 is not 'mining', the whole process is what is called mining.


text:
How to check relays of tx?
I believe a tx is made of an output of previous tx.
So, I also believe that all tx are traced back to tx originally created (as a mining reward).
But, in blockchain.info and blockexplorer.com, I could not find relays of tx.
We can know only connection of addresses in tx page.
Then, I have three questions about relays of tx.
1. Is a id(hash) of tx included in next tx id?
2. Is there a way to get information of previous tx in these websites ?
3. Why do these websites hide connection of tx?
Thank you for helping me!

Block explorers dumb down information so that it is easier for the common person to read. In reality, Bitcoin is not actually how block explorers display information; addresses do not exist at the protocol level and coins are not sent from addresses to other addresses.

Is a id(hash) of tx included in next tx id?

Yes.

Is there a way to get information of previous tx in these websites ?

Yes. Most block explorers have an advanced mode that will display this information, or at least link back to the transaction outputs that are being spent. On blockchain.info, you will see a link labeled Show Scripts & Coinbase when you view a transaction, click that and you will see the advanced information about the transaction.

Why do these websites hide connection of tx?

Because it isn't useful to most people and is confusing.

You are kind!  Thank you!  Your answer is perfectly what I wanted:)


text:
Getting error while running Blockchain.info api
I am getting error as {"error":"Not found"} when I am trying to run the blockchain.info wallet api service locally on my computer.
I was getting the error of "Address in Use " error when I ran it on http://127.0.0.1:3000/
after changing it to http://127.0.0.1:8000/ I am getting error.

Blockchain.info is really not working anymore, seems to be they are stopping API service or there's something wrong. Since API don't work anymore (callbacks - gap limit so far).


text:
How to get all transactions of address with bitcoin api in node.js?
I want to find all transactions of address in regtest. How it is possible to do?
I have this solution, but I get response (201) before for ends. I think it's bitcoin timeout false.
    bitcoin.getReceivedByAddress(user_address).then ((current_balance) => {
        //get current address balance\
    //if balance has changed, check latest transactions
    if (current_balance > 0) {
        bitcoin.getBlockCount().then ((n) =>{

            for (let i = n; i > current_balance !== 0 && i > 0; i--) {
            bitcoin.getBlockHash(i).then((hash) => {
                bitcoin.getBlock(hash).then( (block) => {
                for (let j in block.tx) {
                bitcoin.getTransaction(block.tx[j]).then ((transaction) => {
                    if (transaction.details[1].address === user_address
                && transaction.details[1].category === "receive") {
                    current_balance -= transaction.details[1].amount;
                }

            });

            }

        });

        });

        }

    });
    }

}).then(() => {
        res.send(201);
    })

You should specify which library and api you are using.  "bitcoin api" is not enough information.

I use bitcoin core lib.

Welcome to Bitcoin.SE! Your question can be improved if you edit it and specify additional information to assist those researching an answer. More is generally better!


text:
Can I retrieve funds in a derived address with a high index?
I sent funds to a derived address, but I didn't know about the gap limit and how the addresses should be used incrementally. I've used a huge value for the index but wallets only check the first few values -  is there a way I can retrieve them?

Can you explain a bit on „derived“ address? HD wallet? xpub keys? From which wallet did you send?

Yes, just use something that lets you generate addresses with a high index. For example, you could use https://iancoleman.io/bip39/ and enter into the starting from index box the index you would like to begin deriving addresses at. Then you can get the private keys and import them into your wallet.
IIRC there is not a wallet software that will let you specify where to start deriving addresses.

@gorod Note the above site does not support Electrum seeds. Answer pebwindkraft's question about wallet software above. If it's electrum mention my name and I'll provide suitable instructions.


text:
How to run Bitcoin Core behind corporate proxy?
I'm want to run Bitcoin Core client on TestNet and I need to config it for using under corporate proxy.
Since I'm using Squid to set proxy for my system I should set "localhost:3128" somewhere... but bitcoin-qt options seems to have only SOCK5 proxy field.
I also tried to set the proxy using the command line:
./bitcoin-qt --testnet -proxy=localhost:3298

...but it doesn't work.
How can I solve? Can I run Bitcoin Core using setting a http proxy?

Obvious question: is said corporation happy with you running this software on their computers and/or network? If they are, they should be happy to punch the relevant holes through the firewall for you; if they're not, you shouldn't be trying to work around that.

Bitcoin doesn't use HTTP for its communications - it has its own specific protocol that runs directly on top of TCP.  So an HTTP proxy like squid won't help.
If you aren't able to make outgoing TCP connections through your firewall (mainly to destination port 8333) then you'll have to contact your corporate IT people about adding appropriate firewall rules.  The same if you want to be able to enable listening.

Although bitcoind itself only supports socks5, you can make any dynamically linked binary http-proxy capable with a LD_PRELOADing tool like proxychains:
The prerequisite here is that your proxy server itself
supports the HTTP CONNECT method to non-standard ports.
In my VM lab setup I  use mitmproxy on 192.168.100.1 8888  to analyze the network traffic using this /etc/proxychains.conf:
strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
localnet 192.168.100.0/255.255.255.0
localnet 127.0.0.0/255.0.0.0
localnet ::1/128
[ProxyList]
http    192.168.100.1 8888

and bitcoind using proxychains:
proxychains bitcoind -testnet


text:
Providing Liquidity in CryptoCurrency Exchange!
Can anybody give some idea about the issue of providing liquidity to the users for creating a cryptocurrency exchange ?
Thanks!

To summarize the 'liquidity problem' as I understand it: A cryptocurrency exchange needs users in order to function, but it also needs liquidity in order to serve users, and users are the ones who provide liquidity!
So where does the liquidity come from in the first place? Why would 'user 1' join, if there is nobody else to trade with? This is a sort of chicken-and-egg problem, but the answer could come in various forms.

Maybe the exchange operator is very rich, and can act as a market-maker, until the point in time that a critical mass of users has been reached and the market can be self-sustaining.
The exchange operator could work with other wealthy individuals, and provide them incentives to act as market makers
The exchange operator could work with a mining pool, using them as a market maker (allowing the pool to exchange BTC for $, in order to pay their overhead costs).

Eventually, an exchange with a good base of users will have both market makers, and market takers present. To ensure there are enough market makers, the exchange may incentivize certain types of orders (eg market makers pay no fees, market takers pay a small fee).

The liquidity would be dependant on the amount of available exchangeable cryptocurrencies or fiat currencies. And to answer your question all crypto currencies, ICOs, tokens, and etc. hold some value and they can be exchanged, and that's what solves the liquidity issue.
For example coinbase accepts xyz $ and allows u to change it into xyz crypto currency like ripple or something, the more available currencies higher the liquidity and the ease of transaction increases the liquidity of assets.
This question is to some extent unnecessary. But, hey all of us get confused at times!

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


text:
Problem of crashing command on "lightningd/lightningd --network=testnet --log-level=debug"
When I try running the "lightningd/lightningd --network=testnet --log-level=debug" after sucessfully starting the Bitcoin server using the "bitcoind -daemon -testnet" ,following issue occurs:
lightningd/lightningd --network=testnet --log-level=debug
2018-02-12T12:34:40.313Z lightningd(14966): Trying to guess public addresses...
2018-02-12T12:34:40.313Z lightningd(14966): Address 192.168.0.73:9735 is not routable
2018-02-12T12:34:40.313Z lightningd(14966): Failed to connect 10 socket: Network is unreachable
2018-02-12T12:34:40.313Z lightningd(14966): testing /home/blockchain/lightning/lightningd/lightning_channeld
2018-02-12T12:34:40.314Z lightningd(14966): testing /home/blockchain/lightning/lightningd/lightning_closingd
2018-02-12T12:34:40.314Z lightningd(14966): testing /home/blockchain/lightning/lightningd/lightning_gossipd
2018-02-12T12:34:40.315Z lightningd(14966): testing /home/blockchain/lightning/lightningd/lightning_hsmd
2018-02-12T12:34:40.315Z lightningd(14966): testing /home/blockchain/lightning/lightningd/lightning_onchaind
2018-02-12T12:34:40.316Z lightningd(14966): testing /home/blockchain/lightning/lightningd/lightning_openingd
2018-02-12T12:34:40.471Z lightningd(14966): Client: Received message 11 from client
2018-02-12T12:34:40.480Z lightningd(14966): Loaded 0 invoices from DB
2018-02-12T12:34:40.480Z lightningd(14966): Client: Received message 9 from client
2018-02-12T12:34:40.480Z lightning_gossipd(14974): pid 14974, msgfd 12
2018-02-12T12:34:40.481Z lightningd(14966): Loaded 0 channels from DB
bitcoin-cli exited with code 1: error: Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file (/home/lightning/.bitcoin/bitcoin.conf)
2018-02-12T12:34:40.518Z lightningd(14966): bitcoin-cli exited with code 1: error: Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file (/home/lightning/.bitcoin/bitcoin.conf)
Log dumped in crash.log
2018-02-12T12:34:40.545Z lightningd(14966): FATAL SIGNAL 6 RECEIVED
2018-02-12T12:34:40.548Z lightningd(14966): backtrace: lightningd/log.c:486 (log_crash) 0x410b18
2018-02-12T12:34:40.561Z lightningd(14966): backtrace: (null):0 ((null)) 0x7fc0b7dc24af
2018-02-12T12:34:40.561Z lightningd(14966): backtrace: (null):0 ((null)) 0x7fc0b7dc2428
2018-02-12T12:34:40.561Z lightningd(14966): backtrace: (null):0 ((null)) 0x7fc0b7dc4029
2018-02-12T12:34:40.561Z lightningd(14966): backtrace: lightningd/log.c:575 (fatal) 0x410f52
2018-02-12T12:34:40.561Z lightningd(14966): backtrace: lightningd/bitcoind.c:723 (wait_for_bitcoind) 0x4056c9
2018-02-12T12:34:40.562Z lightningd(14966): backtrace: lightningd/chaintopology.c:723 (setup_topology) 0x407bd8
2018-02-12T12:34:40.562Z lightningd(14966): backtrace: lightningd/lightningd.c:331 (main) 0x40f258
2018-02-12T12:34:40.562Z lightningd(14966): backtrace: (null):0 ((null)) 0x7fc0b7dad82f
2018-02-12T12:34:40.562Z lightningd(14966): backtrace: (null):0 ((null)) 0x403248
2018-02-12T12:34:40.562Z lightningd(14966): backtrace: (null):0 ((null)) 0xffffffffffffffff
Fatal signal 6. 0x410bfe log_crash
    lightningd/log.c:512
0x7fc0b7dc24af ???
    ???:0
0x7fc0b7dc2428 ???
    ???:0
0x7fc0b7dc4029 ???
    ???:0
0x410f52 fatal
    lightningd/log.c:575
0x4056c9 wait_for_bitcoind
    lightningd/bitcoind.c:723
0x407bd8 setup_topology
    lightningd/chaintopology.c:723
0x40f258 main
    lightningd/lightningd.c:331
0x7fc0b7dad82f ???
    ???:0
0x403248 ???
    ???:0
0xffffffffffffffff ???
    ???:0
Log dumped in crash.log
Aborted (core dumped)
Can anybody please solve my issue and explain me what is exactly happening!

The issue seems to be contained in the error message.
Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file (/home/lightning/.bitcoin/bitcoin.conf)

So, set rpcuser and rpcpassword appropriately in ~/.bitcoin/bitcoin.conf.


text:
what are ScriptSig?

I was studying bitcoin script, and upon watching this transaction in blockexplorer i was confused , what exactly is ScriptSig and scriptPubKey is of reciever?
According to what I know, the receiver contributes the ScripSig and sender contributes the ScriptPubKey. I cannot understand the function of CHECKSIG operation and what signature does it validate.

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

The question is very generic, and requires a whole lot to be answered... Also the image has low resolution. We would have to type the numbers from an address or a transaction manually into a block explorer - that's a bit too much :-) I provided a link, where the idea of the scripts is explained. Andreas' book "Mastering Bitcoin" is an amazing book that'll definitely give you additional help. It's freely available online here: http://chimera.labs.oreilly.com/books/1234000001802/index.html, see chapters 6 on transactions, and 7 on scripting.


text:
Bitcoin not received!
Bitcoin not received in copay or bit pay wallet but shows up on Blockchain.
Blockchain website: https://blockchain.info/address/1MeHHf8AqqCFwgQCYZ7BcqM8gLZ462cpdW

can you give more details?

What else do you need?

My bitcoin is received but there was just a one day delay.


text:
Bitcoin Core does not connect to the network
i have installed Bitcoin Core 0.15.1 on my computer. I also made a Port Forwarding for Port 8333 and gave my Computer a static IP Adress.
My computer stats are:
Intel Core i5 3.30GHz
AMD Radeon R9 380 Series
232 GB Samsung SSD 750 EVO 250GB
1863 GB Seagate HDD
16 GB RAM
But i have the problem, that de Core do not connect with the Network. (Left on the Bottom always stands "connecting to peers". But nothing happens. I waited 5 hours and there still stands "connecting to peers". But the Peer Tab(you can see in the picture) there are some peers connected i think. In the Debug File there are two Fails:
ProcessMessages(ping, 8 bytes) FAILED
ProcessMessages(getaddr, 0 bytes) FAILED
What can i do? Can someone help me?

Welcome to Bitcoin.SE! I will have a good read of your question and see if I can identify an answer.

Are you using Bitcoin Core with all default configuration or some custom options? If you could edit your question to explain it would be helpful.

@Willtech thanks for the fast answer. I am running it with deufault configuration.

If you click on a peer in the Peers window you have posted a screenshot of, do any of the peers say that they are Outbound or, do all of them say that they are Inbound?


text:
Share difficulty and hashrate
Can anybody explain relations and formulas between mining share difficulty, target and hashrate?
Thank you.

Difficulty is a measure of how difficult it is to find a hash below a given target.
Target is a 256-bit number (extremely large) that all Bitcoin clients share. The SHA-256 hash of a block's header must be lower than or equal to the current target for the block to be accepted by the network.
Target = current difficulty = output by Bitcoin's getDifficulty RPC call
(Difficulty is basically a different representation of the target to make it easier for normal humans to understand it.)
Hashrate is computed hashes per second.
difficulty = hashrate / (2^256 / max_target / intended_time_per_block)
             = hashrate / (2^256 / (2^208*65535) / 600)
             = hashrate / (2^48 / 65535 / 600)
             = hashrate / 7158388.055

Sources:Relationship between Hash-Rate and Difficulty && https://en.bitcoin.it/wiki/Difficulty


text:
blockchain.info says password is incorrect, and wont allow me to access my BTC
I had a wallet ID through blockchain.info. I signed in, received my BTC from where I bought it, all was good.
I wrote down my 12 words for recovery and have them.
I changed my password to something that I know and logged off.
When I came back, it says the password was wrong and wouldnt let me log in (YES, I'm 1000% sure my password is correct).
I used the recovery tool and the 12 phrases and got emailed a new wallet ID...my BTC are not there.
My new password does not work for my original wallet ID.
This seems to be a common problem and I would really appreciate some help.
BTC REWARD IF YOU CAN HELP ME!

Welcome to Bitcoin.SE! I have not used a blockchain.info wallet but, can you not just do a password reset?

There's no password reset functionality as blockchain.info doesn't know its users' passwords. The 12 words seed is the only information the user needs to restore its wallet. Has OP tried importing the seed into another wallet like Electrum?

Alcio - can you explain what you mean by this?

What do you mean the btc are not there, does a transaction show up when you used the phrase to recover? if so then it was probably stolen, if not, then you used the wrong phrase.

Welcome to Bitcoin.SE! As this is your first answer, remember to be nice and take a look at How to answer?.

Apparently the btc were sitting in an imported section of the original wallet id and doesn’t transfer over to the new one? Does that make sense? The phrase is correct because it creates a new wallet id just without my btc

Yes that makes sense. If you imported the address, it's not part of the hd wallet that is recoverable with the 12 words. If you imported the address, you may still have the private key of the address you imported...

@ChristiaanWesterbeek Can you explain what you mean by your last sentence? “You may still have the private key of the address you imported”? Thanks...

In your previous wallet you imported something right? Do you remember what it was? A paper wallet, something that contained btc? Those are known to be keypairs. An address (~ public key) for viewing and funding and a private key for spending.


text:
Looking for a comprehensive ICO dataset (prices & dates)
I'm working on a short research project on the performance of ICOs and how that relates to the overall sentiment in the crypto market. Unfortunately, I've had no luck so far looking for the required data. I need data on ICO dates and prices as well as price series for the post-ICO period. I've so far only found disjoint sources and no comprehensive dataset. Can anybody point me in the right direction?
Thanks!

Welcome to Bitcoin.SE! I would want that data if I was trying to train Watson to predict things. Hopefully, somebody with an insight into what you need will be along before too long.

I'm developing an open source software to unify all these disjoint sources in one database. I've found an interesting free API service (IcoBench) that have a lot of information for ICOs, like prices, team, even ratings and a lot of more. The post ICO prices are not stored, but you can use coinmarketcap.com for search historical prices after the ICO was ended and be launched to the markets. I've developed an API wrapper and web scraper for that page that works in Python, check out.
I will advise when the project will be more advanced. Currently, this kind of open source unification is a huge neccesary work in cryptoworld. Cheers!

here another sources to complement... https://www.dropbox.com/s/m53zfszs6oldtn0/ICO%20Data%20Export.xlsx?dl=0
you may find here some info with datasets
https://medium.com/@MLJARofficial/predicting-ico-returns-with-machine-learning-af6108ab9e39


text:
Trading crypto currencies with dollars
After I have bought a crypto currency at an exchange like Binance can I sell for dollars if it is going down. Basically if I have a profit from a currency what can I do with it to protect it?

If you don't have your private key, and the custodial wallet that does have your private key is no longer accessible, then you cannot move your coins or "cash out".
Invest in a hardware wallet, and transfer your coins out of any custodial wallet if you plan on hodling the coins.  That way, if you ever need to cash out, you can.

Yes, cashing out is profit protection but, it is also a stop gain. Follow the exchange user guide for instructions on how to sell or contact their support team, the details of how you do this are exchange specific.

Yeah, Willtech is right. You can withdraw your assets if exchange you're using allows doing that. By the way, not only Binance offer such an option. It's also possible to cash out with Cex. Just take a look.


text:
How to look about transtion is complated?
I'm trying to build my own blockexplorer, and to this i need to update a single transtion with confrims, my problems is i can't see how meny confrims there shut be and when my transtion is 100% complated.
i'm using RPC and bitcoin logic but what i'm working on is a multi-currency explorer based on bitcoin rpc syntax.
i use gettransaction (hash) and in this i can only se how many confrims, what do i wrong here?
i know i can say 6 confirms+ will be 100% complated, but the confirms still get bigger after 6 confirms, so i need to know when i shut stop to update my transtion on my blockexplorer project.

Let your explorer display the number of blocks confirmed.
As satoshi explains in section 11 of the whitepaper, a bitcoin transaction is never 100% final, but only the probability of it being not-final decreases with every confirmation. What probability of non-finality is good enough?
People could have any use-case so let people decide for themselves. Most want 6 confirmations safety to buy a car, some want 1 confirmation to buy coffee (and there are people like Roger Ver who want no confirmation!).

Thanks very much, its make sens and i can work with that :)


text:
Can i convert BAR ( Tidex ) to XRP ( Binance ) ?
I need some advice, I do have some BARS with me on Tidex but I would like to send them to my Binance account but in other coin format e.g BARS to Ripple. Is it possible to do so, if any option please do let me know.


text:
bitcoin.conf does nothing for RPC calls
My problem i that I'm trying to communicate my python code with bitcoin-cli (Bitcoin ABC) and I'm suppose to set rpcuser, and rpcpassword on bitcoin.conf file on .bitcoin folder. Right?
Well, when I do so I still can call bitcoin-cli without prompting any password, and, worst, the code does not work:
from __future__ import print_function
import requests, json

rpcPort = 8332
rpcUser = 'xxxxx'

rpcPassword = 'xxxxx'
serverURL = 'http://' + rpcUser + ':' + rpcPassword + '@localhost:' + str(rpcPort)

headers = {'content-type': 'application/json'}
payload = json.dumps({"method": 'getblock', "params": ["0000000000005e5fd51f764d230441092f1b69d1a1eeab334c5bb32412e8dc51"], "jsonrpc": "2.0"})
response = requests.get(serverURL, headers=headers, data=payload)
print(response.json()['result'])

My results:
Traceback (most recent call last):
  File "/home/phglz/Desktop/pruebapython.py", line 17, in <module>
    print(response.json()['result'])
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u "/home/phglz/Desktop/pruebapython.py"]
[dir: /home/phglz/Desktop]
[path: /home/phglz/bin:/home/phglz/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]

I'm quite lost now as you can see I'm not an expert on this.
My bitcoin.conf looks like:
rpcuser=xxxx
rpcpassword=xxxx
daemon=1
keypool=10000
maxuploadtarget=20
maxconnections=16

Thanks in advance for your valued help.

I'm suppose to set rpcuser, and rpcpassword on bitcoin.conf file on .bitcoin folder. Right?

Kind of. rpcuser and rpcpassword have been deprecated in favor of cookie authentication (temporary username and password placed in the .cookie file) and rpcauth.

Well, when I do so I still can call bitcoin-cli without prompting any password,

It's not supposed to. bitcoin-cli reads the data directory to get the information it needs. It will read your bitcoin.conf file for the username and password or it will use the .cookie file.

the code does not work

Your code is completely wrong.

serverURL = 'http://' + rpcUser + ':' + rpcPassword + '@localhost:' + str(rpcPort)

This is incorrect; that's not how authentication works for this.
Bitcoin Core uses HTTP basic auth; the username and password are not part of the URL like that. Since you are using Python Requests, here is their documentation on using HTTP Basic Authentication: http://docs.python-requests.org/en/master/user/authentication/#basic-authentication

Thank you master. I just jumped to bitcoinrpc library, working good so far. I'll be back to this topic when the time comes. It seems it will be a long way. Thanks again.


text:
bitcoinrpc error
I was happily using bitcoinrpc until I moved to python3 (python3.6.4 at the moment) and it stops working. Now I'm trying to use this one: https://github.com/XertroV/bitcoin-python3
After completing install I run the code:

import bitcoinrpc
access = bitcoinrpc.connect_to_local()
  access.getinfo()

Getting the following error:

Traceback (most recent call last):   File
  "/home/phglz/Desktop/Satoshing/backend.py", line 8, in
      access.getinfo()   File "/usr/local/lib/python3.6/dist-packages/bitcoin_python3-0.3.1-py3.6.egg/bitcoinrpc/connection.py",
  line 133, in getinfo   File
  "/usr/local/lib/python3.6/dist-packages/bitcoin_python3-0.3.1-py3.6.egg/bitcoinrpc/proxy.py",
  line 116, in call   File
  "/usr/local/lib/python3.6/dist-packages/bitcoin_python3-0.3.1-py3.6.egg/bitcoinrpc/proxy.py",
  line 67, in request   File "/usr/lib/python3.6/http/client.py", line
  1239, in request
      self._send_request(method, url, body, headers, encode_chunked)   File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
      self.endheaders(body, encode_chunked=encode_chunked)   File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
      self._send_output(message_body, encode_chunked=encode_chunked)   File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
      self.send(msg)   File "/usr/lib/python3.6/http/client.py", line 964, in send
      self.connect()   File "/usr/lib/python3.6/http/client.py", line 936, in connect
      (self.host,self.port), self.timeout, self.source_address)   File "/usr/lib/python3.6/socket.py", line 712, in create_connection
      sock.bind(source_address) TypeError: getsockaddrarg: AF_INET address must be tuple, not int

This issue has been posted before but not solution has been reported. I searched all over the web as much as I could.
If someone out there has an idea of what could be wrong I would appreciate his knowledge.
Thanks a lot.
Felipe

I actually asked a more generic question about Python libraries to interact with Bitcoin-Core. https://bitcoin.stackexchange.com/questions/73815/need-advice-for-python-interaction-with-bitcoin-core-wallet but haven't got any answer. If you are interested, would you please upvote to attract some attentions?

The library did not have an update in 3 years. The getinfo call it attempts has been deprecated for a while and was removed with the 0.16 release of bitcoind. The solution here is to abandon the library and look for other options. Doing the rpc queries directly with python is not very hard.


text:
Are there any tools to check values in tx validation?
Are there any developing tools that can show values(like the hash of tx to sign or the stack of script execution) in tx validation so that developers can check the correctness of their validation code?

For the hash of the tx to sign, I am not aware, but you can easily remove signatures, place the output script, adopt the length field(s), and hash yourself?
For script execution, there are several debuggers: here and here and here :-)


text:
What does this transaction script mean?
I was looking for scripts on the blockchain to test my program, and I encountered a weird scriptPubKey in this tx that I couldn't understand.
The opcodes are
pk1 = 02085C6600657566ACC2D6382A47BC3F324008D2AA10940DD7705A48AA2A5A5E33
pk2 = 03F5D0FB955F95DD6BE6115CE85661DB412EC6A08ABCBFCE7DA0BA8297C6CC0EC4
hash1 = D68DF9E32A147CFFA36193C6F7C43A1C8C69CDA530E1C6DB354BFABDCFEFAF3C
hash2 = F531F3041D3136701EA09067C53E7159C8F9B2746A56C3D82966C54BBC553226

OP_PUSHDATA <pk1>
OP_CHECKSIG
OP_SWAP

OP_PUSHDATA <pk2>
OP_CHECKSIG
OP_SWAP

3 OP_PICK
OP_SHA256
OP_PUSHDATA <hash1>
OP_EQUAL

3 OP_PICK
OP_SHA256
OP_PUSHDATA <hash2>
OP_EQUAL

OP_BOOLAND

4 OP_PICK
OP_SIZE OP_NIP
OP_PUSHDATA 0x20
OP_PUSHDATA 0x22
OP_WITHIN

OP_BOOLAND

3 OP_PICK OP_NIP
OP_PUSHDATA 0x20
OP_PUSHDATA 0x22
OP_WITHIN

OP_BOOLAND

OP_IF

3 OP_PICK
OP_SIZE OP_NIP

3 OP_PICK
OP_SIZE OP_NIP

OP_EQUAL
OP_PICK

OP_ELSE
OP_BOOLAND
OP_ENDIF

I tried to somehow decipher it, and this is the pseudocode in my understanding
bool pk_script(dat1, dat2, sig1, sig2) {
    if (sha256(dat1) == hash1 &&
        sha256(dat2) == hash2 &&
        size(dat1) == 32 or 33 &&
        size(dat2) == 32 or 33) {
        if (size(dat1) == size(dat2)) {
            return checksig(sig2, pk2);
        } else {
            return checksig(sig1, pk1);
        }
    } else {
        return checksig(sig1, pk1) && checksig(sig2, pk2);
    }
}

If this is correct, I can't understand what the condition of the main if is trying to do, nor can I see the meaning of the first branch.
The output was spent in this tx which only pushes two empty strings and two signatures in the scriptSignature.
Could anyone please explain what's the meaning of the rest of the script besides checking the validity of two signatures?

what a wonderful script! I am trying to decode, but have some troubles. I am having troubles to verify the spending tx signatures with the first or second pubkey, no matter if I use the normal hash or a double hash. One observation: sha256 of the 20 bytes hash from the funding tx (0x1B1B01DC...) results in hash2 in the TX_OUTPUT of the spending tx (F531F304...). So this all makes me think that it is a multisig try. Working on it ...

sorry forgot to update after Andrew's reply. That's an interesting discovery. I don't know why the owner would expose part of the answer in the previous tx if he was intended to make it a practical and secure one(don't know much about lightning network though). And my raw tx for signature is this one, which seemed fine when I checked.

when I convert the sig and unsigned tx to hex, and do a double sha256 on it, I get "4eb4dccd727e81315a9ff801c205efc62635471cf8668e42c1c8aebfb51500a3" - which doesn't match somehow (I then use: openssl pkeyutl <tmp_utx_dsha256.hex -verify -pubin -inkey pubkey.pem -sigfile tmp_sig.hex). How did you check, that sig is valid?

I was using a python library and did get the same hash. I tried openssl in your way, and it still seemed to be valid. These were the parameters I used.

ah, I see... this is your own tx. That works with me too :-) I was trying the original tx, but couldn't get it to work. The sig/pubkey and hash didn't match.  Anyhow, the structure of the original  tx is clear, and I don't want to get off topic too much. Thx.

eh... but we did get the hash, that was weird. I was actually checking the next tx that's using this output. Which signature and pub key were you using?

I put my summary in a new answer, otherwise formatting get's in the way ...

Your pseudocode is correct.
The script has two parties involved in it. If either party has two hash preimages, they can sign for the transaction and spend the coins. Or both parties can spend the coins if both of them sign for the transaction.
So presumably each party generates a secret value which is their hash preimage. If some condition is violated, then one party might be forced to give up their hash preimage to the other party thus allowing the other party to spend all of the coins associated with the output.
But there could also be a cooperative spend where both of them sign for the transaction. This is actually similar to what the Lightning Network does for commitment transactions.
Instead of using this script, they could have done a 2-of-2 multisig and revealed the other person's private key just for the case with the revealed hash preimage. However this may not be ideal because revealing private keys could compromise other private keys.

Wait but there is an OP_PICK after OP_EQUAL. So shouldn't it pick the index 1 item(checksig(sig2, pk2)) in the stack if (size(dat1) == size(dat2)) is true or return index 0 item(checksig(sig1, pk1)) if it is false?

Hmm, indeed, I missed that. I'll edit my answer.

Thanks Andrew! I'm still a little unclear about the condition (size(dat1) == size(dat2)). Why does it have to compare the size of the two preimages to determine which public key to use?

Trying to see, how this tx was successfully confirmed (in 2013) in the blockchain should reveal the secret of this script. The previous comments give already an idea, what the script is doing, but doesn't explain all. So I try to decompose further.
Assumption is, that sigscript of the spending tx goes to stack, then followed on top by the pubkey script. To verify the signature, the previous funding tx would need to be converted to an unsigned tx, so I remove the sig from orig tx, replace it with pubkey script, and change input script length:
 01000000 01 A214A2DAF91691AFDD491FD00D894EB3301E35BC18B5554B14E12843037E954C (<-- reverse hex !)
  00000000
  23         (<-- length is decimal 35 Bytes, reversed, hex 0x23)
  2102085C6600657566ACC2D6382A47BC3F324008D2AA10940DD7705A48AA2A5A5E33AC7C2103F5D0FB955F95DD6BE6115CE85661DB412EC6A08ABCBFCE7DA0BA8297C6CC0EC4AC7C5379A820D68DF9E32A147CFFA36193C6F7C43A1C8C69CDA530E1C6DB354BFABDCFEFAF3C875379A820F531F3041D3136701EA09067C53E7159C8F9B2746A56C3D82966C54BBC553226879A5479827701200122A59A5379827701200122A59A6353798277537982778779679A68 (<-- placed pkscript here into sigscript section)
  00000000   (<-- interestingly, Sequence is not FFFFFFFF)
 01 C06C3C0000000000 23 21039DC85F5FE062D4EEF0470FA96D4BBCFFF0096C62042333CD05AD491536560443AC DA538652

which is serialized and double sha256 hashed:
01000000014c957e034328e1144b55b518bc351e30b34e890dd01f49ddaf9116f9daa214a200000000B52102085C6600657566ACC2D6382A47BC3F324008D2AA10940DD7705A48AA2A5A5E33AC7C2103F5D0FB955F95DD6BE6115CE85661DB412EC6A08ABCBFCE7DA0BA8297C6CC0EC4AC7C5379A820D68DF9E32A147CFFA36193C6F7C43A1C8C69CDA530E1C6DB354BFABDCFEFAF3C875379A820F531F3041D3136701EA09067C53E7159C8F9B2746A56C3D82966C54BBC553226879A5479827701200122A59A5379827701200122A59A6353798277537982778779679A680000000001c06c3c00000000002321039dc85f5fe062d4eef0470fa96d4bbcfff0096c62042333cd05ad491536560443acda53865201000000

4eb4dccd727e81315a9ff801c205efc62635471cf8668e42c1c8aebfb51500a3

This double sha256 hash, pubkeys and sig (from the spending tx) matches with these pubkeys:

ssig1:
  30450221009a29101094b283ae62a6fed68603c554ca3a624b9a78d83e8065edcf97ae231b02202cbed6e796ee6f4caf30edef8f5597a08a6be265d6601ad92283990b55c038fa
  pubkey in HEX:
  03F5D0FB955F95DD6BE6115CE85661DB412EC6A08ABCBFCE7DA0BA8297C6CC0EC4
  pubkey in PEM:
  MDYwEAYHKoZIzj0CAQYFK4EEAAoDIgAD9dD7lV+V3WvmEVzoVmHbQS7GoIq8v859oLqCl8bMDsQ=
  double sha256:
  4eb4dccd727e81315a9ff801c205efc62635471cf8668e42c1c8aebfb51500a3
ssig2:
  3044022045d08719828fbd93e49c9223e63f4d2dab2de6c568e1faa2cccb33adf2575d2c02200c00126cb0105275040a963d91e45460147e40451b590485cf438606d3c784cf
  pubkey in HEX:
  02085C6600657566ACC2D6382A47BC3F324008D2AA10940DD7705A48AA2A5A5E33
  pubkey in PEM:
  MDYwEAYHKoZIzj0CAQYFK4EEAAoDIgACCFxmAGV1ZqzC1jgqR7w/MkAI0qoQlA3XcFpIqipaXjM=
  double sha256:
  4eb4dccd727e81315a9ff801c205efc62635471cf8668e42c1c8aebfb51500a3

Quick verification with openssl (hence the pubkey in PEM format):
sig=30450221009a29101094b283ae62a6fed68603c554ca3a624b9a78d83e8065edcf97ae231b02202cbed6e796ee6f4caf30edef8f5597a08a6be265d6601ad92283990b55c038fa
pk=03F5D0FB955F95DD6BE6115CE85661DB412EC6A08ABCBFCE7DA0BA8297C6CC0EC4
hash=4eb4dccd727e81315a9ff801c205efc62635471cf8668e42c1c8aebfb51500a3
printf $( echo $hash | sed 's/[[:xdigit:]]\{2\}/\\x&/g' ) > tmp_utx_dsha256.hex
echo "MDYwEAYHKoZIzj0CAQYFK4EEAAoDIgAD9dD7lV+V3WvmEVzoVmHbQS7GoIq8v859oLqCl8bMDsQ=" > cat pubkey.pem
printf $( echo $sig | sed 's/[[:xdigit:]]\{2\}/\\x&/g' ) > tmp_sig.hex
openssl pkeyutl <tmp_utx_dsha256.hex -verify -pubin -inkey pubkey.pem -sigfile tmp_sig.hex

OK, the part for the signature is clear. So looking further at the pkscript, I'll try to decode:
pubkey1  21 02085C6600657566ACC2D6382A47BC3F324008D2AA10940DD7705A48AA2A5A5E33 AC 7C
pubkey2  21 03F5D0FB955F95DD6BE6115CE85661DB412EC6A08ABCBFCE7DA0BA8297C6CC0EC4 AC 7C
         53 79 A8
hash1    20 D68DF9E32A147CFFA36193C6F7C43A1C8C69CDA530E1C6DB354BFABDCFEFAF3C
         87 53 79 A8
hash2    20 F531F3041D3136701EA09067C53E7159C8F9B2746A56C3D82966C54BBC553226
         87 9A 54 79 82 77
         01 20
         01 22
         A5 9A 53 79 82 77
         01 20
         01 22
         A5 9A 63 53 79 82 77 53 79 82 77 87 79 67 9A 68

The problem I see is, that your statement somehow doesn't seem to match:
if (sha256(dat1) == hash1 &&
    sha256(dat2) == hash2 &&
    size(dat1) == 32 or 33 &&
    size(dat2) == 32 or 33) {
    if (size(dat1) == size(dat2)) {
       return checksig(sig2, pk2);
    } else {
       return checksig(sig1, pk1);
    }

The stack would look after sigscript:
[ssig2]
[ssig1]
[0x00]
[0x00]

And on top the pkscript would follow:
21: OP_DATA_0x21:        length compressed Public Key (X9.63 form, 33 Bytes)
    02085C6600657566:ACC2D6382A47BC3F:324008D2AA10940D:D7705A48AA2A5A5E:33
    corresponding bitcoin address is:   152q849uVmoB5oRcZ4d4tJHyRuB6FPB9Hz
AC: OP_CHECKSIG:         sig must be a valid sig for hash and pubkey

--  this would check the pubkey1 against ssig2, remove pubkey and [ssig2] from stack, and leave [TRUE] on stack
7C: OP_SWAP:             top two items on stack are swapped

--  this would swap [ssig1][TRUE], so [ssig1] is on top of stack
21: OP_DATA_0x21:        length compressed Public Key (X9.63 form, 33 Bytes)
    03F5D0FB955F95DD:6BE6115CE85661DB:412EC6A08ABCBFCE:7DA0BA8297C6CC0E:C4
    corresponding bitcoin address is:   1BaJ2fYiAVnZC73MtX1LsyJBtXNZWDSkt6
AC: OP_CHECKSIG:         sig must be a valid sig for hash and pubkey

--  this would check the pubkey2 against ssig1, remove pubkey and [ssig1] from stack,
    and leave [TRUE] on stack
    [0x00][0x00][TRUE][TRUE]
7C: OP_SWAP:             top two items on stack are swapped

--  this would swap [TRUE][TRUE], reason is unclear
53: OP_3:                the number 3 is pushed onto stack

--  top stack element is "3"
    [0x00][0x00][TRUE][TRUE][0x53]
79: OP_PICK:             item n back in stack is copied to top

--  this would pop 1 element from stack, and bring [0x00] to the top of stack:
    [0x00][0x00][TRUE][TRUE][0x00]
A8: OP_SHA256:           input is hashed using SHA-256
20: OP_Data:             next 32 bytes is data to be pushed on stack
    D68DF9E32A147CFF:A36193C6F7C43A1C:8C69CDA530E1C6DB:354BFABDCFEFAF3C
87: OP_Equal:            Returns 1 if inputs are equal, 0 otherwise

--  hashed the [0x00] value, put OP_DATA on top, and compare it. OP_EQUAL pops two
    elements from stack. This would give [FALSE] on the stack. Stack status:
    [0x00][0x00][TRUE][TRUE][FALSE]
53: OP_3:                the number 3 is pushed onto stack
79: OP_PICK:             item n back in stack is copied to top

--  this would pick the [TRUE] value ??
A8: OP_SHA256:           input is hashed using SHA-256
20: OP_Data:             next 32 bytes is data to be pushed on stack
    F531F3041D313670:1EA09067C53E7159:C8F9B2746A56C3D8:2966C54BBC553226
87: OP_Equal:            Returns 1 if inputs are equal, 0 otherwise

--  hashed the [0x00] value, put OP_DATA on top, and compare it. OP_EQUAL pops two elements from stack. This would give [FALSE] on the stack. Stack status: [0x00][0x00][TRUE][TRUE][FALSE][FALSE]
-- interestingly, this hash would match to sha256(hash) provided in the funding tx, as mentioned in the previous comment. I stop further evaluation of the script here. My understanding is, that we have seen the spending script with two hex 0x00 values, followed by sigs. This does not match the pseudo code? Maybe more like this:
if (sig1 == TRUE &&
    sig2 == TRUE &&
    sha256(dat1) == hash1 &&
    sha256(dat2) == hash2 &&
    size(dat1) == 32 or 33 &&
    size(dat2) == 32 or 33)
    ...

However: I have somewhere an "off by one" at the second hash value (F531F3041D313670...). It should be OP_4 or OP_5 (instead of OP_3) to reach to one of the provided hash images. With the value 3 the OP_PICK would copy [TRUE] (from the sig verification) on top, instead the hash image at position 4 or 5...
I didn't follow the next opcodes, there are more conditions. Also sequence number is "00000000" (not "FFFFFFFF"), and LockTime is "DA538652" (decimal ), which is bigger than 500'000'000, meaning a unix timestamp. This translates to a date: Fr 15 Nov 2013 18:03:22 CET. The tx appeared in the blockchain on 2013-11-15 17:13:23.
So in summary I think, this tx was structured in a way, that someone gave out a keyword with the tx to a second party, and you needed to be able to sign and "know" the keyword. A type of multisig, yes. And, it could not be spent before a certain point in time (the tx would be kept in mempool, but we cannot see this anymore). Else only the owner would be able to spend the tx...
There is probably more to it, I leave it to the experts to decode the remaining part :-)

wow that's a lot of work, thanks! I guess the off-by-one problem is probably at OP_PICK which should pick one-element deeper down the stack(the (n+1)th element after popping out n?).

Yes, I see the off by one also at the OP_PICK, it‘s a bit speculation, cause we don‘t know the original intent. The effort was not too much, I have a set of shell scripts. But aligning it, so it fits here in bitcoin.SE was a major piece of work :-)


text:
Getting Litecoin cash out of my Trezor
I am trying to get my private key out of my Trezor in order to access my Litecoin cash.
I used the following site in order to generate the private key out of my 24-word recovery phrase: https://coinomi.com/recovery-phrase-tool.html
Many addresses get generated out of it. When using any of these keys into the LitecoinCash core wallet (ie. import private key), I am being asked for my passphrase (supposedly word 25th if ever set up, which I did not) and cannot access my Litecoins. I guess I am not generating the correct private key!?
Any advice on how to extract these Litecoin cash out of it?
Cheers

LCC-core is not asking for your Trezor passphrase (25-word) which, as you said, you didn't set up.  LCC-core is asking for your wallet.dat passphrase which is the passphrase used to encrypt the contents of the LCC-core wallet.dat file.  This was a passphrase you set when you originally installed and set up the LCC-core software.
Just a point of advice.  You might be better served using the Electrum-LCC software since it can talk directly to Trezor.  No need to extract private keys (which is inherently risky)


text:
Litecoin tagged addresses
I know that on blockchain info there is a list of bitcoin tagged addresses https://blockchain.info/tags. I'm wondering if there exists something similar for Litecoin, since I did not find any information about it.

Those tagged addresses are only for blockchain.info. They are not part of the Bitcoin blockchain, they are local only to blockchain.info. So you would need a service like blockchain.info that maintains a database of addresses that are tagged, but those tags would only apply to that service only. AFAIK, there is no such service.

Yes, I was wondering if existed such a service, but apparently it does not exist, currently. Thanks!


text:
Bitcoin's script expressivity
I'm conscious that Bitcoin's script is not turing complete, as multiple answers point out (e.g., this answer and this one). But I'm wondering if script can express the language of a PDA or equivalently, of a context-free-grammar.
I think it should be so, because of script's stack, but I'm not sure and therefore I ask for some clarifications/confirmations.

No, it's much less expressive than a PDA, or even a DFA.  There's a stack, but what you don't have is the ability to return to the same program state with different stack contents, or for that matter, to return to the same program state at all.
Execution is linear and there are no loops, so any given instruction in the script is executed at most once.  And each instruction can only inspect a bounded number of stack or input elements.  So a Bitcoin script cannot even recognize the language x* (any number of xs) because a script of length n will only ever be able to look at, say, 4n elements of input, and it cannot distinguish xxxx....xx from xxxx....xy if both strings have length greater than, say, 4n+1.  Even a DFA can recognize that language.

Now I know that there is a language that script cannot accept and DFA accepts. I am wondering if there is an example that works for script and not for DFA.

@Briomkez: There can't be; you can encode any script as a DFA in a very straightforward fashion.


text:
How to send bitcoin programatically using API? Bitcoin Transaction. (Without Setting Node)

Want to send BTC from one address to another address without using
  JSON-RPC.

Followed and used:

https://bitcore.io/api/
https://www.npmjs.com/package/bitcoin-transaction/v/1.1.1

2nd:bitcoin-transaction Working good for testnet but giving each time new errors for Mainnet.
If anyone knows better way to send BTC, kindly let me know.

Software recommendations are not in the scope of this website: https://bitcoin.stackexchange.com/help/on-topic

@JBaczuk Understood.

From C#, I would use NBitcoin to generate raw transaction and push it to some API provider. This eliminates the need of setting up full node.


text:
What is my goal | Objectives when mining?
I kept on learning how miner hash | decrypt | calculate all those infos that was given to them by the pool but I can't find how they do it, maybe there's a function something like:
int hashThis( param1, param2, param3 )
{
  ..
  ..
  return somthingCanBeUsedToInformThePoolOfSucces
}

int Submit()
{
  param = hashThis(param1, param2, param3 )
  submitTothePool(param)
}

That is how know mining is, but I don't know how to implement the function hashThis(), that's why I asked maybe you have a goal to reach, and return it when you reached it

Basically, you are solving a puzzle. A puzzle is to come with a nounce(number) which when added with the block header and hashed, hash should start with some number of zeros.
Higher the number of zeros, difficult it is to come with the nouce for the given block header. According to the current hash power in the network, network adjusts the difficulty.
Implementation would look something like this:
1) Generate block header for the given set of transactions
2) Get the current network difficulty level ( number of zeros hash should start with )
3) Plug in random numbers so that : hash( nounce + blockheader ) starts with given number of zeros
4) Form a block and include nounce in the blockheader ( So that other node can verify your work )


text:
verified transaction in a block is verfied by one node?
i want to know whether block is a combination of transaction verified by one node so all the transaction in that block is verified and once node is full node will broadcast it or any node can add transaction in that block?

Welcome to bitcoin.SE! The provided information is somehow difficult to understand, as it seem to mix two or three questions. How to raise a good question, which increases the probability for a good
answer, see here:
Have a look at https://bitcoin.stackexchange.com/help/how-to-ask.

In the world of blockchain, no one trusts anyone. Transactions in each and every block are verified by each and every node.
Just the node that solves the cryptographic puzzle (In PoW), gets a chance to append a new and valid block to the blockchain. Which in turn will be verified by every node.

you u means there are 2 verification ? one for valid transaction and one for adding valid block in ledger ? so miner or node is getting reward for both ?

Let's put it this way. Miner gets reward only and only if it adds a new block to blockchain. And block must contain all valid transactions. If it contains invalid transaction then other nodes will check the transaction and on finding transaction invalid they won't accept new block.

A miner has to generate a block that other nodes will consider valid or nothing will happen to his block and he won't get any reward. When nodes receive blocks from other nodes, they confirm that the new block complies with all system rules which includes a rule that every transaction in that block be valid. Miners can put anything in the blocks they mine that they want and nobody else can alter them (or it would be a totally different block and not the one they mined) but if they break any validity rules, all honest clients will ignore the block and they'll get no reward.

As per my comment, I will anyhow try to provide a short, general answer:
@Preet has already given good info.
So the bitcoin network consists of miners (which also run a full node), and thousands of full nodes not running mining software. The miners have one and only one task, to make sure valid transactions are assembled into a new  block. When the block is then sent to the network, each full node verifies this block, to be sure the miner was not misbehaving (provided a faulty tx).
The full node would verify the block and each tx inside, based on these rules. You may also read about protocol rules in this webpage. This second set of checks by full nodes is required, for consistency. Two main reasons come to my mind: as a merchant, I want to know, that there is  only valid tx in the blockchain, and if a miner sends wrong blocks, it's IP address  will be added to the list of misbehaving hosts, and eventually be banned (no more tx sent to this host). If a misbehaving miner doesn't receive tx, he is out of business, loosing all his invest into mining hardware.
This is one of the most important things to understand in bitcoin concept: it is more beneficial to play the game, as trying to play against the system.


text:
Can a block more than a week old be considered a valid chain tip?
I recently encountered an assertion about this and I have been trying to get to the bottom of it. It's well-known that Bitcoin blocks have timestamps and that there are certain requirements they need to satisfy for a block to be considered valid, namely (as per this source) a block timestamp needs to be later than the median of the last 11 blocks, and not 2 hours in the future relative to a measure of the current time.
My question is not about block validity, but about practical safeguards that a client might use to detect malfeasance. Is there not any safeguard in place in typical bitcoin clients that prevents a relatively old block, say one week old, from being accepted by a bitcoin client as the most recent block and the current accepted state of the chain? It seems like this would be a good safeguard - it is very unlikely that the most recent block would ever truly be this old, and preventing a client from accepting a block such as this seems like it might prevent an attack from an adversary trying to pass off an old state of the chain as current.

It’s not quite clear to me, how we would end up in a scenario where a block with a week old timestamp looks like the best chaintip to us. Do we only have a single peer or are eclipsed in your scenario? Or is there a network split on-going that split off all hashrate from our section of the internet? Does How does block synchronization work in Bitcoin Core today? answer your question?

Thanks for your answer. Eclipsing is perhaps one way I imagined this might happen, but the context for why I am asking is related to this paper that a colleague and I wrote about quantum attacks on PoW and how certain versions of the attack could result in apparently old but high-difficulty chain tips.

Bitcoin Core will generally connect to at least 10 outbound peers (8 regular, 2 blocks-only). It will ask all of the peers for their chaintips and then start synchronizing the header chain for the chaintip with the most work after choosing a single header sync peer. Only when it has acquired all block headers of the peer and validated them to the extent possible, will it start downloading blocks and advancing its active chaintip. As long as one of our node’s peers is honest and caught up, we’d already be on our way to the actual chaintip.
A block whose timestamp is older than the median of the 11 preceding blocks would simply be rejected at the header sync stage, so we must assume that the attacker is serving a blockchain that is a week old.
If our node were to be eclipsed and all of its peers were offering only a chaintip that is older than a week, our node would synchronize with that chaintip. Our node would remain in "initialblockdownload" state, as it only disables IBD-mode once the timestamp of the node’s active chaintip is no more than 24 hours in the past of its own system time. This would e.g. cause the wallet GUI to display a warning that the node is not caught up. The node would also start trying to make additional connections due to not making progress. If it finds any honest peer, it will continue synchronizing towards the actual best chain. If the eclipse attack persists, it will stall, but remain in IBD mode.
So, the chaintip would be considered valid, but the node would not consider itself caught up to the network.