Local Tax Categorization

The Local Tax Categorization layer is where TaxChain delivers its most valuable utility: translating blockchain-native activity into jurisdiction-specific tax outcomes.

While transaction tracking and classification determine what happened, the local tax categorization module determines what it means under the law — specifically, is it taxable, how is it taxed, when is it taxed, and at what rate or method of calculation. This transformation is essential for aligning decentralized activity with the complex, highly variable structures of national tax codes.

TaxChain achieves this through a modular, rule-driven, and time-sensitive interpretation engine known as the Jurisdictional Rulebook Layer (JRL). Each country supported by TaxChain is modeled as a self-contained logic module that can be independently versioned, upgraded, and audited.


1. Rulebook Architecture

Each jurisdictional rulebook in TaxChain is implemented as a versioned logic package composed of three main layers:

Layer
Purpose
Format

Rule Definition Layer (RDL)

Encodes legal rules in declarative DSL (Domain-Specific Language)

TaxDSL (YAML/JSON-based syntax)

Evaluation Engine (EE)

Executes logic trees based on tags, context, and metadata

Deterministic Rust interpreter

Output Serializer (OS)

Maps results into standardized reporting schema

Jurisdiction-specific JSON + XBRL adapters

Rulebooks are side-loaded at runtime and cryptographically pinned (SHA-256 digest), enabling deterministic and reproducible categorization decisions for any ATU.


2. Input: Tax Context Graph

The categorization engine ingests a set of Classified Atomic Tax Units (cATUs), each of which includes:

  • Raw blockchain metadata (timestamp, gas cost, tokens in/out)

  • High-level economic tags (e.g., NFT_SALE, TRADE, STAKING_REWARD)

  • Market value at transaction time (USD, EUR, CHF, etc.)

  • Wallet residency and country-specific context (e.g., business vs. private holding, legal form, special statuses like "professional trader")

This information is compiled into a Tax Context Graph (TCG) — a temporal DAG that allows the engine to analyze not just isolated events, but also how they relate across time (e.g., FIFO logic, holding periods, loss carryforwards).


3. Core Rulebook Features

Each country’s tax rulebook defines how to process the TCG using a set of localized legal constructs, including:


A. Asset Classification Tables

Tokens and NFTs are mapped into domestic categories such as:

Token Class
DE (Germany)
FR (France)
CH (Switzerland)

BTC

“Privates Wirtschaftsgut”

“Bien meuble” (CGT)

“Vermögensbestandteil”

LP Tokens

Complex Asset (speculative)

Financial Instrument (income+gain)

Dual-nature (possible wealth tax)

Airdrops

“Sonstige Einkünfte”

BNC or professional depending context

Income (subject to AHV)


B. Holding Period Tests

Used to determine tax-free thresholds, long-term holding treatment, or eligibility for exemptions.

Examples:

  • Germany: If a private asset is held for > 1 year, the capital gain is exempt (except for staking-influenced assets, which reset holding period).

  • Austria: Crypto assets sold within 1 year are taxable at progressive income rates; after 1 year, flat 27.5%.

  • Switzerland: No capital gains tax on private assets; but trades must be infrequent and non-professional.

These rules are implemented as time-indexed DAG traversals with memoized evaluation of acquisition-to-disposal paths.


C. Income vs. Capital Determination

A major challenge in crypto taxation is determining whether an inflow is income (taxed at ordinary rates) or capital gain/loss (possibly taxed differently or exempt). TaxChain applies logic rules such as:

  • If tag is STAKING_REWARD or AIRDROP_IN and no corresponding disposal exists → treat as income

  • If tag is SWAP or LP_WITHDRAW with underlying token sold → treat as capital gain

  • If token was received without user action or market risk → likely income

Results are stored in a taxable_basis field, with options: CAPITAL_GAIN, ORDINARY_INCOME, EXEMPT, or MIXED.


D. Cost Basis Calculation

Cost basis rules differ by jurisdiction:

Method
Description
Countries

FIFO

First-in-first-out

DE, AT

LIFO

Last-in-first-out

