what the man above said, and it's pretty much reserved for the most shameless of people who would do it in front of a crowd of people if you think about it. Unless they confessed on their own accordBetween these two posts of 1) Hadd being established through confesssion and the stringency of the 4 witnesses being an anti-slander measure based on hiding sin and honoring ppl 2) The prophet suggesting it's better to conceal one's sins.
What function does the punishment serve?