text:
In DASH, why is in the coinbase transaction sometimes the first output the masternode reward, and other times the second?
Example of the first output being a masternode reward
Example of the first output being a proof-of-work reward
What determines the order of the outputs in the generation transaction?
As far as I understand it:
In src/miner.cpp in the CreateNewBlock function it is determined that the vout index for proof-of-work is 0. Line 86-90:
CMutableTransaction txNew;
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vout.resize(1);
txNew.vout[0].scriptPubKey = scriptPubKeyIn;

Later on in the function it calls the FillBlockPayments function In src/masternode-payments.cpp Line 294:
FillBlockPayments(txNew, nHeight, blockReward, pblock->txoutMasternode, pblock->voutSuperblock);
which calls the FillBlockPayee function. Line 222:
mnpayments.FillBlockPayee(txNew, nBlockHeight, blockReward, txoutMasternodeRet);
There the masternode reward is appended as an additional vout to the transaction txNew. Line 287-291:
// split reward between miner ...
txNew.vout[0].nValue -= masternodePayment;
// ... and masternode
txoutMasternodeRet = CTxOut(masternodePayment, payee);
txNew.vout.push_back(txoutMasternodeRet);

Why then, in the generation transaction, is the first output not always the proof-of-work reward?


text:
Bitcoin transaction fees and how to handle it
Lets say I set a very low transaction fee for a bitcoin transaction(from one of my own wallets to another). I also have mining equipment which is mining for bitcoins. Is there anyway to get that transaction request directed towards me ? In other words can I process my own transactions by giving it priority?
If so how do I do this?

Please ask one question per post; otherwise it gets very hard to keep straight what is answered and what hasn't.  I'm going to take the liberty of commenting out your second question; feel free to ask a new question with it.  You can get the text by viewing the edit history.

While you can prioritize your own transaction, it won't do much good, unless you're in control of a large hash pool. The probability of a single user ever completing a block specifically crafted with their own transaction is extremely small.  It is better to just pay a reasonable transaction fee.

If I want to send 10USD worth of bitcoins, I have to pay 6USD as fees?

Yes, you can. This is the exact purpose of the RPC command prioritisetransaction.

source: Stack Exchange

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

authors: Павел Коновалов

sort: votes


text:
BitcoinCore Password crash
I have a Bitcoin Core wallet. 4 days ago my password worked. Now I can't send bitcoins from my wallet: the password is wrong.  What happened?  Please help, all my money is there.  I did not change the password phrase and I am sure I remember my password.  How can I resolve my problem?

Try caps-lock ?
If you do not know your password it is very difficult. If you search there are other questions like this one discussing software to possibly recover the password.

I tried Caps lock too, I had bitcoin core 0.15.0.1 and create pass, after I update to 0.15.1 and have problem with pass, but several attempts is correct, after I send bitcoins 4 day ago and pass worked, now did't work I update to 0.16, but did't work still, whats happen I don't know, I try btcrecover but nothing, I don't know what's going on

If you don’t  have your password or private key you can never send bitcoin from your wallet

authors: Виктор Персиков

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


text:
If someone bought an old computer and found Bitcoins in it, could they use it (legally)?
Let's say someone bought a used computers which has a copy of a bunch of Bitcoin keypairs. Is he legally allowed to transfer them?
Is this case analogous to finding a pile of cash inside a used bag?

Legal in which jurisdiction? The answer will probably vary greatly depending on who is involved and where it takes place.

This is going to depend a lot on many surrounding facts. Including where this happens. How you acquired the computer and whether you know who the owner is.
I'm most familiar with the law in Australia (Victoria) where stealing is defined as follows: "A person steals if he dishonestly appropriates property belonging to another with the intention of permanently depriving the other of it." I imagine many common law countries have relatively similar definitions (with important differences for edge cases, of which this is one).
If you see bitcoins as property then your example involves theft. I think most jurisdictions will define bitcoins as a form of property, if they don't there would be all sorts of tax issues. This would be the case in Australia and it would be theft.
To me I don't think this is analogous to finding a pile of cash inside a used bag. I think it is closer to find someone's internet banking username and password inside a bag you purchased. Bitcoins are not physical and the private keys (which is what you would find) merely grant you access to them. Most people would agree that doing anything with the internet banking details would be dishonest.
The difference in my example would be whether destroying the keys would be a crime. It is unlikely to be a problem with internet banking details as there is no expectation this would permanently deprive the person of their property. With bitcoin you don't know if there is a backup so you would at least be recklessly dealing with someone's property.

The analogy of a banking username and password is completely different. The username and password establish an identity to access a bank's system. Bitcoin does not have any identities and is not anyone's system. Also, we have a well-defined way to know who owns a bank account. The only reliable way to know who owns a bitcoin is to know who holds the key.

A better analogy would be if there was a worldwide agreement to give $1 to whoever first announced the answer to some math problem and someone accidentally sold a piece of paper to you that contained the answer to that math problem.

Buying an old computer with a Bitcoin wallet on it containing BTC would be analogues to buying an old chest of drawers that holds a wallet with some cash in it (and no ID). You might ask the seller about the wallet since it may not have been intended to be sold but, you ask with a copy of a bunch of Bitcoin keypairs.
If you buy an old computer and it happens to have the plans for the greatest world-changing invention since sliced bread on it, can you claim ownership of the plans? You brought the computer which contains the hard disk, which contains the plans so it would seem at first that you could, however, there are at least copyright and intellectual property laws protecting works to consider in that case.
In the case of the keypairs, I would assume that a court would see using them as computer hacking. I won't cite the case in detail for the length of reply needed but; there was a case in Queensland of a boy around ten years ago convicted of computer hacking. He was using the command prompt on a Windows PC and typing net use over a dial-up connection to access publicly and openly shared files on other computers. That was the court's view, that it was computer hacking.
In any case, using the key pairs you would be deliberately taking something that does not belong to you and that you have certainly not purchased with the computer, and that is theft at least.
If it had usernames and passwords for loging in to various websites you would be no more entitled to use those.

When you own the private keys, you own the coins. It's that simple. You would Need the passphrase to the wallet, though.

Since Bitcoin deals in skirting tax laws and is primarily used by shady types I see no reason why anyone would not just claim the bitcoins, after all most governments, corporations and stock market gurus have at one time or another been corrupt or dealt with insider and information.

Since Bitcoin deals with reestablishing the respect for property rights long undermined through taxation and money printing by governments and people with a kleptocratic mindset under the guise of welfare and warfare, I see no reason why most Bitcoin supporters would not attempt to return the bitcoins to their rightful owner.

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


text:
Electrum wallet giving dust error even for larger amount
I have used this wallet sever times before to send or receive. I closed, downloaded and tried again to send to multiple addresses.
Error message:
https://i.sstatic.net/RK47s.jpg

Please try switching servers using the Network option or the green dot button in the bottom-right. Try making the same payment from a different server.

The dust threshold depends on the min relay fee, which is a server setting.
Thus, it is server dependent. At this point, this threshold is not sent by the Electrum server to the client, but it is a default value, hardcoded in the client. That default value might be lower than the value set by the server you are using. Try to use another server.


text:
I used a BTC mining site and paid the fees but never got paid
[Where I paid mining fees and never got my BTC][1]
the transaction from my wallett shows 150 confirmations. I am new BTC can anyone help with this so i can understand WTF happened and am I just straight effed on the fees i paid. Thanks for your time help I appreciate it. I used the following site http://getbtc.online/dashboard/ one puts in the amount to be mined, the miners mine it and then you pay fee. Afterwards it should deposit the selected BTC amount in your wallet. Mine never got deposited in has several hundred confirmation and i know my wallet address is correct. The miners got paid; This is the site I get after I click on the confirmations in the wallet. I hope this is better as I stated previously; I am new to this and not sure WTF is going on. https://btc.blockr.io/tx/info/c842cc71b4f5133896a6302e208179400d57a79e885b617c4e21489e708fe2d1

Hi,
I've downvoted this question, because it is unclear what happened, how that differs from what you expected, and therefore especially what you're asking about in the first place. Besides that, the link is broken and it appears to have nothing to do with "transaction-fees". Please edit your question to give us a bit more to work with.

From the front page of the site: "How it works our tool?"
Our software is a brand new tool that makes bitcoin mining more faster than any tool on the market..    That poor prose which does not actually provide information seems like a big warning sign.

Thread here. https://bitcointalk.org/index.php?topic=1819752.0

You paid somebody to mine bitcoin, hoping that you will get more value from the bitcoin out than what you paid in, yes? Why would the person sell you the bitcoins at a lower rate, when they could just sell them themselves on the open market and make more money? This stinks of a blatant scam, it doesn't make sense..

To give this a clear answer, so it can stop being bumped:
You have been scammed.
You are not going to get paid, and it is very unlikely you will be able to recover the money you have sent.  Accept that your money is lost, and don't send them any more.


text:
How do i check a bitcoin is valid?
I have a physical cascius bitcoin from 2012 and would like to check that it is still valid and usable. Please could anyone tell me how i can verify its authenticity without removing the hologram.

Seems there are several different kinds: https://en.bitcoin.it/wiki/Casascius_physical_bitcoins. They link a tracker at https://casascius.uberbills.com. Some of them appear to have part of the address printed visibly.  You can look that up on a block explorer such as http://blockchain.info.


text:
What Software Patterns does the Bitcoin source code use?
I'm a Master Student in Computing Science and currently investigating the Bitcoin source code on the Software Patterns that are used. Part of the assignment is to ask the community to guide us.
I would like to ask you if you know any Software Pattern in the source code. In order to give you a view of our scope, below is a list of Patterns covered (Design Patterns and Architectural Patterns).
Thanks in advance,
Patrick
Object Oriented Design Patterns:

Factory Pattern
Adapter Pattern
Composite Pattern
Facade Pattern
Proxy Pattern
Observer Pattern

Architectural Patterns:

Layered Decomposition Pattern
Pipes And Filters Pattern
Data Repository Pattern
Model View Controller Pattern
Client Server Pattern
Peer to Peer Pattern
Publish Subscribe Pattern
Broker Pattern
Message Queue Pattern

i don't think you can find many Object Oriented Design Patterns in the btc-source-code. but there is one example i know:
the blockchain itself is like a composite pattern:
you have a general type called Block. two types inherits Block: MinedBlock inherits from Block and GenesisBlock inherits from Block. A MinedBlock has one attribute of the type Block called PreviousBlock.
(here you can also find the singleton pattern: you need exactly one GenesisBlock-object.)


text:
Can Bitcoins or other coins be transferred back to US dollars?
Can Bitcoins be transferred back to US Dollars?

You can't transform a pear into an apple, however, you can trade it.

