Reference

Matthew 5:17-20
The Ten Commandments

Jesus' righteousness was highlighted by the law and it was credited to believers.  Our sin is highlighted by the law and it was placed on Jesus.  We receive the blessings for Jesus' obedience to the law.  Jesus received the curse for our disobedience to the law.  Anyone receiving this gift also receives the gift of His Spirit, which leads them to obey the law as a thankful celebration of salvation, as opposed to obeying for their salvation.  Each of the Ten Commandments describes another facet of how He does both of those things:  He satisfied the Law's demands and He leads the forgiven.