Bitcoin Forum
May 26, 2024, 10:38:57 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 [2] 3 4 5 »
21  Bitcoin / Hardware wallets / Re: Hardware wallets vs. airgap machines; supply-chain attacks; forward/backward sec on: March 23, 2018, 06:40:23 PM
You indeed did forget the most important and still the most secure: Bitcoin Core and all the other open source software where you download the entire blockchain and where you can encrypt the wallet.

Just a few additions:

Paper Wallets can be encrypted, which makes it more secure than cash, but still is open to a regular robbing with weapon use (Tell the password or die), but the main problem I think is that it can be destroyed very easy.

An encrypted wallet.dat fie can be renamed into Michael_Jackson-Earthsong.mp3 and you carry it around (or send it around). Place another unchanged and unencrypted wallet.dat file with a low amount for plausible deniabiity. There are other plausible deniability solutions like hidden partitions etc. Multiple backups make a file pretty much undestroyable.



I consider the Bitcoin Core Client is a normal hot wallet. In terms of security it is not better or worse than any other hot wallet without the full blockchain. Of course there are clients which have better security than other. but from security perspective I throw all hot wallets into the same pot.

To have a full node instead of using a SPV client is indeed better but both wallets store the private keys in a similar way so they are the same for me in this regard.

You are right that paper wallets can be encrypted, but as you also say with force from an attacker none of the available wallets/key-stores would safe your coins.

The best security is when no one knows that you own any bitcoins. And you also don't have any traces on your PC/phone which might let anyone think you have some bitcoins (like installed bitcoin clients). This could be achieved in parts with an encrypted OS running inside a virtual machine which runs the bitcoin client.

The question is always, how paranoid you wanna be to secure the bitcoins. This also depends on how much you have to secure.

Your idea to encrypt and rename the wallet.dat (security by obscurity) might only work as long as you don't need it. If you want to create a transaction from this wallet.dat you need to encrypt it and load it with the bitcoin client. And when your PC is infected with malicious software it will not help you.
22  Bitcoin / Development & Technical Discussion / Re: Question about computation power for purposeful modification of blockchain data on: March 23, 2018, 05:14:41 PM
Changes to avoid downloading and/or storing such transactions would only be possible for full nodes which are only used privately (with closed port 8333).

This is not true.

Every accessible full node in the network need to provide the correct blocks/transaction to any other node which asks for this blocks, otherwise there is no way for a new node to validate and sync the blockchain correctly.
So, the blocks with those transactions need to be stored by every full node.

This is clearly not true.  If it was true, then it would not be possible to run Bitcoin Core with pruning turned on.

What could be possible is to disallow the access of those transaction by the local gui and via the RPC interface.

But this would not help at all, there is no way to force anybody to use this "censoring" client.

Correct.  The idea would be to provide a client that users can optionally run if they want to avoid downloading the objectionable data and still maintain the rest of the blockchain.

The only way would be to censor those transactions via a hardfork.

Not true.

But this would require every client to be updated, which will never happen.

Only the clients that don't want to reeive or store the data.

Actually the only reason for blockchains is the censorship resistance and immutable property. If we start to implement any way to censor anything (which is actually not possible), we would not need a blockchain anymore. A side effect of censorship resistance and immutable is unfortunately that there can be also stored illegal data which will be there forever.

Correct. I'm not saying that the data would be gone from ALL copies of the blockchain.  I'm just saying that it would be gone from the copies of the blockchain that are being maintained by the users with the new software.

It would only disappear from ALL copies of the blockchain if EVERYBODY ran the new software, AND purged ALL old copies of the blockchain.


I got your point. The specific client which censors these transactions will only be used by people who want it. In this case it would technically work for those people.

But my points you think are wrong are still valid. This client would have some limits and cannot be used as a normal full node any more.

This specific client would only be useful as wallet, as it contains modified blocks which other nodes would reject when it broadcasts them.
If someone install a new orignal full node and ask for blocks to download the blockchain from beginning, this specific client would not be able to serve this as it would get blocked by the other node whenever the cencsored block is transmitted.