Optional

Durchschnitt

Weighted average acquisition cost

CH

Specific ID

Per-asset ID cost tracking (used for NFTs or pNFTs)

All

TaxChain implements a dynamic cost basis engine that maintains per-token acquisition stacks, supporting multi-chain token movements, airdrop blending, and wrapped tokens (e.g., WETH/ETH) with mapping equivalence.


E. Reporting Events & Tax Triggers

The engine detects reporting events (e.g., a disposal, reward, trade) and calculates:

  • Taxable amount (in fiat)

  • Realized gain/loss

  • Applicable tax treatment

  • Tax year attribution

Each reporting event is logged in a jurisdiction-specific schema (e.g., Anlage SO for Germany, Formulaire 2086 for France) and attached to the monthly PDF/JSON output.


4. Handling Complex Scenarios

TaxChain’s local tax logic handles nuanced real-world cases such as:


DeFi LP Activities

  • DE: Treated as Veräußerungsgeschäft at entry and exit; may trigger two taxable events.

  • CH: LP entry is non-taxable; exit may trigger gain only if fiat conversion involved.

  • FR: Entry often taxed as swap; exit as capital gain; subject to minimum reporting thresholds.

To support this, the categorization engine flattens nested LP wrappers (e.g., Curve LP inside Convex) and reconstructs proportional underlying token flows.


Bridged and Wrapped Assets

If a user moves ETH → WETH → USDC across Arbitrum to Optimism:

  • TaxChain links the flows through bridge adapter mappings.

  • Wrapped tokens are treated as non-disposals unless the jurisdiction says otherwise.

  • All cost basis and acquisition history travel with the token, even across chains.


NFTs

Tax treatment varies widely:

  • Germany: NFTs treated as private goods with 1-year speculation period.

  • France: 30% flat rate; must calculate coût d'acquisition and prix de cession.

  • Switzerland: Often treated as collectibles; high-value NFTs can trigger wealth tax obligations.

TaxChain calculates net gains, tracks royalty payments, and categorizes income from NFT-based staking or rewards distinctly.


5. Versioning and Legal Time Travel

Since laws change frequently, TaxChain implements temporal version control:

  • Every ATU is categorized using the rulebook version valid at the time of transaction.

  • If a law changes (e.g., Germany excludes staking rewards from holding-period resets in 2026), historical events remain untouched.

  • Rulebooks are stored as hashed artifacts on-chain to provide proof of correct application at audit time.


6. Outputs and Audit Trails

Each ATU receives final annotated outputs:

{
  "atu_id": "0xabc123...",
  "jurisdiction": "DE",
  "tax_category": "PRIVATE_VERÄUSSERUNG",
  "taxable": true,
  "basis_type": "FIFO",
  "gain_eur": 642.17,
  "reporting_year": 2025,
  "rulebook_version": "de_1.4.2"
}

These are used to generate:

  • Monthly tax summaries (PDF, JSON, CSV)

  • Annual declarations (XBRL, e-filing schemas)

  • Regulatory exports for advisors or auditors (pNFT-gated)


7. Extensibility

TaxChain supports:

  • DAO-voted rulebook upgrades (with audit logs and community sign-off)

  • Local overrides for tax professionals (with signature + annotation stored on-chain)

  • Enterprise plug-ins for specialized logic (e.g., treatment of tokenized securities or fund vehicles)


8. Future Plans

  1. Dynamic Residency Detection: Auto-adjust tax jurisdiction per wallet using timestamped location proofs and exchange KYC API data.

  2. Progressive Filing Simulation: In countries with tiered brackets (e.g., Austria, France), simulate user’s full taxable income position across asset classes.

  3. AI Legal Mapper: Use deterministic LLMs to assist in interpreting and mapping novel crypto behaviors into existing tax rules.


In summary, the Local Tax Categorization layer is the core of TaxChain’s regulatory intelligence. It brings structure, legal clarity, and jurisdictional compliance to the inherently unstructured world of crypto transactions — ensuring users can face tax season with complete transparency and confidence.

Last updated