Block Collider OP Codes

#1

All events in the blockchain universe can be expressed in NRG (energy). This is the over all design philosophy of the multichain scripting language.

Below you can find an overview of all the OP_CODE functions explained. Click the Codes for their detailed descriptions:

3 Likes

FAQ's for Borderless UD Mode
#2

OP_MONOID

The first operation is called “OP_MONOID”. This “opcode” must be the first argument in your script and is the first of several which introduce set theory logic into the multichain. Monoids pull the operating context off of the stack and allow any address to spend the NRG value as long as it runs the Monoid script first. Once a sequence of transactions start operating in the monadic set you can create amazing decentralized applications which behave like as if they were on their own chain without adding the bloat of a new blockchain.

How do I use it?

The implications of OP_MONOID are far reaching. The first: using Monoids to settle and resolve partial orders. Unlike atomic swaps which create inefficient markets. Monadic settlements allow takers to take some of an order. OP_MONOID is designed to enable settlement between thousands of parties in a single transaction.

1 Like

#3

OP_EMERGENCY

Do what you can, with what you have, where you are. ” ~ TR

The second operation is “OP_EMERGENCY”. The function represents an event flag which means that it signals miners to evaluate the transaction in a specific context–generally no fees. The function requires setting an expiration block height when the OP_EMERGENCY is no longer active, an optional Super Collider reference, and a event public key. The event public key is determined by the non-governmental organization (NGO) or sovereign nation and provided by their own communication channels.

How do I use it?

As globalisation continues and communication becomes more efficient we can greatly improve the way we as the human race handle hurricanes, refugees, earthquakes and other calamities. When included in BEAM script, OP_EMERGENCY allows miners to support an event by adding the transaction for free, prioritizing the addition of the transaction into the miner’s block or some other benefit captured in the message. The public key can be arbitrarily set by the NGO nation but in order to prevent any form of spoofing the NGO can deploy a short lived Super Collider whose latest block hash can be included in this field preventing bad agents from free-riding benefits alloted to the specific OP_EMERGENCY.

1 Like

#4

OP_TAKERPAIR

…my dream is to contribute to open source software projects even from within an immobile body. That will be a life very much worth living. ” ~ HF

The third operation is “OP_TAKERPAIR”. The function requires the input of four arguments, the first two arguments are the outpoint referencing the callback of the operation and the next two are the takers spending address and the deposit address of two connected blockchains. The connected chains are inherited from the OP_MAKERCOLL referenced in the OP_CALLBACK which restricts their set type defined in the making transaction.

How do I use it?

OP_TAKERPAIR is a bound operation which means it must be included with OP_CALLBACK and a order type such as “OP_MAKERCOLL” or “OP_MAKERAUCT”. The operation is used to create marketplaces of between blockchains or data feeds connected to the Block Collider or Super Collider in which it is used. OP_TAKERPAIR orders support partial orders, incomplete order types, and schnorr based anonymous transactions.

1 Like

#5

OP_NONCELOCKBL

Conformity is the jailer of freedom and the enemy of growth. ” ~ JFK

The fourth operation is “OP_NONCELOCKBL”. It is critical for use in logistics, transaction miners, insurance linked securities–any event where the real world event is unlocked by providing some level of work to spend. The function requires the input of two arguments, the first argument is a signature signing the work and hash provided and the second is the minimum distance threshold that must be a achieved.

How do I use it?

OP_NONCELOCKBL is a very useful tool for setting unique events for transaction mining on Overline or over the network. For example, if a pool of NRG was held in an insurance council event and the council did not meet in a timely manner a to reimburse policy holders a failsale NONCELOCKBL could be allowed to spend the NRG within a window of time proving that either a miner had enough CPU power to capitalize on the event or that enough policyholders got together to mine together to unlock the NRG in the event the council failed to convene.

1 Like

#6

OP_X

Success consists of going from failure to failure without loss of enthusiasm. ” ~ WC

The fifth operation is “OP_X”. OP_X is a dictionary tool which allows new external data protocols to be added which would traditionally trigger a hard fork on a multichain. The function takes two arguments, the id of the dictionary to be used and the data (up to 64 characters) which is processed by the dictionary and subsequently by the nodes or miners supporting the dictionary.

How do I use it?

