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.
Data Models
DataKey Enum
Every storage entry is keyed by a variant of theDataKey enum:
Plan Struct
A plan defines the billing terms that a merchant offers. Once created, plans are immutable except for theamount 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:| Storage Type | Threshold | Extend To | Approximate Duration |
|---|---|---|---|
| Persistent (plans, subs, indexes) | ~30 days | ~120 days | Entries are extended when accessed; archived entries can be restored |
| Instance (admin, counters) | ~30 days | ~90 days | Extended on every contract invocation |
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.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.| Event | Topics | Data |
|---|---|---|
PlanCreated | plan_id | Full Plan struct |
PlanUpdated | plan_id | New amount |
PlanDeactivated | plan_id | - |
SubscriptionCreated | sub_id, plan_id | Full Subscription struct |
ChargeBilled | sub_id, plan_id | amount, periods_billed |
ChargeFailed | sub_id, plan_id | failed_at timestamp |
SubscriptionPaused | sub_id, plan_id | failed_at timestamp |
SubscriptionCancelled | sub_id, plan_id | cancelled_at timestamp |
SubscriptionExpired | sub_id, plan_id | periods_billed |
SubscriptionReactivated | sub_id, plan_id | - |
MigrationRequested | old_plan_id, new_plan_id | Count of affected subs |
MigrationAccepted | old_sub_id, new_sub_id | new_plan_id |
RefundIssued | sub_id, plan_id | amount |
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.