6 On the word of two or three witnesses, a man may be given the punishment of death; but he is not to be put to death on the word of one witness. 7 The hands of the witnesses will be the first to put him to death, and after them the hands of all the people. So you are to put away the evil from among you.

8 If you are not able to give a decision as to who is responsible for a death, or who is right in a cause, or who gave the first blow in a fight, and there is a division of opinion about it in your town: then go to the place marked out by the Lord your God; 9 And come before the priests, the Levites, or before him who is judge at the time: and they will go into the question and give you a decision: 10 And you are to be guided by the decision they give in the place named by the Lord, and do whatever they say: 11 Acting in agreement with their teaching and the decision they give: not turning to one side or the other from the word they have given you. 12 And any man who, in his pride, will not give ear to the priest whose place is there before the Lord your God, or to the judge, is to be put to death: you are to put away 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.