Inspiration
In today’s fast-paced regulatory environment, organizations must navigate complex and ever-evolving compliance requirements. Blockchain technology introduces both opportunities and challenges for payment systems due to its transparency, decentralization, and efficiency. However, the movement of money remains a highly regulated activity requiring strict compliance with legislation. Traditional manual compliance processes are time-consuming, error-prone, and unsuitable for the immutable nature of blockchain transactions. This inspired us to develop a Blockchain Payment Compliance Framework and an AI-driven Compliance Rule Mining Agent to streamline compliance processes while enabling on-chain implementation of compliance rules.
What it does
The Blockchain Payment Compliance Framework integrates compliance directly into blockchain transactions using smart contracts written in Solidity. This approach ensures that regulatory adherence is maintained on-chain, with the ability to dynamically update rules as regulations evolve. Complementing this framework is the AI-driven Compliance Rule Mining Agent, which automates the extraction of compliance rules from unstructured documents, such as regulatory guidelines and contracts. The agent is capable of identifying blacklisted countries and extracting payment threshold requirements, generating deployable Solidity code for compliance. By enabling users to upload regulatory documents and customize compliance rules, the system ensures adaptability, accuracy, and efficiency in navigating complex regulations.
How we built it
Blockchain
Programming Language
Our blockchain system was developed using the Solidity language, which allows us to create smart contracts compatible with the Ethereum chain.
Design Patterns
We used the factory pattern to generate Payment contracts from within another contract. We also used the chain-of-responsibility pattern to allow Compliance contracts to be layered on top of each other. This permits compliance rules to be refreshed and updated despite the immutable nature of deployed blockchain contracts.
Security
While security was not the primary focus in building our prototype, we ensured to include basic security features such as using the ownerOnly modifier to ensure only the creator of the PaymentProcessor contract could execute its functions. We also used private variables where required to mask potentially sensitive data from the public.
AI
Data Processing
We began by converting PDF documents to text using tools like PyPDF2 and NLTK. Next, we leveraged spaCy, an advanced NLP library, to extract entities (e.g., countries, monetary values) from the documents.
Model Training
We trained a BERT-based sequence classifier on annotated sentences to predict whether a sentence is relevant to blacklists or thresholds. Expert-annotated data was used to create training datasets for supervised learning, ensuring that the models captured the nuances of compliance language.
Inference Module
To enhance prediction accuracy, we integrated external resources like WordNet for country name standardization. Two modules were developed: Blacklist Country Generator: Identifies references to blacklisted countries. Threshold Generator: Detects specific regulatory thresholds mentioned in contracts.
Contract Engine
The predictions from the models were fed into a custom-built Contract Engine that generates a compliance contract template.
Challenges we ran into
Extracting structured data from unstructured PDF files was challenging due to formatting inconsistencies across documents, which required extensive preprocessing efforts. Scalability posed another critical hurdle, particularly in processing large volumes of documents efficiently. We addressed this by leveraging SpaCy to filter out irrelevant content, prioritizing sentences containing relevant named entities, which significantly improved the pipeline’s performance.
Accomplishments that we're proud of
We are proud to have successfully developed an end-to-end AI pipeline that automates the extraction of compliance rules from complex, unstructured documents, significantly reducing manual effort and improving accuracy.
One of our key accomplishments was fine-tuning BERT-based models to achieve high precision in classifying sentences related to blacklists and thresholds. Overcoming significant data preprocessing challenges, we ensured that our system could handle diverse document formats efficiently. Additionally, we built a robust inference module, which leverages external resources like WordNet to enhance entity recognition and standardization. Another major achievement was creating a custom Contract Engine capable of generating compliance-ready templates, streamlining the compliance process for legal teams. Finally, we delivered a scalable solution that can process large volumes of documents while maintaining high accuracy and performance, demonstrating the robustness of our approach.
Another key accomplishment that we are proud of is successfully implementing a functional suite of contracts on the blockchain. Blockchain development, due to the many security features, is intentionally cumbersome and difficult. Due to our understanding of the rationale behind these security features, we were able to identify which ones we could safely circumvent to get to a tangible end product. For example, any functionality that involves the transfer of eth within Solidity comes with many requirements on how the contract is defined and who is executing the contract. Since this was not material to a prototype, we circumvented this issue by introducing a simplified ERC20 token as the instrument of transaction.
What we learned
Throughout this project, we gained deep insights into various areas, particularly in leveraging advanced NLP models for precise entity recognition and classification. We explored transformer-based models like BERT, utilized SpaCy for named entity recognition (NER), employed NLTK for text preprocessing, and integrated WordNet to reconcile different country naming conventions. Building high-quality training datasets required meticulous annotation and expert input to ensure accuracy. Additionally, we developed a deeper understanding of compliance terminology, especially concerning blacklists and thresholds, which was instrumental in designing the rule extraction engine. Fine-tuning and deploying BERT-based models for specialized tasks, such as blacklist and threshold sentence prediction, further enhanced our expertise. However, despite the usefulness of these tools, real-life challenges made the process complex. Issues such as ambiguous language, incomplete data, and evolving regulatory requirements often demanded iterative refinement and careful handling to achieve reliable results.
What's next for Regulatory Intelligence
Moving forward, our primary focus is to enhance the adaptability and scalability of the AI-driven Compliance Rule Mining Agent. We plan to expand its scope by incorporating additional regulatory domains, such as financial compliance, environmental regulations, and data privacy laws. To improve accuracy further, we aim to train more specialized models using larger and more diverse datasets, enabling the system to handle complex language nuances and evolving regulatory terminology more effectively.
In addition, we plan to integrate real-time updates from regulatory databases, ensuring that the system remains current with changing laws and policies. We are also exploring the possibility of adding explainability features, enabling users to understand why specific rules were extracted and how decisions were made. Another key step is developing a user-friendly dashboard that allows compliance teams to visualize extracted rules, customize thresholds, and generate reports effortlessly.
Lastly, we envision expanding the deployment options by offering cloud-based and on-premise solutions to cater to organizations with varying security and infrastructure requirements. By continuously improving performance, broadening functionality, and enhancing user experience, we aim to make Regulatory Intelligence an indispensable tool for compliance teams across industries.
Log in or sign up for Devpost to join the conversation.