A:
the Waliy of a woman in concluding the marriage contract has to be a Mukallaf (person meeting the conditions to be held legally accountable for their actions) and Rashid (rational). Otherwise, the judge will act as her Waliy because the Muslim ruler is the Waliy of those who have no Waliy and in turn a judge can represent the ruler. The person is considered Mukallaf when he reaches the age of puberty by ejaculating Maniy (sperms that are released on orgasm) with desire, whether in sexual dreams or otherwise, by having coarse pubic hair, or by reaching the age of fifteen. A person is considered Rashid when he is well-behaved and so is able to choose a suitable match for the woman in his charge. May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.