I've started a new (free online) book(let) titled
Programming Bitcoin Script Transaction (Crypto) Contracts
Step-by-Step (in Ruby) .
Let's start with building your own bitcoin stack machine from zero /
scratch and let's run your own bitcoin ops (operations)...
## A simple stack machine
def op_add( stack )
left = stack.pop
right = stack.pop
stack.push( left + right )
def op_2( stack )
stack.push( 2 )
## Let's run!
stack = 
op_2( stack ) #=> stack = 
op_2( stack ) #=> stack = [2,2]
op_add( stack ) #=> stack = 
Unlock the ?+2=4 puzzle on your own computer and
win "unspent transaction outputs" (UTXOs) on your own testnet.
Happy bitcoin scripting with ruby.