What is righteous? How does it prosper oneself?

Thus says in the Qu’ran, if you are righteous, God shall bless you and you will attain prosperity.

Is it then true to say, those of the capitalist and rich people are righteous then, they did prosper. One rich man say, it is wrong to say that rich people are greedy, but the poor are greedy, because rich people give much of their fortune to charity, research, and to the poor. While the poor does not give anything usually.