invkey is optional