You are on page 1of 8

BLOCKCHAIN BASED SOCIAL

MEDIA PLATFORM
Project Report

Adeel Ahmed – BSE193081

Ahmad Gulzaib - BSE193068

Akbar Saqlain – BSE193131


Abstract: nature of blockchain, social media
platforms can potentially offer greater
This report presents a blockchain-based
privacy and control for users, as well as
social media platform that aims to
reduced dependence on advertising
address the issues of data privacy and
revenue.
security that are prevalent in centralized
social media platforms. The platform In this report, we will explore the concept
utilizes the decentralized nature of of a blockchain-based social media
blockchain technology to allow users to system and how it differs from traditional
have full control over their data and social media platforms. We will also
content, while also providing a secure and discuss the potential benefits and
transparent environment for interactions. challenges of such a system, as well as
The platform includes features such as some examples of existing blockchain-
end-to-end encryption, user-controlled based social media projects.
data storage, and built-in rewards for
Motivation for Blockchain
content creators. The project aims to
Technology:
create a new standard for social media
platforms, where users can trust that their Traditionally, the database is maintained
data is safe and secure, and where their by a central Authority or a single
voices and contributions are valued. The organization that has then complete
report discusses the technical details of Control of the database. It has the ability
the platform, including the underlying to tamper with the Database and
blockchain infrastructure and the various manipulate the data. Usually the authority
features and functionalities that have Maintaining the database is the same that
been implemented. Overall, the project has created it and Will be using it. In such
demonstrates the potential for blockchain cases the organization has no Motive of
technology to revolutionize the social manipulating or falsifying its own data.
media industry and create a more But in Other cases involving financial
equitable and user-centric online matters or sensitive data like Voting, it’s
experience. not wise to give total control of database
to a Single authority or organization.
Introduction:
Even if the organization is guaranteed as
Blockchain technology has the potential to not make Any fraudulent changes to
to revolutionize a wide range of the database, it is easier for
industries, including social media. By
Hackers to manipulate a central database.
leveraging the decentralized and secure
To avoid such

