Some of the captives taken on the day of Badr had no ransom to offer, so the Messenger of Allah ﷺ set their ransom as teaching the children of the Ansar how to write.One day a boy came crying to his father, who asked him, "What is the matter?"The boy replied, "My teacher hit me."The father said, "The wicked man is seeking revenge for Badr. By Allah, you shall never go to him again."
كان ناس من الأسرى يوم بدر لم يكن لهم فداء، فجعل رسول الله ﷺ فداءهم أن يعلموا أولاد الأنصار الكتابة، قال: فجاء غلام يوما يبكي إلى أبيه، فقال: ما شأنك؟ قال: ضربني معلمي قال: الخبيث يطلب بذهل بدر والله لا تأتيه أبدا.
Ahmad (2216) narrated it from Ali bin Asim, and Bayhaqi (6/322) narrated it through the route of Ali bin Asim and Khalid bin Abdullah, both of them from Dawud bin Abu Hind, who said, Ikrima narrated to us, from Ibn Abbas, who said, and then he related it. Its chain of transmission is hasan because of Ali bin Asim, for he is considered daif by most scholars, except that Imam Ahmad held a favorable opinion of him, and moreover he has been corroborated.His statement, "the dhihl," means vengeance, or enmity and rancor.Ibn Saad narrated in his Tabaqat (2/22), from Amir Shaybi in a mursal report, that he said, the Prophet ﷺ took seventy captives on the day of Badr, and they were ransomed according to the amount of their wealth. The people of Makkah could write, while the people of Madinah could not. So whoever had no ransom to pay was given ten boys from among the boys of Madinah to teach, and once they became proficient, that would serve as his ransom. He said, Zayd bin Thabit was among those who were taught. End of report.Ibn Tallaa said in his Aqdiyat Rasul Allah ﷺ (1/235–236), "Sometimes a captive would be ransomed on condition that he teach a number of Muslims writing. It is reported from the Prophet ﷺ that he had ten Muslims taught writing." Ibn Wahb said, "This was because the people of Madinah were not skilled in writing."