Merge pull request #1708 from reaperhulk/serialize-shared-private-bytes

move private_bytes to a shared method so we can reuse it