The comparison with pruned nodes is not good. First these nodes do not hold any invalid (censored) transactions or blocks. And second, like this specific client, they cannot broadcast all blocks to the network, they only forward new received blocks and can maybe send the blocks which are not pruned. If the whole bitcoin network would only consist of pruned nodes, it would not be possible to install a new full node as no one has a full copy of the blockchain any more. Even for pruned nodes, first the complete blockchain need to be downloaded and validated, only then the already spent transacations will get deleted and only the unspendet transaction will be kept on disk to save space.

I'm just thinking of any reason why anybody would want to install such a specific client which censors some transactions.
Only people who don't want to have those things on their PC would install it. But wouldn't it in this case just be not enough that those people don't look at these transactions?
Nearly no normal user is searching the local copy of the blockchain for transactions like this. Most people just don't know that such transactions exists. And even if they would know it, again most of these people would not be able to find such transactions and extract any image files out of the blockchain.

So you would need someone who know that such transactions with hidden images exists. This one need to investigate which transactions this are (not sure if there are listings of such transactions available in the internet). Then he would need to find out how to extract the information from the blockchain to save it as a picture.
In case you have somebody who really want to do this, then he would not download this specific client but the original one. Or maybe much easier just get the transactions from blockchain.info or something similar.

These are just my thoughs why it would be useless to invest time in creating such a client.
The people who don't like these things will not try to find it even if it is somewhere saved on their local copy of the blockchain, and the other people (I think there will not be much people at all) who want to get those stuff will not use this client.
23  Bitcoin / Development & Technical Discussion / Re: How to restore wallet? on: March 23, 2018, 09:38:56 AM
HI!!!  Wink
As a result of the power failure, my computer's power supply and the hard drive were burnt. The wallet was not copied.
After dancing with a tambourine from a damaged disc, it was possible to partially restore the purse. In particular, the file wallet.dat is broken and is not directly transferred to the new wallet.
But there are files wallet.cpp and wallet.h, which are kind of whole, that is, they managed to be pulled out completely from the damaged disk.
Question. Will I have these files a chance to restore my wallet? Maybe they have any traces of private keys, addresses or something else? Or if there is no wallet.dat, then it is already impossible to do anything at all? Smiley

wallet.cpp and wallet.h are only source files to build the bitcoin client. They will not help at all to restore a damaged wallet.dat.

If you don't have any older backup of your wallet.dat I'm not sure that you will be able to recover the file.
24  Bitcoin / Development & Technical Discussion / Re: Question about computation power for purposeful modification of blockchain data on: March 23, 2018, 08:20:35 AM
Bitcoin Core with pruning turned off can be modified to avoid downloading and/or storing the transactions that have the undesired data once the data is identified. I'm not aware of anyone that has created such changes yet, but it wouldn't be excessively difficult to do, perhaps it could become an interesting open source project). It won't prevent you from receiving new data that you don't want, and it will continue to be possible for malicious people to encode undesired data into their transactions in the future.

Changes to avoid downloading and/or storing such transactions would only be possible for full nodes which are only used privately (with closed port 8333).

Every accessible full node in the network need to provide the correct blocks/transaction to any other node which asks for this blocks, otherwise there is no way for a new node to validate and sync the blockchain correctly.
So, the blocks with those transactions need to be stored by every full node. What could be possible is to disallow the access of those transaction by the local gui and via the RPC interface.

But this would not help at all, there is no way to force anybody to use this "censoring" client.

The only way would be to censor those transactions via a hardfork. But this would require every client to be updated, which will never happen.

Actually the only reason for blockchains is the censorship resistance and immutable property. If we start to implement any way to censor anything (which is actually not possible), we would not need a blockchain anymore.
A side effect of censorship resistance and immutable is unfortunately that there can be also stored illegal data which will be there forever.

