Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
CTG-TOKEN committed Jan 22, 2023
1 parent 986c40b commit 40d2494
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,43 @@
Introduction

In recent years, the use of blockchain technology has grown rapidly, with many companies and organizations looking to utilize its potential to revolutionize the way we conduct business and manage assets. Among the most popular blockchain platforms is Bitcoin, which is widely considered to be the first and most successful application of blockchain technology. However, despite its popularity and success, Bitcoin has several limitations that have prevented it from achieving widespread adoption. These limitations include slow transaction speeds and a lack of security.
MsB is a decentralized payment channel that enables fast, secure and low-cost transactions between two parties.

Our proposed solution is a smart contract that can be built on top of the Bitcoin network to provide increased speed and security for Bitcoin transactions.
SecureSpeed uses a smart contract deployed on the Ethereum blockchain that stores the payment channel data and implements the logic for managing the channel. The smart contract allows users to deposit funds, withdraw funds, update their deposit, initiate transactions, and resolve disputes.

MsB also integrates an external oracle contract to resolve disputes between the parties involved in a payment channel. The oracle contract can be any contract that implements the resolveDispute(address user1, address user2) function, which returns a tuple of a boolean and a uint.

Background

Bitcoin transactions are processed by a decentralized network of nodes that follow a set of consensus rules. These rules dictate the way the network processes transactions and confirms them in the blockchain. However, the current process for confirming transactions is slow and can take several minutes to complete. Additionally, the decentralized nature of the network also introduces security risks, as transactions can be subject to double-spending and other forms of fraud.

Our smart contract solution addresses these limitations by creating a "lightning network" on top of the Bitcoin network. This lightning network allows participants to open payment channels with one another and make multiple transactions without having to broadcast each one to the entire network. By keeping transactions off-chain, the speed of transactions is greatly increased. Additionally, smart contract can be used to create multisignature wallets, this allows for more secure storage of bitcoin, by requiring more than one signature to authorize a transaction.

Problem Statement

Current blockchain-based payment systems have several limitations such as high transaction costs, slow transaction times, and lack of privacy. SecureSpeed aims to overcome these limitations by creating a decentralized payment channel that allows users to transact directly with each other, without the need for a central intermediary.

Technical details

Our smart contract is written in Solidity and can be deployed on the Ethereum network. However, it can also be ported to other blockchain platforms that support smart contracts. The contract creates a multi-sig wallet that requires multiple signatures to authorize a transaction. The execute function can be called by any of the owners to initiate a transaction, but it requires confirmation from other owners before it can be executed.
The MsB contract is written in Solidity, and it's compiled with version 0.11.0. The contract uses a mapping to store the payment channel data, which is organized as a two-dimensional mapping, where the first key is the address of the first user, and the second key is the address of the second user. Each channel is represented by a struct that contains the following fields:

address user1: the address of the first user
address user2: the address of the second user
uint deposit: the deposit in the channel
bool closed: a flag that indicates whether the channel is closed or not

The contract has several functions that allow users to interact with the payment channel:

deposit(address user, uint value): allows a user to deposit funds into the channel.
withdraw(address user, uint value): allows a user to withdraw funds from the channel.
updateDeposit(address user, uint value): allows a user to update the deposit in the channel.
initiateTransaction(address user1, address user2, address recipient, uint value, bytes memory signature1, bytes memory signature2): allows users to initiate a transaction between them, where signature1 is the signature of the first user, and signature2 is the signature of the second user.
resolveDispute(address user1, address user2): allows the parties involved in the channel to resolve a dispute by calling the external oracle contract.
closeChannel(address user1, address user2): allows the parties involved in the channel to close the channel when the deposit is zero.
updateChannel(address user1, address user2, uint newDeposit): allows the parties involved in the channel to update the deposit in the channel.
executeTransaction(address user1, address user2, address recipient, uint value, bytes memory signature1, bytes memory signature2): allows the parties involved in the channel to execute a transaction.


The contract also includes a function for opening payment channels between participants. Once a payment channel is open, participants can make multiple transactions without having to broadcast each one to the entire network. This greatly increases the speed of transactions and reduces the number of transactions that need to be confirmed on the blockchain.

Expand Down

0 comments on commit 40d2494

Please sign in to comment.