Bitcoin is just like anything else you can own.  You can buy it using any currency that a seller is willing to accept, and you can sell it for any currency you are willing to accept.  You aren't transferring, you are trading.  A bitcoin is always a bitcoin, and a dollar is always a dollar.  You simply need to exchange it with someone.


text:
Special min difficulty rule for testnet
I heard about this "special difficulty rule" for testnet, which allows blocks with timestamp 20 min later than the last block to have the min difficulty target.
So does it mean that the miners can simply declare that their block has such timestamp without actually waiting for 20 minutes?

It seems like that's the case... I mined a min-difficulty block only 13 min after the previous block(only for testnet).

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


text:
Bitcoin opening and closing times
What time does the Bitcoin market open and close?
Also, I've just joined Cryptorobot365 which claims to win 9/10 trades, but I'm still losing money on my account after 4 hours, albeit only £4. Can somebody please help, as I've never done this before?

"which claims to win 9/10 trades" Come on! That's 100% scam.

There's no "the Bitcoin market".  Bitcoin is traded on many different exchanges.  As far as I know, all of them allow trades 24 hours a day, every day.  Unlike traditional stock exchanges, they don't ever close.

ive just joined Cryptorobot365 which claims to win 9/10 trades

Any service which makes such claims is a scam.  Get out while you can.


text:
How effective are arbitrage bots?
I hear many good reviews about cryptobots. But they all work according to the pattern. Explain to me how to use them correctly?

Arbitrage is a race: a good arbitrage bot will take advantage of differences in price, before anyone else is able to. By performing the arbitrage trading, the difference in price will disappear, so only the fastest traders will be able to profit.
So with this in mind, I am extremely skeptical of any arbitrage bot that is being publicly sold, as the user that purchases the bot will be directly competing with all other users that purchased that bot, and probably other people that have their own methods as well.
And so I think it is likely that the only person who is sure to profit, is the person who sold the bot!

Bots really work according to the given algorithm, but this is their advantage. For example, they can collect information about exchange rates on different exchanges and offer you an exchange. But almost all of these programs are paid and subscription is available for several months at a time. Some, for example a BibitBot, have free versions for several days.


text:
What is encrypto password in copay?
I have never set up an encrypto password in copay.   I want to send BTC but copay asks for encrypto password and cannot go any further.  Please let me know what to do.

Are you 100% sure it asks for an "encrypto" password. Unless there's some non-English language setting where that word makes sense - it isn't a word I'd expect to see in a CoPay wallet. I note there is a separate app called "encrypto" that can be used to encrypt files or folders. Please clarify. Editing your question to include a screenshot would help people to help you better.

Regardless of how the password got enabled, once it is set, there is no way to access your coins without it, except by restoring the wallet using your backup phrase.  So if you have your backup phrase, you can create a new wallet to access your coins.  Choose the + button to create a new wallet and select "Import Wallet", and use the "Recovery Phrase" tab.
If you don't have the backup phrase, you are out of luck unless you can find the password.  You might try to figure out how it got set:

Perhaps you set it and then forgot?  Think about what password you might have chosen, or how you usually choose passwords.
Perhaps someone got access to your phone or computer, and set a password?  Try to figure out who that might be, and ask them.  Of course, it's possible they already spent all your coins.
Perhaps there's a bug in the Copay software that set a password without asking you.  If you've ruled out all other possibilities, you could report it as a bug.  But if so, it's hard to guess what the password might be, and I suspect you won't be able to recover your funds in this case.

Reference: https://support.bitpay.com/hc/en-us/articles/115003004403-I-forgot-my-wallet-spending-password-What-can-I-do-


text:
Can i use one pair public and private key for all transactions?
Can I use one pair public and private key for all transactions, digital signatures and wallet addresses?
In the other hand, I have a private key and want to sign all transactions and have a public key for broadcast. Can I do?
Is this way secure?

Yes, you can use one private key to sign all your transactions. You can use the one public key to receive all tokens as well. In terms of security, as long as you keep your private keys safe and you don't expose it to the world, it does not matter how many keys you use to sign your transactions. However, if you keep all your tokens in one address, you're essentially putting all your eggs in one basket. If that one key is ever compromised, the attacker has access to all your tokens.

Each private key is associated with exactly one public key, which is associated with exactly one address.  So if you only want to use one private key, then you can only have one address.  This is "secure" in that it won't make it any easier for people to steal your money (barring a successful attack on ECDSA) but it is not so good for privacy, since people will have an easier time identifying your transactions as yours.
It is also possible to have one "master" private key or seed, from which many different "child" private keys are generated.  This is how an HD wallet works.  It is associated with a master public key, which can be used to identify your addresses and generate new ones, but as mentioned above, it would not be good for your privacy to actually make it public.


text:
Why are my Bitcoin/Bitcoin Cash commands not working on SV?
Just trying to run some pretty simple commands on an SV node. Why am I getting this?
ey@BitcoinSV:~$ bitcoind -testnet
bitcoind: command not found

Hi cryptskip, your edit changed your post into a different question and made Andrew's answer not make sense anymore, so I reverted it.  It would be better if you'd ask your updated question as a new post.

That error means that the command bitcoind was not found on your computer's path. Make sure that you have installed the software correctly such that the bitcoind binary is on the path.

Bitcoin SV is a fork of bitcoin-core, so all the commands of bitcoin are almost the same as on Bitcoin SV
in here you can find all the RPC commands with much more details
https://bitcoin.org/en/developer-reference#rpc-quick-reference


text:
Ubuntu 14 LTS with SX tools installation issues
I'm trying to install the SX (http://SX.dyne.org) tools using Ubuntu 14 LTS following the installation instructions (http://sx.dyne.org/introduction.html#installation).

I use wget to download the SH script to root, then...
install with sudo bash ./install-sx.sh

All goes well until this point (terminal window output edited for brevity ie the start if the installation looks fine):
checking for CURL... yes
checking for libsecp256k1... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/bitcoin/Makefile
config.status: creating src/Makefile
config.status: creating libbitcoin.pc
config.status: executing depfiles commands
config.status: executing libtool commands
configure: WARNING: unrecognized options: --with-libsecp256k1
Making all in include/bitcoin
make[1]: Entering directory '/usr/local/src/libbitcoin-git/include/bitcoin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/usr/local/src/libbitcoin-git/include/bitcoin'
Making all in src
make[1]: Entering directory '/usr/local/src/libbitcoin-git/src'
  CXX      utility/ec_keys.lo
utility/ec_keys.cpp: In function 'libbitcoin::ec_point libbitcoin::secret_to_public_key(const ec_secret&, bool)':
utility/ec_keys.cpp:66:23: error: 'secp256k1_ecdsa_pubkey_create' was not declared in this scope
             compressed))
                       ^

utility/ec_keys.cpp: In function 'bool libbitcoin::verify_public_key(const ec_point&)':
utility/ec_keys.cpp:75:78: error: 'secp256k1_ecdsa_pubkey_verify' was not declared in this scope
     return secp256k1_ecdsa_pubkey_verify(public_key.data(), public_key.size());
                                                                              ^

utility/ec_keys.cpp: In function 'bool libbitcoin::verify_private_key(const ec_secret&)':
utility/ec_keys.cpp:81:60: error: 'secp256k1_ecdsa_seckey_verify' was not declared in this scope
     return secp256k1_ecdsa_seckey_verify(private_key.data());
                                                            ^

utility/ec_keys.cpp: In function 'bool libbitcoin::ec_tweak_add(libbitcoin::ec_point&, const ec_secret&)':
utility/ec_keys.cpp:115:73: error: 'secp256k1_ecdsa_pubkey_tweak_add' was not declared in this scope
     return secp256k1_ecdsa_pubkey_tweak_add(a.data(), a.size(), b.data());
                                                                         ^

utility/ec_keys.cpp: In function 'bool libbitcoin::ec_multiply(libbitcoin::ec_point&, const ec_secret&)':
utility/ec_keys.cpp:121:73: error: 'secp256k1_ecdsa_pubkey_tweak_mul' was not declared in this scope
     return secp256k1_ecdsa_pubkey_tweak_mul(a.data(), a.size(), b.data());
                                                                         ^

utility/ec_keys.cpp: In function 'bool libbitcoin::ec_add(libbitcoin::ec_secret&, const ec_secret&)':
utility/ec_keys.cpp:127:64: error: 'secp256k1_ecdsa_privkey_tweak_add' was not declared in this scope
     return secp256k1_ecdsa_privkey_tweak_add(a.data(), b.data());
                                                                ^

utility/ec_keys.cpp: In function 'bool libbitcoin::ec_multiply(libbitcoin::ec_secret&, const ec_secret&)':
utility/ec_keys.cpp:133:64: error: 'secp256k1_ecdsa_privkey_tweak_mul' was not declared in this scope
     return secp256k1_ecdsa_privkey_tweak_mul(a.data(), b.data());
                                                                ^

utility/ec_keys.cpp: In function 'bool libbitcoin::verify_public_key(const ec_point&)':
utility/ec_keys.cpp:76:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

utility/ec_keys.cpp: In function 'bool libbitcoin::verify_private_key(const ec_secret&)':
utility/ec_keys.cpp:82:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

utility/ec_keys.cpp: In function 'bool libbitcoin::ec_tweak_add(libbitcoin::ec_point&, const ec_secret&)':
utility/ec_keys.cpp:116:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
utility/ec_keys.cpp: In function 'bool libbitcoin::ec_multiply(libbitcoin::ec_point&, const ec_secret&)':
utility/ec_keys.cpp:122:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

utility/ec_keys.cpp: In function 'bool libbitcoin::ec_add(libbitcoin::ec_secret&, const ec_secret&)':
utility/ec_keys.cpp:128:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

utility/ec_keys.cpp: In function 'bool libbitcoin::ec_multiply(libbitcoin::ec_secret&, const ec_secret&)':
utility/ec_keys.cpp:134:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

make[1]: * [utility/ec_keys.lo] Error 1
make[1]: Leaving directory '/usr/local/src/libbitcoin-git/src'
make: * [all-recursive] Error 1
Xxxxx@ubuntu:/$ sx
The program 'sx' is currently not installed. You can install it by typing:
sudo apt-get install lrzsz

Has anyone got any idea why this is occurring and if there's a workaround? I initially had more issues with Ubuntu 12.04 LTS so have upgraded to 14 LTS as I mentioned.

There was a breaking API change in libsecp256k1 that hasn't been addressed in libbitcoin's master branch. It has been addressed on their develop branch if you want to go down that road.
I have had the most luck with mastercoin's install-sx.sh script that pulls from older un-tagged commits that seem to work in harmony.

It works! Thank you for sharing the knowledge. I'd recommend all Windows users run a Virtual Machine/installation of Ubuntu 14 LTS to use SX, Pybitcointools and all other Python BTC utilities to their full extent (Windows is close to impossible)


