When I use the
getbalance command in bitcoin-cli and I set
minconf to 1. Will it display the bitcoins with 1 confirmations and more? If this is true, what is a good amount of confirmations that will make the transaction safe but also fast?
To answer your question, yes, setting
1 will display the balance of your wallet that is summed up by combining the transactions in your wallet that have a minimum of
1 network confirmation.
Your secondary question is really a question between balancing the security of your transactions and the speed at which you wish to spend your funds, because waiting, say, 2 network confirmations will be faster (~20 minutes), but will not be confirmed long enough on the block chain for the transaction to be "secure".
This is essentially a form of the "50 percent attack":
An attacker that controls more than 50% of the network's computing power can, for the time that he is in control, exclude and modify the ordering of transactions. This allows him to: Reverse transactions that he sends while he's in control. This has the potential to double-spend transactions that previously had already been seen in the block chain. Prevent some or all transactions from gaining any confirmations Prevent some or all other miners from mining any valid blocks The attacker can't: Reverse other people's transactions Prevent transactions from being sent at all (they'll show as 0/unconfirmed) Change the number of coins generated per block Create coins out of thin air Send coins that never belonged to him With less than 50%, the same kind of attacks are possible, but with less than 100% rate of success. For example, someone with only 40% of the network computing power can overcome a 6-deep confirmed transaction with a 50% success rate. It's much more difficult to change historical blocks, and it becomes exponentially more difficult the further back you go. As above, changing historical blocks only allows you to exclude and change the ordering of transactions. It's impossible to change blocks created before the last checkpoint. Since this attack doesn't permit all that much power over the network, it is expected that no one will attempt it. A profit-seeking person will always gain more by just following the rules, and even someone trying to destroy the system will probably find other attacks more attractive. However, if this attack is successfully executed, it will be difficult or impossible to "untangle" the mess created -- any changes the attacker makes might become permanent.
The above was taken from https://en.bitcoin.it/wiki/Weaknesses
Hope this helps