In my opinion the advantage of bitcoin outweighs all the possible use cases for illegal purposes (e.g. buying drugs, money laundering, storing of illegal data...). The reason for this is, that all those illegal stuff can be done and is done better without bitcoin or blockchains.
25  Bitcoin / Development & Technical Discussion / Re: RPC-backended GUI for bitcoind on: March 23, 2018, 07:19:31 AM
To what purpose? Why not just use QT client? The RPC interface is much slower than the QT client and so any client built on top of RPC will be slow. Even if there's such a client (unheard of), who would use it?
It is no way to attach QT client to another node via rpc

I want GUI for already running node


I also had this idea and did not find a direct way to do this (but I did not really search hard).

But it depends on what you want to achieve with it.
My approach was to connect a SPV client directly to my full node, so I don't rely on full nodes of other people.

One way to do this would be to install an electrum server which talks to your full node and then use the electrum client to make use of your full node.

Maybe there are wallets outside which can directly connect to bitcoind RPC but I did not found them.
One security concern I would have with such wallets is, that you need to open the RPC port for everyone to be able to connect to your bitcoind. This could be a big attack vector if not secured properly.
26  Bitcoin / Hardware wallets / Re: Hardware wallets vs. airgap machines; supply-chain attacks; forward/backward sec on: March 23, 2018, 07:05:27 AM

Do they claim their hardware to be unhackable!?


More or less they were claiming that it's unhackable, and that's my only issue with them.
https://www.ledger.fr/2015/03/27/how-to-protect-hardware-wallets-against-tampering/

Quote from: link above
There is absolutely no way that an attacker could replace the firmware and make it pass attestation, without knowing the Ledger private key.

This claim was proven false now.

Nevertheless in my opinion I still think a hardware wallet is more secure than any other wallets when used safely.
Just that hardware wallets do have security issues does not make any other type of wallet which have MORE security issues suddenly better.

My ranking of wallets in terms of security would be the following

  • Hardware wallets
    If you don't take them outside of your home and attacker don't get physical access they are pretty safe -> with physical access as proven now it might not be safe
  • Paper wallets
    If they are kept hidden in a secret place -> but with physical access by an attacker -> no security at all.
    If people carry them around I consider them worse than any mobile wallets (they do at least have a pin to secure the wallet).
  • Airgapped PCs
    Pretty safe as long as an attacker don't get pyhsical access. I consider them worse than a hardware wallet because a PC/MAC/whatever even if not connected to the big world has a much bigger attack vector than a hardware wallet if getting pyhsical access.
  • Any local hot wallets on PC/MAC
    With spyware or other malicious software these wallets can be easily compromised. No physical access necessary
  • Any mobile wallets
    The security of such wallets is usually quite bad. Usually very short pin-codes are used to secure the wallet. As it's easy to lose them an attacker can get physical access to it.
  • Online wallets where you control the private keys
  • Online wallets where you don't control the private keys

Did I miss any type of wallet?

Beside of my listed ranking anyone can (and should) improve the security by combining several methods above and use multi signature addresses. In this case it is not possible to steal funds if just one of the methods is compromised.

Would be interested if someone has a different ranking than me.
27  Bitcoin / Development & Technical Discussion / Re: github question on contributing to bitcoin - unsure about creating a PR on: March 22, 2018, 11:29:32 AM

No, you can't push on upstream, you don't have the permissions to do it so.

