Magickbase / ckb-explorer-public-issues

CKB Explorer Issues
https://explorer.nervos.org/
3 stars 2 forks source link

An independent service of transaction graph #354

Open Keith-CY opened 1 year ago

Keith-CY commented 1 year ago

utxo 模型 交易的拓扑是一个网图 可视化出来应该还是比较有意思的

All cells on-chain are linked by input -> output in transactions, so they construct a graph that shows the history of the whole chain/live cells.

It would be very intuitive and impressive for data analysis.

The service can be designed standalone and provides data to CKB explorer UI

homura commented 1 year ago

graph-idea

In my imagination, it may look like this


At the present, there doesn't seem to be a way to fetch which transaction consumed a particular OutPoint via RPC directly


A close idea is to use the get_transactions to probe which transactions have consumed the Script of the OutPoint, but there are some problems with this way

Keith-CY commented 11 months ago

graph-idea

In my imagination, it may look like this

At the present, there doesn't seem to be a way to fetch which transaction consumed a particular OutPoint via RPC directly

A close idea is to use the get_transactions to probe which transactions have consumed the Script of the OutPoint, but there are some problems with this way

  • the scripts of the OutPoint must not be popular on the chain, otherwise the probing process will become very long

Please have a look at this proposal @Danie0918 @Sven-TBD

Danie0918 commented 11 months ago

graph-idea In my imagination, it may look like this At the present, there doesn't seem to be a way to fetch which transaction consumed a particular OutPoint via RPC directly A close idea is to use the get_transactions to probe which transactions have consumed the Script of the OutPoint, but there are some problems with this way

  • the scripts of the OutPoint must not be popular on the chain, otherwise the probing process will become very long

Please have a look at this proposal @Danie0918 @Sven-TBD

This is a useful and interesting feature and we will start moving forward with its implementation.

Sven-TBD commented 11 months ago

https://vs0cjf.axshare.com/?id=j6zrfc&p=_354_an_independent_service_of_transaction_graph&g=1 @Keith-CY

Keith-CY commented 11 months ago

vs0cjf.axshare.com/?id=j6zrfc&p=_354_an_independent_service_of_transaction_graph&g=1 @Keith-CY

cc @homura

homura commented 11 months ago
image

The diagram is cool and inspiring, but I guess it might be affected by the above one. It is based on the view of a single cell. However, it's not easy to define an entry cell, and it's difficult, maybe impossible, to define a one-to-one relationship between cells. Therefore, I propose changing the view from single-cell-based to timeline-based

image

Next, I'll talk about what each of these elements represents.


A cellbase transaction example


This is a chained transaction exam. The dashed lines linked to the transactions are clickable and link to the corresponding block area.


This is an example of the spent cellbase transaction. Also, the dashed line is clickable and links to the corresponding block area.

Keith-CY commented 11 months ago
image

The diagram is cool and inspiring, but I guess it might be affected by the above one. It is based on the view of a single cell. However, it's not easy to define an entry cell, and it's difficult, maybe impossible, to define a one-to-one relationship between cells. Therefore, I propose changing the view from single-cell-based to timeline-based

image

Next, I'll talk about what each of these elements represents.

A cellbase transaction example

This is a chained transaction exam. The dashed lines linked to the transactions are clickable and link to the corresponding block area.

This is an example of the spent cellbase transaction. Also, the dashed line is clickable and links to the corresponding block area.

Is it necessary to order the transactions by block [n]? Transactions are ordered by their nature(linked list). The graph may be hard to read if a transaction is linked to several transactions that are far from each other from the block number dimension because they may not be linear. For instance

Block                   Block + N            Block + N + 1000            Block + N + 10000000
Transaction ---------> Transaction
     ├-----------------------------------------> Transaction
     └-----------------------------------------------------------------------> Transaction
homura commented 11 months ago

Is it necessary to order the transactions by block [n]?

Block                   Block + N            Block + N + 1000            >Block + N + 10000000
Transaction ---------> Transaction
    ├-----------------------------------------> Transaction
    └--------------------------------------------------------->--------------> Transaction

No, but it isn't easy to design how to

The new one I proposed is not a fix, but another new way that will make the design more intuitive

The graph may be hard to read if a transaction is linked to several transactions that are far from each other from the block number dimension because they may not be linear

Exactly, this is the reason to keep an OutPoint with a dashed line in the Tx3, and users can click the OutPoint with a left-slide animation to locate the corresponding block area

homura commented 10 months ago

A PoC can be previewed here https://ckb-tx-illustration.vercel.app/

yanguoyu commented 7 months ago

I have already implemented a demo using Cytoscape. Cytoscape is convenient for constructing tree diagrams. I will continue to research how to add nodes dynamically.

FrederLu commented 3 months ago

https://pudge.explorer.nervos.org/transaction/0x8ab56f4f70cac7c23aac75bc81abb403f799befc16490528f342b3837fc82824 Image

https://pudge.explorer.nervos.org/transaction/0xbf824fe159e97d65af0776c7ad9261fc98f5b648f411edf9a4bab20bf63a43e2 Image

It was found that the fifth data in UTXO graph was incomplete. @yanguoyu

Sven-TBD commented 3 months ago

https://pudge.explorer.nervos.org/transaction/0x8ab56f4f70cac7c23aac75bc81abb403f799befc16490528f342b3837fc82824 Image

https://pudge.explorer.nervos.org/transaction/0xbf824fe159e97d65af0776c7ad9261fc98f5b648f411edf9a4bab20bf63a43e2 Image

It was found that the fifth data in UTXO graph was incomplete. @yanguoyu

I checked with Guoyu like last week, and I told him 4 cells should be displayed here by default, though he said it could be 5, never mind, let's make it 4, so we could mark this bug as fixed @FrederLu

FrederLu commented 3 months ago

https://pudge.explorer.nervos.org/transaction/0x8ab56f4f70cac7c23aac75bc81abb403f799befc16490528f342b3837fc82824 Image https://pudge.explorer.nervos.org/transaction/0xbf824fe159e97d65af0776c7ad9261fc98f5b648f411edf9a4bab20bf63a43e2 Image It was found that the fifth data in UTXO graph was incomplete. @yanguoyu

I checked with Guoyu like last week, and I told him 4 cells should be displayed here by default, though he said it could be 5, never mind, let's make it 4, so we could mark this bug as fixed @FrederLu

OK, I got it then.