Moved from pump-io/pump.io#658 and note that that issue has some references to code for this that we can possibly use.