2
Situations, blockchain makes the Another potential benefit of a blockchain-
database public, so that Anyone can store based social media system is the ability to
an individual copy of database that can reward users for their contributions to the
Always be compared to check for platform. Many traditional social media
manipulations. However, The individual platforms rely on advertising revenue as
copies must always be updated to their primary source of income, which
maintain Consistency. To maintain a can lead to a user experience that is
consistent decentralized Database, cluttered with ads and lacking in
blockchain utilizes consensus incentives for content creation. In a
mechanism. blockchain-based system, users could
potentially earn tokens or other rewards
What is a blockchain-based social
for creating and curating high-quality
media system?
content, fostering a more engaged and
A blockchain-based social media system dynamic community.
is a platform that utilizes blockchain
technology to store and manage user data
and interactions. In contrast to traditional Technology:
social media platforms, which are
Front-end
typically centralized and controlled by a
single company, a blockchain-based <!DOCTYPE html>
social media system would be <html>
decentralized and potentially operated by <head>
<script
a network of users. src="https://code.jquery.com/jquer
y-3.6.0.min.js"></script>
One of the key features of a blockchain-
<script>
based social media system is the use of $(document).ready(function() {
cryptographic techniques to secure user // Connect to the Ethereum
data and protect privacy. With traditional blockchain
const web3 = new Web3(new
social media platforms, user data is often Web3.providers.HttpProvider("http:
collected and shared with third parties for //localhost:8545"));
targeted advertising and other purposes.
In a blockchain-based system, user data // The address of the smart
contract that handles messaging
could be stored in a decentralized const contractAddress =
manner, allowing users to have greater "0x1234567890abcdef";
control over their data and who has access
// The ABI of the smart
to it.
contract

3
const contractABI = [{...}]; .catch(function(error) {
// There was an error
// Create an instance of the sending the message
smart contract console.log("Error
const contract = new sending message:", error);
web3.eth.Contract(contractABI, });
contractAddress); });

// The address of the // Listen for


account sending the message messageReceived events
const senderAddress = contract.events.messageRecei
"0x0987654321fedcba"; ved({
filter: {sender:
// Send the message when the '0x0987654321fedcba'},
button is clicked fromBlock: 0
$("#send-message- }, function(error, event){
button").click(function() { console.log(event); })
// Get the message from .on('data',
the input field function(event){
const message = // Display the received
$("#message-input").val(); message in the div
$("#messages").append(` const message =
<p style="border: event.returnValues.message;
1px solid; $("#messages").append(`
padding: 10px; <p style="border:
box-shadow: 5px 5px 8px 1px solid;
black; padding: 10px;
border-radius: 10px; box-shadow: 5px 5px 8px
margin: 20px;">Sender : black;
0x0987654321fedcba <br> border-radius: 10px;
Message :`+message+` margin: 20px;">Sender :
</p> 0x0987654321fedcba <br>
`); Message : ${message}
</p>
// Send the message `);
contract.methods.sendMessa })
ge(message).send({ from: .on('changed',
senderAddress }) function(event){
.then(function(receipt) // remove event from
{ local database
// The message has })
been sent .on('error',
console.log("Message console.error);
sent:", receipt); });
}) </script>

4
</head> <button style="height:
<body> 62px;position:absolute;border-
<div style="width: radius: 0px 15px 15px 0px;border:
100%;height:35em;align-items: 0px;" id="send-message-
center;border-style: button">Send message</button>
dashed;border: </body>
1;overflow:auto;padding: 10;" > </html>
<h1 style="text-align:
center;">Messages</h1>
<div style="padding: 10px;" The JavaScript code listens for the
id="messages" > ‘messageReceived’ event emitted by the
<p style="border: 1px
smart contract, and when a new message
solid;
padding: 10px; is received, it appends the message to the
box-shadow: 5px 5px 8px black; div element with the id "messages".
border-radius: 10px;
margin: 20px;">Sender : The JavaScript code listens for the click
0x0987654321fedcba <br> event on the "Send message" button, and
Message : Hello World
when the button is clicked, it gets the
</p>
<p style="border: 1px solid; value of the input field with the id
padding: 10px; "message-input" and passes it to the
box-shadow: 5px 5px 8px black; sendMessage function of the smart
border-radius: 10px;
contract.
margin: 20px;">Sender :
0x95123sadaxcf <br>
Back-end
Message : Hello World
</p>
pragma solidity ^0.8.0;
<p style="border: 1px solid;
padding: 10px;
box-shadow: 5px 5px 8px black;
border-radius: 10px;
contract Message {
margin: 20px;">Sender :
0x95123sadaxcf <br>
struct MessageStruct {
Message : Hello World
</p> address sender;
</div>
</div> string message;
<br>
}
<textarea style="width:
90%;height: 50px;resize:
none;border-radius: 15px 0px 0px
15px;padding: 5px;" type="text" mapping(address => MessageStruct)
id="message-input"></textarea>
public messages;

5
The smart contract has a struct called
‘MessageStruct’ that stores the sender
function sendMessage(string memory
address and message as a key-value pair.
_message) public {
These are stored in a mapping called
messages[msg.sender] = messages. The sendMessage function is
MessageStruct(msg.sender, _message); used to add new messages to the
mapping.
}

The getAllMessages function is a view


function getAllMessages() public function that returns an array of addresses
view returns (address[] memory, string[] and an array of messages. The function
memory) { uses a for loop to iterate through the
address[] memory addresses = new mapping and push the sender address and
address[](address(0)); message into the respective arrays.

string[] memory messages = new Examples of blockchain-based social


string[](string.empty); media systems:

uint i = 0;

for (address sender in messages) { There are several examples of


blockchain-based social media projects
addresses.push(sender); that are currently in development or have
already launched.

messages.push(messages[sender].messag Steemit is a blockchain-based social


e); media platform that rewards users for
creating and curating content. The
i++;
platform, which launched in 2016,
} utilizes a cryptocurrency called STEEM
to reward users for their contributions.
return (addresses, messages);
Another example is Minds, a blockchain-
}
based social media platform that aims to
} offer greater privacy and control for
users. The platform, which launched in
2015, utilizes a cryptocurrency called

6
MINDS to reward users for their In conclusion, a blockchain-based social
contributions and allows users to media system has the potential to offer
monetize their content through greater privacy, control, and incentives
subscriptions and paid memberships. for users compared to traditional
platforms. While there are challenges and
considerations to take into account, such
Challenges and considerations as scalability and network effects, the
concept represents an interesting
Despite the potential benefits of a alternative to the current centralized
blockchain-based social media system, model of social media. As the technology
there are also challenges and continues to evolve, it will be interesting
considerations to take into account. to see the impact that blockchain-based
One challenge is the scalability of such a social media systems have on the
system. Blockchain technology has faced industry.
scalability issues in the past, with some
UI:
cryptocurrencies struggling to process a
high volume of transactions in a timely
manner. This could potentially be a
problem for a social media platform that
requires fast and efficient processing of
user interactions.

Another consideration is the issue of


network effects. Traditional social media
platforms have benefited from strong
network effects, with a large user base
attracting more users and creating a
virtuous cycle. It remains to be seen if a
blockchain-based social media system
could achieve the same level of traction
and user adoption.

Conclusion:

7
References:

 “Decentralized social networks:


A survey,” by S. Singh, V. K.
Chaudhary, and P. K. Jain. In
ACM Computing Surveys
(CSUR), vol. 52, no. 2, pp. 1-34,
2019.
 “A review of decentralized social
networks: Challenges,
opportunities, and the road
ahead,” by A. P. Santos, J. P.
Martins, and L. B. Ruiz. In IEEE
Access, vol. 8, pp. 95,487-95,507,
2020.
 “Blockchain-based social media:
A review of platforms and their
features,” by T. R. Bose and S.
Dey. In IEEE Access, vol. 7, pp.
138,566-138,581, 2019.
 “Decentralized social media: A
survey of protocols and platforms,”
by M. A. Al-Khalifa and S. Al-
Bassam. In IEEE Access, vol. 8, pp.
132,973-132,992, 2020.
 “Towards blockchain-based social
media: A qualitative analysis of
Steemit,” by M. A. Al-Khalifa and S.
Al-Bassam. In IEEE Access, vol. 7,
pp. 78,639-78,654, 2019.

You might also like