# What is the agent for?
To use Operate, the agent is the primary tool developers need in order to integrate Operate in their apps. It can be seen as a Bitcoin interface layer - it is responsible for loading programs (tapes) from transactions, it loads all of the necessary Ops, runs the tape in a VM and returns a result.
Now Operate offers two alternative agent implementations, and we're committed to supporting both:
- Elixir - Original implementation. Ideal for performant and scalable back-end apps.
# Try Operate right now!
You may need to manually load the Operate library. Paste the following in to the console above.
To get started, copy and paste the following line into the console to configure the agent with a number of aliases for common Bitcoin protocols. Not every transaction will be compatible with Operate, but with these common aliases you should be able to play with transactions from some popular Bitcoin apps.
# Twetch example
Next up, try loading and running a tape from any transaction. Lets try this example from Twetch:
// Load a Tape tape = await Operate .loadTape('d732924fdde726203ccec9f0a4589c78f149341b899d864e36af88938efa2553') // Run the Tape result = await Operate.runTape(tape) // Convert Map to Object data = Operate.util.mapToObject(result)
At each step in the above code, try inspecting the returned data. You'll notice the
result is by default returned as an instance of
# Bit.sv example
Next up, lets try the same with a Bit.sv transaction:
tape = await Operate .loadTape('9fab521bf3859da182c4bfb85499bba6f1f2a5b5658c96a079be84a56ccd3078') result = await Operate.runTape(tape) data = Operate.util.mapToObject(result) // Traverse the metanet node parent = await data._META.parent()
The final line there gives a hint as to what Operate offers app developers. Not only does Operate parse transactions and implement all these data protocols, but it is returning interactive objects with functions attached. Bit.sv transactions are Metanet nodes, so we can create Ops that implement the Metanet protocol and provide functions for traversing the tree.
Wouldn't it be great if there was also an Op for the Bit.sv protocol that provides functions handling decryption of the private data, given the correct private key? This is what interoperability looks like with Operate.
# Learning more about Operate
In addition, head over to the Github repository to browse the source code.