OP_X is first used by vanity addresses to simplify trade through human readable addresses 12 characters addresses. These addresses can also be exchanged. OP_X is also used to incorporate the entire Mathematics Subject Classification dictionary allowing academics to submit research to request grants or build upon previous work. A dictionary is also used by supporting nodes which interact over the FIX protocol allowing traditional turret data streams to consume and post orders to Block Collider.

1 Like

#7

OP_MONAD

All potential energy exists in the ether. It may vibrate, and it may rotate, but as regards locomotion it is stationary—the most stationary body we know: absolutely stationary, so to speak; our standard of rest. ” ~ OL

The sixth operation is “OP_MONAD”. This is a bound function meaning that it requires specific operations to also be included in the script. The operations required for OP_MONAD are “OP_MONOID” and or “OP_CALLBACK”. OP_MONAD defines a nested section of the script which means that all the operations after OP_MONAD until OP_ENDMONAD are pushed onto a separate stack. One of the output scripts of the given script matches the stack exactly of OP_MONAD.

How do I use it?

OP_MONAD is used to require a separate operation to be a part of any spending transaction. In BORDERLESS operations OP_MONAD is used to have uncollateralized operations automatically return to the counterparty of the trade regardless of whichever part spends the collateralized NRG. OP_MONAD protects isomorphism for NRG value which was injected into the script in a monadic operation. OP_MONAD could be considered the inverse of OP_MONOID in that OP_MONAD an endofunctor (typed output) and OP_MONOID is the set creating functor (typed input). For more information on Monoids/Monads: https://www.youtube.com/watch?v=DiisKQAkGM4

0 Likes

#8

OP_MINUNITVALUE

“Look deep into nature, and then you will understand everything better.” ~ AE

The seventh operation is “OP_MINUNITVALUE”. The function takes one argument, a numeral value. The value defines a unique equality constraint among the outputs. When the operation is run each output value when the value is the divisor must be equivalent. The restraint could be compared to how OP_MONAD locks in a required script among the outputs. OP_MINUNITVALUE assigns how the outputs divide the NRG captured in the contract.

How do I use it?

OP_MINUNITVALUE is most commonly used in collateralized NRG events such as those found in chain-to-chain interoperability contracts. For example, if a two individuals are participating in the BTC-ETH marketplace on Borderless the OP_MINUNITVALUE is set to “2” when the Maker and Taker have matched. This ensures that when the maker or taker spend the value of collateralized NRG they each receive their respective NRG back.

1 Like

#9

OP_BLAKE2BLC

Thus, a good man, though a slave, is free; but a wicked man, though a king, is a slave. For he serves, not one man alone, but, what is worse, as many masters as he has vices. ” ~ SA

The eighth operation is “OP_BLAKE2BLC”. The function takes one argument, a string. The string is then hashed twice with two forms of the BLAKE2B hash, in order BLAKE2BL then BLAKE2BLS. The operation returns a 40 character string.

How do I use it?

BLAKE2 consistently shows performance gains over the traditional SHA256 and SHA328 and Keccak hashing algorithms. In many use cases especially when operating in a 64 bit environment these gains can be 200%. OP_BLAKE2BLC is a compressed form of a double BLAKE2BL hash which decreases the size and therefore fees of all transactions which use it. To learn more about Blake2: https://blake2.net/acns/slides.html

1 Like

#10

OP_CHECKSIGNOPUBKEY

“The supreme art of war is to subdue the enemy without fighting.”" ~ ST

The ninth operation is “OP_CHECKSIGNOPUBKEY”. The function takes two arguments, message and a signature. From these it rebuilds a Schnorr Signature based cryptographically sound public key. The operation is used in classic lock/unlock transactions of Block Colliders.

How do I use it?

OP_CHECKSIGNOPUBKEY allows users to lock transactions to specific public key combinations without revealing the public key until the transaction claimant provides a spending output. The transaction can become zero-knowledge if the underlying message included is also a public key. Most importantly two parties can confirm a transaction knowing only the source or the destination. The operation is lite and the proof does not requires a full-node sync to confirm.

1 Like

#11

OP_MARK

A good atmosphere and smart people can accomplish a lot. ” ~ JS

The tenth operation is “OP_MARK”. The function a.k.a. takes three arguments, the expiration block height, the blockchain or dataset key, and a public key in address form. The operation uses a an additional fee function called the “window fee”. This fee is calculated based on the size of the window of the operation as set by the expiration block height and an multiplier unique to the operation.

How do I use it?

OP_MARK enables users to establish individual marketplace operations which require events to take place on a given blockchain. For example, a shipping company could sell the transport of a product to a destination based on the address given by OP_MARK and a custom smart contract on Ethereum. Or an initial coin offering could specify the award value for deposits to a specific Bitcoin transaction. Most commonly OP_MARK allows the sale of individual good or products for a fixed value.

1 Like

#12

OP_DEPSET

“The human spirit, driven by an invincible force, will never cease to ask: What is beyond?” ~ LP

The eleventh operation is “OP_DEPSET”. The function three numeral arguments the shift operator, the deposit height, and the settlement height. The operator is in a class of operations which use elements from the operating environment which includes the input transaction, outputs, and callback references. OP_DEPSET adds the shift operator to the multichain height at which the transaction has entered the block and adds the resulting number to both the deposit and settlement height. OP_DEPSET returns a numeral indicating which the window in which the current evaluation is being run.

‘0’ FALSE no start block or outpoint block provided
’1’ TRUE deposit settlement restrictions lifted
’2’ DEPOSIT transaction operating within deposit window
’3’ SETTLE transaction operating within settlement window

How do I use it?

OP_DEPSET allows users to define windows of block heights for time relevant logic. While the operation can be used in many ways, the most common use case became the name of the operator or “the deposit and settlement” windows of a trading operation between blockchains. For example, a Market Maker defines different operations to enforce how quickly an order on Borderless (or any other marketplace on Block Collider) is settled.

0 Likes

#13

OP_ENVOUTPOINTUNIT

Reality is merely an illusion, albeit a very persistent one. ” ~ AE

The twelfth operation is “OP_ENVOUTPOINTUNIT”. This operations does not take an argument and is an environment operator indicated by “ENV” prepending the variable pulled from the environment, in this case “OUTPOINT UNIT”. Every transaction has BTC value operator like Bitcoin, however multichains have both an NRG value and unit operator which restricts outputs to be divisible by the UNIT.

How do I use it?

OP_ENVOUTPOINTUNIT is used to add spending rules on transactions. For instance an insurance policy of NRG which is forcibly split into NRG payouts of a minimum unit size. Or it can be used to enforce that outputs return captured collateral in collateralized NRG transactions.

0 Likes

#14

OP_CHECKSIG

“Low-level programming is good for the programmer’s soul.” ~ JC

The thirteenth operation is OP_CHECKSIG. BEAM is built on Bitcoin script as a necessary extension to provide multichain logic, however OP_CHECKSIG harkens back it’s roots as original, uncompressed implementation of Bitcoin’s script’s OP_CHECKSIG - it takes a signature and compressed public key arguments and validates that input data match the signature of a public key provided.

How to use it?

OP_CHECKSIG can be used to lock transactions to a specific public key which is provided as one argument of the opcode. OP_CHECKSIG returns truthy value back onto stack so e.g. OP_VERIFY is suggested to be used for successful BEAM script verification.

0 Likes

#15

OP_PROMISE

“Look to the past and remember no empire rises that sooner or later won’t fall.” ~ AS

The fourteenth operation is OP_PROMISE. The operation takes four arguments a partial signature, an optional R proof, blockchain to watch, and the tx hash acting as a solution. OP_PROMISE can be used with Schnorr signatures making one or more parties watching the transaction capable of determining the PROMISE’ validity without revealing the solution or the check itself to the entire blockchain. Traditionally a sizable NRG sum is awarded to the individual who can provide the TX hash and R pattern. OP_PROMISE is commonly triggered by miners who are already monitoring the respective connected chain.

How to use it?

OP_PROMISE allows users to create incentives for miners or rovers to create and submit a complete full signature executing a given transaction on the connected blockchain. This has a wide array of uses, most notably is to create “Bleeding” transactions which trigger in the even a transaction does or does not happen. Learn more about Bleeding transactions: https://docs.blockcollider.org/docs/bleed

0 Likes

#16

OP_DATATOHASH

“The lessons of competition are lessons for life.” ~ RK

The fifteenth operation is OP_DATATOHASH. The operation takes five arguments, [optional/default 0] threshold numeral, [optional/default 0] hashing algorithm, an address string, partial solution string, and a complete solution hashed with the given hashing algorithm.

In short OP_DATATOHASH creates a communal competition for the discovery of the solution to a particular hash. There are two modes of the operation’s execution…

