Ibn Jurayj said to Ata (may Allah have mercy on him): "What is meant by khayr (good): wealth, or righteousness, or all of that?" He said: "We consider it to be nothing but wealth." I said: "And if he has no wealth but is a truthful man?" He said: "I do not reckon khayr to be anything but that: wealth and righteousness."
And Mujahid (may Allah have mercy on him) said about "if you know any good in them" [Surah al-Nur: 33]: "Wealth, whatever their character and their religion may be."
Imam al-Shafi'i (may Allah have mercy on him) said: "Khayr is a word whose intended meaning is known from the context in which it is addressed. Allah Almighty says: 'Indeed, those who believe and do righteous deeds, they are the best of creation' [Surah al-Bayyinah: 7], so we understood that they are the best of creation through faith and righteous deeds, not through wealth. And Allah Almighty says: 'And the sacrificial camels We have made for you among the symbols of Allah; for you therein is good' [Surah al-Hajj: 36], so we understood that the good here is the benefit of reward, not that the camels hold wealth for them. And He, the Mighty and Majestic, says: 'When death approaches one of you, if he leaves good' [Surah al-Baqarah: 180], so we understood that it means if he leaves wealth, because what is left behind is wealth, and (this is shown) by His saying: 'the bequest for parents and near relatives' [Surah al-Baqarah: 180]. So when Allah Almighty said: 'Make a contract with them if you know any good in them' [Surah al-Nur: 33], the most apparent of its meanings, by the indication of what we have deduced from the Book, was: strength to earn wealth, and trustworthiness; because a slave may be strong and earn, yet not pay if he is not trustworthy, and he may be trustworthy yet not strong enough to earn, so he does not pay."
Al-Shafi'i (may Allah have mercy on him) said: "'If you know wealth in your slave' is not the apparent meaning of the words, for two reasons: first, wealth is not 'in' him, it is only 'with' him, whereas what is in him is the earning capacity that brings wealth; second, the wealth in his hands belongs to his master." He said: "Perhaps whoever held that khayr means wealth meant that the slave had earned wealth for his master by his labour, and this indicates that he would earn wealth by which he could be freed, just as he earned it before."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21608