The IRS, unsurprisingly, is way ahead of you on this one
http://www.irs.gov/taxtopics/tc420.html
and in fact you are obliged to report bartering income on your US taxes. Bartering, of course, remains perfectly legal, as long as you report it on your taxes.
Of course the IRS doesn't bother to enforce this on small-scale bartering. But if you set up a large-scale bartering network then they would. If you went one step further and threw in an intermediary system of "credits" so that transactions could take place indirectly (instead of swapping pigs for goats you swap pigs for credits and credits for goats) then they'd consider that as minting currency and take a rather dim view.