Ethereum: a comprehensive guide to sequence verification and relative timelock
The Ethereum platform is built on top of a novel consensus algorithm called Proof of Work (Pow) that requires Nodes to solve complex mathematical equations to value transactions and create new blocks. In addition, the network utilizes a mechanism called sequence verification to ensure the integrity of the blockchain.
Sequence Verification: A Brief Overview
Sequence Verification is a layer 2 Scaling solution that aims to improve the performance of Ethereum by reducing the number of gas used in each transaction. It works by creating a “sequence” of transactions that are executed sequentially, one after another.
Here’s How It Works:
1.
2.
3.
How Nsequence Works
The nsequence
project implementation of sequence verification that is designed for high-performance scaling. Here’s How It Works:
- A user creates an
nsequence
contract on the Ethereum network.
2.
3.
- The contract uses a novel algorithm called “hash chaining” to verify the validity of the sequence.
5.
Relative Timelock (RTT): A Practical Example
Relative Timelock is a feature that enables Ethereum Nodes to process multiple transactions in parallel without blocking or waiting for confirmation. Rtt relies on an off-chain wallet and a custom implementation of sequence verification.
Here’s a step-by-step example:
1.
2.
3.
4.
Practical Example: Sample Transactions
Let’s Consider Two Sample Transactions:
Transaction 1: tx1
`Json
{
"Data": {
"Amount": 100,
"to": "0x1234567890abcdef"
}
}
Transaction 2: tx2
`Json
{
"Data": {
"Amount": 200,
"from": "0x567890abcdef"
}
}
Sequence Verification
The value for each transaction. This is done using the createsequence ()
function in the nsequence
contract.
`Json
{
"sequenceid": "Tx1 tx2",
"Transactions": [
{
"txid": "tx1",
"hash": "0x ..."
},
{
"txid": "tx2",
"hash": "..."
}
]
}
rtt
. Lockwallet ()
Function.
`Json
{
"Walletid": "0x1234567890abcdef",
"LockeddDation": 10 // Seconds
}
When a Node Receives a message containing the sequence, it uses rtt to process multiple transactions in parallel. The sequence is verified by hashing each transaction with its corresponding id and linking them together.