Firearms regulation once again became a controversial and hot topic due to the recent school shooting in Florida, sparking much discussion and debate from both sides of the issue. At the moment, the background check for gun purchases only encompasses NICS (the National Instant Criminal Background Check System), which involves 3 databases. The background check includes: convictions at the federal level (ATF), convictions at the state level, and designations of mental defective/residing or having resided in a mental institution.

We created "B-Gun," a website that can assist with the operations of cooperating government agencies using their databases of records with blockchain technology. One of our sources of inspiration was the Estonian government, which utilizes guardtime blockchain to protect patient records. We drew inspiration from their example in encrypting legal documents as part of background checks for blockchain. Ultimately, our website ensures the privacy of the end-user, the gun permit applicant, and guarantees greater efficiency of government agencies when it comes to verifying one's right to carry a license and bear arms--all without changing any current legislation regarding gun control. Under the new proposed system of background check, information about the gun applicant, including sensitive information such as mental health statements, can be passed from agency to agency with much more security compared to the old system, where leaks and cyberattacks are a real possibility. Furthermore, B-Gun connects federal government background check processes to state and local government processes more seamlessly, and is better able to keep track of paperwork so each agency only has access to paperwork they are supposed to have access to.

What it does

We created a website for people who want to apply to be gun registration owners that includes information about the gun registration process and an option to contact a representative, but at its core is the registration process. After the user fills out the registration page, he/she is taken to a page to complete user registration so he/she can log in to check on progress anytime. To ensure privacy of transfer of data between the gun applicant and the government agencies, we anchor data to the blockchain to prove the integrity and timestamp of any data using Tierion. We are using Tierion to store information about the applicant in a decentralized network. User registration information is stored in a database that we built, along with the hash of file associated with the user.

Since the hash is only visible on blockchain, and not through the encrypted file, the privacy of the information contained in the records is ensured. The government agencies use smart contract blockchain technology to verify records as part of background checks. The smart contracts ensure that the correct government agencies have access to the documents and that the correct agencies are approving or disapproving of gun permit applicants, which is based on the agencies’ addresses.

How we built it

We built the front-end of our website, which consists of forms for the gun owner to complete regarding the gun purchase, using HTML, CSS, and JavaScript in PyCharm. The Microsoft azure database, which stores the legal and medical documents of the gun permit applicant (in the form of form fields), was built using the Microsoft Azure API. The blockchain technology involved in the hashing (encryption) of these documents was built using the Tierion API, which allowed us to encrypt the documents once sent to the azure database and before being retrieved by government agencies. We utilized the Ethereum RPC test client as a framework for our smart contract blockchain, which was built in Remix IDE using Solidity and serves as the mode of verification for government agencies to approve background checks. The Web3.js was used to connect our localhost client to the Ethereum test framework. For the front-end of the form, viewed by the government agencies, we used HTML and CSS. For integrating the separate components together--the website, the form fields, the database, the encrypting blockchain, and the smart contracts--we had to integrate the various APIs required, and used Express.js and Node.js in the process.

Challenges we ran into

One of our greatest challenges was conceptualizing the blockchain technology, and implementing it given our specifications and modifications to the most widespread use of blockchain (for cryptocurrency), since none of us were familiar with the technical side of blockchain. After scouring through many tutorials, we initially looked into creating a blockchain from scratch and connecting to it via Postman or cURL. However, we realized that the blockchain we had written lacked many of the complicated functionalities, such as a method for transaction validation, and that--given the time constraints--we would be much better off using the Ethereum RPC client for testing. Then we had to determine how to retrieve legal files from the azure database and hash, or encrypt, the files. We first sought to build this ourselves, but discovered the Tierion API, which had many of the advanced capabilities we were looking for. Next, integrating the hash to the website from Solidity, and configuring the encrypted documents to be sent from the web site to the Microsoft azure database was our next biggest challenge. This required much debugging and trial-and-error. Finally, working with the Microsoft azure API and the Tierion API in order to integrate those with the website was our final obstacle. We managed to overcome this through sending messages from server to server--rather than from the original server to the Microsoft azure database and Tierion separately.

Accomplishments that we're proud of

We’re super proud that we learned blockchain! Further, we have shown that we are able to persist through difficulties as revealed through our initial lack of technical knowledge about blockchain, and that we have what it takes to create a website using blockchain technology in only 24 hours! This experience has allowed us to take an interest and learn--under a time constraint--coding languages that some of us have never encountered before. After our AthenaHacks 2018 experience, we have surely made a personal commitment to learn more about areas of interest in computing, specifically the particulars of blockchain technology (what makes it so convoluted to build, etc.) as well as various APIs available for projects, on our own time.

What we learned

As women with a keen interest in the integration of technology in solving our modern day social issues, the issue of gun control undoubtedly caught our attention. Through our experience at AthenaHacks, we have not only learned the technical details of building blockchain, integrating blockchain with a website, encrypting documents for cybersecurity purposes, but the craft of delegating tasks between team members who exude strength in particular skills.

What's next for B-Gun

In the future, the website will use a Microsoft API to conduct sentiment analysis for indications of mental illness from the mental institution/healthcare records to deem whether the person apply qualifies. If the analysis deems that the person is not a fit for a firearm they will be denied. If the person would like to appeal, they will have 30 days to apply with the appropriate records to dispute the process. In addition, linked timestamping would be incorporated through records that would be KSI-instrumented (keyless signature infrastructure), in which a formal proof and distributed consensus are required, and based on hash function cryptography.

We’ve had a great time at AthenaHacks 2018! Thank you to the organizers, sponsors, and mentors for their hard work, efforts, and time. We appreciate this opportunity to learn and build collaboratively and creatively, and we hope to see you next year!

Built With

Share this project: