No description
  • Haskell 99.8%
  • Nix 0.2%
Find a file
2025-06-02 01:02:46 +02:00
app dhall -> toml + ghc 9.6.6 -> 9.8.4 + country-codes -> iso3166-country-codes 2025-06-02 01:02:46 +02:00
files
LICENSE
src/KYCheck dhall -> toml + ghc 9.6.6 -> 9.8.4 + country-codes -> iso3166-country-codes 2025-06-02 01:02:46 +02:00
test dhall -> toml + ghc 9.6.6 -> 9.8.4 + country-codes -> iso3166-country-codes 2025-06-02 01:02:46 +02:00
CHANGELOG.md
kycheck.conf dhall -> toml + ghc 9.6.6 -> 9.8.4 + country-codes -> iso3166-country-codes 2025-06-02 01:02:46 +02:00
kycheck.example.conf dhall -> toml + ghc 9.6.6 -> 9.8.4 + country-codes -> iso3166-country-codes 2025-06-02 01:02:46 +02:00
package.yaml dhall -> toml + ghc 9.6.6 -> 9.8.4 + country-codes -> iso3166-country-codes 2025-06-02 01:02:46 +02:00
README.md dhall -> toml + ghc 9.6.6 -> 9.8.4 + country-codes -> iso3166-country-codes 2025-06-02 01:02:46 +02:00
shell.nix
stack.yaml dhall -> toml + ghc 9.6.6 -> 9.8.4 + country-codes -> iso3166-country-codes 2025-06-02 01:02:46 +02:00

KYCheck

KYCheck is a Counter Terrorist Financing (CTF) sanction processing tool written in Haskell. It can be used for compliance processes in software such as GNU Taler.

The most recent XML sanction list should be downloaded from the Swiss State Secretariat for Economic Affairs (SECO). In the future additional sanction lists can be added.

Prepare for installation

Download the repository containing all the source files

Then make sure you have The Haskell Tool Stack installed. When using Nix, you can just type:

$ nix-shell

Stack configuration

Currently the stack configuration is set for GHC version 9.8.4. If you have a different version installed, that is likely perfectly fine - but you'll need to change some things.

First, find out what version of GHC you are working with:

$ ghc --version

Then look up which version of LTS (Long Term Support) Haskell packages matches your version of GHC. You can find an overview on Stackage.

Update your stack.yaml:

snapshot: lts-23.24

Should become:

snapshot: lts-YOUR.VERSION

Install and run

Once stack is installed, we can install kycheck with the command:

$ stack install --local-bin-path DESTINATION_FOLDER

If you do not specify a path, the binary will be placed in ~/.local/bin by default. This means you can run it from there or copy it to the desired location afterwards as well.

$ ~/.local/bin/kycheck --help

You can either provide all the parameters on the command line, or use a configuration file (in Dhall. There is an example configuration file called kycheck.conf available, with reasonably sane defaults. You can specify your own using the flag --config.

Start the application (we recommend using the more verbose option (using --info) until you've gained some experience with the tool), and wait until the data is loaded and the application indicates it is ready to receive your input. After that, you can paste in data about people and organisations you want to check against. Use jsonlines, one line per person or entity. E.g. if you paste:

{"full_name" : "Maria Consuela", "last_name" : "", "address" : { "country" : "GT", "street_name" : "Unknown", "street_number" : "", "zipcode" : "" }, "birthdate" : "1953-06-23", "nationality" : "GT", "national_id" : "" }

kycheck will print something like:

Score {match_quality = 0.85357136, confidence = 0.9311688, expiration = 0, reference = 73508}

If there are multiple entries that match, kycheck will print all of them so you can investigate.

Enter new lines with subject data until you've researched all.

You can also check out legal entities. Using an example organisation from our tests (note that this is an example entity that is not on the sanction list, so we need to provide our own alternative 'sanction list'):

$ .local/bin/kycheck --config kycheck.example.conf --input test/data/target_1.xml

The input:

{"company_name" : "Eindhoven University of Technology", "id" : "abcdef", "address" : { "country" : "NL", "street_name" : "Groene Loper", "street_number" : "3", "zipcode" : "5612 AE", "town_location" : "Eindhoven" } }

Will yield this output:

Score {match_quality = 0.90476197, confidence = 0.98701304, expiration = 0, reference = 1}

You can exit the application by typing the word 'quit' and pressing enter, or by pressing <ctrl> C.

Testing

There are a lot of tests included. If you want to make sure that everything works as advertised, run all the implemented tests via this command:

$ stack test

Updating

Update the repository, and repeat the above steps.