Abstract:$\mathcal F$-metrics are metrics based on projective sets. In this paper, construction of optimal codes for a special $\mathcal F$-metric associated with a generalized Vandermonde matrix is given. Encoding and fast decoding algorithms are described. A public-key cryptosystem is considered as an example of a possible application of codes constructed.