Certain capital crimes, such as committing adultery with a betrothed maiden, carried the penalty of execution by stoning. The reality of stoning is quite different from what most people envision. In movies, the condemned is tied to a stake and pelted with stones. In reality, he was pushed off a small cliff. If the fall didn’t kill him, a rock was dropped on him. Only if this failed to do the job would he then be pelted by the people.
We have previously discussed the reason for capital punishment: even though it was rarely carried out, the possibility was meant to serve as deterrent to committing serious crimes.
As we have also discussed before, Ramban (Nachmanides) does not count the four methods of capital punishment to be four separate mitzvos, as the Rambam does. Instead, Ramban considers them all to be details of the general obligation to purge our communities of evil (Deuteronomy 17:7).
This mitzvah only applies in Temple times. It is discussed in the Talmud in tractate Sanhedrin on pages 45a-b. It is codified in the Mishneh Torah in the fifteenth chapter of Hilchos Sanhedrin and is #229 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos.