Anchors Away: Adding security with anchoring

Technical Updates | July 8, 2019
Home » Company » Blog » Anchors Away: Adding security with anchoring

By definition, “to anchor” means to secure firmly in a position. Factom Inc. coined the term’s use in the blockchain space in our initial Factom® protocol whitepaper in November 2014. The term anchoring is the clearest description of Factom’s publication of Merkle roots into the Bitcoin blockchain as the mental image mirrors what we do in reality. The term “anchoring” has now become a widely used term of art within the blockchain industry.

Anchoring for Enterprise

Anchoring provides the Factom® blockchain with two clear benefits: enhanced security and cross chain interoperability. 

By inserting cryptographic anchors in other blockchains, the Factom blockchain increases the odds of resistance to an attack. All blockchains are susceptible to a 51% attack. However, for such an attack to be successful against the Factom blockchain, it would also need to be successful on all the blockchains the Factom blockchain anchors into. Rolling back the Factom® blockchain would requiring rolling back several other blockchains at the same time. 

As the Factom blockchain periodically inserts the Merkle root proofs of its data into other chains, it creates a path to trace proofs from one chain to another.  Anchoring into other blockchains allows for the ability to trace the Merkle root down to the final anchor. If the data has changed, the hash in the additional blockchain wouldn’t match.  

Additionally, enterprise companies that are leery of traditional public blockchains can now be empowered by the hybrid model. With the ability to provide a private blockchain which anchors into the public Factom blockchain, this ensures that the data proofs made in private could not be compromised.  Data provided by a Factom hybrid blockchain can be trusted by parties outside the private blockchain because of the public anchors.  

As the blockchain industry matures from the early days to actively solving problems at a production level, diversifying security through anchoring has become an obvious next step. When evaluating the industry and future opportunities, the pragmatic choice is the Ethereum blockchain. 

Technical Design and Constraints

The initial anchoring solution used by the Factom® Protocol was designed with the Bitcoin network in mind. For each Directory Block created on the Factom blockchain, a Bitcoin transaction would be submitted, from the anchoring address back to itself, utilizing the OP_RETURN field to store the Key Merkle root of that block. To get a list of all anchors submitted, one would need to fetch all transactions created from the anchoring address, and match the OP_RETURN values against the Directory Block Key Merkle roots from a running Factomd node. This all was possible in Bitcoin because everything centers around transactions — a full node stores all transactions along with their data, while also having first class support for fetching the entire history of activity for an address. 

In Ethereum, however, transactions take a backseat to the EVM’s state (i.e. the current state of execution for all smart contracts on the network). A “full” Ethereum node does not keep the entire history of transactions, as it’s not entirely necessary for the verification of current contract state. While there has been a long running debate over whether such transaction ledger recording  should be supported, The Ethereum core developers determined that it would be an anti-pattern and would not be added.

Thus a smart contract with event logs was the only viable path forward for anchoring on this platform. Any decision does not come without its tradeoffs, though. Unfortunately for Factom developers, it’s easy to take constant priced transactions for granted and forget that most networks aren’t afforded the luxury of $0.001 per KB of usage. Smart contract storage, in contrast,  is expensive and unpredictable. In looking to the future of Ethereum, this cost is likely to only rise with the ever increasing talk of “blockchain rent” being charged to users who would like their data to continue being served on the network.

Keeping all of the above in mind, it was clear that submitting an independent anchor for every single Directory Block in the Factom blockchain proved not to be viable. Rather, a new strategy was formed to aggregate a large group of Directory Blocks into a single anchor. Similar to how the Factom protocol aggregates a whole block’s worth of entries into a Merkle tree, the new anchoring strategy takes a window of 1000 consecutive Directory Blocks, constructs a Merkle tree, and submits the Merkle root as the anchor payload. To re-anchor the entire history of a Factom network with 200k blocks, it would now take a mere 200 transactions, as opposed to 200,000. 

Ethereum smart contract for anchor storage 

Factom Chain for Ethereum anchor receipts 

 

Not only is this method advantageous when newly anchoring the several-year old Factom blockchain, but also helps in the continuous process when anchoring new blocks. Say for instance that Ethereum experiences a new craze like CryptoKitties. Traffic rises dramatically. Spare transaction capacity drops dramatically. In the case of one-to-one Directory Block anchors, a backlog would begin to build up as newer anchor transactions become gated on confirmation of older anchors with lower nonces. By the time the first anchor in that backlog makes its way into an Ethereum block, a significant amount of time may have passed — potentially hours and many Directory Blocks.

The rolling window strategy, however, nearly eliminates the backlog buildup. For example, let’s say there currently exists a pending anchor transaction for Directory Block 1500 (i.e. a Merkle root of blocks 501 through 1500). When the 1501 is finalized and ready to be anchored, we simply shift the window over by one, and replace the currently pending transaction by using a slightly higher fee. In the unlikely scenario that an entire week goes by (equivalent to about 1000 blocks in the Factom blockchain) without an anchor transaction able to go through, that particular anchor is considered “mandatory” and cannot shift any further until it becomes confirmed. The system will continue to slowly raise the fee in hopes of enticing a miner to include it in their next block.

The future of anchoring

As the blockchain ecosystem and industry continue to evolve, it will always be prudent to grow with it. There is no telling where the industry will be in the next 5 years.  We have seen it evolve greatly in the last 5 years. Anchoring will continue to be critical to the security of the Factom blockchain, and it creates bridges between different blockchain solutions.

The Factom protocol serves as a better way to anchor into Bitcoin.  Now, the Factom protocol also provides a better way to anchor into Ethereum.  As Ethereum shifts and changes, the core developers will adjust the methods of anchoring into Ethereum to match the best practices.  In the future, other blockchains will gain market share and thus security, and the Factom blockchain will anchor into them to inherit their security as well.  

As the Factom protocol continues to develop the technology to be the data integrity solution for secure, efficient, and trusted transactions.

POSTED: July 8, 2019 BY Crystal Wiese IN Technical Updates
ABOUT THE AUTHOR

Crystal Wiese is the Director of Marketing at Factom. Working within the startup tech scene for the past 10 years she has become passionate about taking great ideas and building a strong comprehensive narrative. Graduating from the Art Institute of Portland with a degree in Design Management, Crystal has always seen the value in creating strong ties between the technical, creative and business.