Encode and Decode params for Phantom