Does Islam allow punishment based on self confession ?

I fully understand the concept of Naskh and Mansukh. As long as you also have objections on Punishment of Rajam , we do not have anything to debate about.