flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Smart Contracts] Soulbound Stream Position Receipts & Non-Fungible Ownership Tokens

Open blurbeast opened this issue 2 months ago β€’ 10 comments

Overview & Background

In decentralized finance and Web3 payroll, payment streams represent continuous yield-bearing financial assets. Currently, a stream's recipient and sender relationships are stored strictly as static address fields inside Soroban contract storage. By issuing a standardized position token or Soulbound NFT receipt upon stream creation, recipients and creators gain on-chain verifiable proof of ongoing cashflows.


Detailed Problem Statement

  1. Lack of On-Chain Composability:
    • Other DeFi protocols on Soroban (such as lending markets, decentralized debt protocols, or secondary vesting marketplaces) cannot easily verify or lock a user's future streaming balance as collateral.
  2. Wallet Portfolio Invisibility:
    • Wallets like Freighter, Albedo, or Lobstr display standard Stellar SEP-0041/SEP-0050 tokens and NFTs, but active FlowFi streams remain completely invisible in standard wallet asset lists without custom indexer queries.
  3. Identity Verification & Proof of Income:
    • Freelancers and remote workers currently lack a cryptographic attestation of verifiable ongoing recurring cashflow for creditworthiness or DAO membership.

Technical Specification & Architecture

1. Position Token Representation

Design a position token model in contracts/stream_contract:

  • Each stream produces an associated NFT Position Identifier (e.g. StreamPosition { stream_id: u64, role: PositionRole } where role is Sender or Recipient).
  • Option for either:
    • Transferable Position: Enabling secondary trading or delegation of stream income (with sender or recipient transferability toggles).
    • Soulbound Attestation: Non-transferable token linked immutably to the recipient's Stellar address for credit/payroll proof.

2. Interface Definition

#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum PositionRole {
    Sender,
    Recipient,
}

#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct StreamPositionMetadata {
    pub stream_id: u64,
    pub role: PositionRole,
    pub token_address: Address,
    pub rate_per_second: i128,
    pub start_time: u64,
    pub end_time: u64,
    pub is_transferable: bool,
}

3. Minting & Burn Mechanics

  • When a stream is instantiated, optionally mint position metadata into contract storage or invoke a companion Soroban NFT contract.
  • When recipient_key_rotation or stream transfer occurs, update position ownership accordingly.
  • Upon complete stream payout (StreamStatus::Completed) or cancellation, update the position metadata status to Settled or burn the active entitlement.

4. View Functions

pub fn get_position_metadata(env: Env, stream_id: u64, role: PositionRole) -> Result<StreamPositionMetadata, StreamError>;
pub fn get_positions_by_owner(env: Env, owner: Address) -> Vec<StreamPositionMetadata>;

Target Files

  • contracts/stream_contract/src/types.rs
  • contracts/stream_contract/src/lib.rs
  • contracts/stream_contract/src/storage.rs
  • contracts/stream_contract/src/test.rs

Acceptance Criteria

  • [ ] Position metadata is securely generated upon stream creation.
  • [ ] get_position_metadata returns accurate rate, timeframe, asset address, and ownership role.
  • [ ] Non-transferable positions cannot be transferred to third-party addresses.
  • [ ] Transferable recipient positions properly update stream.recipient upon valid transfer authorization.
  • [ ] Unit tests verify position lifecycle: minting, metadata queries, transfers, and post-completion status.

blurbeast avatar Sep 27 '26 05:09 blurbeast

@Purity-Euphemia has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

Please I can work on this πŸ™Thank you

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Purity-Euphemia to this issue.

Purity-Euphemia avatar Sep 27 '26 15:09 Purity-Euphemia

@Osifowora has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

​Hi maintainer, I would love to work on this issue. I can get started on it right away.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Osifowora to this issue.

Osifowora avatar Sep 27 '26 15:09 Osifowora

Congratulations, @Osifowora! πŸŽ‰ Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

πŸ§‘β€πŸ’» @Osifowora: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🀠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Sep 27 '26 15:09 drips-wave[bot]

This issue has been marked as completed by a Drips Wave moderator for @Osifowora as part of the Stellar Wave Program's 9th Wave πŸ₯³

Moderator's reason: [Auto-assessed] The PR (#1524) from assigned contributor Osifowora is open, cleanly implements all features requested in Issue #1464 (as well as #1465, #1466, #1467), passes all unit tests, has clean mergeable state, and there are no maintainer objections across any channel.

😎 @Osifowora: You earned 150 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here.

πŸ§‘β€πŸ’» Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

ℹ️ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.

drips-wave[bot] avatar Oct 04 '26 14:10 drips-wave[bot]

@YoungBoss04 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hello, this issue interests me. I've handled comparable tasks in the past and can begin straight away.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @YoungBoss04 to this issue.

YoungBoss04 avatar Oct 16 '26 22:10 YoungBoss04

@anasisgay16 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hello maintainer, i would like to work on this issue

ℹ️ Repo Maintainers: To accept this application, review their application or assign @anasisgay16 to this issue.

SantanFeli avatar Oct 16 '26 22:10 SantanFeli

@Bossbaby0313 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hello please asign

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Bossbaby0313 to this issue.

Bossbaby0313 avatar Oct 16 '26 22:10 Bossbaby0313

@Wittig18 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

hey maintainer, i would love to work on this

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Wittig18 to this issue.

Wittig18 avatar Oct 16 '26 22:10 Wittig18

@moon-code12 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hi, Maintainer I can fix this issue

ℹ️ Repo Maintainers: To accept this application, review their application or assign @moon-code12 to this issue.

moon-code12 avatar Oct 16 '26 22:10 moon-code12

Congratulations, @anasisgay16! πŸŽ‰ Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

πŸ§‘β€πŸ’» @anasisgay16: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🀠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Oct 16 '26 22:10 drips-wave[bot]