text:
I want to change 0.25 dollar cents in bitcoin for my digital content, is it too little?
I am a developer and very new in bitcoin world. I have plans of having website where I sell digital content for 0.25(or less) cents of dollars in bitcoin form.
What I understand is I have to pay for transaction fee for each purchase, I confess I don't know much about it.
If I want no fee can I develop my own "bitcoin transaction mechanism"?
Please, I need help thanks

currently that's not feasible with bitcoin due to its price. The alternative is to use another coin with a lower price to make it truly a "micro-transaction" with sub-penny fees. But the problem with scenario is your users will now have to buy that coin just to buy your product. Check coinmarketcap.com for a list of coins to use.

sorry I didn't understand. Currently 0.25 cents of dollar is 0.000062 bitcoin. So there is no way I can use/create a system to have customer buying my digital content for 0.000062?  forgive me, I am really new to this

Technically the lowest denomination of a bitcoin is a 100 millionth of a bitcoin or a Satoshi. That is 0.00000001 = 1 Satoshi so your value is greater than that and this possible, you would send/receive 6200 Satoshi. But some exchanges like coinbase won't allow small transactions.

Bitcoin transaction fees vary with supply and demand.  You can see a current snapshot at https://bitcoinfees.21.co/.  Right now a typical fee for a transaction is around BTC 0.0006.  As you can see, this will not work very well if your goal is to charge 1/10 of this amount (USD 0.25 = BTC 0.000062 as you mentioned).
Moreover, you will have to pay (roughly) the same transaction fee again in order to spend the money you receive.  So even if somebody does pay the transaction fee to send you the money, you could not spend it without taking a loss.
As such, it is not currently practical to use Bitcoin for such small transactions.

thanks for the answer, is there an alternative to avoid the fee altogether? for example: maybe if I host a block in my cloud(aws, azure) I can process the transactions myself?(I don't know just spitting the little I could understand from my research)

No, that is not practical.  The phrase "host a block" doesn't make sense - you could imagine doing your own mining, but the costs of doing that on any scale that would meaningfully speed up your transactions would be in the hundreds of thousands of dollars.  As duckx says, you can consider using a different currency altogether, but this will be less convenient for your customers who will have to find somewhere to buy that other currency.

Technically the lowest denomination of a bitcoin is a 100 millionth of a bitcoin or a Satoshi. That is 0.00000001 = 1 Satoshi so your value is greater than that and this possible, you would send/receive 6200 Satoshi. But some exchanges like coinbase won't allow small transactions.


text:
What are all the small transactions in Satoshi's address?
I read that Satoshi never moved or spent his coins, so I expected to see his address stay unchanged since mined. But it looks like there are lots of small transactions: e.g. in the first address there are more than 1000 txs, and in the second address, there are about 65. What are those for? Who made them and why?

Of course, because Bitcoin is (mostly) anonymous, we can't know for sure who has been sending these, let alone their reasons.  But some guesses:

People donating money to Satoshi, since it's known to be his address.
Mistakes.  Satoshi's address is commonly used as an example in guides for creating transactions, etc, and it could be that some people copied the example and forgot to change the destination address.
Attention.  I saw some transactions with attached OP_RETURN messages, e.g. this one (see under "Output Scripts" near the bottom).  By sending to a well-known address, there is a better chance that curious people like you will stumble upon the transaction and read the message.
Just for lols.
There are altcoins and other protocols that rely on "burning" bitcoins by sending them to a well-known address with no known private key.  A variant on this would be to send the coins to Satoshi.  Either he eventually spends them (so it becomes a donation) or he doesn't (so it's a burn), but either way the parties involved probably aren't getting the coins back.  I haven't seen this variant in practice but it's conceivable that someone has tried it.


text:
How to calculate the average worker hashrate on a pool?
I just calculated the average hashrate of all poolminers on Slushpool by dividing the Pool Scoring Hash Rate by the amount of active workers:
So with current values that is: 641.1 Ph/s / 30287 ~= 21,2 TH/s
Is this the right way to do it, or am I missing something?
That seems to be pretty high ...

Welcome to Bitcoin.SE! You can help the site by marking answers as accepted, if they answer your question and are complete enough, this way the question does not remain as "unanswered".

This seems correct, as far as I understand.

Ok, but why is the hashrate then so high?

Someone with several miners (say 10 antimner S9) could aggregate them and appear as a single user with (say 120 TH/s).

well, good point, but then it´s a misleading term used by Slushpool, to call it "Active Workers", because a worker normally is the entity of a single miner (like 10 Ant miner S9 = 10 workers even they are all owned by the same user)

@D.Hot I believe with Slushpool it is also possible to put several miners on the same worker.

authors: นายชัยวุฒิ แซ่มั่ว


text:
Can Bitcoin and Bitcoin Cash potentially have the same address?
Because Bitcoin Cash is forked from Bitcoin, what happens if two separate users create a wallet, could their address potentially be the same? Let's call that address xyz. Then if someone sends money to xyz which blockchain would it go to?

Sure.
Addresses are not really a thing as far as blockchains go - they mostly just care about the keys involved (or in the case of Bitcoin and Bitcoin based networks, the locking script which locks an output to be spendable only by a certain [set of] key[s]).
Since the key generation process relies on entropy, and does not rely on the network you are creating the key for, it is possible, and highly improbable, that two people are able to generate an identical key.
It is so improbable that no wallet I'm aware of actually checks for key reuse on the target chain. It's simply something that is not likely to occur, provided you have a good enough source of entropy.
Note that even if you do end up generating (or manually copying) a key across networks, the actual "address" may still be different, since Bitcoin uses base58/bech32 addresses, while BCH uses base58/cashaddr addresses. This is merely an encoding, however, and does not change the underlying key required to spend the outputs.


text:
How to know earning LN routing fees
I am using c-lightning version:v0.6-182-g1851ebb. Is there a way to know how much I have earned routing fees? I found that lnd has lncli feereport command that shows earned fees. Does c-lightning have same functionality? If not, is there a way to know earned routing fees?
I created a query for calculating earned routing fees. However, this doesn't work because HTLCs info is removed when a channel forwarded HTLCs closed.
sqlite3 $HOME/.lightning/lightningd.sqlite3 "select sum(a.msatoshi - b.msatoshi) from channel_htlcs a inner join channel_htlcs b on a.id = b.origin_htlc"

Any ideas?

lightning-cli listforwards
List all forwarded payments and their information

I've written a plug-in for c-lightning that emulates lncli feereport command of LND. For full functionality, including day_fee_sum, week_fee_sum and month_fee_sum calculations, requires c-lightning v0.7.1 or newer (older versions didn't save timestamps for historical forwards).
https://github.com/kristapsk/lightning-feereport


text:
How can I send a RGB token via Lightning Network?
RGB on lightning has happened recently. This documentation is said that payment channel can have HTLCs that contain RGB state transitions. That means payment for RGB assets can be delayed on LN when a payer makes a payment. Is it possible to forward the RGB assets through multiple channels that do not recognize any RGB assets?

Can you provide a link to the documentation you are referencing?

@Poseidon Edited this question to have the reference.

Is it possible to forward the RGB assets through multiple channels that do not recognize any RGB assets?

I am not 100% comfortable with the RGB protocol, so what I am saying is my understanding of it.
from the docs I read

Above we just saw a simplification of payment channels that involve only two parties, but since in reality the lightning network is designed also to route payments towards more participants, all payments actually use HTLCs output. With RGB channels it works exactly the same way, for each payment that is being routed through the channels, a dedicated HTLC output will be added to the lightning commitment transaction.

I guess that all the route should be an RGB channel because when I am making a payment I need to update the HTLC and the docs says that we should update also the OP_RETURN to make the RGB state transition.

. Together with the new HTLC output,  a new allocation needs to be added to the RGB state transition, which will send the amount of assets involved in the payment towards the new HTLC output. Whoever manages to spend the HTLC output, either through knowledge of a secret or by waiting for a timelock expiration, will be able to move both the satoshis that were in the output and all the assets assigned to it.

I do not know what will be changed with Taproot but I guess if the transaction is built in a different way, all the routes should support this feature because the HTLC is for a channel and not for a path.
In this case, I do not have a clear for a multipart update


text:
Why don't private blockchain networks that do not charge for transactions charge a fee when processing ethereum/ proprietary token on the network?
I ask this questions because there seems to be 2 flavors of blockchain: 1. Public think bitcoin and ethereum. 2. Private hyperledger, SAP Leonaro, etc. The public network charges for transactions to incentive nodes to process the transaction. The private network does not charge for transactions which is why it is popular with businesses. Why is there no network that can do both? For example eosio | Blockchain software architecture  is trying to make it cheaper to process transactions which I assume is meant to appeal to businesses and consumers. Why cannot a private blockchain such as Hyperledger Sawtooth/ Fabric which are private be free for businesses to use because businesses validate transactions but also accept a token which has value and when a consumer users the token to purchase an item from a business in the network either charge a fee for validating the transaction or do not charge for it.

I'm trying to describe is businesses are always going to prefer useing something that is free. For example, it would be too costly to have to pay a transaction fee for a high volume manufacturing company when they wanted to add data to the blockchain. At the same time, businesses want to accept tokens for purchasing their items. Why can't businesses use blockchain/ Hyperledger Fabric for the private networks internal use but have a Fabric token to use when businesses on the private network purchase items from eachother or consumers purchase products from the business?

Hyperledger Sawtooth and other private blockchains (or enterprise blockchains) restrict the set of nodes allowed in the blockchain network. There is no need for cash payment, because it is an internal operation in an organization or consortium of organizations.  One of the main values of enterprise blockchains is to escape the high fees and overhead and delay from third-party arbitrators of transactions, whether it be stock, securities, money, or goods.


text:
encode/decode Base-58 C++
I have built a base-58 encoder using this formula: https://www.youtube.com/watch?v=GedV3S9X89c&feature=youtu.be
Is there a smarter way to encode/decode with base-58?
I read somewhere that you need a bignum library which I use Boost for.
My goal is to convert between these two:
008D4D508F5BF2C28B20A3863405F05D3CD374B045E4B316E7
1Dt8ty59tU9LkrXG2ocWeSzKFAY8fu6jga

Which so easily this website do: http://lenschulwitz.com/base58
I know bitcoin source code have a base-58 encoder/decoder, but I do not know how to implement it successfully.

this may help: https://bitcoin.stackexchange.com/questions/5829/how-do-i-base58-checked-encode-decode-an-address-in-c-what-does-normalize-l

I've used Base58 encoding/decoding many times. On the contrary, I hated using a BIGNUM library. So, I used Base-x's base conversion algorithm. (Make sure to respect the MIT license) It should be easy to translate it to any language.
const char * const ALPHABET =
    "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
