6 On the evidence of two or three witnesses the death sentence shall be executed; a person must not be put to death on the evidence of only one witness. 7 The hands of the witnesses shall be the first raised against the person to execute the death penalty, and afterward the hands of all the people. So you shall purge the evil from your midst.

8 If a judicial decision is too difficult for you to make between one kind of bloodshed and another, one kind of legal right and another, or one kind of assault and another-any such matters of dispute in your towns-then you shall immediately go up to the place that the Lord your God will choose, 9 where you shall consult with the levitical priests and the judge who is in office in those days; they shall announce to you the decision in the case. 10 Carry out exactly the decision that they announce to you from the place that the Lord will choose, diligently observing everything they instruct you. 11 You must carry out fully the law that they interpret for you or the ruling that they announce to you; do not turn aside from the decision that they announce to you, either to the right or to the left. 12 As for anyone who presumes to disobey the priest appointed to minister there to the Lord your God, or the judge, that person shall die. So you shall purge the evil from Israel.

Matthew Henry's Commentary on Deuteronomy 17:6-12

Commentary on Deuteronomy 17:1-7

(Read Deuteronomy 17:1-7)

No creature which had any blemish was to be offered in sacrifice to God. We are thus called to remember the perfect, pure, and spotless sacrifice of Christ, and reminded to serve God with the best of our abilities, time, and possession, or our pretended obedience will be hateful to him. So great a punishment as death, so remarkable a death as stoning, must be inflicted on the Jewish idolater. Let all who in our day set up idols in their hearts, remember how God punished this crime in Israel.

Commentary on Deuteronomy 17:8-13

(Read Deuteronomy 17:8-13)

Courts of judgment were to be set up in every city. Though their judgment had not the Divine authority of an oracle, it was the judgment of wise, prudent, experienced men, and had the advantage of a Divine promise.