Deuteronomy 6:25 "And if we are careful to obey all this law before the Lord our God, as He has commanded us, that will be our righteousness."
(When we live our lives, we live them in the sight of and before the Lord God Himself. We don't live and move in a vacuum or hidden away. We are always visible and under the gaze of the Lord. Nothing is hidden from Him. Since we are always seen by the Lord, He knows how we live our lives. And today He calls us to live righteously before Him. He not only charges us to obey Him and His laws, but He rewards our obedience and assigns our heart of obedience as righteousness in His sight.
He credits us with His great mercy.
Other places that this word for righteousness is used is translated alms.
The Lord grants us the charity of His mercy
as we commit ourselves to obey Him,
and He ascribes to us the very mercy of His righteousness.)