This may be a dumb idea, but what about a national firearms permit?
With this permit you could buy/sell a firearm and buy ammo or primers.
You could sell in a private sale to any other permit holder. This could also be used as a concelled carry permit were legal.
You get the permit automatically if you are law enforcement, active military or discharged military with an honorable discharge. All other must go through gun safety and firearms training at their own expense. Those trained will have to have at least three trainers. Any trainer may flag a trainee as "unstable" and require a review process before the permit is issued.
All those with criminal records, no honorable discharge or mental health issues will be disqualified.
I know that we view firearms ownership as a right, not a privilege so there might be some difficulty in crafting legislation.