.. Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. .. SPDX-License-Identifier: Apache-2.0 DAML-LF Value Specification =========================== **version 5, 29 May 2019** The DAML-LF language includes ways to define *data types*, specifications of structure, and includes rules by which a restricted subset of those data types are considered *serializable*. This specification, in concert with the ``value.proto`` machine-readable definition, defines a format by which *values* of *serializable DAML-LF types* may be represented. Only such *serializable values* may be stored on a ledger. Values are typically consumed in tandem with related DAML-LF type information, so many fields that may be inferred with this information are optional. For example, `message RecordField`_ names are defined as part of their respective LF datatypes, so there is no need to repeat that information in the record value. Do not read this without ``value.proto`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``value.proto`` defines the baseline rules for values; that file must be consulted in concert with this document for a full specification of DAML-LF values. Except where required for clarity, we do not repeat rules defined and enforced in that file within this document. When consulting the section on each message type, you must also refer to the same definition in ``value.proto`` for a full definition of the requirements for that message. This document is insufficiently detailed to construct a correct value; you must refer to ``value.proto`` as well to have a full set of rules. Do not read ``value.proto`` without this ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In the same fashion, ``value.proto`` by itself cannot be consulted for a full specification of the value format, because it is impossible to define all the requirements for values in the ``.proto`` format. All such rules are included in this document, instead. If you are constructing a DAML-LF value, it is not sufficient to merely conform to the structure defined in ``value.proto``; you must also conform to the rules defined in this document. A value that happens to conform to ``value.proto``, yet violates some rule of this document, is not a valid DAML-LF value. Backward compatibility ^^^^^^^^^^^^^^^^^^^^^^ DAML-LF values are accompanied by a version identifier; every change to ``value.proto`` entails a change to this specification, and every change to this specification introduces a unique new version. `Version history`_ defines a total ordering of all past versions; any version *y* not listed there should be considered *y>k* for any known version *k*. A value of version *n* may be interpreted by consulting any version of this document *m≥n*. Likewise, any version *q* of the value specification is sufficient to interpret values of any version *r≤q*. In other words, later versions of this specification preserve the semantics and parseability of earlier versions; there is no need to consult or implement older versions in order to interpret any value, and you may always simply consult the latest appropriate version. By contrast, a value of version *s* must be rejected by a consumer that implements this specification of version *t