You just push your branch to your github repository, doing git push origin, and create a PR (you'll get a beautiful "Compare & pull request" showing on your fork repository  page on github)

Code:
$ git push origin
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 4.17 KiB | 4.17 MiB/s, done.
Total 13 (delta 9), reused 0 (delta 0)
remote: Resolving deltas: 100% (9/9), completed with 8 local objects.
To github.com:mycroft/bitcoin.git
 * [new branch]          new_feature -> new_feature

Got you. Thanks
28  Bitcoin / Development & Technical Discussion / Re: github question on contributing to bitcoin - unsure about creating a PR on: March 22, 2018, 09:43:35 AM

What did I miss or how can I create a pull request with only the changes done in the topic branch and not everything I have done in the master branch?


When you do a pull request, it will ask for the upstream project to pull the whole branch contents & do a diff against upstream branch. This includes your commits in the current branch, but also all commits that are in the history in the branch.

So, if history on upstream is A -> B -> C, you clone this, then create a feature D you push in master in your own repository, then create a branch from D and commit E (you'll get A -> B -> C -> D -> E in this branch), the pull request will make a diff between upstream history (A -> B -> C) and your current commit log (A -> B -> C -> D -> E), and not only the commits you exclusively made in your branch.

What you want to do is clone the upstream repository and commit your new feature by creating a branch from upstream's master branch, not from your master branch.

Thank you for your quick response.

I had to lookup what an upstream repository is, but I think I found out how it works.

I did the following

$ git remote add upstream https://github.com/bitcoin/bitcoin
$ git fetch upstream

getting the last changes from upstream to be up to date
$ git checkout master
$ git merge upstream/master

then I checked out the upstream/master
$ git checkout upstream/master
$ git checkout -b <topic_branch>

and added my changes again.

Unfortunately the last update killed my changes as the feature I wanted to add relies on a feature which was removed 2 days ago....
So I cannot continue to check if creating a pull request would work the way I did now.

Maybe you can tell me if I'm on the right track with my steps above so I can do it correctly when I have another change I want to contribute?
What would be the correct next steps to create a pull request?

$ git commit
$ git push -u upstream/master <topic_branch>

Would I see then the upstream branch in my github repository to be able to create the pull request from there?

I think I need to do some experimenting on a github test project as well to see how everything works.


Edit: did not see your last edit before posting my comment.
But it looks like I found the correct way how to do it. I think I just did also some unnecessary steps.

I will do some tests on a test project to make sure I understood everything correctly.

Thank you so much!
29  Bitcoin / Development & Technical Discussion / github question on contributing to bitcoin - unsure about creating a PR on: March 22, 2018, 08:22:06 AM
I was missing a small, let's say feature, in the current bitcoin-qt version. So I decided to implement this by myself.

As I never contributed to an OSS before I did some research on how to do that correctly.

Starting point was the CONTRIBUTION document from the bitcoin repository https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md.
My missing knowledge there was basically the correct use of git / github with branches, remote repositories, merging and pull requests.

I learned about that and I'm quite confident that I understood all those stuff.

I already did
  • Fork the bitcoin/bitcoin repository to my github account
    done on github.com
  • Frequently created pull requests from bitcoin/bitcoin to my forked repository to stay up to date
    done on github.com by browsing to bitcoin/bitcoin repository -> clicked "New Pull request" -> clicked compare across forks -> changed the "Base fork" to my repository -> created the pull request and merged it
  • cloned my forked repository to my build environment
    $ git clone https://github.com/<MyGitHubUser>/bitcoin.git
  • created a topic branch
    $ git checkout -b <topic_branch>
  • made my changes
  • commited my changes and pushed the local topic branch to my forked repository
    $ git commit
    $ git push -u origin <topic_branch>

Now comes the part where I'm uncertain if I did everything correct or if I'm missing something.

On github I browsed to my bitcoin fork, selected my pushed topic branch and clicked the "New Pull request" button.

There I see the comparison from bitcoin/bitcoin to my_fork/topic_branch. The suggested title for the pull request by github is my last commit message from my topic branch. So far so good.

But I expected to see only my changes I made within the topic branch, but additionally I also see all the changes from my previously pull requests from bitcoin/bitcoin which I merged to my master branch.
Of course I don't want to have those changes in my pull request back to bitcoin/bitcoin.

I did not see anything on github which allow me to select only my last commit to be in the pull request.

What did I miss or how can I create a pull request with only the changes done in the topic branch and not everything I have done in the master branch?

I would appreciate any hints on how to solve this issue.

Thank you in advance.
30  Bitcoin / Development & Technical Discussion / Re: Young developer looking for a path to continue learn on: March 21, 2018, 05:47:53 AM

I would suggest you look at the book of Andreas M. Antonopoulos - Mastering Bitcoin, which explains the technical concept of Bitcoin.

The book covers all parts of bitcoin and is ment to be read by developers.

You can buy it at Amazon or you check out the free version at https://github.com/bitcoinbook/bitcoinbook
31  Bitcoin / Bitcoin Technical Support / Re: Where did wallets store bitcoins ? on: March 19, 2018, 07:02:45 PM
This is a common sense, but If you are selling your phone ALWAYS format your phone completely to minimize a chance that someone will have access your wallet.
Also, all modern phone now have applocker to put an extra security from meddling hands, use them (Especially if your phone has finger print scanner).

Formating your phone reduces the chance that someone can access your wallet. The only 100% secure way to avoide that someone restores the wallet is to create a new wallet on another device (new phone  or anywhere else) and transfer all coins from the old wallet to the new one and never use any of the addresses from the old wallet again. In this case even if the old wallet got somehow restored or hacked or whatever there are no coins on it which can be stolen.
32  Bitcoin / Development & Technical Discussion / Re: What happens when all nodes on the blockchain go offline? on: March 19, 2018, 05:58:19 PM
There is more than that the longest chain wins, it's actually the longest valid chain wins.

Completely agree that it's the longest valid chain that wins. But it is not always possible to know if a selfish transaction is invalid. The validity rules embedded in the software can check for some invalid situations but not for every possible invalid situation. If validity rules were able to check for every invalid situation there would be no 51% attack (https://www.investopedia.com/terms/1/51-attack.asp).

... they may have to accept those blocks with selfish transactions ...

Note the use of may purely for that reason  Smiley

As ranochigo and bob123 already mentioned, the 51% attack has nothing todo with consensus rules.
Even with a 51% attack you would not be able to create invalid transactions as they would be rejected by any other participants.

But you could do the following, even if it is very hard to do because you really need massive amount of hash power even to lower the difficulty. If you don't manage it to mine 2016 blocks the difficulty will not decrease. And with a high enough difficulty to begin with, you might need 1 week or longer to just mine one single block. To mine 2016 blocks would then take years.

But lets say just for fun the attacker does have the necessary hash power.
What could he do with a 51% attack?

1) He could prevent transactions which are broadcasted and are inside the mempool to get into a block so that the transaction keeps unconfirmed as long as he keeps the 51% advantage.
2) If he really is the only one who mines this coin he could rollback transactions. For this he defines a specific blockhight from the past, lets say he start 2 weeks in the past (about 2000 blocks before the current block hight) and continue mining from this block and create a fork. At some point his fork might be longer than the original one and then all other participants would need to reorg their chain and your chain become the longest valid one.
The only reason why someone would do this, is when he plans to replay one of his own transactions.
Lets say he made a transactions 2 weeks ago where he transmitted 10 coins. The transaction was confirmed by the network and got into one block. If he starts mining one block before the block of his transaction he could create a replay transaction which use one of the same UTXOs from the original transaction and send the coins to one of his address instead of the original target. In this case the orignal transaction would become invalid and the original receiver of the coins would not get it.