const char ALPHABET_MAP[256] = {
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1,  0,  1,  2,  3,  4,  5,  6,  7,  8, -1, -1, -1, -1, -1, -1,
    -1,  9, 10, 11, 12, 13, 14, 15, 16, -1, 17, 18, 19, 20, 21, -1,
    22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1,
    -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, -1, 44, 45, 46,
    47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};

const double iFactor = 1.36565823730976103695740418120764243208481439700722980119458355862779176747360903943915516885072037696111192757109;

// reslen is the allocated length for result, feel free to overallocate
int EncodeBase58(const unsigned char *source, int len, unsigned char result[], int reslen) {
    int zeros = 0, length = 0, pbegin = 0, pend;
    if (!(pend = len)) return 0;
    while (pbegin != pend && !source[pbegin]) pbegin = ++zeros;
    int size = 1 + iFactor * (double)(pend - pbegin);
    unsigned char b58[size];
    for (int i = 0; i < size; i++) b58[i] = 0;
    while (pbegin != pend) {
        unsigned int carry = source[pbegin];
        int i = 0;
        for (int it1 = size - 1; (carry || i < length) && (it1 != -1); it1--,i++) {
            carry += 256 * b58[it1];
            b58[it1] = carry % 58;
            carry /= 58;
        }
        if (carry) return 0;
        length = i;
        pbegin++;
    }
    int it2 = size - length;
    while ((it2-size) && !b58[it2]) it2++;
    if ((zeros + size - it2 + 1) > reslen) return 0;
    int ri = 0;
    while(ri < zeros) result[ri++] = '1';
    for (; it2 < size; ++it2) result[ri++] = ALPHABET[b58[it2]];
    result[ri] = 0;
    return ri;
}

// result must be declared (for the worst case): char result[len * 2];
int DecodeBase58(
    const unsigned char *str, int len, unsigned char *result) {
    result[0] = 0;
    int resultlen = 1;
    for (int i = 0; i < len; i++) {
        unsigned int carry = (unsigned int) ALPHABET_MAP[str[i]];
        if (carry == -1) return 0;
        for (int j = 0; j < resultlen; j++) {
            carry += (unsigned int) (result[j]) * 58;
            result[j] = (unsigned char) (carry & 0xff);
            carry >>= 8;
        }
        while (carry > 0) {
            result[resultlen++] = carry & 0xff;
            carry >>= 8;
        }
    }

    for (int i = 0; i < len && str[i] == '1'; i++)
        result[resultlen++] = 0;

    // Poorly coded, but guaranteed to work.
    for (int i = resultlen - 1, z = (resultlen >> 1) + (resultlen & 1);
        i >= z; i--) {
        int k = result[i];
        result[i] = result[resultlen - i - 1];
        result[resultlen - i - 1] = k;
    }
    return resultlen;
}

Cool. What would be a quick example on how to use this code?

@dalslandan200 https://hastebin.com/ujepeduqus.cpp

DO NOT use the above code...  It quite simply doesn't work.  I've spent a long time debugging my code only to find out it was this God awful implementation of a Base58 encoder and decoder.  Did you even TEST this code before you pasted it here???

Duh, had always been calling encode with the result array initialized to zero.

@MCCCS It's not the output array that needs to be initialised to zero, it's the
unsigned char digits[len * 137 / 100]; array that does because of carry += (unsigned int) (digits[j]) << 8;

@MCCCS Also you have a MUCH bigger problem with these algorithms. With your encoder, if you try encoding data beginning with 0, or even just a single 0 byte, your output will be "11" encoded when it should be "1".  Secondly, with your decoder, if you supply characters outside of the ASCII range, you can start to read outside of your 128 byte mapping array.  That's why the bitcoin implementation uses 256 bytes and there's a cast to uint8_t.

@TheWelder Re-transcribed encode from scratch.

@TheWelder No, digits[len * 137/100] doesn't need to be initialized. Its first element is initalized to zero and in the beginning digitslen is 1. Every time digitslen is increased, the new element is assigned a value. But this doesn't matter anymore.

@MCCCS You're right, didn't notice the added initialisation of the first element.  Anyway, have added my implementation below with a fuzz tester to ensure that it works.

