Skip to main content

Single Contract, Shared by All

Vowena is a single smart contract deployed once on Stellar’s Soroban platform. Every merchant, every plan, and every subscription lives inside the same contract instance. There are no separate deployments per merchant - plans and subscriptions are differentiated by their on-chain data, not by contract addresses.
This design means one contract address to integrate, one set of events to index, and one deployment to maintain. Merchants share infrastructure while retaining full isolation of their data.

Storage Strategy

Soroban offers multiple storage types with different cost and lifetime characteristics. Vowena uses two:

Instance Storage

Shared across the contract. Stores global state that every invocation may need: the admin address and auto-incrementing counters (NextPlanId, NextSubId). Instance storage lives as long as the contract instance itself.

Persistent Storage

One entry per entity. Each plan, subscription, and index is its own persistent ledger entry. This is critical for Soroban’s parallel execution model - transactions touching different plans or subscriptions never contend on the same storage key.
Because each plan and subscription is a separate persistent entry, Soroban can execute charges for different subscriptions in parallel across validators. This is a deliberate design choice for scalability.

Data Models

DataKey Enum

Every storage entry is keyed by a variant of the DataKey enum:

Plan Struct

A plan defines the billing terms that a merchant offers. Once created, plans are immutable except for the amount field (within the ceiling).

Subscription Struct

A subscription links a subscriber to a plan and tracks billing state.

SubscriptionStatus Enum


TTL Management

Soroban ledger entries have a time-to-live (TTL) and can be archived if not extended. Vowena manages TTLs to keep data available:
If a persistent entry is archived (e.g., a very old subscription no one has touched), it can be restored by anyone calling extend_ttl. The data is never deleted - just temporarily inaccessible until restored.
The contract exposes an extend_ttl function that can be called by anyone to proactively extend the TTL of any plan or subscription.

Events

Vowena emits 13 event types covering every state change in the protocol. All events are indexable by Soroban event listeners and the Vowena SDK.
Use the SDK event listener to subscribe to these events in real time and build dashboards, notifications, or analytics pipelines.

What’s Next

Plans

Learn how merchants create and configure subscription plans.

Subscriptions

Understand the subscription lifecycle and state machine.

Billing

Deep dive into the permissionless charge flow.

Security

Explore the consumer protection guarantees.