> For the complete documentation index, see [llms.txt](https://stoxfi.gitbook.io/stoxfi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stoxfi.gitbook.io/stoxfi-docs/asset-and-accounting-model.md).

# Asset & Accounting Model

StoxFi maintains two representations of a supported asset.

The first is the underlying ERC 20 held on Robinhood Chain.

The second is the confidential representation maintained by ConfidentialStock on Ethereum.

The underlying asset remains locked in StoxVault while the confidential representation exists.

This creates the accounting relationship that connects public collateral with encrypted balances.

### Asset Model

**StoxFi Asset and Accounting Model**

<figure><img src="https://2963579709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIccUwMy0hIW7yzdERSR%2Fuploads%2FTTR9imdsLBEUMZ09v5nE%2Fstoxfi-asset-accounting-model.png?alt=media&amp;token=bad63b07-8e17-4597-9afd-2d48fdf23bd2" alt=""><figcaption></figcaption></figure>

The underlying ERC 20 enters StoxVault, is converted into confidential units, and is represented as encrypted supply on Ethereum.

During redemption, confidential value is burned before the corresponding underlying collateral is released.

### Underlying Asset

On Robinhood Chain, the underlying asset is a standard ERC 20.

The current implementation uses assets with 18 decimals.

Balances and transfers on this side are public.

When a user shields an asset, the underlying tokens are transferred into StoxVault.

They are not burned.

They remain locked in the vault until a valid redemption authorizes their release.

### Confidential Representation

On Ethereum, each supported asset has a corresponding ConfidentialStock contract.

The confidential representation uses 6 decimals.

User balances are stored as encrypted `euint64` values rather than public integers.

The confidential representation is created when collateral enters StoxVault and is destroyed through the redemption process before collateral leaves the vault.

### Decimal Conversion

The public and confidential representations use different decimal precision.

For an 18 decimal underlying asset and a 6 decimal confidential representation, the conversion rate is:

`rate = 10^(18 − 6)`

Therefore:

`rate = 10^12`

The relationship between the two representations is:

`underlying amount = confidential amount × 10^12`

For example:

`2,000 underlying tokens`

correspond to:

`2,000,000,000 confidential units`

The conversion takes place during shielding.

### Sub Unit Remainders

An underlying amount may contain precision below the 6 decimals supported by ConfidentialStock.

StoxFi does not retain this remainder as collateral.

The amount is divided into the portion that can be represented confidentially and the remaining sub unit amount.

The representable amount is accepted into the collateral position.

The remainder is refunded to the user.

As a result, an amount below `10^-6` of one underlying token cannot be represented in the confidential system.

### Exact Token Receipt

StoxVault verifies the amount of underlying ERC 20 actually received.

It checks the change in its token balance before and after the transfer.

If the received amount does not equal the expected amount, the deposit is rejected.

This prevents a fee on transfer token from creating a confidential position larger than the collateral actually received.

### Locked Collateral

For each supported stock, StoxVault tracks the amount of underlying collateral using:

`lockedOf[stock]`

The value increases when collateral is successfully deposited.

It decreases when underlying collateral is released following redemption.

This value represents the underlying assets backing the live confidential representation.

### Structural Backing Relationship

The public accounting relationship is:

`lockedOf[stock] = live confidential supply × rate`

For an underlying token with 18 decimals and a confidential representation with 6 decimals:

`lockedOf[stock] = live confidential supply × 10^12`

This relationship connects the quantity held in StoxVault with the quantity represented confidentially on Ethereum.

### Minting

ConfidentialStock does not provide an administrative mint function.

Confidential value is created only through a validated cross chain instruction from its bound StoxVault.

The sequence is:

1. Underlying tokens enter StoxVault
2. StoxVault verifies the exact quantity received
3. The amount is converted into confidential units
4. Locked collateral is recorded
5. A mint instruction is sent
6. ConfidentialStock creates the corresponding encrypted balance

The confidential representation is therefore linked to collateral received by the vault.

### Redemption

The reverse accounting process begins when a user requests redemption.

The requested encrypted amount is limited to the user's available confidential balance.

The resulting amount is burned immediately.

Only after the burned value has been publicly decrypted and verified can ConfidentialStock dispatch the release instruction.

On Robinhood Chain, StoxVault caps the release against the collateral recorded for that stock.

The underlying ERC 20 is then transferred to the redemption destination.

### Burn Before Release

The confidential value is burned before StoxVault releases the underlying asset.

This ordering prevents the same confidential balance from remaining spendable while a redemption is pending.

It also separates the confidential state transition from the later cross chain release.

The confidential position therefore ceases to be spendable before the corresponding collateral can leave StoxVault.

### Supply Limit

Confidential balances use `euint64`.

The maximum supported confidential value is therefore:

`2^64 − 1`

At 6 decimals, this represents approximately `18.4` trillion whole confidential units.

StoxFi checks the supply limit during shielding to prevent encrypted arithmetic from exceeding the supported range.

### Asset Isolation

Each supported stock is associated with its own confidential representation.

StoxVault maintains the relationship between the underlying stock and its confidential peer.

Collateral for one asset cannot be used as the release balance for another asset.

This preserves isolation between supported stock positions.

### Public and Confidential Accounting

| Property           | Underlying Asset         | Confidential Representation      |
| ------------------ | ------------------------ | -------------------------------- |
| Location           | Robinhood Chain          | Ethereum                         |
| Representation     | ERC 20                   | ConfidentialStock                |
| Decimals           | 18                       | 6                                |
| Balance type       | `uint256`                | `euint64`                        |
| Balance visibility | Public                   | Encrypted                        |
| Transfer amount    | Public                   | Encrypted                        |
| Asset custody      | StoxVault                | No underlying custody            |
| Creation           | Existing ERC 20          | Mint following validated deposit |
| Destruction        | Not burned during shield | Burned during redemption         |

### Current Demonstration Assets

The current StoxFi deployment uses three demonstration assets:

1. NVDA
2. TSLA
3. NFLX

These underlying tokens are StoxFi deployed `MockStockToken` contracts.

They are stand ins used to demonstrate the asset and accounting architecture on test networks.

They do not represent real NVIDIA, Tesla, or Netflix equity exposure.

The corresponding confidential representations are cNVDA, cTSLA, and cNFLX on Ethereum Sepolia.

### Accounting Model Summary

StoxFi does not move the underlying stock to Ethereum.

The underlying ERC 20 remains locked in StoxVault on Robinhood Chain.

The confidential representation exists separately on Ethereum and uses encrypted balances.

Creation of confidential value follows collateral deposit.

Redemption burns confidential value before collateral release.

Decimal conversion provides the numerical relationship between the two representations.

Together, these mechanisms maintain the structural relationship between locked collateral and the live confidential representation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://stoxfi.gitbook.io/stoxfi-docs/asset-and-accounting-model.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