But you can do this only with transactions where you control the private key. All other transactions which were inside the blocks you rollbacked would just go back to the mempool and wait for anybody to mine them again. They are not lost. Either the attacker himself mines those reorganized transactions on his side of the fork or like in point 1 described, he just ignores them and they stay in the mempool forever or until any other miner starts mining and he looses the 51% advantage.

Actually there is a chance that those rollbacked transaction are lost forever if the other participants of the network did not had the original rollbacked blocks in their local blockchain. For example they start syncing the blockchain from the beginning or from an older point than the attacker started the reorg. But if anybody did have this reorg blocks in their local blockchain, those transaction would be broadcasted again (through the reorg process of the bitcoin client) and later mined again by any other miner.

That's actually the only 2 attack points you have with a 51% attack.
Point 2 above (to get already spent coins back) makes only sense if the coins do have any value (but if no one is interested in those coins - no node is online, no one is mining then the value of this coin will be 0). And then it's maybe still more profitable to just mine as much blocks as possible on top of the last block to get the block reward.

In all other situations where you start creating invalid blocks/transactions you would just create an invalid fork of the blockchain which does not give you any advantage as all other participants would just reject your blocks.
33  Bitcoin / Development & Technical Discussion / Re: What happens when all nodes on the blockchain go offline? on: March 19, 2018, 06:16:39 AM
Let's take example of Bitcoin. Assume all nodes of Bitcoin network go offline for some reason. Now assume an adversary (a party who wants to do harm to Bitcoin) detects the situation and starts mining blocks. Since no one else is mining at that time, the adversary can create selfish (illegal) transactions and include them in his/her blocks. If he is able to build many such blocks on top of each other, when the parties start getting back online, they may have to accept those blocks with selfish transactions (since the longest chain wins). If those blocks are accepted, the adversary has been able to successfully do illegal transactions.

