TAP IVMS 101
A complete implementation of the IVMS 101.2023 data model for the Travel Asset Protocol (TAP).
Overview
This crate provides a comprehensive implementation of the interVASP Messaging Standard (IVMS) 101.2023, which is used for Travel Rule compliance in virtual asset transfers. IVMS 101 is the global standard for exchanging required originator and beneficiary information between Virtual Asset Service Providers (VASPs) to comply with FATF Recommendation 16.
Key Components
- Person Entities: Natural Person and Legal Person data structures with comprehensive identity information
- Transaction Participants: Originator, Beneficiary, Originating VASP, and Beneficiary VASP
- Transaction Data: Amount, currency, identifiers, payment types, and network information
- Geographic Addresses: Full postal address support with multiple address types
- Identification: National IDs, customer numbers, LEI, BIC, and other identifiers
- Validation: Built-in validation for all fields including ISO standards
- Builder Patterns: Ergonomic construction of complex data structures
Features
- Complete Data Model: Implements all IVMS 101.2023 data structures
- Validation: Built-in validation for all fields including country codes, currency codes, LEI, BIC
- Builder Patterns: Ergonomic builders for constructing complex data structures
- Serialization: Full serde support for JSON serialization/deserialization
- Type Safety: Type-safe enumerations prevent invalid values
- Documentation: Comprehensive documentation with examples
Usage
Add to your Cargo.toml:
[]
= "0.1.0"
Basic Example
use *;
use *;
use *;
// Create a natural person
let person_name = new
.legal_name
.build?;
let person = new
.name
.country_of_residence
.national_id
.build?;
// Create a legal person (VASP)
let vasp_name = new
.legal_name
.build?;
let vasp = new
.name
.lei?
.country_of_registration
.build?;
// Create an IVMS message
let message = new
.originator
.beneficiary
.originating_vasp
.transaction?
.build?;
// Serialize to JSON
let json = message.to_json_pretty?;
Working with Geographic Addresses
use *;
use *;
let address = new
.address_type
.street_name
.building_number
.post_code
.town_name
.country
.build?;
let person = new
.name
.add_address
.build?;
Validation
All data structures include comprehensive validation to ensure compliance:
use *;
// Validate country codes (ISO 3166)
validate_country_code?; // OK
validate_country_code?; // Error: must be 2 characters
validate_country_code?; // Error: invalid country code
// Validate currency codes (ISO 4217)
validate_currency_code?; // OK
validate_currency_code?; // OK
validate_currency_code?; // Error: not ISO 4217
// Validate LEI (Legal Entity Identifier)
validate_lei?; // OK
validate_lei?; // Error: must be 20 characters
// Validate BIC/SWIFT codes
validate_bic?; // OK (8 chars)
validate_bic?; // OK (11 chars)
validate_bic?; // Error: wrong length
// Validate required fields
let person = new
.build; // Error: missing required name field
IVMS 101 Compliance
This implementation follows the IVMS 101.2023 specification, ensuring full compliance with Travel Rule requirements:
Data Structures
- Natural Person: Individual persons with names, addresses, national IDs, date/place of birth
- Legal Person: Organizations/VASPs with legal names, LEI, BIC, registration details
- Name Types: Support for legal, trading, shortened, and phonetic names
- Address Types: Home, business, geographic, and other address classifications
- ID Types: National ID, passport, driver's license, customer ID, and more
Transaction Information
- Amount and currency (ISO 4217)
- Transaction direction (incoming/outgoing)
- Transaction identifiers and blockchain hashes
- Payment type codes
- Network information
Validation Rules
- ISO 3166 country codes (2-letter)
- ISO 4217 currency codes (3-letter)
- LEI format validation (20 characters)
- BIC/SWIFT code validation (8 or 11 characters)
- Required field enforcement
- String length constraints
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Integration with TAP
This crate is designed to work seamlessly with the Travel Asset Protocol (TAP) ecosystem:
use IvmsMessage;
use Transfer;
// Create IVMS data for a TAP transfer
let ivms_data = new
// ... build IVMS message
.build?;
// Attach to TAP transfer message
let transfer = Transfer ;
Error Handling
The crate provides detailed error messages for validation failures:
use IvmsError;
match result