Enum Class BackingStrategy

java.lang.Object
java.lang.Enum<BackingStrategy>
xyz.tcheeric.cashu.voucher.domain.BackingStrategy
All Implemented Interfaces:
Serializable, Comparable<BackingStrategy>, Constable

public enum BackingStrategy extends Enum<BackingStrategy>
Backing strategy for voucher token amounts.

The backing strategy determines how many sats back a voucher and whether it can be split peer-to-peer. The merchant chooses the strategy at issuance based on the voucher's use case.

Strategy Comparison

StrategyToken AmountSplittableUse Case
FIXEDConstant (e.g., 1 sat)NoTickets, passes
MINIMALConstant (e.g., 10 sats)Yes (coarse)Gift cards
PROPORTIONALScaled to face valueYes (fine)Split payments
See Also:
  • invalid reference
    VoucherSecret
  • Enum Constant Details

    • FIXED

      public static final BackingStrategy FIXED
      Fixed minimal sat backing for non-splittable vouchers.

      Use for tickets, event passes, and single-use vouchers that must be redeemed whole. The token amount is a configurable constant (default: 1 sat).

      Splitting is disabled - attempting to split a FIXED voucher should fail.

    • MINIMAL

      public static final BackingStrategy MINIMAL
      Low constant sat backing for occasional splits.

      Use for gift cards, loyalty points, and store credit where splits are occasional. The token amount is a configurable constant (default: 10 sats).

      Splitting is possible but with coarse granularity (limited split points).

    • PROPORTIONAL

      public static final BackingStrategy PROPORTIONAL
      Proportional sat backing scaled to face value for precise splits.

      Use for splittable vouchers, shared payments, and group gifts where precise division is needed. Token amount scales with face value (default: 1 sat per minor unit, e.g., 1 sat per cent for EUR).

      Splitting supports fine granularity (cent-level precision).

  • Method Details

    • values

      public static BackingStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BackingStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isSplittable

      public boolean isSplittable()
      Returns true if this strategy allows splitting.
      Returns:
      true for MINIMAL and PROPORTIONAL, false for FIXED
    • hasFineGrainedSplits

      public boolean hasFineGrainedSplits()
      Returns true if this strategy supports fine-grained splits.
      Returns:
      true only for PROPORTIONAL