Your explained way to cheat the system is not possible.
There is more than that the longest chain wins, it's actually the longest valid chain wins. If only the longest chain would win, I could start mining now with a very low difficulty and broadcast new blocks every 5 minutes. I would then have the longest chain and would, in your logic, force all other participants to change to my side of the blockchain, because it's the longest. That's not how it works.
If someone creates transactions or blocks which other nodes don't accept, because they go against the consensus rules, they just ignore those transactions and blocks and also ignore the node which is broadcasting those.
This is how it works at the moment with 100000 of participants, this is how it will work with only 2 participants in the bitcoin network.
The only way to be successful with such an attack is when the attacker change the bitcoin client and change the consensus rules so that his illegal transactions looks like valid transactions and all other participants of the network download this bitcoin client.
If other participants work with the original client and original consensus rules the only thing what happens is, that the attacker creates a fork of the blockchain with illegal transactions and blocks. All other will just ignore this side of the fork and continue on the other valid side of the fork.

So it's actually a dump way to cheat in this way.
If you are the only one left in the network you could just start mining normal and valid blocks and be happy with the block reward and hope that the coin is coming back alive after some time to be able to sell those coins. But it depends with which difficulty the last block was mined. If it was too high, you might not be able to mine any block within a reasonable time frame. Difficulty adjustments in Bitcoin only happens after 2016 mined blocks. So it's possible you are not able to mine those much blocks to reduce the difficulty.
Then the only way to bring the blockchain back to life would be a hardfork to change the difficulty adjustment. But then again, if other nodes start to join the network again, they will see your blocks as invalid unless they also update to your new client with new difficulty adjustment.

How he can to start mining if he does not have previous blocks?
This will be just a new blockchain.

In the example of Bitcoin there are currently a lot of full nodes which have the full blockchain saved. So even if all nodes go offline that does not mean that everyone is deleting the blockchain.
In the best case someone who want to continue mining already have the previous blocks. If not he might find someone who did run a full node in the past and get the blocks from this person.

34  Bitcoin / Development & Technical Discussion / Re: Can someone please answer me on this with LN ? on: March 16, 2018, 12:00:57 PM
But having to manually submit the newer signature to steal the other guys funds back for cheating is not very mass adoption friendly.

I'm quite sure you don't need to do this manually. The lightning node software is doing this for you automatically when it identify an unfair player.
But for that you have to be online (at least to be online again before the time lock of your channel partners transaction is reached).

It's correct that you don't need to be online 24/7 as this time lock is quite high. I think 1000 blocks or so, which are roughly 7 days. But I could be wrong with this. Better look up yourself if you want the correct time.
35  Other / Serious discussion / Re: How to mine less than 12,5 Btc?? on: March 16, 2018, 08:36:49 AM

Actually it is possible to create a coinbase transaction which pays less than the maximum possible amount.

Check this url about protocol rules https://en.bitcoin.it/wiki/Protocol_rules which explains all the checks which are done to ensure consensus.

Quote
...
"block" messages
...
15. Add block into the tree. There are three cases: 1. block further extends the main branch; 2. block extends a side branch but does not add enough difficulty to make it become the new main branch; 3. block extends a side branch and makes it the new main branch.
16. For case 1, adding to main branch:
  ...
  2. Reject if coinbase value > sum of block creation fee and transaction fees
...

To verify this statement I was also checking the bitcoin code what is actually implemented and I found this https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp#L2011-L2017

