ZK Firma Digital is a zero-knowledge protocol that allows Costa Rican Firma Digital card owners to prove their identity in a privacy preserving way. It provides a set of tools to generate and verify proofs, authenticate users and verify proofs off/on-chain.
The project aims to develop a zero-knowledge proof infrastructure solution for enhancing Costa Rica's digital identity system. Our goal is to strengthen citizen privacy by minimizing data collection, enabling individuals to access a wide range of valuable services without disclosing sensitive information.
See the documentation for more details.
The Costa Rican government offers an advanced digital identity system (Firma Digital) that allows residents or entities to sign documents with a digital identity validated by the central bank as CA and authenticate themselves on various public or private websites and services. However, there is a significant privacy concern related to sensitive data in Costa Rica. A small amount of identity information, such as a national ID number or car plate number, can lead to extensive data collection. Private companies can use this kind of data to harvest citizen data, for instance, by calling and offering them products or services without any previous request or permission. This fact is exceptionally relevant now that big corporations harvest indiscriminate user data to train AI models. Even worse, criminals are collecting this same data to perform identity theft and fraud, sometimes even making fraudulent calls from the jails.
Our project aims to address these privacy issues by developing a zero-knowledge proof infrastructure using blockchain technology and ZK circuits. This solution will enable citizens to verify their identity and provide specific information without revealing actual personal details. By minimizing the distribution of sensitive data across various institutions and companies, we can significantly reduce the risk of data theft. Additionally, this system can authenticate users for diverse services, ensuring they are real individuals and not bots, without requiring sensitive information such as email addresses or phone numbers.
- Anonymous authentication
- Descentralized anonymous voting
- Anonymous proof of humanity
- Health data privacy
- Know Your Customer
- Privacy-Preserving Verification
- Anti-Sybil Mechanisms
- DAO Governance
- Quadratic Funding (QF)
- Wallet Recovery
- And many more!
-
Download the installer: Windows Installer
-
Verify the sha256 hash:
certutil -hashfile "C:\file\path\zk-firma-digital-0.5.exe" SHA256
The result should match:
a12d82222533d546b0364a2589ced1ecc024ce49d89881ad94b48c4f2e2b4c61 zk-firma-digital-0.5.exe
-
Run the installer if the hash matches.
Note: The Windows installer includes a couple of Javascript dependencies, Nodejs and Snarkjs. The installer also includes the zkey necessary for generating valid ZK proofs, which makes it a bit heavy.
-
Launch the program:
- Insert your smart card into a USB port.
- Run:
"C:\Program Files\zk-firma-digital\zk-firma-digital.exe"
- Alternatively, search for ZK Firma Digital in the Start menu.
- Download the installer:
wget https://app.sakundi.io:9090/zk-firma-digital_0.5_amd64.deb
- Verify the sha256 hash:
The result should match:
sha256sum zk-firma-digital_0.5_amd64.deb
f7924230256b432a755746f7e86455f292f4e2659acc1f46e6db09c08c04b407 zk-firma-digital_0.5_amd64.deb
- Install the Debian package:
sudo dpkg -i zk-firma-digital_0.5_amd64.deb
- Launch the program:
- Insert your smart card into a USB port.
- Run:
/usr/share/zk-firma-digital/zk-firma-digital.bin
- Alternatively, search for the app in your application launcher.
- Clone the repository:
git clone https://github.com/kuronosec/zk-firma-digital cd zk-firma-digital
- Run the build script:
./builder/build_linux.sh
-
Install the prerequisites:
- Git for Windows
- Python 3.10+
- Install PyInstaller:
pip install pyinstaller
- Inno Setup
- Configure antivirus to exclude the build and release directories.
-
Clone the Repository:
git clone https://github.com/kuronosec/zk-firma-digital.git cd zk-firma-digital
-
Run the build script:
./builder/build_windows.sh
-
Locate the output files:
- Executable:
build
directory. - Installer:
release
directory.
- Executable:
-
Troubleshooting:
- Antivirus or Security Issues: During the build process, your antivirus software (including Windows Defender) may flag the generated
.exe
file as a potential threat. This is a common issue with self-built executables. To resolve it:- Add Exclusions: Configure your antivirus or security software to exclude the build and release directories.
- For Windows Defender:
- Open Windows Security.
- Navigate to Virus & threat protection.
- Click on Manage settings under Virus & threat protection settings.
- Toggle Real Time Protection off temporarily (if necessary).
- Scroll down to Exclusions and click on Add or remove exclusions.
- Add the paths for both the
build
andrelease
directories to the exclusion list.
- For Windows Defender:
- Validate the Executable: After adding exclusions, rerun the build process and verify that the executable runs without being flagged.
- Add Exclusions: Configure your antivirus or security software to exclude the build and release directories.
- Missing Tools or Command Errors: If you encounter errors like
command not found
when running the build script, it may indicate missing tools or misconfigured system paths. Follow these steps:- Review the build script for errors or missing dependencies.
- Consult the repository's issues page or documentation for additional support.
- Antivirus or Security Issues: During the build process, your antivirus software (including Windows Defender) may flag the generated
Once you generate a ZK credential (a JSON file) using your Firma Digital card, you can test it by authenticating on this Proof of Concept (PoC) website:
- Website: http://app.sakundi.io:8080/
- Source code: GitHub Repository
- Example credential: residence-credential.json