Good question, and nice that you’re thinking about user lockouts early. TOTP is time-based and usually smoother because phones keep time well enough; adding a small time window (±1 step) helps avoid most fails. For offline or batch actions, HOTP shines since it doesn’t rely on time, and you can advance the counter on successful use. Mid-flow, consider using a tool like the
hotp generator so you can test counters, window sizes, and throttling. Also: rate-limit attempts, expose backup codes, and store only hashed secrets. If you expect device changes, offer an easy re-enroll path and verify with a second factor before resetting.