Code:
bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex,
                  CCoinsViewCache& view, const CChainParams& chainparams, bool fJustCheck)
{
...
    CAmount blockReward = nFees + GetBlockSubsidy(pindex->nHeight, chainparams.GetConsensus());
    if (block.vtx[0]->GetValueOut() > blockReward)
        return state.DoS(100,
                         error("ConnectBlock(): coinbase pays too much (actual=%d vs limit=%d)",
                               block.vtx[0]->GetValueOut(), blockReward),
                               REJECT_INVALID, "bad-cb-amount");
...

You can clearly see, that it's not allowed to reward more than the block reward + transaction fees, but anything equal or smaller than the block reward + transaction fees is fulfilling the consensus rules and is valid.

The question is just, if and why someone would not claim the maximum possible reward when mining a block.


Nevertheless that this situation is possible, I'm not sure if your example is actually doing this or if there is another reason like paxmao or teramit already explained.

If you could provide the block hash of your example we could give you a better reason what exactly happens with the block reward inside this block.
36  Bitcoin / Development & Technical Discussion / Re: Can someone please answer me on this with LN ? on: March 15, 2018, 01:16:09 PM
So if I open a channel and then shut down my PC for a few days, does the channel still remain open at all ?
The way I understand is this: you can turn off your PC for a short time, the PC wouldn't close the channel. The channel opening and closing are the two transactions, which hit the blockchain (aka fees). These transactions are created as multisig funding tx, with a hash, a timelock and some logic to increase/decrease values. Now the hash is the relevant part, it is used as a revocation key. So if your counterparty finds out, you are not "on" anymore, they might activate this revocation key and as such close the channel.
If they don't, you can switch on your PC, and continue to send the signatures(aka payment updates) for the updated transaction to your counterparty.
And then there is a timelock in the channel: if your PC happens to be "off" when timelock is approaching, this might also close the channel.
However, there is an incentive in the lightning channel to stay online, or vice versa, a punishment. If you hold channels open, and turn off your PC, then the counterparty might be "hostage" to you (or your PC), and would have to wait for the timeout of the channel. Also, if one of the parties tries to cheat by posting an outdated commitment transaction, the counterparty can take all the bitcoins in the channel. This provides a strong incentive not to cheat.

Better leave your system "on" !

The best summary I could get for this so far is here on bitcoin.stackexchange: https://bitcoin.stackexchange.com/questions/55310/do-parties-in-a-lightning-network-channel-need-to-be-online



Cool so basically the channel stays open till the timelock ends or the other party closes it manually ? My channel stays open otherwise ?

If the other party don't want to cheat on you and close the channel with the latest confirmed transaction, everything is fine.
The problems start if the other party close the channel with an old version of the transaction (where you get less coins than with the latest transaction) and you are offline. In this case you could lose coins..
If you are online and see this, you have the possibility to post a transaction where you can grab the coins of the other party.

Just an example:
Initial channel balance is 1 BTC from you and 1 BTC from the other party.
Then a transaction happens from the other party to you. Say you receive 0.2 BTC.
The current status of the channel (latest confirmed transaction) is 1.2 BTC for you, 0.8 BTC for the other side.

If the other party is closing the channel with the first transaction where he closes it with 1 BTC for him and you don't see it, he would be able to steal you those 0.2 BTC.
If you would be online and you recognize it, you could post a transaction (only then) to get the full 2 BTC from the channel.

This means, there is an incentive that all parties play fair and only post the last confirmed transaction and don't cheat. If someone cheats, and the other party see it, this party could then get the whole balance of the transaction and the cheater get nothing. That's the only reason why the lightning network works without trust on the other party.

But in case you are offline and don't have the possibility to see this kind of cheating on you, you would lose coins.

But I guess there will be possibilities (if not already possible with current implementations) to delegate this checks to someone who is online 24/7.
37  Bitcoin / Development & Technical Discussion / Re: Lightning - Question to understand atomic transactions over the network on: March 09, 2018, 06:24:20 AM
That's not how payment routing actually works. That's just the messaging protocol to transmit some information between nodes.

The actual payment part works through Hashed Time Locked Contracts (HTLCs). So node A offers a HTLC output to node B. In order for node B to spend from that HTLC (thus being paid by node A), he needs to provide the preimage to some hash in addition to his own signature. After some timeout, node A can take the money back with a signature of his own.

In LN, the HTLCs are used to make the payments between the nodes. They use the same hash so they all have the same hash pre-image required. So if any one HTLC is spent, all HTLCs in the route can be spent since the hash pre-image is revealed during the spend. If the hash preimage is never revealed, then the coins are never sent to the other party. This makes it atomic.

As a shortcut (to avoid on chain transactions for each HTLC) LN uses the onion routing method you described. The hash preimage is given to the recipient by the sender and that is transmitted to each node in the route so that they all have the hash preimage. Once both nodes in the channel have the hash preimage, they resolve the HTLC off chain. If some nodes are not able to transmit the hash preimage to settle the HTLC off chain, then the node that was able to settle with one peer but not the other can settle on-chain, and in doing so, reveals the hash preimage for the remaining nodes to settle (either on chain or off chain, as necessary). That node is incentivized to settle on chain because he would actually be losing money by not settling.

Thank you for your great answer. This was the missing link I had.
It's now clear for me and I can dig deeper into the details of the lightning protocol/network.
38  Bitcoin / Development & Technical Discussion / Re: Lightning - Question to understand atomic transactions over the network on: March 08, 2018, 05:36:06 AM
2) Sender is encrypting the selected route node by node (onion routing)

