🤖Technology & Architecture
Learn more about the technology backing Solswipe!
Benefits of The Solana Ecosystem
Solana is a high-performance blockchain designed for scalability, offering rapid transaction speeds with a high throughput and low-cost structure. It can handle tens of thousands of transactions per second at a fraction of the cost compared to traditional blockchains, due to its unique consensus mechanism known as Proof of History (PoH) combined with Proof of Stake (PoS). This combination enables Solana to optimize processing time and reduce latency, making it ideal for applications requiring high-speed data exchange and real-time user interaction.
Why we chose Solana
SolSwipe chose Solana over other blockchains primarily for its exceptional speed and efficiency, which is crucial for a social media platform with potentially millions of simultaneous users and real-time content updates. Additionally, Solana's lower transaction costs ensure that operating at a large scale remains economically feasible, while its growing ecosystem of decentralized applications (dApps) and projects provide ample opportunities for integration and collaboration within a robust community, further enhancing the platform's value proposition.
What are Smart Contracts & How do we use them
Smart contracts on SolSwipe are self-executing contracts with the terms of the agreement directly written into lines of code. These contracts facilitate, verify, and enforce the negotiation or performance of an agreement or transaction. SolSwipe utilizes these smart contracts to manage various functions such as user identity verification, content monetization strategies, and the distribution of rewards. This not only automates essential processes but also ensures they are executed in a transparent and conflict-free manner, bolstering trust and efficiency across the SolSwipe platform.
Smart Contract Overview (2024/04/19)
UserProfile Contract
Purpose: Manages individual user profiles on the SolSwipe platform.
Key Attributes:
Owner: The Solana public key of the user who owns the profile.
Display Name and Bio: Customizable user identifiers that are stored as strings, with display names of up to 100 characters and biographies of up to 356 characters.
Timestamp: Stores the Unix timestamp of when the profile was created, providing a temporal reference for the account's inception.
Posts, Comments, Followers, Following: Arrays of public keys that reference the user’s posts, comments made, followers, and accounts the user is following.
Post Contract
Purpose: Facilitates the creation and management of posts by users on the platform.
Key Attributes:
Owner and User: Public keys for the owner of the post and the user profile associated with the post.
Timestamp: Unix timestamp noting when the post was made.
Description: A text field allowing up to 200 characters for post content description.
Video IPFS CID: A string field up to 200 characters, storing an IPFS content identifier for video content linked to the post.
Likes and Comments: Lists of public keys representing users who have liked the post and comments associated with it.
Functionalities Enabled by Smart Contracts
Creating and Updating User Profiles
Users can create a profile using the
create_user_profilefunction, which sets up their public profile details such as display name and bio, and initializes lists for posts, comments, followers, and following. Updates to display names and bios are managed through specific functions (update_user_profile), ensuring that changes adhere to character limits and are properly authenticated.
Content Creation and Management
The
create_new_postfunction allows users to create posts by specifying a description and optionally linking video content via an IPFS CID. The contract ensures that the user does not exceed post limits and that content length is within prescribed bounds. Posts can be updated or deleted through dedicated functions, providing flexibility while maintaining control over the content lifecycle.
These smart contracts form the backbone of the SolSwipe platform, leveraging Solana's high-performance blockchain infrastructure to deliver a seamless, secure, and user-friendly experience for decentralized social media interactions.
Decentralized Content Storage
SolSwipe leverages the InterPlanetary File System (IPFS), a decentralized storage solution, to handle video content, ensuring a robust and scalable media distribution model. IPFS operates by creating a peer-to-peer network of nodes that store and share files in a distributed fashion. Instead of relying on a central server, files are broken into blocks and distributed across multiple nodes, which means that content can be served by any node that has the required blocks, reducing the load on any single point and enhancing delivery speeds.
When a user uploads a video on SolSwipe, the content is split into blocks and given a unique fingerprint called a Content Identifier (CID). This CID acts as a permanent record of the file and cannot be altered without changing the file’s content, thereby ensuring the integrity of the data. The video is then accessible via this CID on the IPFS network, which can be retrieved by anyone who has the CID, making the system highly resistant to censorship and server failure.
The benefits of using IPFS for SolSwipe are significant:
Decentralization: Unlike traditional hosting services which can form bottlenecks and points of failure, IPFS eliminates single points of failure, as files are hosted by multiple nodes independently.
Censorship Resistance: Content hosted on IPFS can be accessed anywhere without the interference of centralized authorities, which is crucial for maintaining the free flow of information on a decentralized social media platform.
Redundancy and Fault Tolerance: IPFS stores multiple copies of each data block across the network, ensuring that the system can withstand node failures without losing data.
Efficient Content Retrieval: IPFS uses a content-addressable storage model where content is fetched based on its hash, leading to faster and more efficient data retrieval.
Reduced Bandwidth Costs: With IPFS, nodes can load content from the nearest nodes that store the data, rather than downloading from a centralized server, thereby reducing bandwidth usage and costs.
By integrating IPFS, SolSwipe not only enhances its operational efficiency but also aligns with its core principles of decentralization and user empowerment, providing a resilient foundation for hosting and sharing video content securely and efficiently.
Last updated
