My inspiration came to me when I was studying engineering in University and I was taking difficult math classes such as multivariable calculus, linear algebra. To learn a lot of these concepts, I found it very helpful to see step-by-step solutions of a given problem. There are online, advanced math calculators out there already that are either free and not fully featured or they are fully featured and require a monthly subscription to view the solutions.

As I've been religiously learning about Bitcoin since August 2017, I was inspired by my passion to create a solution.

What it does

Obilisk will currently compute user inputted arithmetic and algebraic problems and give the user the answer. A solution can also be provided on the condition that they pay a micro-fee (on the order of a few thousand sats). In the future, options to compute more difficult math problems in fields such as calculus, differential equations, etc, will be added.

How I built it

The backend of Obilisk is built using Flask as a framework. All of the math algorithms, with the exception of the Jenkins-Traub algorithm, were designed from scratch and written in python. They are based on known mathematical formulas such as Cardano's method, quadratic formula, etc.

The front end of Obilisk is made using HTML, CSS and Javascript.

With the help of the Internet (Stack Overflow, LNDs Slack channel and in particular), I was able to program Obilisk myself.

How users are charged is calculated in one of two ways: 1. an API call to coinmarketcap is made to see the current exchange averaged price of Bitcoin. That value is then used to calculate the equivalent of $0.25 CAD in sats. 2. the total memory consumption for the duration of the math algorithm is multiplied by some constant.

Challenges I ran into

As I am mostly a self-taught programmer, there were many challenges with designing this website. Learning new programming languages, learning object oriented programming, figuring out how to write a program that can take a string of text, i.e. the equation, and transform it into understandable mathematical instructions.

One of the biggest challenges was developing the BEMDAS algorithm. Basically the algorithm that can properly solve math equations following the rules of BEMDAS. After spending quite some time tackling this problem, I realized that using recursion would greatly simplify the problem. I also challenged myself not to consult the internet for other peoples code for this algorithm.

I also ran into many other challenges. How to configure my lightning node, how to make gRPC calls to the node, how to launch a website using cloud computing, how to link a domain name to an IP address using nameservers and a records. All of these issues were due to my lack of experience in the field.

Accomplishments that I'm proud of

Teaching myself how to code and pushing through the many hurdles that came with the design of this project. Overall, I am proud of myself for persevering. As someone once said, good ideas are a dime a dozen but execution is priceless.

I think I am most proud of figuring out that initial algorithm that implements the rules of BEMDAS properly.

What I learned

Aside from the obvious (learning how to code, learning about the architecture of Bitcoin and the Lightning Network), I also learned many soft skills such as how to breakdown tasks into manageable steps and how to set goals and achieve them. I learned a lot about how the Internet works from a DNS/webserver perspective. I also learned many useful unix commands and how to use SSH which are industry standard practices. The unix commands has greatly enriched my computer experiences and has allowed me to do more troubleshooting on my own.

What's next for

Adding ability to do calculus functions (derivatives and integrals). Matrix and vector operations. Adding ability to pay for bulk calculations. Lots of bug fixes. I'd also like to design a better UI/UX.

My long term version is to offer more than just advanced math solutions. I would like to offer cloud computation for complex calculations like Computational Fluid Dynamics, or other rendering/simulation work.

I'd also like to add a feature where users can take pictures of written equations and with computer vision, the webapp can decypher the equation and solve it. I could create a circular economy by having users train the machine learning algorithm by solving Captcha style puzzles and pay them a few sats for doing so.

Share this project: