Professional Documents
Culture Documents
MEDIA PLATFORM
Project Report
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); });
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.
}
uint i = 0;
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.
Conclusion:
7
References: