# Mathematical Fun with ErgoScript#

Just for fun, I decided to see how hard it would be to create a "bounty" protected by some mathematical problem. I was inspired by today's announcement that 42 can be written as the sum of three cubes:

42 = (−80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3

I created the following trivial contract:

{
val a = getVar[BigInt](1).get
val b = getVar[BigInt](2).get
val c = getVar[BigInt](3).get

a * a * a + b * b * b + c * c * c == 42
}


I converted this to a P2S address using a simple P2S web tool that I'm working on, which gave me this P2S address:

YUgUAFeNudkkLfjWcnXfg6HphUDaWdaR88yTQHeP6oozcvvwbM74SRZPW1R3WrqYmyp5vM4PhC2SuTfMA

Now, in order to claim the "bounty", I created an unsigned transaction with the three values above included in the extension field under spendingProof. No signature was necessary, of course, just the correct values that solve the puzzle. I successfully claimed the bounty and sent it on to the crowdfunding CLI project!
• It would be good to have better documentation for ErgoScript; in particular, I was confused about BigInt and whether it represented 256-bit integers as noted here, or arbitrary-precision integers due to the use of java.math.BigInteger internally -- it has now been confirmed to represent 256-bit integers.