I used BIGNUM from openssl to encode hex with base58
 #include <string>
 #include <vector>
 #include <openssl/bn.h>

 string b58(const char *priv_hex)
 {
   char table[] = {'1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

BIGNUM *base58 = NULL;

BIGNUM *resultExp = BN_new();
BIGNUM *resultAdd = BN_new();
BIGNUM *resultRem = BN_new();
BN_CTX *bn_ctx = BN_CTX_new();

BN_dec2bn(&base58, "58");

string endresult;
vector<int> v;

BN_hex2bn( &resultAdd, priv_hex );

while( !BN_is_zero(resultAdd) ) {
    BN_div(resultAdd, resultRem, resultAdd, base58, bn_ctx);
    char *asdf = BN_bn2dec(resultRem);
    v.push_back(atoi(asdf));
}

for (int i = (int)v.size()-1; i >= 0; i--) {
    endresult = endresult + table[v[i]];
}

BN_free(resultAdd);
BN_free(resultExp);
BN_free(resultRem);
BN_CTX_free(bn_ctx);

return endresult;
}

and then use it like this:
string ttest = "008D4D508F5BF2C28B20A3863405F05D3CD374B045E4B316E7";
const char *phex = ttest.c_str();
string ret = b58(phex);
cout << ret << endl;

"Dt8ty59tU9LkrXG2ocWeSzKFAY8fu6jga"

I have sill a problem with leading zeros. I try to fix this as well

Look for specific leading 0s in the input ...  for( int i=0 ; i<priv_hex.size()  ; i++ ) {
if( priv_hex[i] == 0 ) {
v.push_back(0) ;
} else {
break ;
}
}

Have added my own implementation, complete with a fuzz tester to ensure that it works properly.  (The CodecMapping parameter is provided so that you can change the alphabet string as I've had to do from time to time)
#include <vector>
#include <random>
#include <string>
#include <algorithm>
#include <iomanip>
#include <iostream>

inline static constexpr const uint8_t Base58Map[] = {
  '1', '2', '3', '4', '5', '6', '7', '8',
  '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
  'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q',
  'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
  'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
  'h', 'i', 'j', 'k', 'm', 'n', 'o', 'p',
  'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
  'y', 'z' };
inline static constexpr const uint8_t AlphaMap[] = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0xff, 0x11, 0x12, 0x13, 0x14, 0x15, 0xff,
  0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0xff, 0x2c, 0x2d, 0x2e,
  0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff };

using CodecMapping = struct _codecmapping
{
  _codecmapping(const uint8_t* amap, const uint8_t* bmap) : AlphaMapping(amap), BaseMapping(bmap) {}
  const uint8_t* AlphaMapping;
  const uint8_t* BaseMapping;
};

std::string Base58Encode(const std::vector<uint8_t>& data, CodecMapping mapping)
{
  std::vector<uint8_t> digits((data.size() * 138 / 100) + 1);
  size_t digitslen = 1;
  for (size_t i = 0; i < data.size(); i++)
  {
    uint32_t carry = static_cast<uint32_t>(data[i]);
    for (size_t j = 0; j < digitslen; j++)
    {
      carry = carry + static_cast<uint32_t>(digits[j] << 8);
      digits[j] = static_cast<uint8_t>(carry % 58);
      carry /= 58;
    }
    for (; carry; carry /= 58)
      digits[digitslen++] = static_cast<uint8_t>(carry % 58);
  }
  std::string result;
  for (size_t i = 0; i < (data.size() - 1) && !data[i]; i++)
    result.push_back(mapping.BaseMapping[0]);
  for (size_t i = 0; i < digitslen; i++)
    result.push_back(mapping.BaseMapping[digits[digitslen - 1 - i]]);
  return result;
}

std::vector<uint8_t> Base58Decode(const std::string& data, CodecMapping mapping)
{
  std::vector<uint8_t> result((data.size() * 138 / 100) + 1);
  size_t resultlen = 1;
  for (size_t i = 0; i < data.size(); i++)
  {
    uint32_t carry = static_cast<uint32_t>(mapping.AlphaMapping[data[i] & 0x7f]);
    for (size_t j = 0; j < resultlen; j++, carry >>= 8)
    {
      carry += static_cast<uint32_t>(result[j] * 58);
      result[j] = static_cast<uint8_t>(carry);
    }
    for (; carry; carry >>=8)
      result[resultlen++] = static_cast<uint8_t>(carry);
  }
  result.resize(resultlen);
  for (size_t i = 0; i < (data.size() - 1) && data[i] == mapping.BaseMapping[0]; i++)
    result.push_back(0);
  std::reverse(result.begin(), result.end());
  return result;
}

// Fuzz Testing the Encoder & Decoder
int main(int argc, char** argv)
{
  std::random_device device;
  std::mt19937 generator(device());
  std::uniform_int_distribution d1(1, 100);
  std::uniform_int_distribution d2(0, 255);
  CodecMapping mapping(AlphaMap, Base58Map);

  auto create_data = [&]() -> std::vector<uint8_t> {
    std::vector<uint8_t> data(d1(generator));
    std::cout << "Generating: " << std::dec << static_cast<int>(data.size()) << " points\nPoints:\n";
    for (uint8_t& v : data)
    {
      v = static_cast<uint8_t>(d2(generator));
      std::cout << std::uppercase << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(v);
    }
    std::cout << std::endl;
    return data;
  };

  std::vector<uint8_t> test_data, decoded_data;
  std::string encoded_data;
  size_t passed = 0;

  for (size_t i = 0; i < 1000; i++)    // Number of tests here!
  {
    test_data = create_data();
    encoded_data = Base58Encode(test_data, mapping);
    decoded_data = Base58Decode(encoded_data, mapping);

    std::cout << "Encoded\n" << encoded_data << "\nDecoded:\n";

    for (uint8_t d : decoded_data)
      std::cout << std::uppercase << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(d);

    std::cout << "\nTest Result: ";
    if (test_data.size() == decoded_data.size() && test_data == decoded_data)
    {
      std::cout << "PASSED\n";
      passed++;
    }
    else
    {
      std::cout << "FAILED\n";
      break;
    }
    std::cout << std::endl;
  }
  std::cout << "Passed Tests: " << std::dec << static_cast<int>(passed) << std::endl;
  return 0;
}

For those who prefer a bit of old skool C, here's my interpretation of @Markus' answer in C
I've tried to keep the code as close to his original code as possible - returns zero on success or -1 or -2 if it runs out of buffer space.
I've included a test string I use & one he provided.
#include <openssl/bn.h>
#include <string.h>

int b58(const char *priv_hex, char * endresult, int end_sz)
{
char table[] = {'1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H',
    'J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d',
    'e','f','g','h','i','j','k','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

BIGNUM *base58 = NULL;

BIGNUM *resultExp = BN_new();
BIGNUM *resultAdd = BN_new();
BIGNUM *resultRem = BN_new();
BN_CTX *bn_ctx = BN_CTX_new();
int v[300],v_len=0;

    BN_dec2bn(&base58, "58");
    BN_hex2bn( &resultAdd, priv_hex );
    memset(v,0,sizeof(v));

    while( !BN_is_zero(resultAdd) ) {
        BN_div(resultAdd, resultRem, resultAdd, base58, bn_ctx);
        char *asdf = BN_bn2dec(resultRem);
        if ((v_len+1) >= (int)sizeof(v)) return -1;
        v[v_len++] = atoi(asdf);
    }

    if (v_len >= (end_sz-1)) {
        *endresult = 0;
        return -2;
        }

    for(int i = 0;i<v_len;i++) endresult[v_len-i-1] = table[v[i]];
    endresult[v_len] = 0;

    BN_free(resultAdd);
    BN_free(resultExp);
    BN_free(resultRem);
    BN_CTX_free(bn_ctx);

    return 0;
}

main()
{
char * correct = "3MU5WsLWqbK6o9buaD4HtXK1KgozcV8BWj";
char * hex_src = "05d8f01b4132f0c3e290c30788d229811102820524dbc1f61c";
char res[250];

b58(hex_src,res,sizeof(res));
printf("ANS: %s\nTST: %s\n",res,correct);

char * test_q = "008D4D508F5BF2C28B20A3863405F05D3CD374B045E4B316E7";
char * test_ans = "Dt8ty59tU9LkrXG2ocWeSzKFAY8fu6jga";

b58(test_q,res,sizeof(res));
printf("ANS: %s\nTST: %s\n",res,test_ans);
}


text:
Why are there so many opcodes in Bitcoin Script, but they are not usable
In my understanding, miners wont accept non standard scripts. Then why are there several opcodes which cannot be used in custom scripts because they are nonstandard?

You should probably change the title of your question to something like "Why are there so many opcodes in Bitcoin Script, but they are not usable". The current question title is too broad and does not really reflect your question intentions.

Those opcodes can be used in non-standard scripts as part of a Pay-to-Script-Hash address. They can be in the redeemScript of the P2SH address and be standard.
Furthermore, standardness is not something that is set in stone; it is not a consensus rule, rather it is node policy. So in the future, we may create new script types which become standard that use other opcodes. Such scripts may be non-standard now (as P2SH and Segwit were in the past) but can become standard in the future. Those opcodes exist so that we can make scripts which perform smart contract-like things without needing a fork.

I figured out that we can use OPCODE to create a redeem script which is hashed for P2SH. So it seems that we can create our own smart contract: However Bitcoin script does not have enough OPCODEs to create smart contract that can do with Ethereum.
Some people have proposed to add some OPCODEs to Bitcoin.


text:
How can I check my transaction signature is correct?
I have tried recreating the exact transaction from "Appendix B: Funding Transaction Test Vectors" from BOLT 3 from the Lightning RFCs. My transaction looks exactly the same when parsed, except my signature is different (since there is randomness involved in ecdsa signatures).
Is there a way to check that I have signed the transaction correctly? Thanks
Original tx:
0200000001adbb20ea41a8423ea937e76e8151636bf6093b70eaff942930d20576600521fd000000006b48304502210090587b6201e166ad6af0227d3036a9454223d49a1f11839c1a362184340ef0240220577f7cd5cca78719405cbf1de7414ac027f0239ef6e214c90fcaab0454d84b3b012103535b32d5eb0a6ed0982a0479bbadc9868d9836f6ba94dd5a63be16d875069184ffffffff028096980000000000220020c015c4a6be010e21657068fc2e6a9d02b27ebe4d490a25846f7237f104d1a3cd20256d29010000001600143ca33c2e4446f4a305f23c80df8ad1afdcf652f900000000
My code on github
Recreated tx:
0200000001adbb20ea41a8423ea937e76e8151636bf6093b70eaff942930d20576600521fd000000006a47304402204650016c68a27f6fe28028de9f0cb1f939a6a27e7d4030c646263fb5374411aa022064d926c34b4fa5ae12b22437092f28f0bd806cc417a6725337282133726f643f012103535b32d5eb0a6ed0982a0479bbadc9868d9836f6ba94dd5a63be16d875069184ffffffff028096980000000000220020c015c4a6be010e21657068fc2e6a9d02b27ebe4d490a25846f7237f104d1a3cd20256d29010000001600143ca33c2e4446f4a305f23c80df8ad1afdcf652f900000000


text:
Validation Error: Error #-26: 258: txn-mempool-conflict. Action required?
I am getting this error message when trying to send from my blockchain.info wallet.  "Validation Error: Error #-26: 258: txn-mempool-conflict"  Will this eventually be resolved automatically or is action required on my part to be able to send again from my wallet?

why not to ask blockchain.info support?

ok, i'll try that.  Last time I contacted blochain.info support it took a long time to get a response.  I was looking for a simple answer, if anybody knew, but thank you.

Same experience. Haven't heard back from them in 20 hours.

Same error. It's been a week since I contacted blockchain.info support. They replied, and asked for my extended private key but still haven't solved my issue.


text:
Specific explanation of "timeout" configuration option in Bitcoin
According to Running Bitcoin - Bitcoin Wiki, timeout is described as following:
Specify connection timeout in milliseconds
To my understanding it would mean that if a response was expected, if not received in the specific time-range the client would drop connection.
A follow question is, would a node with a 15 second timeout hurt the coin network with a fast block-time of e.g. 45 seconds?

The -timeout flag sets the amount of time to wait during an attempt to connect to a node. It defaults to 5000 ms. This is the connection to other peers on the network for syncing the blockchain, receiving and sending new transactions to the mempool, etc.

A follow question is, would a node with a 15 second timeout hurt the
  coin network with a fast block-time of e.g. 45 seconds?

Faster blocktimes mean that the network has less time to 1 - propagate transactions and 2 - validate them before the next block. This is definitely something to take into account when thinking about block times. A slower node (both in terms of network latency for syncing and cpu power for validation) may not be able to confirm new blocks fast enough, but the bigger problem is if a majority of the nodes are slow compared to the block time.

Yes but I don't think you can change them through the bitcoind flags. See https://github.com/bitcoin/bitcoin/blob/0.16/src/net.h

No, the timeout setting has nothing to do with the block time.
The timeout applies when connecting to another node on the network. This connection is independent of blocks being mined.


text:
Manual work as source of entropy
Working on an opensource air-gapped crypto vault, in which I have the regular method of relying on OS to provide cryptographically secure random source and use that to generate the mnemonic phrase.
Also wish to provide a manual option of using dice rolls or coin flips to provide your own entropy and not needing to trust the software to do it for you. Exploring how trustless it can be.
As, I understand there are some bias associated with coins & dices as well. They may tend to favor one or some outcomes more than other. I have read a lot about providing your own entropy source and how that will usually be insecure if you accidentally introduce some bias. But considering, I am willing to go as far as flipping/rolling 256 times to generate a 256 bit binary number, does that eliminate the bias?
If yes, then is it possible to utilize less number of flips/rolls to generate less entropy which is well verified to be secure enough for the purpose of mnemonic generation? Wish to explore this option as its simply a lot of monotonous manual work for the extremely cautious user & if its possible to reduce the burden without sacrificing security.
Again, I have read many statements by fellow people on internet but I have no means to verify anybody's claim hence reverting to this community to chime in.
Some of the methods I read about:

Using multiple dices to effectively roll x dices in every attempt and do it faster. Not sure how the order of reading dices matter here. Saw someone mentioning they should be read in the exact same order.

Approach of mixing coin flip along with four dices to use the provided mapping to derive the words. I don't want to trust this. I would very much like to arrive at a random index for each word and then read the value at that index from the wordlist.

Using Ionman's BIP39 tool, how it shows the provided entropy to be enough, it indeed required putting in 256 inputs (0/1) random values in there before the security validation message (mnemonic looks more secure than it really is) goes away. So as per that tool, anything less than 256 flips/rolls isn't secure enough. True?

How to interpret dice rolls: Then there is also the question of interpreting the dice rolls. Do I use odd even numbers as 0 & 1 respectively or should I use half the range of possible outcomes (1-3) as 0 or 1 and the other half range as the other binary bit?

Just gather every source of randomness you have all together and apply a 256-bit secure hashing function to it such as SHA-256. The advantage of this approach is that it is as secure as its strongest input up to the limit of the hashing function you use.
There is no benefit to discarding information. Why map 3 and 5 both to 1 and give up some entropy? What benefit would you get?

You are right. I just realized I can utilize additional entropy by converting the mixture to its SHA256 hash and then convert it back into mnemonic code. I was too focused on following the trail for a manual method of doing it and assisting in that form by software.

I have decided to not offer the option in my Vault app, as for being truly trustless, I can provide aids to do it all manually & just import the mnemonic into it, and then adding a passphrase on top of it. But for the sake of the question, if manual flips/rolls are to be used, how many flip/rolls do we really need or what mechanism should be used to make this a sufficient source of entropy?

I wouldn't use fewer than 96 bits if you're 100% relying on the randomness of the flips. But you can also grab the TSC as each bit is input, and then you could probably drop to 60 if you do it right.


text:
Validation for a seed collision
Came across this post while researching, and it claims:

This mnemonic: weary weapon unseen like like like like like like like like like and this one: sister glide dude near muse sent like like like like like like both produce the same binary seed (which is this
in hex: 0x1003ca7a7000000000000000000000000) and they both produce
the same address list (starting with
17A2fgCpcKEbg7CbfiJwAb8sjdEzUWD2y2)
4/1000 number comes from this: (# of mnemonic permutations / # of
binary seeds) - 1 == (1626^12 / 2^128) - 1 == about 4/1000. So about 4
in 1000 mnemonics correspond to two binary seeds / two address lists.

Can someone explain/verify the reality of this? Is this true? Applicable to only 12-words mnemonic or to all? Or not valid at all?
When I went ahead and tried to use the 12-word mnemonic provided, I found out that "weary" is not even a word in BIP39 English wordlist, but words are not chosen on the basis of security but rather to reduce human error in reading and transcribing the words. Does the claim hold up? And after reading tons of information on the subject, this is the first and only source that I have seen mentioned mnemonic -> seed collision.

The post (which, note, is dated December 2014) is not referring to BIP39 or any variant, but instead to a particular obsolete and non-standard mnemonic algorithm used by the Electrum client prior to August 2014.  (The author mentions Electrum further down in the post.)  Here is the code; their wordlist does indeed include weary.
You can see their decode algorithm.  Each group of 3 words decodes to a hex string which is normally 8 digits but may in some cases be 9 (the computation of x may produce a value as large as (n-1) * n*(n-1) * n*n*(n-1), where n = 1626, and this number exceeds 2^32).  These hex strings are then concatenated to form the seed to be used.  Modifying the code to insert spaces between the strings makes it clear what is happening:
$ python mnemonic.py weary weapon unseen like like like like like like like like like
1003ca7a7 00000000 00000000 00000000
$ python mnemonic.py sister glide dude near muse sent like like like like like like
1003ca7a 70000000 00000000 00000000

So the first phrase yields a seed which is the same as for the second but with an extra zero on the end.  I presume that elsewhere in the code, the seed is truncated to 32 hex digits before being used, possibly here though I have not traced where that is called.  If so then the values actually used will be the same.
To be clear, this is not a collision in any cryptographic hash function, and has no particular security implications except that it makes the entropy of the seed phrase very slightly less than it might otherwise appear.  It is also not relevant to any seed algorithm in any other software or in any recent version of Electrum.

Let's start from looking at electrum's wordlist (same as BIP39 english). From your example words:
weary
unseen
dude
muse
sent

don't exist in this wordlist. There are dune, museum, wear and sentence. Unseen isn't close to any of the words. If the author of the post provide mnemonic in the form of number it may be possible to calculate, from seed there is no way of getting the mnemonic (it's a HMAC function) and confirming his claim.

Sorry but how does what you said confirm anything? Your answer is more like a comment & it didn't add any new info. I think you misunderstood the question.

It's not true (not valid) as these words aren't existing in any mnemonic dictionary I am aware of. Word is just a number representation (abandon = 0, zoo = 2047) that creates a mnemonic.

Yet that says nothing about the possibility of such a collision, which is the original question. You are stating what I have already stated in the question.


text:
Is there a central repository that states a country's latest policy on bitcoin?
The legal status of bitcoin changes from country to country, to include a wide range of policies from acceptance to outright banning it.

The best I found so far is Wikipedia. It is actually quite up to date.
https://en.wikipedia.org/wiki/Legality_of_bitcoin_by_country

Hello Tagir, please feel free to put personal information or references to your company into your user profile, but please do not mention your business in posts completely unrelated to your business. Thank you.


text:
Does Trezor have any shortfalls security-wise?
Or do you have a recommendation for another cold wallet?

First, thanks for getting involved and asking so many questions!  It really helps make this SE site a more useful resource.  Second, is there any way you can expand the context of this question, making it a bit more clear what you want to know?  It was auto-flagged as "low-quality" because of how short it is, so it is in danger of being closed by the community.  Asking for specific security concerns about the Trezor will likely attract more answers, as well as being more useful to those seeking the same answers.


text:
My multibit wallet (Ver. 0.5.15) shows nothing after being sent part of a coin?
I've reset the blockchain about 5 times over a week and still nothing
I upgraded multibit wallet to version 0.5.15 and still nothing.
Any ideas or help would be greatly appreciated!!! :-)

Do not vandalize your own posts.

First, check on blockchain.info and see what the status of the transaction is.  Make sure that it shows that the address you think it was sent to really received the coins.  Once you have done that, you know that the transaction has been recorded publicly.  Then it is just a matter of opening a wallet that owns that address.
You need to check the "Request" tab in MultiBit and make sure that the address you sent the coin to is listed there.  If it isn't, then you have opened the wrong wallet, and you need to find the wallet that contains the address you sent it to.

Thanks for your reply Harold! From this transaction http://blockexplorer.com/tx/5e4307b74042abca80b96d7fb1daca9ca14040ed9e2b1d36a9ecd6928be2635e#i58867693 with my multibit wallet address being 1HC9Tu1jpr9nztak4F5mr2zWyFfjaTiTjR do you think the part bitcoin should arrive into my wallet? Thanks again!

The balance of that address is zero:
http://blockexplorer.com/address/1HC9Tu1jpr9nztak4F5mr2zWyFfjaTiTjR
But you should check to see if you own any of the other addresses in your receive tab.


text:
What is a step by step way to insert data in OP_RETURN?
I was following https://bitcointalk.org/index.php?topic=453086.0
for creating a message in OP_RETURN. I am able to decode my raw transaction, but on signrawtransaction it gives

error: {"code":-22,"message":"TX decode failed"}

I validated the address, is there something that is missing in that tutorial.

Best way would be to post the resulting tx. Is the data you're embedding less than 40 bytes?

Thanks Matthieu, you were right about the size. But I still had to do more steps. So was looking for a complete Step by Step.

I got this message when I'd forgotten to replace the original script length with the new one for my OP_RETURN hex string.

I wrote a little demo program which puts a snippet of data into an OP_RETURN script. It requires a bitcoin instance that accepts RPC connections, though it could be implemented without that. You can find it on github here. It's been tested, but only on testnet. I'm going to go through the code and explain what it's doing.
Start
[...]
logging.basicConfig()
logging.getLogger("BitcoinRPC").setLevel(logging.DEBUG)

This makes logging more verbose. It's handy because it shows what RPC calls are being made.
Connect to bitcoind
rpc_user = "bitcoinrpc"
rpc_password = "87Y9A2gs25E9HDPGc9axqSqzxMR2MyTtrMkYc5KiZk2Z"

rpc = AuthServiceProxy("http://%s:%s@127.0.0.1:18332/" % (rpc_user, rpc_password))

Note that your password will be different, and that you use port 8332 for mainnet instead of port 18332.
List unspent outputs
first_unspent = rpc.listunspent()[0]
txid = first_unspent['txid']
vout = first_unspent['vout']
input_amount = first_unspent['amount']
SATOSHI = Decimal("0.00000001")
change_amount = input_amount - Decimal("0.005") - SATOSHI

The - Decimal("0.005") part is so that we pay a transaction fee.
Create transaction
# Marker address we're going to replace
# Produces a pattern that's easy to search for
mainnet = 0
if mainnet:
    dummy_address = "1111111111111111111114oLvT2"
else:
    dummy_address = "mfWxJ45yp2SFn7UciZyNpvDKrzbhyfKrY8"

These are two different encodings of a Pay to Public Key Hash of all zeros. The top one is the mainnet representation, and the bottom is the testnet representation.
# My change address
change_address = "mhZuYnuMCZLjZKeDMnY48xsR5qkjq7bAr9"

Remember, this is my change address. If you don't change it, you'll be sending money to me.
tx = rpc.createrawtransaction([{"txid": txid, "vout": vout}], \
                              {change_address: change_amount, \
                               dummy_address: SATOSHI})

And now we have an actual transaction. It doesn't contain any of our own data though, so we'll have to fix that.
Replace dummy output with our own output
# Pattern to replace
# Represents length of script, then OP_DUP OP_HASH160,
# then length of hash, then 20 bytes of zeros, OP_EQUALVERIFY OP_CHECKSIG
oldScriptPubKey = "1976a914000000000000000000000000000000000000000088ac"

This is a bit of a hack. Instead of creating our own output, we create a dummy output, then search for the pattern it makes and replace it. There's probably a better way to do this, but this seems easiest.
# Data to insert
data = "Melons."
if len(data) > 75:
    raise Exception("Can't contain this much data-use OP_PUSHDATA1")

newScriptPubKey = "6a" + hexlify(chr(len(data))) + hexlify(data)

Next we create the data we want to put into the blockchain. I'm using the string Melons., but you could use anything. (Above 40 bytes is nonstandard, though.) I covered most of this in my other answer.
This code will break if the data is longer than 75 bytes. If you need it for more than that, you could use OP_PUSHDATA1 instead of the single-byte pushdata that I'm using here.
#Append int of length to start
newScriptPubKey = hexlify(chr(len(unhexlify(newScriptPubKey)))) + newScriptPubKey

This part is a little different than my other answer, because we need to include the length of the scriptPubKey also. This code will break with data longer than 251 bytes. If you want it to work on data longer than that, encode a varint correctly.
if oldScriptPubKey not in tx:
    raise Exception("Something broke!")

Error checking for this very rickety method.
tx = tx.replace(oldScriptPubKey, newScriptPubKey)

Finally, a string replace swaps the new script for the old one.
Sign it
tx = rpc.signrawtransaction(tx)['hex']

Bitcoin handles the heaving lifting here.
Broadcast it to the network.
rpc.sendrawtransaction(tx)

Done! Now just wait for your transaction to get into a block.
I ran the code (output), and I produced a transaction, which you can see in Block Explorer here. If you copy the string next to OP_RETURN, and paste it into a Hex to ASCII converter, you get...
Melons.

Done!
Other resources
I found this webpage helpful while writing this.

Nice, as it's an OP_RETURN scriptsig (If I understands correctly), does that mean the tx will be removed / invalidated by the network?

@Valmond scriptsig scriptPubKey, actually. does that mean the tx will be removed / invalidated by the network? Not... really. It will be removed from the unspent transaction output set in some clients, but many clients will still remember it. (They need to, because they need to prove to new clients that it's just an OP_RETURN transaction.)

Note, the transaction you produced would not be a standard transaction on mainnet because the op_return output has a value > 0.  It gets relayed/mined-by-default on testnet because testnet accepts almost all transactions as standard.

@DavidA.Harding I did that because createrawtransaction wouldn't accept a value of 0. Can you provide a source to that claim? I can't find any check like that in Solver or IsStandard.

@NickODell oh, bugger---you seem to be correct; I've been giving people bad advice for a year now.  Sorry.

I got a few questions.

How did you calculate the dummy addresses with such precision?
If I enter a real address as dummy (getnewaddress) and then txhex = createrawtransaction. Then I get the script hex by decodedtx = decoderawtransaction txhex and oldScriptHex = decodedtx.scriptPubKey.hex. Then txhex.replace(oldScriptHex, newScriptHex) and this approach doesn't decode anymore (code -22; TX decode failed). why? newScriptHex is identical in your version and mine.

Currently you can use createrawtransaction with a vout like {"data": "your hex data"} and don't have to deal with the replacing.

You can make life easy by using one of our OP_RETURN libraries:

PHP: https://github.com/coinspark/php-OP_RETURN
Python: https://github.com/coinspark/python-OP_RETURN

The code will also show you exactly how it's done.

http://digitalcommons.augustana.edu/cscfaculty/1/
Academic paper describing the different methods of data insertion for Bitcoin's blockchain.


text:
What year did bitcoins come out?
I purchased one in 2009 or 2010 . I want to know how I would recover it. I was sent to prison I would like to know asap please and thank you .

The Bitcoin network was launched in early 2009.
To recover your coins, you'll need to find the wallet file that contains your private keys. You'll need to remember how you stored your Bitcoin, did you have a run wallet on a personal computer? etc. Remembering the answer to that question is probably your only hope of recovering your Bitcoin.
Without any additional info, I don't think there is any way that anyone here can help you further than that.

No other wallets existed at that time. It’s likely if this story is true, they are misremembering.


text:
Using the main Bitcoin-Qt Client, can you change where it stores the block chain?
I don't want 12 gigabytes stored on my boot drive.  Can I change where the  Bitcoin-Qt stores the block chain?

Asking about how to change the default storage location has been posted many, many times. The future canonical question is probably Bitcoin-Qt setup: Change block-chain file location, settings? documentation?. Possible duplicate of Bitcoin-Qt setup: Change block-chain file location, settings? documentation?.

You surely can. Just add -datadir parameter to the command line, when starting bitcoin-qt.
For example:

bitcoin-qt.exe -datadir=D:\BITCOINDATA


text:
What can happen if/when a node is surrounded by rogue nodes?
If a node (V) accepts incoming connections, is he vulnerable to becoming completely surrounded by corrupted nodes? Would an attacker be able to control which transactions are relayed to V and which transactions V is able to broadcast to the network?
I assume for this to happen V would have to, over time, lose connections to honest nodes to have them replaced by the attackers'.
If so, in what circumstances would the Bitcoin client lose connection with an honest node, other than it going offline?

I don't know how frequently this occurs but the Bitcoin.org client (using default settings) will, after some amount of time (in the several minutes range, if I remember correctly), intentionally drop the existing connection and connect to a new peer chosen from the list of peers it knows about.
So the duration available to the attacker to feed the node corrupt (invalid) data is not very long.
If the node will be used to honor payments on 0/unconfirmed, then a race attack is a possibility so the recommendation is to not allow any incoming transactions and to have only outgoing connections and even then only to well-connected nodes.
There is further discussion of the risks here:

http://bitcointalk.org/index.php?topic=4335.msg63432#msg63432
http://codinginmysleep.com/bitcoin-attacks-in-plain-english

Wouldn't an attacker with man-in-the-middle capabilities be able to hijack all connections to the bitcoin network (incoming and outgoing), masquerading as many different nodes?


text:
How do I upgrade my Bitcoin client?
I am working with an older version of Bitcoin and want to upgrade to version .4.  Is there a specific way to do this?  I want to try to upgrade, but am paranoid that I could lose my wallet if I do something wrong.

Which operating system are you using?

Make sure to download the client securely: http://bitcoin.stackexchange.com/questions/565/how-can-one-download-the-bitcoin-client-securely

Personally I am using a Mac but I would like to know how to do it on a Windows also because my parents use it there.

First, you should backup your wallet.dat in case something goes wrong. The file is located in the data directory:

Windows
C:\Documents and Settings\YourUserName\Application data\Bitcoin (XP)
C:\Users\YourUserName\Appdata\Roaming\Bitcoin (Vista and 7)

The easiest way to open your appdata folder is to press Windows Key-R, then type %appdata% and hit enter.

Linux
~/.bitcoin/
Mac
~/Library/Application Support/Bitcoin/

Then install the new version in the regular manner. The new client should use your previous settings (including the wallet and the blockchain data).
If, by some strange magic, your wallet gets corrupted, just copy your backup into the data folder.

Please see my comment on the question.

@ripper234 OK. I removed the website from the answer.

Great.  I was hoping it would be simple and figure it would be.  I just didn't see anywhere saying for sure what to do.  Thanks for the answer.

From @Jasom Dotnet "If you have problem to access AppData dir on your Win, you can type %APPDATA% into commnad line (Win + R)"


text:
How to use Signed Hash to Send Coins in bitcoinj
I am very new to bitcoinj library. I am using 0.14.7 version of bitcoinj and developing my own application in java. I have created a watch-only wallet by using the tPub of the Offline wallet. Upto Receiving payments on watch-only wallet, it is working fine. Now, i have to spend those coins. For that, I have created a transaction and found its transaction Hash.
To sign that transaction Hash with private key, I have followed How to sign raw transaction given a private key and SHA hash (in java) code. and now I am getting the signed hash. Please guide me that how can I use this signed hash to send and broadcast the transaction.?
Your help will be appreciable. Thanks in advance.
The sample code is given below:

// Through this way, I am finding the Transaction Hash.

SendRequest request = SendRequest.to(Address.fromBase58(params,externalAddress), Coin.parseCoin(amount));
request.signInputs = false;
request.tx.getInputs();
request.missingSigsMode = Wallet.MissingSigsMode.USE_DUMMY_SIG;
String hash = request.tx.getHashAsString();

//now using createSignHash method, which is taking transaction hash and signing that with private key and returning the Signed Hex.
System.out.println("Signed Hash : " + createSignHash(hash));

 sendrawtransaction signedHex

is the rpc you need to call which will submit your raw transaction to local node and network.

First of all thanks for replying. According to [link] (https://en.bitcoin.it/wiki/Raw_Transactions), "raw transaction API was introduced with Bitcoin-Qt/bitcoind version 0.7". I am using bitcoinj. How to use sendRawTransaction here? Can you help me to know the process for bitcoinj? or is there any alternative for sendRatTransaction there?


text:
Unomp does not support asic boost
I setup my unomp server and connect a cpuminer/minerd to it to mine bitcoin. Everything works like a charm. Then I connect my INNOSILICON T2 to it to mine bitcoin, it gives the following error:
[2018-12-24 20:00:33.857] [DEBUG] [default] - Pool bitcoin Thread 3 Unknown stratum method from (unauthorized) [ip]: mining.configure.
Does anyone know why? Maybe unomp does not support new "mining.configure" extension introduced in stratum protocol to enable asic boost? If so, what are unomp alternatives that support asic boost?

UNOMP is no longer maintained and development of it stopped before the introduction of Asicboost into stratum. Thus it does not support using Asicboost.
CKPool is a mining pool software that that does support Asicboost.


text:
More decimals to Bitcoin
Bitcoin USD price is increasing continuously; it is not impossible to imagine a day where we get 1 satoshi = 1 USD cent or even more, 1 satoshi = 1 USD.
In that scenario we have a problem, bitcoin micropayments will be impossible, even with Lightning Network.
I know it is possible to increase the decimal places of bitcoin, e.g. 1 BTC = 1 00000000 00000000 units. My question is, how it can be done?

related: https://bitcoin.stackexchange.com/q/122/5406

The Lightning Network protocol allows to send millisatoshi (1/1000 of satoshi) as the smallest unit: https://bitcoin.stackexchange.com/questions/69700/what-is-a-millisatoshi-i-thought-satoshi-is-the-smallest-unit

The Bitcoin developers would have to hard fork the chain to allow it.
I also don't think Bitcoin can get that expensive. Your talking 1 BTC = $100,000,000. If that's the case, the Bitcoin market cap would be $1,670,673,700,000,000 (1.6 quadrillion dollars). There is no such figure of money similar to that in circulation.

So the only way is a hard fork. sad :/
Yeah the numbers are huge, and there is litecoin and other cryptos to help it

Nit: the whole network would need to hardfork, rather than just the Bitcoin developers. ;)

If one Satoshi would be 1 dolar, then the full market cap of Bitcoin would be all the coins available multiplied by it's price.
There is 16707388 bitcoins in circulation at 29th/november/2017.
A satoshi is smallest amount, the one 0.00000001 BTC.
So, if one bicoin is 10^8 satoshis and you suppose one satoshi will reach one dolar, then you really mean is that bitcoin price is will soon reach 10^8 dolars. If you really think bitcoins will be priced at 100 million. So, the total market price would be 16707388 * 10000000 = 16707388*10^8 =~ 16,7*10^14. That is a very great number. 1670 trillion dolars. This site tries to especulate on the total number of money available here.
So, there is still much room for Bitcoins to apreciate before such problem happens.
First, if a satoshi becomes a dolar, there is still much transactions that can be done in a block. A block should have sufficient size to offer many transactions and still be profitable. And if bitcoin apreciates beyond imagination, then people would not use it for small trades. As simple as that. I just don't see people carring diamonds and gold to buy grocery goods.

Bitcoin is already greater than 5 Bolivars, and greater than 1 Yen. If a satoshi ends up a greater value than 1 dollar it will likely mean that the dollar has significantly devalued to likely equal to the buying power of 1 cent. See Monstrum's answer to see the valuation of dollars to bitcoin.
It's a real possibility, given that gum that I could buy for a 50 cents as a kid now costs greater than a dollar for my kids. Given that the US dollar is inflationary by design, 1 dollar to a 1 cent buying power has essentially already occurred. The buying power of 4 cents in 1913 is equivalent to the buying power of 1 dollar today (Source: http://www.usinflationcalculator.com/) to put that in perspective, a bitcoin is worth only $300 USD in 1913 money.
I don't see that a satoshi/dollar equivalency issue is problematic so long as the buying power of a satoshi remains reasonable, and as Monstrum's evaluation of the market cap suggests, a massive amount of cryptocurrency would have to have been lost/destroyed to create such a deficit of supply and demand, so much so that the current iteration of the bitcoin network would be unfeasible, a hard fork or altcoin would be adopted I suppose. Such a scenario would be a decent argument that every individual is responsible for their share of stewardship of the bitcoin network, down to responsible wallet management.


text:
How to fork a cryptocurrency
I have cloned a coin and changed some variable to make it my own coin. I have launched it and have a few mining pools mining my coin. Going through the code I notice I have an error and the reward halving starts over at block 10k. So miners are getting 500 coins per block instead of 250 coins. I believe this sort of change would fork the coin to a new blockchain but I want current holders to keep the same amount of coins on the new fork. How can I change the code and fork the chain to comply with the new info?
https://github.com/DataSaverCoin/DSC/blob/master/src/main.cpp

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question.

Question has been edited.

Compile the code. Release the new client. Old and new version will disagree at some point in the future (block 10k in your case) et voila, you will have a forked chain.

So the old wallet.dat will still work with a newer client? If that's the case I can just force the pools to update their wallet. My biggest concern was that I'd have to regenerate the merkleroot and genesis block and start mining from scratch.

I would assume so. You can test it yourself to be sure.


text:
how to know if a webpage has mining code?
Until recently I have heard that lot of webpages are infected with the javascript which uses your computer's power to mine bitcoins.
Whats the correct method to identify if the website i am browsing is infected by this?

Typically when you browse to a website that is mining with your computer, you will notice that CPU usage increases dramatically. However, if the mining code is tuned to prevent noticeable CPU usage increases, it will be basically impossible to detect if a website is mining through your browser. The only way to know would be to examine each and every website's source code yourself.
However to avoid this problem, you can just prevent JavaScript from running at all. Using a plugin like NoScript, you can prevent JavaScript from executing when you visit any website which will thus prevent JavaScript miners from using your computer to mine cryptocurrencies. You can then enable JavaScript for specific websites and enable certain scripts for each website so that you know are not mining with your computer while still making websites that use JavaScript usable.

Many web sites have for years made CPU fans hum due to advertisements that are for some reason more socially acceptable.  Adds are really more of endemic problem today than mining code buggyware functioning in a browser.

I think for ads there are working browser plugins available to identify and remove from the page your are browsing.

@AndrewChow disabling JS seems near to impossible as nearly every website requires it. Was looking something to analyse javascript code and see if there is anything relating to do some sort of repetative task or cpu intensive tasks.

One can prevent javascript from running in the browser from urls that are known to do bad things. As mentioned, usually these are advertisers and the like. Luckily modern browsers sandbox urls to allowed domains, but if a site owner has added a script to their site, it's as good as part of the site. However, if it talks to a different site, most browsers other than Chrome block it by default. With Chrome one has to install an extension such as Privacy Badger by eff.org or uBlock Origin by Raymond Hill.


text:
Why are ticker messages in the MtGox PubNub API repeated?
I'm using MtGox's PubNub API to fetch ticker data. I've subscribed to the BTC/EUR ticker with id 0bb6da8b-f6c6-4ecf-8f0d-a544ad948c15 . In more than half the cases when I receive a new ticker message, the data is just the same as that of the previous message, except for the timestamp of course. I expected ticker messages only when there is new data available, so I do not understand why the ticker messages get repeated. Examples:
diff_to_previous  instant_________      last_all        last_local      last_orig       buy_____        sell____        vwap____        vol_____________    item  avg_____      high____        low_____
n/a               2013-12-12 16:31:46   EUR 628.31408   EUR 620.22000   USD 865.00000   EUR 620.22000   EUR 629.00000   EUR 647.91649   BTC 1365.61335998   BTC   EUR 649.27938 EUR 680.00000   EUR 615.00000
none              2013-12-12 16:31:50   EUR 628.31408   EUR 620.22000   USD 865.00000   EUR 620.22000   EUR 629.00000   EUR 647.91649   BTC 1365.61335998   BTC   EUR 649.27938 EUR 680.00000   EUR 615.00000
none              2013-12-12 16:31:53   EUR 628.31408   EUR 620.22000   USD 865.00000   EUR 620.22000   EUR 629.00000   EUR 647.91649   BTC 1365.61335998   BTC   EUR 649.27938 EUR 680.00000   EUR 615.00000
last_all          2013-12-12 16:32:05   EUR 617.41846   EUR 620.22000   USD 850.00000   EUR 620.23000   EUR 629.00000   EUR 647.91649   BTC 1365.61335998   BTC   EUR 649.27938 EUR 680.00000   EUR 615.00000

What kind of events trigger a ticker message to be broadcast?

This question is also on bitcointalk.org.

PubNub MtGox API Ticker Repeat Messages
The Ticker Events are Updates that are streamed directly to you which may or may not represent a price change.  However the ticker updates are typically tied to a trade event which occur on the trade channel.
You can find the trade stream here:
http://www.pubnub.com/console/?sub=sub-c-50d56e1e-2fd9-11e3-a041-02ee2ddab7fe&pub=demo&channel=dbf1dee9-4f2e-4a08-8cb7-748919a71b21&origin=pubsub.pubnub.com&ssl=true
So in regards to the updates you may receive unchanging value updates.  You may also consider looking at historical values by using the History API: http://www.pubnub.com/how-it-works/storage-and-playback/
Also check out the related Stackoverflow article: https://stackoverflow.com/questions/20547815/convenient-way-to-extract-data-from-the-mtgox-pubnub-json-api/20553315#20553315
or
https://stackoverflow.com/questions/20495713/are-there-ready-made-java-classes-for-the-mtgox-pubnub-json-api/20500700#20500700


text:
What is the 'tlv_payload' in lnd route?
When creating a custom route, if you use the queryroutes from lnd it sometimes  with tlv_payload set to either True or False. How does the node figure whether to set this flag?
I cant seem to find it in the source code. Clearly when using RPC calls such as 'getnodeinfo' the feature bit set from the node does not come through. So is this possible that the feature set per node is not exposed via RPC?

The tlv_payload is a modification to the way onion packets are created between the 1.0 version and the 1.1 version (current working version) of the BOLT specs. The (optional) feature is named var_onion_optin in BOLT#9.
In V1.0 of the spec, there was a fixed structure for sending onion payloads to hops along a route, which contained a short_channel_id, a cltv_expiry and an amount_to_forward. In the latest version, implementations can add custom data to be forwarded in addition to the previously required ones. These contain a type and length encoded as a compact size integer, and the value of length bytes is serialized afterwards. Hence Type-Length-Value, or TLV.
Nodes which support the newer format advertise the var_onion_optin feature when they broadcast a node_announcement message, by setting bit #9 in the features field of this message.
In the lnd codebase, the feature folder contains the logic for feature bit vectors. It appears from manager.go that LND now treats the tlv_payload as enabled by default unless it is disabled as part of the config. Older versions of LND will obviously not support the feature and will use the legacy hop_data payload format.

Thanks Mark, so the core information is stored in the node_announcements. How does one get this info? There does not seem to be an RPC/CLI command which can get this info? Or rather is it stored on disk anywhere?

It uses bbolt for storage. The channeldb folder in lnd contains all of the database code. I'm not too familiar with lnd so not sure where it stores data by default, but I imagine it uses some standard directory like XDG_DATA_HOME.


text:
How does the 'queryroutes' function in lightning's LND calculate the route fees?
I am testing my own routing implementation and for some weird reason a handful of channels reject my payment stating InsufficientFee.
The scenario is A -c1-> B -c2-> C whereby Node A is sending a payment to C via B where the channels used are denoted as c1 and c2.
For c1 the node fee policies are
    "node1_policy": {
        "time_lock_delta": 40,
        "min_htlc": "1",
        "fee_base_msat": "1000",
        "fee_rate_milli_msat": "1",
        "max_htlc_msat": "16777215000",
    },
    "node2_policy": {
        "time_lock_delta": 144,
        "min_htlc": "1000",
        "fee_base_msat": "1000",
        "fee_rate_milli_msat": "100",
        "max_htlc_msat": "16777215000",
    },

For c2 the node fee policies are
    "node1_policy": null,
    "node2_policy": {
        "time_lock_delta": 144,
        "min_htlc": "1000",
        "fee_base_msat": "10000",
        "fee_rate_milli_msat": "100",
        "max_htlc_msat": "10000000000",

    }

For an amount of 4999000 mSat queryroutes uses this route and calculates the fees as
{'amt_to_forward': '4999',
                       'amt_to_forward_msat': '4999000',
                       'chan_capacity': '16777215',
                       'chan_id': 'c1',
                       'fee': '10',
                       'fee_msat': '10499',},
                      {'amt_to_forward': '4999',
                       'amt_to_forward_msat': '4999000',
                       'chan_capacity': '10000000',
                       'chan_id': 'c2',
                       'fee': '0',
                       'fee_msat': '0',}
             'total_amt': '5009',
             'total_amt_msat': '5009499',
             'total_fees': '10',
             'total_fees_msat': '10499',}

Could someone please explain in step-by-step detail how the lnd client gets to this value?

To answer your question two things have to be known:

Routing fees are always charged from the recipient to the sender as the fee rate of later packages impacts earlier routing decisions.
Nodes get paid a routing fee to forward a package on an outgoing channel.

The first remark is not of importance for your case as the path only includes 1 routing node. The second remark means that only the fee police for channel c2 are relevant. Node A does not charge itself a routing fee on channel c1 to forward to B and node B would only charge a fee on channel c1 if a paymant was to be forwarded to node A
So let us look at the payment amount and the policy of channel c2
the policy says:
 "fee_base_msat": "10000",
 "fee_rate_milli_msat": "100",

where the payment_amount is 4999 that means that you have to send an onion to B that has the following amount of msat
payment_amount * 1000 + fee_base_msat + payment_amount * fee_rate_milli_msat / 1'000
pluging in your numbers this means:
4999000 + 10000 + 4999 * 100 / 1000 = 5009000 + int(499.9) = 5009000 + 499 = 5009499
That is exactly the amount your node sends on its way to complete the onion. Also note that if your node would have been forwarding that payment from anouther node E the other node would have to use that result as the payment_amount with the above formula and your channel police from c1 to forward the payment. That is what I meant in the first remark that the amounts are calculated from the receiver to the sender.

Thank you for answering, However it seems that the lnd client rounds payments, if I enter 4999999 its rounded to 4999000 surely it should not do this? Edit: queryroutes takes Satoshis, not mSat, so the rounding will always occur regardless.

One issue I found now, that i cannot seem to explain is, in one case n1_policy is 'fee_base_msat': '489', 'fee_rate_milli_msat': '1000', whilst n2_policy is 'fee_base_msat': '1000',  'fee_rate_milli_msat': '1',. In this case n1 received the payment, why would lnd choose n1 policy instead of n2 ?


text:
DigitalNote Wallet Stuck on last node (415608)
I've downloaded the 1.0.12-beta (last) version of the XDN Wallet from the official website, got the address, transferred 70€-worth of XDN in it using Changelly. The transaction worked fine and I got the confirmation from Changelly.
My wallet has the "not sync issue" that everyone else has (digitalcoin wallet won't sync), I tried to fix it by downloading the latest blockchain data and replacing the .dat and .bin files with the ones downloaded, then restarted the wallet.
The wallet started creating the cache, then it blocked showing "Synchronizing 415608/415608".
The digitalnotewallet.log's last lines shows the following error:
[node_server] Failed to connect to any of seed peers, continuing without seeds

So I'm stuck again without my updated balance.
Is there any way to access my wallet online using my private key, as can be done using a file with MyEtherWallet?

I hope it helps you, but the current version should fix that.
https://github.com/xdn-project/digitalnotewallet/releases
If this does not help, can try to change the p2pstate.bin file,
located in
C/Windows/Users/Your username/AppData/Roaming/digitalnote
with the file from this one
https://drive.google.com/drive/folders/0B4t0S1ES9L-RUUUzX2ZjUW5Xems
and should not help it all, say something!
And if needed, the current addresses should be:
176.9.2.145:8480,
73.187.10.116:42080,
176.9.147.178:8480,
148.251.51.113:8480,
122.173.153.251:42080
Best regards

Thank you very much @Matt, I've upgraded the GUI to the .13 version and replaced the p2pstate.bin file and it started synchronizing. 2017-Sep-08 10:08:40.113286 INFO [protocol] [148.251.51.113:8480 OUT] Sync data returned unknown top block: 415607 -> 425457 [9850 blocks (27 days) behind]  2017-Sep-08 10:08:40.113286 INFO [protocol] SYNCHRONIZATION started

Here is a video on how to fix the syncing issue. Basically, you need to replace the blockchain files with a new set, then restart the syncing. The video has some details on how to do it, but really you need to just replace these files:
cd ~/.digitalnote
p2pstate.bin
blockchainindices.dat
blockindexes.dat
blocks.dat
blockscache.dat

You can grab new copies of the files here.