<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- PRIVATE working draft -02. Not posted, not submitted, not sent. Revised 1 December 2026 so that the document no longer claims to update RFC 6238; it builds on RFC 6238. Includes live and pressure test results added 30 November 2026. -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     category="exp"
     docName="draft-rigopoulos-totp-offline-audit-02"
     indexInclude="true"
     ipr="trust200902"
     submissionType="independent"
     sortRefs="true"
     symRefs="true"
     tocInclude="true"
     version="3"
     xml:lang="en">
  <front>
    <title abbrev="TOTP Offline Time and Viewed Records">TOTP with an Offline Time Source and a Prover-Side Viewed Record</title>
    <seriesInfo name="Internet-Draft" value="draft-rigopoulos-totp-offline-audit-02"/>
    <author fullname="E. A. Rigopoulos" initials="E. A." surname="Rigopoulos">
      <organization>YPS Services LLC</organization>
      <address>
        <email>ea.rigopoulos@ypsservices.com</email>
        <uri>https://ypsservices.com/</uri>
      </address>
    </author>
    <date day="1" month="December" year="2026"/>
    <area>Security</area>
    <workgroup>Independent Submission</workgroup>
    <keyword>TOTP</keyword>
    <keyword>HOTP</keyword>
    <keyword>OTP</keyword>
    <keyword>offline</keyword>
    <keyword>viewed record</keyword>
    <abstract>
      <t>
        This document builds on RFC 6238 and does not update or replace it.
        It specifies two optional mechanisms, compatible with RFC 6238,
        for use with the Time-Based One-Time Password (TOTP) algorithm.  It specifies an Offline Time Source profile in
        which the prover derives Unix time from a local clock that has no
        network dependency, together with a declared maximum drift rate and a
        method for measuring that rate against a trusted reference.  It also
        specifies an append-only viewed record written on the prover when a
        TOTP value is displayed or copied, and optional verifier behaviour
        that uses that record to reject or flag an OTP accepted at a time-
        step the device never recorded as viewed.  This document also describes an
        optional Reference Device role, guidance for new hardware including
        offline crypto wallets, an optional binding of a viewed record to
        the action or transaction for which the code was displayed, and
        test results from a local simulation of verifier behaviour.  The
        TOTP value itself is computed exactly as in RFC 6238.  A viewed
        record detects unviewed or wrong-step OTPs; it does not prevent
        acceptance unless the verifier checks the record.  This document is
        Experimental.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro">
      <name>Introduction</name>
      <t>
        This document specifies a method that builds on <xref target="RFC6238"/>, which defines TOTP as
        an extension of the HMAC-based One-Time Password (HOTP) algorithm in
        <xref target="RFC4226"/>.  It does not update, obsolete, or modify
        RFC 6238 (see <xref target="relationship"/>).  The moving factor in RFC 6238 is a time-step counter
      </t>
      <artwork>
T = floor((Current Unix time - T0) / X)
      </artwork>
      <t>
        with a default time-step size X of 30 seconds and a default origin T0
        of 0 (the Unix epoch).  Requirement R1 in Section 3 of <xref target="RFC6238"/> says
        the prover and the verifier MUST know or be able to derive the
        current Unix time.  It does not say how that time is obtained, and it
        does not require or forbid a network time source.
      </t>
      <t>
        Section 5.2 of <xref target="RFC6238"/> observes that a validation system does not
        know the client's exact timestamp when an OTP was generated.  It says
        a verifier SHOULD set a policy for an acceptable delay window,
        RECOMMENDS that at most one time-step is allowed as the network
        delay, and requires that, after a successful validation, the verifier
        MUST NOT accept the same OTP again.  Section 6 RECOMMENDS a limit on
        clock drift and a resynchronisation procedure.  Neither section
        specifies a clock implementation, and neither defines a record on the
        prover of when a code was displayed or copied.
      </t>
      <t>
        In common deployment a verifier accepts the previous, current, and
        next step (a "+/- 1" window).  Under that policy, three different
        codes can be valid at once and a given code remains acceptable for 90
        seconds.  The one-time-use rule in Section 5.2 applies only at that
        verifier and only after it has already accepted that OTP.  It does
        not block a different adjacent-step code, and it cannot show whether
        a code in the window was ever viewed on the device.
      </t>
      <t>
        This document specifies the following optional mechanisms, which are used together with <xref target="RFC6238"/> and do not change it:
      </t>
      <ul>
        <li>
          an Offline Time Source profile, in which the prover derives Unix
          time from a local clock with no network dependency, a declared
          maximum drift rate D_max, a resynchronisation procedure, and a
          measurement method;
        </li>
        <li>
          applicability of that profile to devices built or upgraded with a
          qualifying local real-time clock, including new hardware and
          offline crypto wallets, together with battery-status reporting
          (<xref target="hw-applicability"/>);
        </li>
        <li>
          an optional Reference Device role that provides signed time
          messages as a trusted local reference (<xref target="ref-device"/>);
        </li>
        <li>
          a prover-side viewed record, written when a TOTP value is
          displayed or copied, containing the time-step T, a truncated keyed
          digest of the code (not the plaintext OTP), a local viewed
          timestamp, and a monotonic sequence number;
        </li>
        <li>
          an optional binding of that record to an identifier or digest of
          the action or transaction for which the code was displayed
          (<xref target="tx-binding"/>);
        </li>
        <li>
          an optional verifier check that uses the record to reject or flag
          an OTP associated with a step the device never recorded as viewed,
          which narrows the effective +/- 1 window for unviewed neighbour
          steps; and
        </li>
        <li>
          a requirement that a verifier that implements this document apply the
          one-time-use rule that already exists in Section 5.2 of
          <xref target="RFC6238"/> atomically (<xref target="atomic-check"/>).
        </li>
      </ul>
      <t>
        The TOTP calculation is unchanged.  Provers and verifiers that
        implement only <xref target="RFC6238"/> remain interoperable with implementations of
        this document.  This document is Experimental because the time-source
        profile, the record format, the optional verifier check, the
        Reference Device role, and the optional transaction binding need
        implementation and operational experience, including privacy and
        deployment practice, before any later revision is considered.
      </t>
    </section>

    <section anchor="conventions">
      <name>Conventions and Definitions</name>
      <t>
        The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in BCP
        14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all
        capitals, as shown here.
      </t>
    </section>
    <section anchor="terminology">
      <name>Terminology</name>
      <dl newline="true">
        <dt>Prover</dt>
        <dd>The token or application that computes a TOTP value, as in <xref target="RFC6238"/>.</dd>
        <dt>Verifier</dt>
        <dd>The validation system that accepts or rejects a TOTP value.</dd>
        <dt>Time-step T</dt>
        <dd>The integer moving factor defined in Section 4.2 of <xref target="RFC6238"/>.</dd>
        <dt>D_max</dt>
        <dd>
          The maximum allowed fractional frequency error of a local
          clock, in parts per million (ppm), declared by an implementation
          of the Offline Time Source profile.  A declaration of D_max
          MUST state the temperature range over which it applies.
        </dd>
        <dt>Viewed record</dt>
        <dd>
          An append-only entry written by the prover when a TOTP
          value for a given T is displayed or copied to the user.
        </dd>
        <dt>Audit mode</dt>
        <dd>
          Optional verifier behaviour that accepts TOTP values as
          in <xref target="RFC6238"/> and later compares them with viewed records, flagging
          mismatches.
        </dd>
        <dt>Enforce mode</dt>
        <dd>
          Optional verifier behaviour that, at validation time,
          requires a viewed record for the accepted time-step and rejects
          the OTP if no such record is provided.
        </dd>
        <dt>Reference Device</dt>
        <dd>
          An optional standalone device that keeps a higher-quality
          local clock and issues signed time messages that a prover may use
          as a trusted reference under <xref target="resync"/>.
        </dd>
        <dt>Action identifier</dt>
        <dd>
          An optional identifier or digest, carried in a viewed
          record, of the action or transaction for which a TOTP value was
          displayed, as specified in <xref target="tx-binding"/>.
        </dd>
      </dl>
    </section>

    <section anchor="ots">
      <name>Offline Time Source</name>
      <t>
        An implementation that claims the Offline Time Source profile defined
        here MUST derive the "Current Unix time" used in Section 4.2 of
        <xref target="RFC6238"/> from a local clock, with no network protocol required to
        compute T or the TOTP value.  The profile does not change X, T0, the
        hash function, the digit count, or the truncation of <xref target="RFC6238"/>.
      </t>
      <t>
        This document does not specify a particular clock part or product.
        Any local real-time clock, including a temperature-compensated
        crystal oscillator or a similar time source, may be used if it meets
        the declared D_max and the measurement method in <xref target="measurement"/>.
      </t>

      <section anchor="dmax">
        <name>Maximum Drift Rate</name>
        <t>
          An implementation of this profile MUST declare a maximum drift rate
          D_max in ppm.  D_max is a bound on the absolute fractional frequency
          error of the local clock relative to a trusted reference after the
          clock has been set.  The declaration MUST state the temperature
          range over which D_max applies.  A figure quoted for a narrower
          range (for example 0 degrees C to +40 degrees C) MUST NOT be used
          as D_max outside that range.  Under a constant-rate model, the time
          in days for the accumulated offset to reach a threshold of S seconds is
        </t>
        <artwork>
