I've had an idea for a "smart gun" too. It basically replacing the primers with an electronic ignitor similar to ones used in kid's model rocketry. Then you can have a battery pack hidden in the stock that supplies the power to ignite the powder.