MODE 1: Threshold.
If the threshold is given the distance between the sum of the hash of the hashing algorithm, address string, and partial solution is compared to the string given as the hex sum. If this is below the threshold and the partial solution hashed is equivalent to hex summed string the operation returns the address string. Otherwise the operation returns false.

MODE 2: Challenge.
If the BLAKE2 hashing algorithm, sum of the address, and the partial solution is equal to the provided sum hash the operation the address string is returns. If not it returns a false.

How to use it?

The operation draws inspiration from Bitcoin’s pay to hash where if a solution is provided which equates to the given hash the Bitcoin is unlocked. In practice however, this allows the miner to steal the solution reward sending it to the miner’s address. OP_DATATOHASH on the other hand allows miners to organize to discover the hash of solution. When a discovery is made the miners can also mine for with the solution to achieve a threshold which makes stealing the transaction irrelevant or untimely. The given owner address can also be a Schnorr public key which when combined with a set of addresses incentivizing pools of miners to seek the solution to the hash.

0 Likes

#17

OP_VERIFY

“Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better. “ ~ ED

The sixteenth operation is OP_VERIFY. It goes back to event Bitcoin script roots – Forth and other stack-based languages. Usually an operation leaves result of its computation on the stack. OP_VERIFY consumes the topmost item on the stack and checks if the value on the stack is zero. If so, it terminates the script with failure.

How to use it?

OP_VERIFY is used for checking the result of a previous operation - use it wherever you want to check result of previous opcode(s) operation result.

0 Likes

#18

OP_FIX

“ A vision without a strategy remains an illusion.” ~ LB

The seventeenth operation is OP_FIX. The operation a supported service flag (SSF) which means that it is used by external APIs or protocols such as FIX, HTX, or TOR. All SSF operations must have a minimum of one argument but may scale up to 16 depending on the external service the operation references. OP_FIX which will be released in the third quarter of 2019, this network wide optional upgrade enables nodes with FIX2 and FIX-GLA high speed trading functionality to interact with decentralized marketplaces built on Block Collider.

Block Collider’s OP_FIX syntax come from the standard defined by the CBOE Futures Exchange which can be viewed here: http://cdn.batstrading.com/resources/membership/CBOE_FUTURES_EXCHANGE_FIX_SPECIFICATION.pdf

How to use it?

OP_FIX allows traditional data feeds and order book operations to be implemented into trading systems with minimal software overhead. Multichains incentivization of timely updates of the blockchains they contain make them ideal for organizations making data driven decisions. Nodes on Block Collider that enable OP_FIX can stream data automatically from all decentralized marketplaces operating on Block Collider without any data processing. Bringing fair, open, and performant trading tools to consumers is the logical evolution of global borderless markets.

0 Likes

#19

OP_ENVOUTPOINTHASH

“I know in my heart that man is good. That what is right will always eventually triumph. And there’s purpose and worth to each and every life.” ~ RR

The eighteenth operation is OP_ENVOUTPOINTHASH. This operations does not take an argument and is an environment operator indicated by “ENV” prepending the variable pulled from the environment, in this case “OUTPOINT HASH”. When queried the operation returns the hash of the transaction from the value has been transferred.

How to use it?

Users can restrict the context from which certain operations run. For example, a transaction could be written which requires the amount to be spent from a particular address. This is useful to add an additional protection to MONAD operations which leave the logic context of the chain. Since these have side effects which are difficult to calculate for new programers they can restrict spending of the transaction manually by locking it to a specific outpoint hash.

0 Likes

#20

OP_CALLBACK

“from one thing, know ten thousand things” ~ MM

The nineteenth operation is OP_CALLBACK. The OP_CALLBACK operation is in the bound class of operations such as OP_TAKERPAIR or OP_MAKERCOLL. OP_CALLBACK takes only two arguments, outpoint transaction hash and the index of the output in reference. OP_CALLBACKs are restricted to hierarchical operations otherwise BEAM would be capable of loops and or turing complete.

How to use it?

OP_CALLBACK allows users to spend NRG locked in a OP_MONAD operation. The hash and index serves as a reference for the compiler to inject and evaluate the script at that location into the in the current operating context. The initial use of OP_CALLBACK is to support partial orders unlike Atomic Swaps which force the complete transfer of value. In a broad scope users can reference any monadic code in Block Collider.

0 Likes