You could be right but how does the sender know what channels are open between each of the banking nodes
to be in a position to plan the route ?
...
Here is the current map if that helps you https://lnmainnet.gaben.win/

You answer your question by yourself.
With the link you provided you see the complete network. Each node has information about the exact same info like this site has. You know each node in the network with each capacity of every payment channel between two nodes. So by knowing this, the source can make whatever route it wants to reach the target (I think there is a limit of maximum 20 hops).

Different implementations may focus on different strategies to route to the target. But I guess the most will try to find the cheapest route which has enough capacity to send the coins.
39  Bitcoin / Development & Technical Discussion / Lightning - Question to understand atomic transactions over the network on: March 07, 2018, 02:35:24 PM

Hi,

I'm trying to deeply understand how the lightning network is working.

I understand how a payment channel between two nodes works, but I did not find out yet, how a more complex multi hop transaction is working in terms of an atomic transaction.

How does the network make sure, that all nodes are doing the transaction if everything is fine, or that no node is doing the transaction if any problem occurs (for example one of the selected nodes in the route is down).

I understand the network like this.

1) Sender is searching the best route through all nodes to reach the target.
2) Sender is encrypting the selected route node by node (onion routing)
3) Sender send coins to the first node using a payment channel between sender and first node
4) The next node decrypts the follow up node and continue sending coins to the next node over the next payment channel
5) continue with 4 until the target node is reached.

In my understanding, whenever I send something over the payment channel, this transaction is completed and not reversible (this is maybe the point where I'm wrong).
So, when I have 10 nodes in my selected route, and node 5 in my list is down. How does the network make sure, that the 4 nodes before are doing a rollback to give back the coins to the sender, so the sender can try a different route.

An explanation about this missing link I have would be great.

Thank you in advanced.
40  Local / Trading und Spekulation / Re: Steuern auf Bitcoin in Österreich? on: December 11, 2017, 08:17:33 AM

Hab meine bei Coinfinity, Bitpanda bzw. Coinbase gekauft.

Die führen jeweils eine Bestell-Historie. Damit kann man nachweisen wann man wie viele Coins zu welchem Preis gekauft hat.

Nehme an, dass auch andere Börsen das mit speichern.

Wenn man die Coins privat von Person zu Person kauft, (zB Localbitcoins) weiß ich nicht genau inwieweit die nicht vorhandenen Aufzeichnungen hier helfen.

Im Zweifel auf jeden Fall in einer Excel Tabelle jeden Kauf mit Datum und aktuellem Preis notieren. Vielleicht reicht das ja schon.
Pages: « 1 [2] 3 4 5 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!