cardano-serialization-lib icon indicating copy to clipboard operation
cardano-serialization-lib copied to clipboard

CIP-0116 compatibility

Open klntsky opened this issue 1 year ago • 0 comments

This is a compatibility table between JSON representation layouts in CSL and the cardano json-schema CIP. (CIP-0116).


Why is this here?

The goal is to eventually synchronize CSL's JSON data layouts with the "standard" schema.


[x] means that the layout of a type in CSL is compatible with the JSON-schema (but not necessarily all the structural sub-components of the type! This just indicates whether there are changes needed in code for the type itself) [ ] means that there are some differences (that are listed below) [?] means that the compatibility hasn't been checked yet.


Babbage era

  • [x] Address - uses bech32
  • [?] AssetName
  • [ ] AuxiliaryData
    • does not include prefer_alonzo_format (CSL-specific)
  • [x] AuxiliaryDataHash
  • [ ] BaseAddress
    • CSL does not offer to_json
  • [ ] BigInt
    • CSL serializes as JSON number when used in PlutusData:
    > lib.PlutusData.new_integer(lib.BigInt.from_str('1239999999999999999999999999999999999999999')).to_json()
    Uncaught 'Integer 1239999999999999999999999999999999999999999 too big for our JSON support'
    > lib.BigInt.from_str('9999999999999999999').to_json()
    '"9999999999999999999"'
    
  • [?] Block
  • [x] BlockHash
  • [ ] BootstrapWitness
    • attributes is an array of numbers in CSL instead of hex(bytes)
    • chain_code is an array of numbers in CSL instead of hex(bytes)
  • [ ] ByronAddress
    • CSL does not offer to_json
  • [x] ByteString
  • [ ] Certificate
    • CSL does not use tag property
  • [ ] CostModels
    • CIP uses snake_case for field names
  • [ ] Credential
    • does not use tag property
  • [x] DNSName - DNSRecordSRV in CSL
  • [x] DataHash
  • [x] Ed25519KeyHash
  • [x] Ed25519PublicKey
  • [x] Ed25519Signature
  • [ ] EnterpriseAddress
    • CSL does not offer to_json
  • [x] ExUnitPrices
  • [x] ExUnits
  • [x] GenesisDelegateHash
  • [x] GenesisHash
  • [x] Header
  • [x] HeaderBody
  • [x] Int128
  • [ ] Ipv4
    • CSL represents as an array of 4 bytes, CIP represents as a string
  • [ ] Ipv6
    • CSL represents as an array of 12 bytes, CIP represents as a string
  • [x] KESSignature
  • [x] KESVKey
  • [ ] Language
    • CIP uses snake_case for enums
  • [ ] MIRPot
    • CIP uses snake_case for enums
  • [ ] Mint
    • incompatible
  • [ ] MoveInstantaneousRewards
    • CSL does not use tag property, CIP doesn't use MIREnumJSON
  • [x] MultiAsset
  • [ ] NativeScript
    • CSL does not use tag property
  • [ ] NetworkId
    • CIP uses snake_case for enums
  • [ ] NonZeroInt64
    • Not present in CSL
  • [x] OperationalCert
  • [ ] PlutusData
    • does not use tag property
  • [?] PlutusScript
  • [?] PlutusV1CostModel
  • [?] PlutusV2CostModel
  • [?] PointerAddress
  • [?] PoolMetadata
  • [?] PoolMetadataHash
  • [?] PoolParams
  • [?] PoolPubKeyHash
  • [ ] PosInt64
    • not used in CSL
  • [x] ProtocolParamUpdate
  • [x] ProtocolVersion
  • [x] Redeemer
  • [ ] RedeemerTag
    • CIP uses snake_case for enums
  • [ ] Relay
    • does not use tag property
  • [ ] RewardAddress
    • CSL does not offer to_json
  • [x] ScriptDataHash
  • [x] ScriptHash
  • [ ] ScriptRef
    • does not use tag property
  • [x] Transaction
  • [x] TransactionBody
  • [x] TransactionHash
  • [x] TransactionInput
  • [ ] TransactionMetadata
    • CIP is incompatible with GeneralTransactionMetadata: uses key/value pairs
  • [ ] TransactionMetadatum
    • does not use tag property
  • [ ] TransactionOutput
    • plutus_data uses different format (tagged)
  • [x] TransactionUnspentOutput
  • [ ] TransactionWitnessSet
    • rename vkeys field to vkeywitnesses
  • [x] UInt32
  • [x] UInt64
  • [x] URL
  • [x] UnitInterval
  • [x] Update
  • [ ] VRFCert
    • output and proof fields must be hexstrings
  • [x] VRFKeyHash
  • [x] VRFVKey
  • [ ] Value
    • property names do not match
  • [x] Vkeywitness

Conway era

TBD

klntsky avatar May 01 '24 16:05 klntsky