Stalin invented it before you :) The main problem with your idea is that people capable of valuable insight are notoriously rare in the prison population. Stalin though was able to work such problem around.
Google for Soviet Union "sharashka", in particular "sharashka Korolev USSR space program" :)