Sure. For starters, tannic acid is a rust converter (I'll explain later), but not to any substantial degree and possibly not how you think. If you are going to reduce rust (reduction is the opposite of oxidation) you need a stronger solution of acid than you can obtain by boiling walnut hulls. Soaking traps in vinegar will reduce rust, as will other acids, like muratic acid.
I venture that you could soak your traps for a month in your tannic acid solution, and not remove an appreciable amount of rust from them. That tannic acid will however convert some of that surface rust to ferric tannate (I had to look that one up.) and forms a black layer that is actually somewhat water resistant -- like the blueing on a gun. But it is not a very substantial coating. (You wouldn't take your gun out and bury it in the dirt.) Also note that you cannot "dye" a trap unless in it rusty jn the first place. No rust, no reaction.
Just for an FYI, I knew a fellow who just kept a barrel full of oak bark and water. He would throw his traps in there, cold, and just leave them for a week or two. His traps came out just as black as if he had boiled them.
So back to the point, boiling traps in a tannic acid solution (oak bark, walnuts, sumac bark, logwood, etc.) is certainly good for coloration, and it does add a tiny degree of protection. However it should most definitely be followed up by wax.
Now, if you want to go to the trouble of soaking the rust off some traps with an acid, you may be able to get to the point that you will have shiny clean steel with no rust on it. But it will begin to rust just as soon as you remove the trap from the solution. (P.S. if you do that, you should boil those traps in baking soda or some other base solution to neutralize the acid.
What I'm saying is it is virtually impossible keep rust off a trap. Protect them as best you can but through use they are going to pick up some rust anyway. I personally don't think rust is a contaminant. Virtually everywhere you go, animals are encountering rusty bits of iron and it doesn't instill much curiosity (or danger) to their mental process.
Back to the point. I haven't used dye for a long, long time. Even with new traps I just boil them clean and wax them. The wax puts a protective film on them and seals up rust and all.
Endeavor to persevere.