t_days = S / (|D_max| * 10^-6) / 86400
        </artwork>
        <t>
          Implementations SHOULD NOT declare a D_max greater than 20 ppm.  A
          tighter class (for example 2 ppm) MAY be declared if the measurement
          method supports it.  The values 2 ppm and 20 ppm are model classes
          for illustration and default policy; they are not measurements of any
          particular device.  A declared class of 2 ppm does not mean that the
          clock has no drift.  Even at 2 ppm, under the constant-rate model,
          the accumulated offset reaches one default time-step (30 seconds) in
          about 174 days, as calculated below.
        </t>
        <t>
          At 20 ppm, the model reaches a 15-second offset in 8.681 days and a
          30-second offset (one default time-step) in 17.361 days.  At 2 ppm
          those intervals are 86.806 days and 173.611 days.  Any nonzero offset
          of at most one time-step already requires a verifier window of +/- 1
          if the prover's current code is to be accepted at every phase of the
          step.  The moment the offset exceeds X seconds, a window of +/- 2 is
          required.  Implementations SHOULD set or compare the local clock
          against a trusted reference often enough that the expected offset
          remains at most one time-step, given the declared D_max.
        </t>
      </section>

      <section anchor="resync">
        <name>Setting and Resynchronisation</name>
        <t>
          When the local clock is first set, and whenever the measured offset
          exceeds a configured threshold, the clock MUST be set from a trusted
          reference.  That threshold SHOULD be no greater than one time-step X.
          The trusted reference MAY be a network time protocol, a satellite
          time source, or another local reference of known quality, including a
          Reference Device as specified in <xref target="ref-device"/>.  Use of a
          network protocol to set the clock does not remove the requirement
          that ordinary TOTP generation under this profile proceed without a
          network dependency.
        </t>
        <t>
          Re-synchronisation means that the device's Unix time is checked
          against a trusted reference and, if required, set from that
          reference.  It does not generate, rotate, or replace the shared TOTP
          secret.  A new shared secret is obtained only by a separate
          enrolment or re-enrolment procedure.
        </t>
        <t>
          If the accumulated offset is larger than the verifier's accepted
          window, automatic resynchronisation as described in Section 6 of
          <xref target="RFC6238"/> may not be sufficient.  In that case an additional
          authentication measure SHOULD be used before the clock is set, as
          already recommended in that section.
        </t>
      </section>
      <section anchor="measurement">
        <name>Measurement Method</name>
        <t>
          An implementation that claims a D_max MUST be able to demonstrate it
          by the following method, or by a method of equal or greater rigour.
        </t>
        <ol>
          <li>
            Set the local clock from a trusted reference and record the
            device Unix time and the reference Unix time.
          </li>
          <li>
            Once per day, for at least 14 consecutive days (28 days is
            RECOMMENDED), record both Unix times again.  The reference SHOULD
            be NTP, a satellite time source, or a Reference Device whose own
            last trusted sync and D_max are known.
          </li>
          <li>
            Compute the daily offset (device seconds minus reference
            seconds), the maximum absolute offset, and a least-squares
            estimate of rate in ppm over the interval.
          </li>
          <li>
            The claim holds if the estimated rate and the projected offset
            remain within D_max and within one time-step over the intended
            service interval, for the temperature range stated with D_max.
          </li>
        </ol>
        <t>
          This method is a laboratory or operational check of a clock class.
          It is not a substitute for a published measurement of a specific
          shipped device.
        </t>
      </section>

      <section anchor="hw-applicability">
        <name>Applicability to New Hardware and Existing Devices</name>
        <t>
          The Offline Time Source profile applies to a device that is built,
          or later upgraded, with a local real-time clock that can keep time
          without a network, meets a declared D_max over a stated temperature
          range, and can be measured as in <xref target="measurement"/>.  Typical
          qualifying clocks include a battery-backed RTC or a crystal
          oscillator with temperature compensation (for example a TCXO RTC).
          The profile is a requirement that new designs MAY adopt.  This
          document makes no claim that any existing commercial product already
          meets it.
        </t>
        <t>
          A device that has no independent local real-time clock, and that
          obtains Unix time from a host operating system or from the host on
          each use, MUST NOT claim the Offline Time Source profile.  Such a
          device MAY still implement the viewed record in <xref target="viewed-record"/>,
          because that record does not depend on the source of time.
        </t>
        <t>
          Offline crypto wallets and similar tokens are a natural application
          of the profile: a wallet that never touches a network still needs a
          trustworthy local time-step in order to compute TOTP, and a declared
          D_max gives a verifier a stated reason to keep a narrow window.
          Existing wallet models that take time from a host, and that have no
          qualifying RTC, would not meet the profile unless upgraded.  The
          viewed record, and the optional transaction binding in
          <xref target="tx-binding"/>, can be adopted independently of the clock
          source and are therefore available to current hardware as well.
        </t>
        <t>
          An example microcontroller and RTC combination that could be used
          for laboratory evaluation is described in <xref target="impl-status"/>.  That
          description is an example only.  It is not a measurement under
          <xref target="measurement"/>, and it is not a statement about any shipping
          product.
        </t>
      </section>

      <section anchor="battery">
        <name>Battery Status</name>
        <t>
          A battery-backed implementation of this profile SHOULD report the
          status of the clock's backup supply (for example a low-battery
          indication or a measured backup voltage) to the user or to a
          managing application.  When the backup supply is low, missing, or
          otherwise indicated as insufficient, the implementation MUST treat
          the local clock as untrusted until the clock has been set again
          from a trusted reference as in <xref target="resync"/>.  Codes MAY still be
          generated in that state, but an implementation that claims the
          profile MUST NOT present them as satisfying the declared D_max.
        </t>
        <t>
          Battery life MAY be estimated from the cell's datasheet capacity and
          the RTC's timekeeping current, taking into account self-discharge
          and any additional current drawn by the module.  This document does
          not publish a battery-life figure for any cell or module.  An
          implementer who publishes such a figure MUST cite the capacity and
          current values used and the conditions under which they apply.
        </t>
        <t>
          Battery life and calendar age are not measures of clock accuracy.
          They MUST NOT be used to rank a device as a trusted time reference;
          see <xref target="ref-ranking"/>.
        </t>
      </section>
      <section anchor="ref-device">
        <name>Reference Device</name>
        <t>
          A deployment MAY use a standalone Reference Device as the "local
          reference of known quality" permitted by <xref target="resync"/>.  The role is
          optional.  Ordinary TOTP generation under the Offline Time Source
          profile remains possible without one, provided the prover's own
          clock has been set from some trusted reference and remains within
          the configured offset threshold.
        </t>

        <section anchor="ref-role">
          <name>Role and Clock Quality</name>
          <t>
            A Reference Device keeps a local clock of higher quality than the
            provers that rely on it and issues signed time messages to those
            provers over a local link.  Suitable clock classes include a
            GPS-disciplined oscillator, a radio-controlled clock, or a
            temperature-controlled crystal that is itself periodically checked
            against a trusted time source.  This document does not specify a
            particular part.
          </t>
          <t>
            The local link MAY be Bluetooth, NFC, USB, or a local network.
            The profile still requires that generating a TOTP value does not
            depend on a network protocol; a prover may remain offline between
            syncs.
          </t>
        </section>

        <section anchor="ref-message">
          <name>Signed Time Message</name>
          <t>
            A time message from a Reference Device MUST contain at least the
            following fields, and the signature or MAC MUST cover all of them:
          </t>
          <ul>
            <li>a format version;</li>
            <li>the reference Unix time at the moment of issue;</li>
            <li>the Reference Device's declared D_max and the temperature range over which that D_max applies;</li>
            <li>the Unix time of the Reference Device's own last sync from a trusted source; and</li>
            <li>an identifier of that last trusted source, if known.</li>
          </ul>
          <t>
            The message MUST be authenticated so that a prover can detect
            forgery or alteration.  The authentication key or public key is
            provisioned to the prover by an authenticated procedure that is
            out of scope of this document.  The concrete encoding and the
            signature or MAC algorithm are agreed at provisioning.  A JSON
            <xref target="RFC8259"/> object is a suitable illustrative encoding:
          </t>
          <sourcecode type="json">
{
  "v": 1,
  "ref_unix": 1764547200,
  "d_max_ppm": 2,
  "d_max_temp": "0C..+40C",
  "last_sync_unix": 1764460800,
  "last_sync_source": "gnss",
  "alg": "Ed25519",
  "sig": "...hex..."
}
          </sourcecode>
          <t>
            The example is illustrative.  It is not a test vector, and the
            signature value is omitted.
          </t>
        </section>

        <section anchor="ref-offset">
          <name>Measuring and Applying an Offset</name>
          <t>
            When a prover receives an authentic time message, it MUST compute
            the offset as device Unix time minus the reference Unix time
            carried in the message, and it SHOULD log that offset, the
            reference identifier, and the time of comparison.  The prover
            MUST NOT reset its clock from the message unless the absolute
            offset exceeds the configured threshold, which SHOULD be no
            greater than one time-step X, as already required in
            <xref target="resync"/>.  If the offset is larger than the verifier's
            accepted window, the additional authentication measure in
            <xref target="resync"/> still applies before the clock is set.
          </t>
          <t>
            A prover MUST ignore a message that fails authentication, and
            SHOULD ignore a message whose claimed last-sync time is older
            than a configured limit or whose declared D_max is worse than the
            prover will accept.
          </t>
        </section>

        <section anchor="ref-ranking">
          <name>Ranking References</name>
          <t>
            If more than one candidate reference is available, a prover
            SHOULD prefer the candidate with the tighter declared D_max and,
            if those are equal, the more recent authenticated last trusted
            sync.  A prover MUST NOT rank references by battery life, by
            advertised remaining capacity, or by the age or "newness" of the
            device.  Those properties do not measure frequency error, and a
            newer or longer-lived clock can still be unset, poorly
            characterised, or tampered with.
          </t>
          <t>
            Provers MUST NOT treat one another as trusted references merely
            because they implement this profile.  Unauthenticated
            peer-to-peer copying of time, including a policy of following
            whichever peer reports the longest battery life, is a
            tamper-propagation risk: a single wrong or compromised clock can
            move the others (see <xref target="security"/>).
          </t>
        </section>

        <section anchor="ref-software">
          <name>Software Sync Path</name>
          <t>
            A software application MAY provide the passage through which a
            prover obtains a signed time message from a Reference Device or
            from another trusted reference, for example over USB or another
            local link, without itself being the clock source.  The author's
            Last Viewed software is one such application that could provide
            that sync path.  This document does not claim that any particular
            software release already implements the path, and it makes no
            claim about the clock specifications of any hardware used with
            that software.
          </t>
        </section>
      </section>
    </section>
    <section anchor="viewed-record">
      <name>The Viewed Record</name>
      <t>
        When a TOTP value is displayed or copied, a prover that implements
        viewed records MUST append a record for the corresponding time-step
        T.  Records MUST be append-only: an implementation MUST NOT alter or
        delete an earlier record except as part of a documented, integrity-
        preserving rotation or expiry policy.  The plaintext OTP MUST NOT be
        stored in the record; a truncated keyed digest is stored instead.
      </t>

      <section anchor="record-fields">
        <name>Record Fields</name>
        <t>Each record contains at least the following fields:</t>
        <dl newline="true">
          <dt>v</dt>
          <dd>Format version.  This document defines version 1.</dd>
          <dt>seq</dt>
          <dd>
            A monotonic sequence number.  The first record on a prover MUST
            use seq = 1.  Each later record MUST use a seq greater than all
            earlier records on that prover.
          </dd>
          <dt>T</dt>
          <dd>The time-step counter of the viewed TOTP value, as in <xref target="RFC6238"/>.</dd>
          <dt>viewed</dt>
          <dd>
            The local time of the view, as an RFC 3339 UTC timestamp with
            a "Z" suffix and second precision (for example,
            1970-01-01T00:00:59Z).
          </dd>
          <dt>digits</dt>
          <dd>The TOTP digit count (typically 6 or 8).</dd>
          <dt>alg</dt>
          <dd>The TOTP hash algorithm: "SHA1", "SHA256", or "SHA512".</dd>
          <dt>digest</dt>
          <dd>
            Lowercase hexadecimal encoding of the leftmost 8 octets of
            the viewed-code MAC defined below.
          </dd>
          <dt>mac</dt>
          <dd>
            RECOMMENDED when a record is exported or sent to a verifier.
            Lowercase hexadecimal encoding of the leftmost 16 octets of the
            covering MAC defined below.
          </dd>
          <dt>action</dt>
          <dd>
            OPTIONAL.  Present when the transaction-binding extension of
            <xref target="tx-binding"/> is used.  Lowercase hexadecimal encoding of an
            identifier or digest of the action or transaction for which the
            code was displayed, as specified in that section.  When this
            field is absent, the covering MAC is computed exactly as in
            the preceding revision of this document, so the test vectors in
            <xref target="test-vectors"/> remain unchanged.
          </dd>
        </dl>
        <t>The viewed-code digest is:</t>
        <artwork>
