Modelling a Java Ring based implementation of an N-Count payment system

N-Count is a system for offline value transfer. A prototype of an N-Count payment system has been designed, and it has been implemented in Java. We have used the Java Ring with the Java Card API as a secure device. The system has also been modelled using the Spin model checker. The combined prototyping and model checking has made it possible to investigate safety properties of the prototype, both formally and intuitively. Because of this model building activity, problems have been identified and solved before an actual system has been built.