Can someone please explain me how the dividend system works?
Of course. Let's start with the relevant use case from the design document:
BlockCredits are used solely to pay transaction fees on B&C. Community members with excellent reputations may propose to become BlockCredit custodians subject to shareholder approval. While the protocol permits shareholders to elect anyone to become a BlockCredit custodian for any purpose, it is expected that shareholders will elect BKC custodians that will make the BKC they receive available for sale at a variety of exchanges and venues. A BKC custodian may be a single entity or a group of entities using a multisig address to jointly control BKC they receive. Once sold, a BKS custodian will use the funds received to purchase Bitcoin and distribute it as dividends to all shareholders in proportion to their holdings.
In short, a BlockCredit (BKC) custodian will be given BKC to sell on an exchange through a shareholder vote. The custodian will sell the BKC for Bitcoin (or NBT, or USD), and then return the funds in the form of Bitcoin to all shareholders using the automated dividend function present in the protocol.
This mechanism is currently being used with great success in the NuBits and NuShares network. Here is a video showing how a custodian would distribute a dividend:
https://www.youtube.com/watch?v=MSVqMjAoYBgYou'll notice that there is a specific date and time set for the dividend. Dividends are automatically distributed based on the ownership of shares at a specific point in time. Once a custodian has announced that a dividend has been distributed to shareholders, you would open up your Bitcoin and BlockShares clients and then use a button that automatically imports the dividend into your Bitcoin wallet.
How do you prevent inside trading cheating when buying bitcoins in order to distribute dividends?
It is likely that regular dividends will occur, possibly every week or two. As such, the custodian will be required to publicly account for the funds they received. For example, they might say "I sold 10,433 BlockCredits this week on a BKC/BTC pair, and received 40.987 BTC in total" Or, if a BKC/USD trading pair was used, they could say "I sold 10,433 BlockCredits this week for 10,433 USD. I purchased 41.732 BTC at 250.00 USD with the USD funds received." Should a custodian try and "skim" some BTC off that dividend amount, it is likely that shareholders will switch to a more honest custodian. In the event of perceived dishonesty, shareholders could request that custodians share their trading logs to ensure that full value is being returned to shareholders.
Did that answer your questions?