Romans 4:
[20] He staggered not at the promise of God through unbelief; but was strong in faith, giving glory to God;
[21] And being fully persuaded that, what he had promised, he was able also to perform.
[22] And therefore it was imputed to him for righteousness.
What was “it?”
“It” was the keeping of the commandments in belief!
The keeping of the commandments was “imputed” to him, not empty immaginary righteousness.
Willing obedience is the righteousness of Yehova.
If you don't have obedience, you have no faith.
.
the direct subject of “it” goes back to verse19, 20, and 21...that he did not stagger “at the promise of God through unbelief but was strong in faith”. That was the “it” that was imputed unto him for righteousness. Romans 4:19 cites the promise of God to Abraham that he would have a son thru Sara’s barren womb and he believed it.( See Genesis 18)!
That is your “it”...that Abraham believed what the “angel of the Lord” (who was that very I AM that existed before Abraham) told him regarding his having an heir from his own loins. His belief in God especially in this instance was what was imputed to him as “Christly Righteousness”...indeed as Genesis 18 goes on to speak of(”shall I not tell my servant what I am about to do?”), it was this righteousness that allowed Abraham to act as intercessor for any of the righteous folks who might be left in the cities of Sodom(he was no doubt thinking of his nephew Lot) and got a promise from God that he would not destroy the city if 10 righteous people still lived in the city!~!!!
So what work did Abraham do, that Paul should cite Genesis 18 in his writ of Romans 4? He simply believed in the promises of God...and that what was imputed unto him as righteousness!