Let R be a *-ring containing a nontrivial self-adjoint idempotent. In this paper it is shown that under some mild conditions on R, if a mapping d : R → R satisfies d([U * , V ]) = [d(U) * , V ] + [U * , d(V)] for all U, V ∈ R, then there exists Z U,V ∈ Z(R) (depending on U and V), where Z(R) is the center of R, such that d(U + V) = d(U) + d(V) + Z U,V. Moreover, if R is a 2-torsion free prime *-ring additionally, then d = ψ + ξ, where ψ is an additive *-derivation of R into its central closure T and ξ is a mapping from R into its extended centroid C such that ξ(U + V) = ξ(U) + ξ(V) + Z U,V and ξ([U, V ]) = 0 for all U, V ∈ R. Finally, the above ring theoretic results have been applied to some special classes of algebras such as nest algebras and von Neumann algebras.