Stashed Cash 1 Solution
Ledger Treasure is our newsletter that contains a new Bitcoin Cash puzzle each month. The first person to solve the puzzle is be able to claim the BCH prize. You can sign up here if you would like to participate in the future Ledger Treasure puzzles for a chance each month to claim over $100 of Bitcoin Cash hidden on the BCH blockchain.
The first issue of Ledger Treasure was emailed to registered subscribers on December 1st. The puzzle contained within the newsletter was called “Stashed Cash 1”. Within an hour of the puzzle email announcement someone was able to solve the puzzle and claim the prize. Great work!
The 1 BCH treasure was found here:
Claimed here (
1) Loading the Template
2) Finding the Treasure
The first challenge is to find the location of the treasure, meaning you need to figure out what bitcoin address is holding the 1 BCH. To do this you need to fill out the blanks in the redeem script section before the address can be known. The following math problem is presented in the script template:
<X1> <X2> <X3> OP_SUB OP_ADD OP_16 OP_EQUAL
This Script is equivalent to: X1 + ( X2 – X3 ) = 16.
To get a better understanding of how this stack-based math is working please study Figure 1, which illustrates how the computer evaluates the operators defined in the script template JSON.
Note: The use of OP_EQUAL would normally leave either 1 or 0 on the top of the stack, but since OP_EQUALVERIFY is used the stack is left empty at the end of the following example. Normally an empty stack would lead to script failure, but in this case, it is acceptable because there is more code to be executed to the right of OP_EQUALVERIFY that is shown in Figure 2 below.
Figure 1: Puzzle Math Problem (showing part of the Script)
X1 = “half a dozen” = 6 => 0x06*
X2 = “fictional character of the Netflix science fiction horror series Stranger Things” = 11 => 0x0b*
X3 = “some number (solve for X3)” = – (16 – X1 – X2) =– (16 – 6 – 11) = 1 => 0x01*
* – BIP62 logic converts these values to 0x56, 0x5b, and 0x51 within the redeem script.
3) Using the Oracle
The final requirement of this puzzle was to interact with the Ledger Treasure Newsletter Subscriber Oracle, which is accomplished using the “Oracles” tab of the Cashy website. The oracle’s public key was required for the redeem script section and the unlocking script section oracle’s signature was required for the unlocking script section in the “Spend” tab.
The only way to obtain a valid signature for this puzzle is to first be a subscriber of the Ledger Treasure newsletter.
Figure 2 illustrates the Script execution for the entire puzzle.
Figure 2: Execution process and stack for the whole puzzle
Overall this first puzzle was a success. There were at least three individuals who were able to solve the puzzle within three days of the puzzle release (Dec 1st). Initial feedback has been very positive and I am looking forward to possibly doing these puzzles more often than once per month.
The difficulty of this puzzle was not hard, but it requires the players take time to think about what is going on and maybe learn a little bit about Script. Eventually, these puzzles should become more difficult and we’ll need to find a way to increase the difficulty puzzles while also having simple puzzles for newcomers.
Please let me know your thoughts on this puzzle solution or anything about Cashy website in the comments below.
Make sure you’re signed up for the newsletter as the January 1st puzzle coming up soon!
(1) All references to P2SH.cash were removed and replaced with Cashy.
(2) Fixed missing oracle public key in figure 2.