properly serialize tx to disk.