How is virtualchain connected to bitcoin?


How is virtual chain connected to bitcoin? What data does virtual chain store?And how does virtual chain become a chain? Is there any document beyond the white paper?



I definitely recommend reading the whitepaper as it answers all of this questions in a relatively easy to understand way. If you still need help, maybe try out these videos:

and others in this playlist.

tl;dr/dw: It runs on top by using the metadata of the underlying blockchain to store state information from the virtual chain. The data it stores varies but it’s mostly, again, just state data. The one that Blockstack uses is the one to store name transactions, as you can kind of see in this block: .


You are so kind! I still confused that in the white paper, figure 4 shows that virtualchain stores ‘op_code,hash’. Is that exact? And is virtualchain just a peer-to-peer database? How a block in a virtualchain identity a prev block?


All of the virtual chain is stored on the underlying blockchain – in this case, Bitcoin. Thus all of the data is in the metadata of the Bitcoin transactions… transactions within transactions.

I believe so, yes, the op_code, hash is within the transaction metadata and thus part of the virtual chain data whatnot. It’s not a peer-to-peer database per se, but it is a virtual blockchain, running on top of a previously existing one.

I believe you can identify the previous block by “rewinding” and looking through previous normal blocks and looking for the metadata that matches the schema of a Blockstack transaction, though usually only the latest is used (unless you want to view the history).


My understanding is that a blockstack block is a block in the underlying blockchain. So, if you know how to find the prev block in the underlying blockchain you can find the one in the blockstack chain.


If you follow the definition of peer-to-peer database as in then I would argue that the virtual blockchain is indeed a p2p database. The blockstack nodes are connected via the bitcoin network.


How virtual chain index bitcoin? How to determine a transaction is in which block in bitcoin?


You should read the virtualchain paper:

Also, there’s slides from the conference in which it was presented:


May I have another question? Where the transaction happens? I didn’t find any transaction source code in blockstack-core