HMAC-SHA-256(K,
    "TOTP-VIEWED" || 0x00 || uint64be(T) || ASCII(code))
        </artwork>
        <t>
          where K is the shared TOTP secret, uint64be(T) is T as an 8-octet
          big-endian unsigned integer, and ASCII(code) is the exact decimal
          digit string of the viewed OTP, including leading zeros.  The ASCII
          label is the 11-octet string %x54.4F.54.50.2D.56.49.45.57.45.44.
        </t>
        <t>
          The covering MAC, when the action field is absent, is:
        </t>
        <artwork>
HMAC-SHA-256(K,
    "TOTP-VIEWED-MAC" || 0x00 || uint64be(seq) ||
    uint64be(T) || ASCII(viewed) || uint8(digits) ||
    ASCII(alg) || digest_octets)
        </artwork>
        <t>
          The ASCII label is the 15-octet string
          %x54.4F.54.50.2D.56.49.45.57.45.44.2D.4D.41.43.  digest_octets is the
          8-octet value encoded by the digest field, not its hexadecimal
          representation.  The mac field MUST NOT be included in its own input.
        </t>
        <t>
          When the action field is present, the covering MAC is the same
          construction with the action octets appended:
        </t>
        <artwork>
HMAC-SHA-256(K,
    "TOTP-VIEWED-MAC" || 0x00 || uint64be(seq) ||
    uint64be(T) || ASCII(viewed) || uint8(digits) ||
    ASCII(alg) || digest_octets || 0x00 || action_octets)
        </artwork>
        <t>
          where action_octets is the raw octet string encoded by the action
          field, not its hexadecimal representation.  The additional 0x00
          separator is omitted when the action field is absent, so an
          unextended record has the same MAC as in version -00.
        </t>
        <t>
          An optional account or issuer label MAY be stored locally;
          implementations that export records SHOULD consider the privacy
          implications in <xref target="privacy"/>.
        </t>
      </section>
      <section anchor="json-rep">
        <name>JSON Representation</name>
        <t>
          A log MAY be represented as a JSON <xref target="RFC8259"/> array of objects.  The
          following example is the first Appendix B test time (Unix time 59)
          with the 8-digit SHA-1 TOTP of <xref target="RFC6238"/>:
        </t>
        <sourcecode type="json">
{
  "v": 1,
  "seq": 1,
  "T": 1,
  "viewed": "1970-01-01T00:00:59Z",
  "digits": 8,
  "alg": "SHA1",
  "digest": "6cd61375889ffa0b",
  "mac": "44e256b21a8a649325bc0e411e049f45"
}
        </sourcecode>
      </section>

      <section anchor="cbor-rep">
        <name>CBOR Representation</name>
        <t>
          The same record MAY be represented in CBOR <xref target="RFC8949"/>.  In diagnostic
          notation:
        </t>
        <artwork>
{
  "v": 1,
  "seq": 1,
  "T": 1,
  "viewed": "1970-01-01T00:00:59Z",
  "digits": 8,
  "alg": "SHA1",
  "digest": h'6CD61375889FFA0B',
  "mac":    h'44E256B21A8A649325BC0E411E049F45'
}
        </artwork>
        <t>
          Interoperable exchange SHOULD use the JSON representation unless both
          sides have agreed to CBOR.  This document does not register a media
          type (see <xref target="iana"/>).
        </t>
      </section>

      <section anchor="tx-binding">
        <name>Transaction Binding</name>
        <t>
          The viewed record defined above covers a time-step.  It does not,
          by itself, distinguish one use of a viewed code from another use of
          the same code.  The simulation in <xref target="impl-results"/> showed that when
          a code had been recorded as viewed, enforce mode still accepted the
          first submission of that code, including a submission that beat the
          user, and that a non-atomic verifier could accept the same viewed
          code from ten parallel clients.  Those cases are the gap that this
          optional extension is specified to close, under the conditions
          stated below.
        </t>
        <t>
          A prover and a verifier MAY agree a policy in which each viewed
          record also carries an action identifier for the action or
          transaction the code was displayed to authorise.  Typical contents
          are a verifier-supplied challenge or session identifier, or a
          digest of transaction fields such as the amount and destination.
          Related challenge-response work, in which transaction details enter
          the OTP calculation itself, is specified for HOTP in the OATH
          Challenge-Response Algorithm (OCRA) <xref target="RFC6287"/>.  This extension
          does not change the TOTP value; the identifier is carried in the
          viewed record, not mixed into the OTP.
        </t>
        <t>
          When a digest is used, it is RECOMMENDED that action be the
          lowercase hexadecimal encoding of the leftmost 16 octets of SHA-256
          over a canonical UTF-8 encoding of the agreed transaction fields.
          A verifier-supplied challenge is encoded as lowercase hexadecimal
          of the challenge octets.  Plaintext amounts, destinations, or
          account identifiers SHOULD NOT be placed in an exported record
          (see <xref target="privacy"/>).
        </t>
        <t>
          When this policy is in force, a verifier in enforce mode MUST
          reject an OTP unless an authenticated viewed record covers the
          accepted time-step and the action field matches the action being
          authorised.  A record without an action field MUST be treated as
          not covering that action.  The effect is that a code which remains
          valid across a +/- 1 window cannot authorise a second, different
          transaction or session.  A relay of a viewed code to a different
          login or payment, and a first use of an intercepted code against a
          different action than the one that was displayed, are therefore
          rejected.
        </t>
        <t>
          This extension does not prevent the first submission of a viewed
          code against the same action or challenge that was displayed, for
          example a shoulder-surf of a code already bound to that payment or
          login.  The Section 5.2 rule in <xref target="RFC6238"/>, applied atomically as
          in <xref target="atomic-check"/>, remains the control that stops a second
          acceptance of that same (OTP, action) pair at that verifier.
        </t>
        <t>
          Transaction binding is an explicit, mutually agreed policy, like
          enforce mode.  A verifier that has not agreed the policy MUST
          ignore a present action field for acceptance, and MUST still
          recompute the covering MAC with the field included if it is
          present, so that a bound record is not mistaken for an unbound one.
        </t>
      </section>
    </section>
    <section anchor="verifier">
      <name>Verifier Check</name>
      <t>
        Support for viewed records on the verifier is OPTIONAL.  A verifier
        that does not implement this section MUST continue to validate TOTP
        values as specified in <xref target="RFC6238"/>.  When this section is implemented,
        two modes are defined.
      </t>

      <section anchor="audit">
        <name>Audit Mode</name>
        <t>
          In audit mode the verifier validates the OTP as in <xref target="RFC6238"/>,
          including the Section 5.2 rule that the same OTP MUST NOT be accepted
          a second time after success.  Independently, it obtains viewed
          records (at the time of validation, or later) and MUST flag an
          accepted OTP whose accepted time-step has no matching viewed record
          on the prover, or whose accepted time-step differs from the step or
          steps recorded as viewed for that authentication attempt.
        </t>
        <t>
          Audit mode detects unviewed or wrong-step acceptances after the fact.
          It does not, by itself, prevent acceptance.
        </t>
      </section>

      <section anchor="enforce">
        <name>Enforce Mode</name>
        <t>
          In enforce mode the verifier, at validation time, additionally
          requires one or more viewed records covering the accepted time-step.
          If it accepts an OTP at step S (including a match in a delay or
          resynchronisation window), and no viewed record with T = S is
          presented and authenticated, it MUST reject the OTP.
        </t>
        <t>
          Under a common +/- 1 window, a user who viewed only step T can still
          submit the current-step code.  Codes for T-1 and T+1, which would
          otherwise be acceptable as different OTPs, are rejected unless they
          too were recorded as viewed.  This narrows the effective window for
          unviewed neighbour steps without changing how the TOTP value is
          computed.  It does not detect a copy of a code that was recorded as
          viewed (for example a shoulder-surf of the displayed OTP), unless
          the optional transaction-binding policy in <xref target="tx-binding"/> applies
          and the copy is presented for a different action.
        </t>
      </section>

      <section anchor="obtaining">
        <name>Obtaining Records</name>
        <t>
          How records are carried to the verifier is out of scope of the TOTP
          calculation.  An implementation MAY send records together with the
          OTP, export them later for audit, or compare them on a local
          management path.  When records are sent, the mac field SHOULD be
          present, and the verifier MUST recompute the digest and the mac using
          the shared secret before relying on the record.  A record with an
          invalid mac MUST be ignored for enforcement and MUST be flagged in
          audit mode.
        </t>
      </section>

      <section anchor="atomic-check">
        <name>Atomic One-Time-Use Check</name>
        <t>
          The rule in Section 5.2 of <xref target="RFC6238"/> that the same OTP MUST NOT be
          accepted a second time after success is effective only if the check
          that the OTP has not already been used, and the update that records
          the use, are performed atomically with respect to concurrent
          validations of the same OTP at that verifier.
        </t>
        <t>
          A verifier that implements this document MUST apply that check and
          update as a single critical section (for example under a lock, or
          as an atomic compare-and-set on the stored last-used step).  The
          simulation in <xref target="impl-results"/> showed that a check-then-update
          implementation, under a forced race of ten parallel submissions of
          a viewed code, accepted all ten, and that enforce mode did not
          close that race, because the viewed record was authentic for the
          same step on every attempt.  Transaction binding does not remove
          this requirement for two submissions of the same (OTP, action)
          pair.
