Many of the Psalms are written by David in the first person. He meditates on the Torah, which involves personalizing its teachings, and then creates songs that celebrate the truths in his own life. The reason that David could say of Yehovah that God was his righteousness has at least three bases:
- Yom Kippur
- God's merciful disposition
- David's prevailing during testing
For all Jews the forgiveness of sins is annually celebrated in the ritual of Yom Kippur:
Lev 16:21 And Aaron shall lay both his hands on the head of the live
goat, and confess over it all the iniquities of the people of Israel,
and all their transgressions, all their sins. And he shall put them on
the head of the goat and send it away into the wilderness by the hand
of a man who is in readiness. Lev 16:22 The goat shall bear all
their iniquities on itself to a remote area, and he shall let the goat
go free in the wilderness.
When the priest emerges alive from the holiest place and all the people chase the goat into the wilderness, bearing their iniquity there is a profound understanding that their sins have been forgiven.
Lev 16:30 For on this day shall atonement be made for you to cleanse
you. You shall be clean before the LORD from all your sins.
- God's merciful disposition
The Torah records:
Exo 34:6 The LORD passed before him and proclaimed, "The LORD, the
LORD, a God merciful and gracious, slow to anger, and abounding in
steadfast love and faithfulness, Exo 34:7 keeping steadfast love for
thousands, forgiving iniquity and transgression and sin, but who will
by no means clear the guilty [of consequences], visiting the iniquity
of the fathers on the children and the children's children, to the
third and the fourth generation."
Notice that this is a description of Yehovah's merciful disposition, not of any particular ritual. The Torah did not have a provision for murder ("blood guiltiness") so could not seek atonement in the Torah. Instead he fell back upon God's gracious nature:
Psa 51:1 To the choirmaster. A Psalm of David, when Nathan the
prophet went to him, after he had gone in to Bathsheba. Have mercy on
me, O God, according to your steadfast love; according to your
abundant mercy blot out my transgressions. Psa 51:2 Wash me
thoroughly from my iniquity, and cleanse me from my sin! Psa 51:3
For I know my transgressions, and my sin is ever before me. Psa 51:4
Against you, you only, have I sinned and done what is evil in your
sight, so that you may be justified in your words and blameless in
your judgment. Psa 51:5 Behold, I was brought forth in iniquity, and
in sin did my mother conceive me. Psa 51:6 Behold, you delight in
truth in the inward being, and you teach me wisdom in the secret
heart. Psa 51:7 Purge me with hyssop, and I shall be clean; wash me,
and I shall be whiter than snow. Psa 51:8 Let me hear joy and
gladness; let the bones that you have broken rejoice. Psa 51:9 Hide
your face from my sins, and blot out all my iniquities. Psa 51:10
Create in me a clean heart, O God, and renew a right spirit within me.
Psa 51:11 Cast me not away from your presence, and take not your Holy
Spirit from me. Psa 51:12 Restore to me the joy of your salvation,
and uphold me with a willing spirit. Psa 51:13 Then I will teach
transgressors your ways, and sinners will return to you. Psa 51:14
Deliver me from bloodguiltiness, O God, O God of my salvation, and my tongue will sing aloud of your righteousness.
So note particularly that he says he will publicly celebrate "God's righteousness", which is what he does in Psalm 4:1, which we are discussing.
Now, Moses says that God is forgiving but rather than completely erasing the consequences he visits upon a few generations the consequences of their disobedience. So when David killed Uriah and took Bathsheba as his wife he sent Nathan to announce that there would be consequences in the next generation, which there were:
2Sa 12:10 Now therefore the sword shall never depart from your house,
because you have despised me and have taken the wife of Uriah the
Hittite to be your wife.' 2Sa 12:11 Thus says the LORD, 'Behold, I
will raise up evil against you out of your own house. And I will take
your wives before your eyes and give them to your neighbor, and he
shall lie with your wives in the sight of this sun. 2Sa 12:12 For
you did it secretly, but I will do this thing before all Israel and
before the sun.'" 2Sa 12:13 David said to Nathan, "I have sinned
against the LORD." And Nathan said to David, "The LORD also has put
away your sin; you shall not die. 2Sa 12:14 Nevertheless, because by
this deed you have utterly scorned the LORD, the child who is born to
you shall die."
So in Psalm 3 and 4 we see David "singing aloud of God his righteousness" and we see no mention of his guilt. His failures brought upon himself the consequences but he does not associate his troubles with his guilt:
Psa 3:1 A Psalm of David, when he fled from Absalom his son. O LORD,
how many are my foes! Many are rising against me; Psa 3:2 many are
saying of my soul, there is no salvation for him in God. Selah. Psa
3:3 But you, O LORD, are a shield about me, my glory, and the lifter
of my head. Psa 3:4 I cried aloud to the LORD, and he answered me
from his holy hill. Selah. Psa 3:5 I lay down and slept; I woke
again, for the LORD sustained me. Psa 3:6 I will not be afraid of
many thousands of people who have set themselves against me all
around. Psa 3:7 Arise, O LORD! Save me, O my God! For you strike all
my enemies on the cheek; you break the teeth of the wicked. Psa 3:8
Salvation belongs to the LORD; your blessing be on your people! Selah.
Not that he isn't aware that this is the harvest of his behavior but that the guilt part has been removed and his focus now is on the complete way in which the mercy of God has provided him with a clean slate.
- David's prevailing during testing and emerging with a clear conscience
David has gained confidence in God and his good standing with God because he has been tried by God and found faithful and his conscience is clear:
Psa 17:1 A Davidic Prayer. LORD, hear my just plea! Pay attention to
my cry! Listen to my prayer, since it does not come from lying lips.
Psa 17:2 Justice for me will come from your presence; your eyes see
what is right. Psa 17:3 When you probe my heart, and examine me at
night; when you refine me, you will find nothing wrong, for I have
determined that I will not transgress with my mouth. Psa 17:4 As for
the ways of mankind, I have, according to the words of your lips,
avoided the ways of the violent. Psa 17:5 Because my steps have held
fast to your paths, my footsteps have not faltered. Psa 17:6 I call
upon you, for you will answer me, God. Listen closely to me and hear
my prayer. Psa 17:7 Show forth your gracious love, save those who
take refuge in you from those who rebel against your sovereign power.
Psa 17:8 Protect me as the most precious part of the eye; hide me
under the shadow of your wings Psa 17:9 from the wicked who have
afflicted me, from my enemies who have surrounded me. Psa 17:10 They
are imprisoned by their own prosperity, they have boasted proudly with
their mouth. Psa 17:11 Now they have encircled our paths and are
determined to cast us down to the ground. Psa 17:12 Like a lion they
desire to rip us to pieces, like a young lion waiting in ambush. Psa
17:13 Arise, LORD, confront them, bring them to their knees! Deliver
me from the wicked by your sword— Psa 17:14 from men, LORD, by your
hand—from men who belong to this world, whose reward is only in this
life. But as for your treasured ones, may their stomachs be full, may
their children have an abundance, and may they leave wealth to their
offspring. Psa 17:15 But as for me, justified, I will behold your
face; when I awake, your presence will satisfy me.
For the NT saint, the goat of Yom Kippur becomes the Messiah. That role as sin bearer was prophesied by Isaiah:
Isa 53:6 All we like sheep have gone astray; we have turned—every
one—to his own way; and the LORD has laid on him the iniquity of us
And this carrying away of the sins of the people is persisted in the new priesthood:
Heb 9:28 so Christ, having been offered [as priest to God] once to
bear [carry off] the sins of many, will appear a second time, not to
deal with sin but to save those who are eagerly waiting for him.