Skip to content

Commit

Permalink
Merge pull request #418 from nervosnetwork/v2
Browse files Browse the repository at this point in the history
feat: merge v0.2.8 into develop
  • Loading branch information
RetricSu committed Jul 30, 2024
2 parents 878e2d2 + 21abd6f commit 52b38ff
Show file tree
Hide file tree
Showing 28 changed files with 588 additions and 35 deletions.
151 changes: 124 additions & 27 deletions website/docs/ecosystem/EcoCardContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ecoCardContents: EcoCardProps[] = [
"An extended RGB protocol to manage state changes and transaction verification",
href: "https://github.com/ckb-cell/RGBPlusPlus-design",
bannerSrc: "rgb++",
tags: ["Protocol"],
tags: ["Protocol", "RGB++"],
links: [
{
label: "github",
Expand Down Expand Up @@ -41,6 +41,80 @@ const ecoCardContents: EcoCardProps[] = [
{ label: "github", link: "https://github.com/nervina-labs?q=joyid" },
],
},
{
title: "HueHub",
description: "First DEX for RGB++ Assets on Bitcoin",
href: "https://huehub.xyz/",
bannerSrc: "huehub",
tags: ["RGB++", "DEX", "DApp"],
links: [{ label: "website", link: "https://huehub.xyz/" }],
},
{
title: "Haste",
description: "Assets Management Tool for Bitcoin/RGB++/CKB",
href: "https://haste.pro/",
bannerSrc: "haste",
tags: ["RGB++", "DApp"],
links: [{ label: "website", link: "https://haste.pro/" }],
},
{
title: "UTXO Swap",
description:
"An AMM DEX that trades assets within the RGB++ and CKB ecosystems",
href: "https://utxoswap.xyz/",
bannerSrc: "utxoswap",
tags: ["RGB++", "DEX", "DApp"],
links: [
{ label: "website", link: "https://utxoswap.xyz/" },
{ label: "doc", link: "https://utxoswap.gitbook.io/en" },
],
},
{
title: "Stable++",
description: "The first stablecoin issued on RGB++",
href: "https://www.stablepp.xyz/",
bannerSrc: "stable++",
tags: ["RGB++"],
links: [{ label: "website", link: "https://www.stablepp.xyz/" }],
},
{
title: "Unicorn",
description: "The First DOBs on CKB",
href: "https://unidob.xyz/",
bannerSrc: "unicorn",
tags: ["DOB"],
links: [
{ label: "website", link: "https://unidob.xyz/" },
{
label: "doc",
link: "https://unicorns-organization.gitbook.io/unicorn-cao-zuo-shou-ce",
},
],
},
{
title: "Dobby market",
description: "The platform for Digital Objects on Bitcoin",
href: "https://app.dobby.market/",
bannerSrc: "dobby",
tags: ["DOB", "DEX", "DApp"],
links: [{ label: "website", link: "https://app.dobby.market/" }],
},
{
title: "World3",
description: "AI-powered autonomous world on Bitcoin",
href: "https://world3.ai/",
bannerSrc: "world3",
tags: ["AIW"],
links: [{ label: "website", link: "https://world3.ai/" }],
},
{
title: "Cellula",
description: "A fully on-chain artificial life simulation game",
href: "https://www.cellula.life/",
bannerSrc: "cellula",
tags: ["AIW"],
links: [{ label: "website", link: "https://www.cellula.life/" }],
},
{
title: ".bit",
description: "Cross-chain Web3 identities for you and your community",
Expand All @@ -62,7 +136,7 @@ const ecoCardContents: EcoCardProps[] = [
"The 1st inscription protocol established on Nervos $CKB blockchain",
href: "https://omiga.io/",
bannerSrc: "omiga",
tags: ["Protocol", "DApp"],
tags: ["Protocol", "DOB", "DEX", "DApp"],
links: [
{ label: "website", link: "https://omiga.io/" },
{ label: "doc", link: "https://docs.omiga.io/" },
Expand Down Expand Up @@ -189,6 +263,14 @@ const ecoCardContents: EcoCardProps[] = [
},
],
},
{
title: "Gate",
description: "A browser-extension wallet that supports CKB & RGB++ assets",
href: "https://www.gate.io/web3",
bannerSrc: "gate",
tags: ["RGB++", "Wallet"],
links: [{ label: "website", link: "https://www.gate.io/web3" }],
},
{
title: "imToken",
description:
Expand All @@ -205,6 +287,22 @@ const ecoCardContents: EcoCardProps[] = [
},
],
},
{
title: "Rei Wallet",
description:
"CKB's native Chrome-extension wallet for digital asset management",
href: "https://reiwallet.io/#home",
bannerSrc: "reiwallet",
tags: ["RGB++", "Wallet"],
links: [
{ label: "website", link: "https://reiwallet.io/#home" },
{ label: "github", link: "https://github.com/teamtaoist/" },
{
label: "doc",
link: "https://docs.reiwallet.io/",
},
],
},
{
title: "SafePal",
description:
Expand Down Expand Up @@ -314,18 +412,6 @@ const ecoCardContents: EcoCardProps[] = [
},
],
},
{
title: "Axon",
description: "A L2 framework that unleashes the power of appchain future",
href: "https://axonweb3.io/",
bannerSrc: "axon",
tags: ["Tools & Infra"],
links: [
{ label: "website", link: "https://axonweb3.io/" },
{ label: "github", link: "https://github.com/axonweb3/axon" },
{ label: "doc", link: "https://docs.axonweb3.io/" },
],
},
{
title: "BandProtocol",
description: "A L2 framework that unleashes the power of appchain future",
Expand Down Expand Up @@ -356,19 +442,6 @@ const ecoCardContents: EcoCardProps[] = [
},
],
},
{
title: "Godwoken",
description:
"An EVM-compatible, L2 optimistic rollup solution built on Nervos L1",
href: "https://www.godwoken.com/",
bannerSrc: "godwoken",
tags: ["Tools & Infra"],
links: [
{ label: "website", link: "https://www.godwoken.com/" },
{ label: "github", link: "https://github.com/godwokenrises" },
{ label: "doc", link: "https://docs.godwoken.io/" },
],
},
{
title: "Khalani",
description:
Expand All @@ -381,6 +454,17 @@ const ecoCardContents: EcoCardProps[] = [
{ label: "doc", link: "https://blog.khalani.network/" },
],
},
{
title: "Metaforo",
description: "Governance tool supporting CKB",
href: "https://metaforo.io/",
bannerSrc: "metaforo",
tags: ["Tools & Infra"],
links: [
{ label: "website", link: "https://metaforo.io/" },
{ label: "doc", link: "https://metaforo.io/g/metaforodocs" },
],
},
{
title: "Perun",
description:
Expand All @@ -402,6 +486,19 @@ const ecoCardContents: EcoCardProps[] = [
tags: ["Tools & Infra"],
links: [{ label: "website", link: "https://unifra.io/" }],
},
{
title: "UTXO Stack",
description: "Bitcoin-Native programmability and scalability Layer 2",
href: "https://www.utxostack.network/en-us",
bannerSrc: "utxostack",
tags: ["RGB++", "Tools & Infra"],
links: [
{ label: "website", link: "https://www.utxostack.network/en-us" },
{ label: "github", link: "https://github.com/ckb-cell" },
{ label: "doc", link: "https://docs.utxostack.network/docs/intro" },
],
},

{
title: "F2Pool",
description: "Leading mining pool for PoW network",
Expand Down
2 changes: 1 addition & 1 deletion website/docs/ecosystem/organizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Explore all the organizations and their relevant GitHub repositories within the
| Org name | Github repo | Major contents |
| -------------- | -------------------------------- | ------------------------------------------------- |
| Nervos Network | https://github.com/nervosnetwork | CKB-VM, RFCs, Moleculec-es |
| Cell Studio | https://github.com/ckb-cell | RGB++ |
| Cell Studio | https://github.com/ckb-cell | RGB++, UTXO Stack, Unique Cell |
| Spore Protocol | https://github.com/sporeprotocol | Spore protocol |
| Cryptape | https://github.com/cryptape | CKB Node Probe, Omnilock, CoBuild, Anyone-can-pay |
| Magickbase | https://github.com/Magickbase | CKB Explorer, Neuron, CKB Testnet Faucet |
Expand Down
118 changes: 118 additions & 0 deletions website/docs/how-tos/how-to-manage-txs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
id: how-to-manage-txs
title: How to Manage Transactions
---

import useBaseUrl from "@docusaurus/useBaseUrl";
import Tooltip from "@components/Tooltip";

# How to Manage Transactions

Contributor: [@doitian](https://github.com/doitian)

Managing UTXO transactions can be challenging because they may be stuck in or even dropped from the CKB node transactions pool when the fee is too low.

This guideline is for any transaction generator looking to trace the transaction status before it is finally confirmed on the chain.

## Transaction States

The transaction lifecycle starts after creation and ends when it is finally confirmed or conflicts with a confirmed transaction. During this lifecycle, the transaction must be in one of the following states:

- Pending
- Confirming
- Confirmed
- Conflicting
- Conflictive
- Reverted
- Abandoned

The list excludes <Tooltip>orphan transaction</Tooltip> that depends on unknown Cells, as transaction generators typically ignore them.

Different states require different strategies as described in the following sections.

<img
alt="Transition Between Different Transaction States"
src={useBaseUrl("img/how-tos/transaction-states.png")}
width="688"
/>

## Pending Transaction

A newly created transaction starts in the **Pending** state.

The generator must store pending transactions locally and regularly send them to CKB nodes. It's essential because CKB nodes may drop transactions from their pools.

It is not recommended for the generator to use output Cells of pending transactions unless the transaction is stuck and requires a <Tooltip>fee bumping</Tooltip>. If chaining pending transactions is unavoidable, limit the chain’s length.

The transaction turns to the **Confirming** state once it appears in a block on the canonical chain.

If the pending transaction or any of its ancestor transactions[^1] has conflicting input Cells with a transaction on the canonical chain, it becomes conflicting.

User or Apps can mark a pending transaction as **Abandoned**, if they decide to give up a stuck transaction.

## Confirming Transaction

Transactions in **Confirming** state are in the chain but have not qualified as **Confirmed** yet.

The generator must store confirming transactions locally but does not need to send them to CKB nodes regularly.

Same as pending transactions, it is not recommended to use the output Cells of confirming transactions.

The block containing the transaction gives one confirmation. Each descendant block in the chain gives an extra confirmation. Although any block can be reverted theoretically, it is safe to assume that the transaction will never be reverted after a certain number, say X, of confirmations. The confirming transaction becomes **Confirmed** when it has received at least X confirmations. X depends on various factors. The generator must decide the value of X and adjust it regularly.

If a chain reorganization reverts the block containing the transaction, the transaction reverts to **Pending**.

## Confirmed Transaction

Transactions in **Confirmed** state are in the chain and has received at least X confirmations.

The generator can remove confirmed transactions from local storage or keep the latest ones as a historical reference.

The generator can freely use the output Cells of confirmed transactions.

If a chain reorganization reverts the block containing the transaction, the transaction becomes **Reverted**.

## Conflicting Transaction

A transaction is in **Conflicting** state if it conflicts with any transaction in the chain. Two different transactions conflict when:

- They have conflict input Cells;
- A transaction has conflicting input Cells with any ancestor of another transaction;
- They are descendants of a pair of conflict transactions.

The generator must store these conflicting transactions locally, because there is a chance they may become **Pending** again.

The generator should not use the output Cells of conflicting transactions.

If all blocks containing conflicting transactions have been reverted, the conflicting transactions revert to Pending.

If any conflicting transaction received X confirmations, the conflicting transactions become **Conflicted**.

## Conflictive Transaction

A transaction is in **Conflictive** state when it conflicts with an on-chain transaction that has received at least X confirmations.

The generator can remove conflictive transactions from local storage, or keep the most recent ones for reference.

The generator should not use the output Cells of conflictive transactions.

If all blocks containing conflicting transactions have been reverted, the conflictive transactions revert to **Pending**.

## Reverted Transaction

**Reverted** state is an alias of **Pending**, suggesting that the transaction was once confirmed, but has been reverted.

The generator must store and send reverted transactions regularly. The state transformations are the same as pending transactions.

## Abandoned

The generator should allow users to mark a pending or reverted transaction as **Abandoned**, when they give up the effort to commit it. But due to a timing gap, an abandoned transaction may still be already submitted to a node.

The generator must store a sufficient time range of recent abandoned transactions. Try not to delete transactions that are marked as **Abandoned**, as they might already be in **Pending** state.[^2]

Users are allowed to mark an abandoned transaction to **Pending**.

Transactions can transform from **Abandoned** to **Confirming** or **Conflicting**, like pending and reverted transactions.

[^1]: Transaction A is considered a parent of B, if B uses an output Cell of A as its input Cell. An ancestor is either the parent or an ancestor of any parent.
[^2]: If you want to accelerate the confirmation, consider using <Tooltip>RBF</Tooltip> <Tooltip>fee bumping</Tooltip> method that involves creating a new transaction using some or all of the same inputs from an unconfirmed transaction, but with a higher fee. Deleting the abandoned transaction eliminates this option. RBF has been a default feature in CKB since [v0.112.1](https://github.com/nervosnetwork/ckb/releases/tag/v0.112.1).
10 changes: 10 additions & 0 deletions website/docs/integrate-wallets/CardContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ const walletCardContents: WalletCardProps[] = [
href: "https://onekey.so/",
tags: ["Mobile", "Desktop", "Hardware"],
},
{
title: "Rei Wallet",
href: "https://reiwallet.io/#home",
tags: ["Browser Extension"],
},
{
title: "Gate",
href: "https://www.gate.io/web3",
tags: ["Browser Extension"],
},
];

export { walletCardContents };
2 changes: 1 addition & 1 deletion website/docs/integrate-wallets/intro-to-wallets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ When it comes to storing and securing CKB assets, users have various options, in

These wallets listed below offer custody and security services tailored to CKB. For more information, refer to the respective guides for each wallet.

<CardLayout colNum={[2, 2, 2, 2]}>
<CardLayout colNum={[3, 2, 2, 2]}>
{walletCardContents.map(({ index, title, href, tags }) => (
<WalletCard key={index} title={title} href={href} tags={tags} />
))}
Expand Down
Loading

0 comments on commit 52b38ff

Please sign in to comment.