Terrand by LoTerra
Terrand is an oracle smart contract on Terra Luna to get distributed randomness beacon. Verifiable, unpredictable, and unbiased random numbers as a service.
The first Terra's randomness oracle, opening new horizons on Terra Blockchain

If you plan to use Terrand on production we just ask to display on your interface that you are using Terrand from LoTerra

For more info please contact @0xantman​

​
Randomness representation from @vectorjuice
Randomness source from https://drand.love/​
Contributors: @webmaster128, @0xantman​
Contract addresses:
Testnet Tequila-0004
terra1vgjrv99xcmgt8m7cw9udmcvyww7sqxqjucvue6
​
Mainnet Colombus-4 (official smart contract of Terrand)
terra17hsftucasxf5leyax47unm84hqnvr0yhusy6xt
​
Mainnet Colombus-5 (official smart contract of Terrand)
​
Testnet Bombay-12
If you add randomness you become the owner of this one and can get paid multiple times by smart contract who need your randomness.

Add randomness

Well! Start now adding randomness and get potential rewards
πŸ™Œ
​
You can get the latest randomness from https://drand.cloudflare.com/public/latest or by roundhttps://drand.cloudflare.com/public/{round}
1
{
2
"drand":{
3
"round": u64,
4
"previous_signature": Binary,
5
"signature": Binary
6
}
7
}
Copied!
Example of use:
    1.
    Get randomness from drand round, signature ,and previous_signature
    2.
    Convert [ HEX ] signature's to [ BASE64 ] you can use https://conv.darkbyte.ru/​
1
// You need to convert the hash signature's to base64
2
{
3
"drand": {
4
"round": 570232,
5
"previous_signature": "j9GtATWs9bZ7By6qxQTkA+9AaD+YT2zaw1qPHghmBeRhhu9A3FRHdphT7aMF2WAdDGXmSqf6alA7n2P6GOXtRz6ctns3Kkq7jl2zzpzGSgguxvAli5rFMQqSK3iaBSJa",
6
"signature": "o/xvA7KrfsthQu6gOqnjiLRwCCUbYA6sDnhF2Vl+95Jh6XsPkZrx93wLn9ukNNyXGQPErcLqWbM8iR2MnZhMWeSuciJ1OvtDZA2ayLoAoOSjrI8ZV8ZP6ekVIIgXBRbK"
7
}
8
}
Copied!

Get the latest randomness

Query:
1
{
2
"latest_drand": {}
3
}
Copied!
Result:
1
{
2
"height": string,
3
"result": {
4
"round": u64,
5
"randomness": Binary,
6
"worker": HumanAddr
7
}
8
}
Copied!
Result example:
1
{
2
"height": "2439975",
3
"result": {
4
"round": 573531,
5
"randomness": "yTBW2ubloeFa+ZRh08Jt+4jVQHHGMX4s3j8mTYKc3oQ=", // This is the randomness hash from drand
6
"worker": "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v" // Worker is the address of the account who added this random
7
}
8
}
Copied!

Get a custom round

Query:
1
{
2
"get_randomness": { "round": u64 }
3
}
Copied!
Example of use:
1
{
2
"get_randomness": { "round": 573531 }
3
}
Copied!
Result:
1
{
2
"height": string,
3
"result": {
4
"randomness": Binary,
5
"worker": HumanAddr
6
}
7
}
Copied!
Result example:
1
{
2
"height": "2439975",
3
"result": {
4
"randomness": "yTBW2ubloeFa+ZRh08Jt+4jVQHHGMX4s3j8mTYKc3oQ=", // This is the randomness hash from drand
5
"worker": "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v" // Worker is the address of the account who added this random
6
}
7
}
Copied!

Why Terrand ?

This oracle bring Drand randomness to Terra Luna! This will be interesting to see community building project around this great oracle. - @0xantman
🀹
The ability to generate randomness is the foundation of many security protocols. - @eprint.iacr.org
Generating public randomness is a common problem, supporting the desire to build a dedicated service which can be more efficient and (potentially) offer higher security against manipulation. A number of interesting applications require random values that cannot be predicted prior to being generated, but are made public after generation.

The drand project aims to create a random number generator that has all five of these properties.

    Unpredictable: you can't predict the next number to come out of the generator.
    Publicly-verifiable: anyone can verify that a random number is a legitimately random number.
    Bias-resistant: you can't lead the generator one way or another.
    Decentralized: a set of independent parties produces random numbers.
    Always available: the system must always be able to provide random numbers.

Dapp integration

Contact LoTerra if you need help and for partnering you can find social media here https://loterra.io ​
You can calculate a determined round from the timestamp of drand genesis from https://drand.cloudflare.com/info
Result
1
{
2
"public_key":"868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31",
3
"period":30,
4
"genesis_time":1595431050,
5
"hash":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce",
6
"groupHash":"176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a"
7
}
Copied!
Perform this calculation to get the actual round or next round
1
CONST GENESIS_TIME: u64 = 1595431050;
2
CONST PERIOD: u64 = 30;
3
// CosmWasm 0.16
4
let timestamp_now = env.block.time.seconds();
5
​
6
// Get the current block time from genesis time
7
let from_genesis = timestamp_now - GENESIS_TIME;
8
​
9
// Get the current round
10
let current_round = from_genesis / PERIOD;
11
// Get the next round
12
let next_round = current_round + 1;
Copied!

Evolution

Terrand will soon encrypt real-time data to be decrypted in a determined future randomness round.

Dapps using Terrand as oracle

(Feel free to contact @0xantman on twitter to add your project on the list)
​LoTerra
🌐
​

Brand tool kit

You can use followed image for branding
​
PNG black text transparent background
​
PNG white text transparent background
Last modified 10d ago