update priv to pub post: fix code formatting, polish
update priv2pub code