"It was not through law that Abraham and his offspring received the promise that he would be heir of the world, but through the righteousness that comes by faith" (Romans 4:13)
Abraham's promise came four hundred and thirty years before the Law was given through Moses. Therefore it is impossible that the promise could ever come by the Law, it has to come by faith. Because faith was the original catalyst for the righteousness that the promise produced.
The Law was given to the Jews and the Law was intended for the Jews, not for the Gentiles. The purpose was to lead them to Christ. It acted as a schoolmaster or guardian to lead towards Christ and His appointed time. Therefore they were always to be justified by faith according to the promise to Abraham given centuries before the Law. ( Galatians 3:23-25 ).
Abraham's offspring was also to be recipients of the promise. The Jews assumed that the heirs were physical decedents of Abraham. However, the promise was that all nations on earth would be blessed by Abraham ( Genesis 12:3 ) and that he would be the father of many nations ( Genesis 17:4 ). However as Paul worded the promise in today's passage, Abraham was the heir of the world. So this removes any claim the Jews had, that they alone were sole beneficiaries of the promise of God.
So the promise comes by faith and the promise is offered to everyone who has faith in it. That faith is what obtains the righteousness that the Law could never provide. Today, the promise has been fulfilled in Jesus and the words spoken to Abraham in Genesis 12 have come to pass. The entire world has been blessed by Abraham and his example of faith.