</t>
        <t>
          Later tests (<xref target="load-results"/>) showed that, with a pause
          between check and update of 0.5 ms or more, a non-atomic verifier
          accepted the same code more than once in every one of 200 trials
          with 100 parallel clients, and that enforce mode on a non-atomic
          verifier still accepted a viewed code up to 100 times.  An atomic
          update accepted exactly one submission in every trial.
        </t>
      </section>
    </section>

    <section anchor="interop">
      <name>Interoperability with RFC 6238</name>
      <t>
        For the same secret K, origin T0, time-step X, hash algorithm, digit
        count, and Unix time, an implementation of this document MUST produce
        the same TOTP value as <xref target="RFC6238"/>.  The Offline Time Source profile
        and the viewed record do not alter that value.
      </t>
      <t>
        A prover that implements this document can be validated by a verifier
        that implements only <xref target="RFC6238"/>.  A verifier that implements this
        document can validate a prover that implements only <xref target="RFC6238"/>,
        provided it does not require enforce mode.  Enforce mode, and the
        transaction-binding policy of <xref target="tx-binding"/>, are therefore
        explicit, mutually agreed policies, not a silent change to TOTP.
      </t>
      <section anchor="relationship">
        <name>Relationship to RFC 6238</name>
      <t>
        This document does not update,
        obsolete, or modify <xref target="RFC6238"/>, and RFC 6238 remains as
        published.  <xref target="RFC6238"/> is a normative reference for the
        Unix-time basis of the moving factor (Section 4.2 and requirement R1 in
        Section 3), for the delay window and one-time-use rule (Section 5.2),
        and for resynchronisation (Section 6).  Everything in this document is
        additional to those rules and applies only to an implementation that
        chooses to claim it.  An implementation of RFC 6238 that does not
        claim anything in this document is unaffected.  This document makes no
        claim of adoption or endorsement by any standards body, vendor, or
        other organisation.
      </t>
      </section>
    </section>
    <section anchor="test-vectors">
      <name>Test Vectors</name>
      <t>
        The following vectors use the Appendix B test token of <xref target="RFC6238"/>: the
        ASCII shared secret "12345678901234567890", X = 30, T0 = 0, and HMAC-
        SHA-1.  The 8-digit TOTP values MUST match Table 1 of that RFC.  The
        6-digit values are the same truncated integer reduced modulo 10^6,
        included because six-digit codes are widely deployed.  The digest and
        mac fields were generated offline from the constructions in
        <xref target="record-fields"/>.  The "viewed" timestamp is the UTC instant equal to the
        listed Unix time, as if the code were viewed at the moment it was
        generated.  Sequence numbers run from 1 to 6 in table order.  These
        vectors do not include the optional action field.
      </t>
      <t>
        <xref target="tab-totp"/> lists the TOTP values.  <xref target="tab-rec8"/> lists the viewed records for
        the 8-digit codes.  <xref target="tab-rec6"/> lists the digest and mac for the
        corresponding 6-digit codes, using the same seq, T, and viewed
        timestamp, with digits = 6.
      </t>

      <table anchor="tab-totp">
        <name>TOTP values for the Appendix B times (HMAC-SHA-1)</name>
        <thead>
          <tr>
            <th>Unix time</th>
            <th>UTC</th>
            <th>T (hex)</th>
            <th>TOTP (8)</th>
            <th>TOTP (6)</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>59</td>
            <td>1970-01-01T00:00:59Z</td>
            <td>0000000000000001</td>
            <td>94287082</td>
            <td>287082</td>
          </tr>
          <tr>
            <td>1111111109</td>
            <td>2005-03-18T01:58:29Z</td>
            <td>00000000023523EC</td>
            <td>07081804</td>
            <td>081804</td>
          </tr>
          <tr>
            <td>1111111111</td>
            <td>2005-03-18T01:58:31Z</td>
            <td>00000000023523ED</td>
            <td>14050471</td>
            <td>050471</td>
          </tr>
          <tr>
            <td>1234567890</td>
            <td>2009-02-13T23:31:30Z</td>
            <td>000000000273EF07</td>
            <td>89005924</td>
            <td>005924</td>
          </tr>
          <tr>
            <td>2000000000</td>
            <td>2033-05-18T03:33:20Z</td>
            <td>0000000003F940AA</td>
            <td>69279037</td>
            <td>279037</td>
          </tr>
          <tr>
            <td>20000000000</td>
            <td>2603-10-11T11:33:20Z</td>
            <td>0000000027BC86AA</td>
            <td>65353130</td>
            <td>353130</td>
          </tr>
        </tbody>
      </table>

      <table anchor="tab-rec8">
        <name>Viewed records for the 8-digit codes (alg = SHA1, digits = 8)</name>
        <thead>
          <tr>
            <th>seq</th>
            <th>T</th>
            <th>digest</th>
            <th>mac</th>
          </tr>
        </thead>
        <tbody>
          <tr><td>1</td><td>1</td><td>6cd61375889ffa0b</td><td>44e256b21a8a649325bc0e411e049f45</td></tr>
          <tr><td>2</td><td>37037036</td><td>edbcdf5108fb06f7</td><td>260c2e3d63510828b3714e034c9d383a</td></tr>
          <tr><td>3</td><td>37037037</td><td>473efb3fb6e79bec</td><td>c1ddec49506f8e556386f0cff4d7ba46</td></tr>
          <tr><td>4</td><td>41152263</td><td>7da5aebe378d6144</td><td>dc673ac6fc03c3ceee2058b029a6a2c5</td></tr>
          <tr><td>5</td><td>66666666</td><td>b20352a510905140</td><td>e3c595af1a3906af6511edbdf0574fde</td></tr>
          <tr><td>6</td><td>666666666</td><td>ecbac0e7cbf5f3ec</td><td>e19efccee63a8278db61ff4c08b7570c</td></tr>
        </tbody>
      </table>

      <table anchor="tab-rec6">
        <name>Digest and mac for the 6-digit codes (alg = SHA1, digits = 6)</name>
        <thead>
          <tr>
            <th>seq</th>
            <th>T</th>
            <th>digest</th>
            <th>mac</th>
          </tr>
        </thead>
        <tbody>
          <tr><td>1</td><td>1</td><td>40fdf812c2d8d342</td><td>100b1728be424e2f42a8005fff2b3035</td></tr>
          <tr><td>2</td><td>37037036</td><td>e85015ba83d941d4</td><td>459e24a8f390cd8352482e4c1ea395f6</td></tr>
          <tr><td>3</td><td>37037037</td><td>49631a5028eda401</td><td>7335e0efb752ac3c6caf9ecbb52c864a</td></tr>
          <tr><td>4</td><td>41152263</td><td>37577bdb0a361084</td><td>194204acbbcb0ef8b4b3add75b1a9e68</td></tr>
          <tr><td>5</td><td>66666666</td><td>14be20c848413dc4</td><td>4dcffc240108b425f856c794dd11d9d6</td></tr>
          <tr><td>6</td><td>666666666</td><td>a88648e1600b3dce</td><td>4b636bbe283295ded27b896100e1ec59</td></tr>
        </tbody>
      </table>
    </section>
    <section anchor="measured">
      <name>Measured Results</name>
      <t>
        The figures in this section come from a reproducible model and
        simulation run offline (networking disabled) on 30 November 2026,
        with seed 20261130 and 200000 Monte Carlo trials.  They are labelled
        as exact arithmetic, a constant-rate clock model, or a simulation
        with stated assumptions.  They are not measurements of a particular
        product or of a carrier network.  The run also confirmed that all six
        SHA-1 8-digit Appendix B test values of <xref target="RFC6238"/> matched.
        A later, separate simulation of verifier behaviour is reported in
        <xref target="impl-results"/>.
      </t>
      <t>Exact acceptance-window arithmetic, with X = 30 seconds:</t>
      <ul>
        <li>Window 0: 1 code valid at once; a given code is accepted for 30 seconds.</li>
        <li>Window +/- 1: 3 codes valid at once; a given code is accepted for 90 seconds.</li>
        <li>Window +/- 2: 5 codes valid at once; a given code is accepted for 150 seconds.</li>
      </ul>
      <t>Constant-rate isolated clock model (exact), time to a 15-second and 30-second offset:</t>
      <ul>
        <li>0.5 ppm: 347.222 days / 694.444 days.</li>
        <li>2 ppm: 86.806 days / 173.611 days.</li>
        <li>5 ppm: 34.722 days / 69.444 days.</li>
        <li>20 ppm: 8.681 days / 17.361 days.</li>
        <li>50 ppm: 3.472 days / 6.944 days.</li>
      </ul>
      <t>
        Relative drift between an offline issuer or verifier and an offline
        device is |r_device - r_verifier| ppm.  An NTP-synced server is
        modelled as 0 ppm against true time.  If both offline clocks drift at
        2 ppm in the same direction, the relative rate is 0 and they do not
        force a wider window.  If they drift at 2 ppm in opposite directions,
        the relative rate is 4 ppm and they reach a 15-second offset in
        43.403 days, which is sooner than a 2 ppm device against an NTP-
        synced server (86.806 days).  An offline issuer is therefore more
        accurate only when the two clocks are closely matched.
      </t>
      <t>
        A network-sync simulation assumed a daily healthy residual of
        Normal(0, 0.020 s) and, independently, bad jumps as a Poisson process
        with a mean of 2 events per year, each Uniform(15, 90) seconds in
        magnitude and random in sign, over 2000 traces of 50 years.  No
        healthy-only trace exceeded 15 seconds.  With jumps, the median time
        to the first offset of 15 seconds or more was 121 days (mean 177.81;
        analytic mean wait for the first jump is 182.62 days).  These
        assumptions are not measured carrier data.
      </t>
      <t>
        Replay simulations used a +/- 1 window and the following delay
        assumptions, which are not measured user behaviour: the view falls
        uniformly in the current step; the typist submits after Uniform(2,
        12) s; a fast attacker submits after Uniform(0.5, 5) s; a slower
        attacker after Uniform(5, 25) s.
      </t>
      <ul>
        <li>
          Shoulder-surf of the viewed code, fast attacker: accepted before
          the typist in 89.97% of trials.  Detectable from the viewed record
          alone: 0%, because the same step was viewed.
        </li>
        <li>
          The same scenario, slower attacker: 12.23% accepted before the
          typist; still 0% detectable from the record alone.
        </li>
        <li>
          Unviewed adjacent code C_T-1: accepted in 90.80% (fast) and 49.80%
          (slow) of trials.  Unviewed adjacent C_T+1, and a code never
          viewed on the device: accepted in 100% of trials.  In all of those
          accepted cases, 100% are detectable afterwards if the verifier
          compares the record.
        </li>
      </ul>
      <t>
        The measurable improvement is therefore detection of unviewed or
        wrong-step OTPs, and prevention only when the verifier implements
        enforce mode.  The record does not, by itself, prevent acceptance,
        and it does not identify a copy of a code that was viewed.
      </t>
    </section>
    <section anchor="impl-results">
      <name>Implementation and Test Results</name>
      <t>
        This section reports a later local simulation of verifier behaviour,
        run offline on 30 November 2026 against the mechanisms in this
        document.  The TOTP generator was checked first against the SHA-1,
        SHA-256, and SHA-512 8-digit Appendix B test values of
        <xref target="RFC6238"/> and against the 6-digit values and viewed-record digest
        and mac fields in <xref target="test-vectors"/>.  All of those vectors matched.
        The simulation used the Appendix B SHA-1 test token, 6-digit codes,
        X = 30, T0 = 0, a +/- 1 window, and Unix time 1111111111
        (T = 37037037).  It compared a plain RFC 6238 verifier, audit mode,
        and enforce mode.  The Section 5.2 one-time-use rule was implemented
        in two ways: a naive check-then-update path, exercised with real
        threads and a barrier so that every thread passed the unused-step
        check before any thread updated (a forced race), and an atomic path
        in which the check and the update ran under a lock.  The code is in
        the author's possession and can be made public.  The run did not
        contact any live authentication service, and the numbers below are
        not measurements of a particular deployed verifier.
      </t>
      <t>
        In the first scenario a user viewed C(T) and an attacker who
        intercepted that code submitted it from 10 parallel clients.  The
        viewed record was authentic and covered T.
      </t>
      <table anchor="tab-s1">
        <name>Ten parallel submissions of an intercepted viewed code C(T)</name>
        <thead>
          <tr><th>Verifier</th><th>Accepted</th><th>Rejected</th><th>Flagged</th></tr>
        </thead>
        <tbody>
          <tr><td>RFC 6238 naive (forced race)</td><td>10</td><td>0</td><td>0</td></tr>
          <tr><td>RFC 6238 atomic</td><td>1</td><td>9</td><td>0</td></tr>
          <tr><td>Audit naive (forced race)</td><td>10</td><td>0</td><td>0</td></tr>
          <tr><td>Audit atomic</td><td>1</td><td>9</td><td>0</td></tr>
          <tr><td>Enforce naive (forced race)</td><td>10</td><td>0</td><td>0</td></tr>
          <tr><td>Enforce atomic</td><td>1</td><td>9</td><td>0</td></tr>
        </tbody>
      </table>
      <t>
        The nine rejections on the atomic rows are the Section 5.2 rule of
        <xref target="RFC6238"/>, not the viewed-record check.  Enforce mode did not close
        the forced race.
      </t>
      <t>
        In the second scenario the device had viewed only T, and the attacker
        submitted the computed neighbour codes C(T-1) and C(T+1) in sequence.
      </t>
      <table anchor="tab-s2">
        <name>Computed unviewed neighbour codes C(T-1) and C(T+1)</name>
        <thead>
          <tr><th>Verifier</th><th>Accepted</th><th>Rejected</th><th>Flagged</th></tr>
        </thead>
        <tbody>
          <tr><td>RFC 6238 atomic</td><td>2</td><td>0</td><td>0</td></tr>
          <tr><td>Audit atomic</td><td>2</td><td>0</td><td>2</td></tr>
          <tr><td>Enforce atomic</td><td>0</td><td>2</td><td>0</td></tr>
        </tbody>
      </table>
      <t>
        The probability that N unique random 6-digit guesses hit at least one
        of k valid codes, without replacement, is 1 - C(10^6 - k, N) /
        C(10^6, N).  The table below is that exact combinatorics; it is not a
        live guessing run against a verifier.  A Monte Carlo of 20000 trials,
        N = 1000, seed 20261130, against the two unviewed neighbour codes,
        observed a hit rate of 0.00195, compared with the exact value
        1.999000999001e-3.  Because enforce mode rejected computed neighbour
        codes when those steps were not viewed, a correct guess of only
        C(T-1) or C(T+1) would also be rejected, and the remaining target, if
        T was viewed, is C(T) alone.
      </t>
      <table anchor="tab-guess">
        <name>Exact P(at least one hit) for N unique 6-digit guesses</name>
        <thead>
          <tr>
            <th>N</th>
            <th>P(2 unviewed neighbours)</th>
            <th>P(any of 3 window codes)</th>
            <th>P(C(T) only, enforce)</th>
          </tr>
        </thead>
        <tbody>
          <tr><td>1</td><td>2.000000000000e-6</td><td>3.000000000000e-6</td><td>1.000000000000e-6</td></tr>
          <tr><td>10</td><td>1.999990999991e-5</td><td>2.999973000045e-5</td><td>1.000000000000e-5</td></tr>
          <tr><td>100</td><td>1.999900999901e-4</td><td>2.999703009405e-4</td><td>1.000000000000e-4</td></tr>
          <tr><td>1000</td><td>1.999000999001e-3</td><td>2.997003994008e-3</td><td>1.000000000000e-3</td></tr>
          <tr><td>10000</td><td>1.990000990001e-2</td><td>2.970102940305e-2</td><td>1.000000000000e-2</td></tr>
          <tr><td>100000</td><td>1.900000900001e-1</td><td>2.710002430004e-1</td><td>1.000000000000e-1</td></tr>
        </tbody>
      </table>
      <t>
        In the third scenario the attacker did not have the shared secret and
        submitted C(T-1) with a viewed record for T-1 whose digest and mac
        were computed under the wrong key.  No authentic record was
        presented.
      </t>
      <table anchor="tab-s3">
        <name>Forged viewed record without the shared secret</name>
        <thead>
          <tr><th>Verifier</th><th>Accepted</th><th>Rejected</th><th>Flagged</th></tr>
        </thead>
        <tbody>
          <tr><td>RFC 6238 atomic</td><td>1</td><td>0</td><td>0</td></tr>
          <tr><td>Audit atomic</td><td>1</td><td>0</td><td>1</td></tr>
          <tr><td>Enforce atomic</td><td>0</td><td>1</td><td>0</td></tr>
        </tbody>
      </table>
      <t>
        In the fourth scenario C(T) was submitted twice, with the authentic
        viewed record both times.  Every verifier accepted the first
        submission and rejected the second (1 accepted, 1 rejected, 0
        flagged).  That rejection is the Section 5.2 rule of <xref target="RFC6238"/>,
        which this document keeps; the viewed-record check was not what
        rejected the replay.
      </t>
      <t>
        In the fifth scenario an attacker who held the shared secret computed
        C(T+1) and a valid covering MAC for step T+1.  The device itself
        never viewed T+1.  Every verifier, including enforce mode, accepted
        the attempt (1 accepted, 0 rejected, 0 flagged).
      </t>
      <t>
        In the sixth scenario the user viewed C(T), the attacker submitted
        that code first, and the user submitted it afterwards.  Every
        verifier accepted the attacker and rejected the user (1 accepted, 1
        rejected, 0 flagged).  Audit mode did not flag the attacker's
        accept, because the record covered T.
      </t>
      <t>What the simulation showed the draft stops, in enforce mode only:</t>
      <ul>
        <li>computed unviewed neighbour-step codes (second scenario);</li>
        <li>a viewed record forged without the shared secret (third scenario).</li>
      </ul>
      <t>
        What it detects only, in audit mode, without changing acceptance:
        unviewed neighbour-step accepts, and an accept that carried a bad
        mac.  Audit mode did not change accepted or rejected counts relative
        to RFC 6238 in any scenario that was run.
      </t>
      <t>What it does not stop:</t>
      <ul>
        <li>
          the first use of an intercepted code that was viewed, including
          ten parallel clients of that code (first scenario) and an attacker
          who submits the viewed code before the user (sixth scenario);
        </li>
        <li>
          a check-then-update race on the one-time-use rule, which enforce
          mode did not close (first scenario, naive rows);
        </li>
        <li>
          an attacker who has the shared secret and forges both a code and a
          record (fifth scenario);
        </li>
        <li>
          a second submission of an already-accepted code, which is already
          refused by <xref target="RFC6238"/> Section 5.2 (fourth scenario).
        </li>
      </ul>
      <t>
        The optional transaction-binding extension in <xref target="tx-binding"/> was
        specified to close the first of those gaps when each authorisation
        has a distinct action or challenge.  It was not itself part of the
        simulation, and this section does not report results for it.
      </t>
    </section>
    <section anchor="load-results">
      <name>Live and Pressure Test Results</name>
      <t>
        This section reports two further sets of tests run on 30 November
        2026.  They test the one-time-use rule and the viewed-record check
        under parallel load.  They do not measure any deployed service.
      </t>
      <t>
        In the live runs a local test login site, listening only on the
        loopback address, verified standard TOTP (HMAC-SHA-1, six digits, X =
        30 seconds, +/- 1 window) from a commercially available authenticator
        application.  For each run the author supplied the code currently
        displayed by that application, and N clients submitted that same code
        at the same time.  The "naive" verifier checked that the step was
        unused, paused for a deliberate 150 ms, and then recorded the step,
        so the race was made reliable on purpose.  The "atomic" verifier
        performed the check and the update as one operation.  The deliberate
        pause means these runs show what a non-atomic verifier can do, and do
        not show how often real servers have such a gap.  An authenticator
        application of this kind does not write viewed records, so enforce
        mode was not exercised in the live runs.
      </t>
      <table anchor="tab-live">
        <name>Live runs, N clients submitting the same code at once</name>
        <thead>
          <tr><th>Verifier</th><th>Clients</th><th>Accepted</th><th>Rejected</th></tr>
        </thead>
        <tbody>
          <tr><td>Naive</td><td>10</td><td>10</td><td>0</td></tr>
          <tr><td>Naive</td><td>50</td><td>50</td><td>0</td></tr>
          <tr><td>Naive</td><td>100 (run 1)</td><td>100</td><td>0</td></tr>
          <tr><td>Naive</td><td>100 (run 2)</td><td>100</td><td>0</td></tr>
          <tr><td>Atomic</td><td>10 (run 1)</td><td>1</td><td>9</td></tr>
          <tr><td>Atomic</td><td>10 (run 2)</td><td>1</td><td>9</td></tr>
          <tr><td>Atomic</td><td>50</td><td>1</td><td>49</td></tr>
          <tr><td>Atomic</td><td>100 (run 1)</td><td>1</td><td>99</td></tr>
          <tr><td>Atomic</td><td>100 (run 2)</td><td>1</td><td>99</td></tr>
        </tbody>
      </table>
      <t>
        Two further runs are excluded and are disclosed here for
        completeness.  One atomic run of 10 clients rejected all ten because a
        stale code from an earlier run had been submitted.  One naive run of
        50 clients had connection resets because the test server's listen
        backlog was too small; the backlog was raised and the run was
        repeated with the results shown.  Both naive and atomic verifiers also
        accepted codes from the adjacent steps inside the +/- 1 window, as
        <xref target="RFC6238"/> permits.
      </t>
      <t>
        The pressure test ran in-process, with no network, against the
        verifier of <xref target="impl-results"/>, using a throwaway key, a
        fixed clock, 100 parallel clients released together by a barrier, and
        200 trials per row.  In the first part, a pause was inserted between
        the unused-step check and the update, and 100 clients submitted the
        same code.
      </t>
      <table anchor="tab-gap">
        <name>Pause between check and update, non-atomic verifier, 100 clients, 200 trials</name>
        <thead>
          <tr><th>Pause</th><th>Trials with more than one accept</th><th>Accepted per trial (min / median / max)</th></tr>
        </thead>
        <tbody>
          <tr><td>none</td><td>0 of 200</td><td>1 / 1 / 1</td></tr>
          <tr><td>0.5 ms</td><td>200 of 200</td><td>5 / 22 / 54</td></tr>
          <tr><td>1 ms</td><td>200 of 200</td><td>8 / 47 / 76</td></tr>
          <tr><td>2 ms</td><td>200 of 200</td><td>24 / 94.5 / 100</td></tr>
          <tr><td>5 ms</td><td>200 of 200</td><td>91 / 100 / 100</td></tr>
          <tr><td>20 ms</td><td>200 of 200</td><td>100 / 100 / 100</td></tr>
          <tr><td>Atomic control (20 ms pause ignored)</td><td>0 of 200</td><td>1 / 1 / 1</td></tr>
        </tbody>
      </table>
      <t>
        The row with no pause is an artefact of how the interpreter schedules
        threads, which ran the check and the update without switching, and
        it is not evidence that a real verifier is safe at zero gap.  Any
        pause of 0.5 ms or more allowed duplicate acceptance in every trial.
        Database round trips and remote calls commonly exceed that.
      </t>
      <t>
        In the second part, enforce mode was run with 100 clients, 200 trials
        per row.
      </t>
      <table anchor="tab-enforce-load">
        <name>Enforce mode, 100 parallel clients, 200 trials per row</name>
        <thead>
          <tr><th>Submission</th><th>Verifier</th><th>Accepted per trial</th></tr>
        </thead>
        <tbody>
          <tr><td>Viewed code with its authentic record</td><td>atomic</td><td>1 in 200 of 200 trials</td></tr>
          <tr><td>Viewed code with its authentic record</td><td>non-atomic, 2 ms pause</td><td>median 100 (minimum 21)</td></tr>
          <tr><td>Viewed code with its authentic record</td><td>non-atomic, 20 ms pause</td><td>100</td></tr>
          <tr><td>Unviewed neighbour codes C(T-1) and C(T+1), no record</td><td>atomic</td><td>0 in 200 of 200 trials</td></tr>
          <tr><td>Current code, no record</td><td>atomic</td><td>0 in 200 of 200 trials</td></tr>
          <tr><td>Current code with a record for a different step</td><td>atomic</td><td>0 in 200 of 200 trials</td></tr>
          <tr><td>Current code with a record forged under a wrong key</td><td>atomic</td><td>0 in 200 of 200 trials</td></tr>
          <tr><td>1 viewed submission and 99 unviewed submissions of the same code</td><td>atomic</td><td>exactly 1 in 200 of 200 trials</td></tr>
        </tbody>
      </table>
      <t>
        Enforce mode rejected every unviewed, wrong-step and forged-record
        submission in every trial under this load.  It did not prevent
        concurrent acceptance of a genuinely viewed code on a non-atomic
        verifier, which is why <xref target="atomic-check"/> requires an atomic
        update.  The tests used one machine and the author's own verifier
        implementation.  They do not test a relay of a code that was viewed
        and then copied; that case is described in <xref target="security"/>.
      </t>
    </section>
    <section anchor="impl-status" removeInRFC="true">
      <name>Implementation Status</name>
      <t>
        This section records the status of known implementations of the
        mechanism defined in this document at the time of posting, following
        <xref target="RFC7942"/>.  It is to be removed before publication as an RFC.
      </t>
      <dl newline="true">
        <dt>Organization:</dt>
        <dd>YPS Services LLC</dd>
        <dt>Implementation:</dt>
        <dd>
          Last Viewed, security software.  A public RFC 6238
          test panel that computes codes locally without a network is
          available at https://lastviewed.ypsservices.com/.
        </dd>
        <dt>Coverage:</dt>
        <dd>
          RFC 6238 code generation with the Appendix B test key.
          The viewed record defined in this document is in development.  A
          local simulation of verifier behaviour, including audit and
          enforce modes and an atomic and a non-atomic one-time-use check,
          was run on 30 November 2026 and is reported in
          <xref target="impl-results"/>.  The simulation code is in the author's
          possession and can be made public.  The optional Reference Device
          role, the transaction-binding extension, and the example hardware
          below have not been measured as shipping implementations.
        </dd>
        <dt>Licensing:</dt>
        <dd>Proprietary.</dd>
        <dt>Contact:</dt>
        <dd>ea.rigopoulos@ypsservices.com</dd>
      </dl>
      <t>Last Viewed is a trademark of YPS Services LLC.</t>

      <section anchor="example-hw">
        <name>Example Hardware for Laboratory Evaluation</name>
        <t>
          The following combination is described only as an example of a
          microcontroller and a TCXO RTC that could be used to evaluate the
          Offline Time Source profile in a laboratory.  It is not a Last
          Viewed product, it is not a claim that Last Viewed includes or
          qualifies this hardware, and it has not been measured under
          <xref target="measurement"/>.  Module layout, charging circuitry, and even the
          identity of the RTC and EEPROM ICs vary between vendors and MUST be
          verified on the board in hand.
        </t>
        <t>
          The microcontroller example is a Raspberry Pi Pico H, Raspberry Pi
          order code SC0917 (also listed by some vendors as RP-SC0917), an
          RP2040 board with pre-soldered headers <xref target="PICO-DS"/>.  The Pico H
          recommended operating conditions in that datasheet are a minimum
          of -20 degrees C and a maximum of +85 degrees C including
          self-heating, with a recommended maximum ambient of 70 degrees C.
          The Pico's own oscillator is not a battery-backed real-time clock
          and is not, by itself, a basis for claiming this profile.  A
          qualifying local RTC would be added over I2C or a similar bus.
        </t>
        <t>
          The RTC example is an Analog Devices / Maxim Integrated DS3231,
          an I2C RTC with an integrated TCXO and crystal <xref target="DS3231"/>.  Figures
          in this paragraph are taken from the Maxim Integrated DS3231
          datasheet, document 19-5170, Revision 10, March 2015.  A later
          Analog Devices reprint, if any, has not been checked for this
          revision and SHOULD be verified by implementers.  Headline accuracy
          in that datasheet is +/-2 ppm from 0 degrees C to +40 degrees C and
          +/-3.5 ppm from -40 degrees C to +85 degrees C.  The frequency stability table, with the aging-offset register at 00h, is more
          specific: for the commercial device (DS3231S, 0 degrees C to +70
          degrees C) the bound is +/-2 ppm from 0 degrees C to +40 degrees C
          and +/-3.5 ppm from above +40 degrees C to +70 degrees C; for the
          industrial device (DS3231SN, -40 degrees C to +85 degrees C) the
          bound is +/-3.5 ppm from -40 degrees C to below 0 degrees C, +/-2
          ppm from 0 degrees C to +40 degrees C, and +/-3.5 ppm from above
          +40 degrees C to +85 degrees C.  A declared D_max that uses the
          +/-2 ppm figure MUST state that it applies only over 0 degrees C to
          +40 degrees C.  Crystal aging in the same table, after reflow and
          marked "not production tested", is +/-1.0 ppm for the first year
          and +/-5.0 ppm over 0-10 years; a declared D_max for a long service
          interval needs to take aging into account as well as the
          temperature-stability figure.  Timekeeping battery current IBATT,
          with EOSC = 0, BBSQW = 0, EN32kHz = 1, and the I2C pins idle, is
          typically 0.84 microamperes and at most 3.0 microamperes at VBAT =
          3.63 V, and typically 1.0 microamperes and at most 3.5 microamperes
          at VBAT = 5.5 V.  A short temperature-conversion current IBATTC of
          at most 575 microamperes at VBAT = 3.63 V (650 microamperes at 5.5
          V) is specified separately; the datasheet's IBATT maximum is the
          figure to use for average timekeeping budget.  This document does
          not convert those currents into a battery-life in years; life is
          estimated from the cell datasheet's capacity and from IBATT, and
          any such estimate is to be verified for the cell and module used.
        </t>
        <t>
          Typical inexpensive "DS3231 Precision Memory" modules sold for use
          with Arduino or Raspberry Pi boards also carry a 32-kbit I2C
          EEPROM, commonly an AT24C32 or compatible part, which can store
          viewed records on the device.  The presence, type, and capacity of
          that EEPROM are properties of the module, not of the DS3231, and
          are to be verified on the board in hand.  Many such modules also
          include a crude charging path (often a resistor and a diode) aimed
          at a rechargeable LIR2032 cell.  That path can damage a
          non-rechargeable CR2032.  An implementer MUST use a cell type the
          module is actually designed for, or MUST disable the charging path,
          and MUST NOT assume that the Analog DS3231 datasheet specifies this
          module circuitry.  Whether a particular board has the path, and
          whether the IC is a genuine DS3231 rather than a substitute with a
          looser accuracy class, is to be verified.
        </t>
      </section>
    </section>
    <section anchor="security">
      <name>Security Considerations</name>
      <t>
        The security of the TOTP value remains that of <xref target="RFC6238"/> and
        <xref target="RFC4226"/>.  This section considers only the additions in this
        document.
      </t>
      <t>
        The viewed record detects; it does not prevent, unless the verifier
        implements enforce mode and actually receives an authentic record at
        validation time.  Audit mode is a retrospective control.  A
        deployment that only stores records on the prover, and never compares
        them, does not change the attack surface of <xref target="RFC6238"/>.
      </t>
      <t>
        This document assumes that the displayed OTP is visible only to the
        user.  Where an observer or interceptor can copy an OTP while it is
        displayed, the viewed record for that OTP is genuine and a verifier
        in enforce mode accepts whichever party submits it first.  This
        document does not claim to prevent that.  It does ensure that the OTP
        is accepted once, and the rejection of the legitimate user's own
        attempt is then a visible collision rather than a silent second
        acceptance.  The parallel-client runs in <xref target="load-results"/>
        model an interceptor on purpose, as a worst-case stress test, and are
        not the expected condition.
      </t>
      <t>
        A shoulder-surf or other copy of an OTP that the prover did record as
        viewed is not distinguishable, from the record alone, from the user's
        own use of that OTP.  The simulation in <xref target="impl-results"/> confirmed
        that enforce mode accepted the first submission of a viewed code,
        including a submission that arrived before the user's.  The optional
        transaction-binding extension in <xref target="tx-binding"/> is intended to
        reject a copy that is presented for a different action or session; it
        does not reject the first use of a correctly bound record for the
        same action.  The Section 5.2 rule in <xref target="RFC6238"/> remains the
        control that stops the same OTP being accepted twice at that verifier
        after a first success.
      </t>
      <t>
        That one-time-use rule MUST be applied atomically, as required in
        <xref target="atomic-check"/>.  A check-then-update implementation can accept
        several concurrent submissions of the same OTP.  The simulation
        forced that race and observed ten accepts out of ten, including in
        enforce mode.  Transaction binding does not remove the requirement
        for submissions of the same (OTP, action) pair.
      </t>
      <t>
        Record tampering: an attacker who can append or alter records without
        K cannot forge a valid digest or mac.  An attacker who has K can
        forge records and TOTP values; protection of K is therefore essential
        and is out of scope of this document, as it is of <xref target="RFC6238"/>.  The
        simulation confirmed that an attacker who held K and forged both a
        neighbour-step code and a covering MAC was accepted in enforce mode.
        Implementations SHOULD treat a record with a missing or invalid mac
        as unauthenticated.  Sequence numbers detect gaps but do not, by
        themselves, prove that a missing view did not occur on a different
        device that shares K.
      </t>
      <t>
        Clock tampering: an attacker who can set the prover's local clock can
        shift T and the viewed timestamp.  The Offline Time Source profile
        reduces dependence on a network time protocol and on sudden network
        time jumps, but it does not prevent physical or software attacks on
        the local clock.  A low or missing backup supply MUST be treated as
        making the clock untrusted until resynchronisation, as in
        <xref target="battery"/>.  Setting the clock SHOULD require an additional
        authentication measure when the offset is large, as in Section 6 of
        <xref target="RFC6238"/> and in <xref target="resync"/>.  Verifiers SHOULD NOT widen the
        acceptance window beyond what Section 5.2 of <xref target="RFC6238"/> recommends
        without understanding the added exposure (more simultaneously valid
        codes and a longer acceptance period for each code).
      </t>
      <t>
        Reference Device compromise: an attacker who can issue authentic
        signed time messages, because they hold the Reference Device's
        signing key or have replaced the device, can shift the clocks of
        provers that trust it.  Mitigation is the same additional
        authentication measure for large offsets, plus the ranking and
        freshness rules in <xref target="ref-ranking"/>, and protection of the
        provisioning of the reference's public or MAC key.  Unauthenticated
        peer-to-peer time copy, including following a peer with a longer
        reported battery life, can propagate a single compromised or wrong
        clock and MUST NOT be used as a trusted reference.
      </t>
      <t>
        Shared-secret storage, provisioning, and the design of any particular
        hardware token are out of scope.  Keys SHOULD still be generated and
        protected as recommended in <xref target="RFC6238"/>.
      </t>
    </section>

    <section anchor="privacy">
      <name>Privacy Considerations</name>
      <t>
        A viewed record is a log of authentication activity: it shows that a
        particular account's OTP was displayed or copied at a particular
        local time.  An action identifier can additionally associate that
        event with a transaction or session.  Implementations SHOULD keep
        records on the prover by
        default, export them only with user or administrator action, and
        retain them only as long as needed for the agreed audit or enforce
        policy.  Account labels and other identifiers SHOULD be omitted from
        exported records unless required.  When transaction binding is used,
        exported records SHOULD carry a digest or a verifier-supplied
        challenge, not plaintext amounts, destinations, or account numbers.
        Verifiers that receive records
        SHOULD apply the same retention limits as for other authentication
        logs.  See also <xref target="RFC6973"/>.
      </t>
    </section>

    <section anchor="iana">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner"/>
            <date month="March" year="1997"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC4226" target="https://www.rfc-editor.org/info/rfc4226">
          <front>
            <title>HOTP: An HMAC-Based One-Time Password Algorithm</title>
            <author initials="D." surname="M'Raihi" fullname="D. M'Raihi"/>
            <author initials="M." surname="Bellare" fullname="M. Bellare"/>
            <author initials="F." surname="Hoornaert" fullname="F. Hoornaert"/>
            <author initials="D." surname="Naccache" fullname="D. Naccache"/>
            <author initials="O." surname="Ranen" fullname="O. Ranen"/>
            <date month="December" year="2005"/>
          </front>
          <seriesInfo name="RFC" value="4226"/>
          <seriesInfo name="DOI" value="10.17487/RFC4226"/>
        </reference>
        <reference anchor="RFC6238" target="https://www.rfc-editor.org/info/rfc6238">
          <front>
            <title>TOTP: Time-Based One-Time Password Algorithm</title>
            <author initials="D." surname="M'Raihi" fullname="D. M'Raihi"/>
            <author initials="S." surname="Machani" fullname="S. Machani"/>
            <author initials="M." surname="Pei" fullname="M. Pei"/>
            <author initials="J." surname="Rydell" fullname="J. Rydell"/>
            <date month="May" year="2011"/>
          </front>
          <seriesInfo name="RFC" value="6238"/>
          <seriesInfo name="DOI" value="10.17487/RFC6238"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba"/>
            <date month="May" year="2017"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="DS3231" target="https://www.analog.com/en/products/ds3231.html">
          <front>
            <title>DS3231 Extremely Accurate I2C-Integrated RTC/TCXO/Crystal</title>
            <author>
              <organization>Maxim Integrated Products, Inc.</organization>
            </author>
            <date month="March" year="2015"/>
          </front>
          <refcontent>Document 19-5170, Revision 10.  Product page now hosted by Analog Devices.</refcontent>
        </reference>
        <reference anchor="PICO-DS" target="https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf">
          <front>
            <title>Raspberry Pi Pico Datasheet</title>
            <author>
              <organization>Raspberry Pi Ltd</organization>
            </author>
            <date year="2026"/>
          </front>
        </reference>
        <reference anchor="RFC6287" target="https://www.rfc-editor.org/info/rfc6287">
          <front>
            <title>OCRA: OATH Challenge-Response Algorithm</title>
            <author initials="D." surname="M'Raihi" fullname="D. M'Raihi"/>
            <author initials="J." surname="Rydell" fullname="J. Rydell"/>
            <author initials="S." surname="Bajaj" fullname="S. Bajaj"/>
            <author initials="S." surname="Machani" fullname="S. Machani"/>
            <author initials="D." surname="Naccache" fullname="D. Naccache"/>
            <date month="June" year="2011"/>
          </front>
          <seriesInfo name="RFC" value="6287"/>
          <seriesInfo name="DOI" value="10.17487/RFC6287"/>
        </reference>
        <reference anchor="RFC6973" target="https://www.rfc-editor.org/info/rfc6973">
          <front>
            <title>Privacy Considerations for Internet Protocols</title>
            <author initials="A." surname="Cooper" fullname="A. Cooper"/>
            <author initials="H." surname="Tschofenig" fullname="H. Tschofenig"/>
            <author initials="B." surname="Aboba" fullname="B. Aboba"/>
            <author initials="J." surname="Peterson" fullname="J. Peterson"/>
            <author initials="J." surname="Morris" fullname="J. Morris"/>
            <author initials="M." surname="Hansen" fullname="M. Hansen"/>
            <author initials="R." surname="Smith" fullname="R. Smith"/>
            <date month="July" year="2013"/>
          </front>
          <seriesInfo name="RFC" value="6973"/>
          <seriesInfo name="DOI" value="10.17487/RFC6973"/>
        </reference>
        <reference anchor="RFC7942" target="https://www.rfc-editor.org/info/rfc7942">
          <front>
            <title>Improving Awareness of Running Code: The Implementation Status Section</title>
            <author initials="Y." surname="Sheffer" fullname="Y. Sheffer"/>
            <author initials="A." surname="Farrel" fullname="A. Farrel"/>
            <date month="July" year="2016"/>
          </front>
          <seriesInfo name="BCP" value="205"/>
          <seriesInfo name="RFC" value="7942"/>
          <seriesInfo name="DOI" value="10.17487/RFC7942"/>
        </reference>
        <reference anchor="RFC8259" target="https://www.rfc-editor.org/info/rfc8259">
          <front>
            <title>The JavaScript Object Notation (JSON) Data Interchange Format</title>
            <author initials="T." surname="Bray" fullname="T. Bray" role="editor"/>
            <date month="December" year="2017"/>
          </front>
          <seriesInfo name="STD" value="90"/>
          <seriesInfo name="RFC" value="8259"/>
          <seriesInfo name="DOI" value="10.17487/RFC8259"/>
        </reference>
        <reference anchor="RFC8949" target="https://www.rfc-editor.org/info/rfc8949">
          <front>
            <title>Concise Binary Object Representation (CBOR)</title>
            <author initials="C." surname="Bormann" fullname="C. Bormann"/>
            <author initials="P." surname="Hoffman" fullname="P. Hoffman"/>
            <date month="December" year="2020"/>
          </front>
          <seriesInfo name="STD" value="94"/>
          <seriesInfo name="RFC" value="8949"/>
          <seriesInfo name="DOI" value="10.17487/RFC8949"/>
        </reference>
      </references>
    </references>
    <section anchor="changes-02" numbered="false" toc="include">
      <name>Changes from draft-rigopoulos-totp-offline-audit-01</name>
      <ul>
        <li>
          Removed the "Updates: RFC 6238" relationship (the XML "updates"
          attribute) and every statement that this document updates or
          modifies <xref target="RFC6238"/>.  The document now describes a
          method that builds on, and is compatible with, RFC 6238.  Reason: a
          document on the Independent Submission stream cannot update a
          Standards Track RFC.
        </li>
        <li>
          Reworded the Abstract and the Introduction accordingly, and removed
          the sentence in the Abstract that described this revision's
          additions.
        </li>
        <li>
          Added a "Relationship to RFC 6238" paragraph to the
          Interoperability section stating what RFC 6238 is relied on for
          (Unix time, Section 5.2, Section 6) and that no adoption or
          endorsement is claimed.
        </li>
        <li>
          Clarified that the atomic one-time-use requirement applies to a
          verifier that implements this document, and restates a rule that
          already exists in Section 5.2 of RFC 6238.
        </li>
        <li>
          The category (Experimental) and the stream (Independent Submission)
          are unchanged.  No technical change to the viewed record, audit
          and enforce modes, the atomic check, the drift model, or the
          test results.
        </li>
      </ul>
    </section>
    <section anchor="changes" numbered="false" toc="include">
      <name>Changes from draft-rigopoulos-totp-offline-audit-00</name>
      <ul>
        <li>
          Clarified that a declared 2 ppm class still accumulates a
          30-second offset in about 174 days under the constant-rate model,
          and that D_max MUST be stated with a temperature range.
        </li>
        <li>
          Added applicability of the Offline Time Source profile to new
          hardware and to upgrades, including offline crypto wallets;
          existing devices without a qualifying RTC cannot claim the
          profile but can still adopt the viewed record.
        </li>
        <li>
          Added battery-status reporting: a low or missing backup supply
          makes the clock untrusted until resynchronisation.  No battery-life
          figures are published.
        </li>
        <li>
          Added an optional Reference Device role, a signed time message,
          offset measurement and the existing large-offset authentication
          requirement, and a rule that references are ranked by declared
          D_max and time since trusted sync, not by battery life or age.
        </li>
        <li>
          Noted that a software application, including the author's Last
          Viewed product, could provide a sync path, without claims about
          particular hardware clock specifications.
        </li>
        <li>
          Added an optional transaction-binding extension to the viewed
          record, with a covering-MAC extension that leaves the -00 test
          vectors unchanged when the action field is absent, and a reference
          to OCRA <xref target="RFC6287"/>.
        </li>
        <li>
          Required atomic application of the RFC 6238 Section 5.2
          one-time-use rule.
        </li>
        <li>
          Added an Implementation and Test Results section reporting only the
          local verifier simulation; listed honestly what was not stopped.
        </li>
        <li>
          Added a Live and Pressure Test Results section: live runs with a
          real authenticator application against a local test site (10, 50
          and 100 parallel clients), a sweep of the pause between check and
          update, and enforce mode at 100 parallel clients, with the limits
          of each stated.
        </li>
        <li>
          Stated the threat-model assumption that the displayed OTP is visible
          only to the user, and that relay of a viewed code is not prevented.
        </li>
        <li>
          Updated Implementation Status per <xref target="RFC7942"/>, including an example
          Raspberry Pi Pico H (SC0917) and DS3231 laboratory build, cited
          from the manufacturers' datasheets, with items that are still to be verified labelled as such.  The example is not a Last Viewed hardware claim.
        </li>
        <li>
          Updated Security Considerations for clock tampering, Reference
          Device compromise, record forgery by a holder of K, and atomic
          verifier checks.
        </li>
      </ul>
    </section>

    <section anchor="acks" numbered="false" toc="include">
      <name>Acknowledgements</name>
      <t>
        This document builds on <xref target="RFC6238"/> by D.  M'Raihi, S.  Machani, M.
        Pei, and J.  Rydell, and on <xref target="RFC4226"/> by D.  M'Raihi, M.  Bellare, F.
        Hoornaert, D.  Naccache, and O.  Ranen.  Errors of interpretation
        remain the author's.
      </t>
    </section>
  </back>
</rfc>
