An Extended Public Key (xpub) can be used to generate a collection of Bitcoin addresses. There is a risk in sharing an xpub. It's possible for anyone who knows your xpub and one corresponding private key to calculate all the other private keys from its collection of addresses.
It's safe to use an xpub provided you make sure nobody ever discovers any of the private keys from the collection of addresses generated from it.
i dont know anything abut private keys & how to keep them safe :/
i will google it
if you have some links where i can read please share them
This linked article explains private keys and the xpub, but it's a bit technical. Although plenty of wallets use an xpub it's usually kept hidden from you. An example is the electrum wallet. It's perfectly safe to use provided you don't reveal the xpub or a private key to anyone else. If you add a password to it the file containing all the sensitive private key related data gets encrypted, so nobody can view it without the password. Just use a password in electrum to protect your private keys.
https://bitcoinmagazine.com/articles/deterministic-wallets-advantages-flaw-1385450276/...there are two major types of deterministic wallets currently in use: Electrum wallets and BIP32 wallets; they use a very similar algorithm, allowing them both to have the master public key property, although the BIP32 wallets go further by also including the hierarchy property
The problem is this: although you certainly can securely hand out child keys with no risk to the parent key, and you can hand out master public keys with no risk to the master private key, you cannot do both at the same time. The exploit for when that situation does arise is actually quite simple, and can be done with two lines of pybitcointools code.
If you want to safely store large amounts of Bitcoins either buy a hardware wallet like a trezor, or use cold storage.
This thread discusses trezor hardware wallets.
https://bitcointalksearch.org/topic/eshop-launched-trezor-bitcoin-hardware-wallet-122438This article explains cold storage using electrum.
http://docs.electrum.org/en/latest/coldstorage.html