-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* oracle randomness doc * slippy
- Loading branch information
Showing
10 changed files
with
144 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,70 @@ | ||
License: MIT-0 | ||
# Title: Oracle Randomness Pallet | ||
|
||
## Introduction | ||
The Oracle Randomness Pallet is a module that provides a secure and decentralized source of randomness on the blockchain. It allows users to generate random numbers that are verifiably fair and unbiased, making it suitable for various applications such as gaming, lotteries, and random selection processes. | ||
|
||
## Features | ||
- Generation of random numbers using a decentralized oracle network | ||
- Verifiable fairness and transparency of the generated random numbers | ||
- Integration with other modules and smart contracts on the blockchain | ||
- Configurable parameters for randomness generation | ||
|
||
## Usage | ||
To use the Oracle Randomness Pallet in your runtime or application, follow these steps: | ||
|
||
1. Add the pallet as a dependency in your `Cargo.toml` file: | ||
```toml | ||
[dependencies] | ||
oracle-randomness = { version = "x.x.x", default-features = false } | ||
``` | ||
|
||
2. Import the pallet into your runtime: | ||
```rust | ||
use oracle_randomness; | ||
``` | ||
|
||
3. Configure the pallet by setting the desired parameters in your runtime's `construct_runtime!` macro: | ||
```rust | ||
construct_runtime!( | ||
... | ||
OracleRandomness: oracle_randomness::{Pallet, Call, Storage, Event<T>}, | ||
... | ||
); | ||
``` | ||
|
||
4. Implement the necessary traits for the Oracle Randomness Pallet in your runtime: | ||
```rust | ||
impl oracle_randomness::Config for Runtime { | ||
type Event = Event; | ||
} | ||
``` | ||
|
||
5. Use the provided dispatchable functions or methods to interact with the Oracle Randomness Pallet. | ||
|
||
## Terminology | ||
- Oracle: A trusted entity that provides random number generation services on the blockchain. | ||
- Randomness: A sequence of unpredictable and unbiased numbers generated by the Oracle Randomness Pallet. | ||
|
||
## Goals | ||
The Oracle Randomness Pallet aims to achieve the following goals: | ||
- Provide a secure and decentralized source of randomness on the blockchain. | ||
- Ensure verifiable fairness and transparency of the generated random numbers. | ||
- Enable integration with other modules and smart contracts for various applications. | ||
|
||
## Interface | ||
The Oracle Randomness Pallet provides the following dispatchable functions or methods: | ||
|
||
### Permissionless Functions | ||
- `request_randomness(seed: T::Hash) -> DispatchResult`: Requests the generation of a random number using the specified seed. | ||
|
||
### Permissioned Functions | ||
- `submit_random_seed_unsigned(block_number: BlockNumberFor<T>, seed: Vec<u8>) -> DispatchResult`: Submits the a oracle's seed from offchain worker. | ||
|
||
- `set_new_random_urls(urls: Vec<Vec<u8>>) -> DispatchResult`: Root set new oracle source urls. | ||
|
||
### Metadata Functions | ||
- `random_number(total: u32, adjust: u32) -> Option<T::u32>`: Retrieves the latest generated random number. | ||
|
||
|
||
## License | ||
Apache License 2.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters