Terrand by LoTerra
Terrand is an oracle smart contract CosmWasm compatible to get distributed randomness beacon. Verifiable, unpredictable, and unbiased random numbers as a service.
The first Cosmos Hub's randomness oracle, opening new horizons on Cosmos Hub
Terrand is opensource. If you plan to use Terrand on production be kind to display on your interface that you are using Terrand from LoTerra. Thanks for your support. Need more info? please contact @0xantmanโ€‹
JOIN OFFICIAL TELEGRAM SUPPORT NOW
โ€‹https://t.me/terrandโ€‹
Support the team with donation
Terra
terra1th7wznjznnyck42v3eyma6cukqvrttsq75cu5a
Juno
juno1ss9t59aaqd0ntq06jlglau76wg0ws2sws5nudx
Randomness representation from @vectorjuice
Randomness source from https://drand.love/โ€‹
Contributors: @webmaster128, @0xantmanโ€‹

Terrand instance

Juno

Mainnet juno-1
Testnet uni-2
Contract
Address
Main
juno15nks67ghx7rqva8wx5c6gxh4djshjd98zy258m9d70y0kt0zw0wshpvs7r
Intern
juno10l7hjd5pmcmgyqyqylsku5txsvs4fxjeu0gpmvkwt2tfqhxlu6kss7ezxq
Contract
Address
Main
juno1689kqmqc4rfavpq4c3m3sc5dlqdmc3d4gvy4skqxhnwjh98mwp7qlxq9h9
Intern
juno1nrnvu5t0nwdcusu00lp6tfzyxdgaekv9kyap22rwzah5vaueru2q5ce33c

Terra classic

Mainnet Colombus-5
Testnet Bombay-12
Contract
Address
main
terra1s90fm6hmh5n9drvucvv076ldemlqhe032qtjdq
โ€‹
Contract
address
main
terra1a62jxn3hh54fa5slan4dkd7u6v4nzgz3pjhygm
If you add randomness you become the owner of this one and can get **rewards multiple times *by a smart contract that needs your randomness.
โ€‹
*We encourage third partyโ€™s smart contract to create a mechanism and allocate funds for incentivise workers.
**Terrand donโ€™t guarantee any workers rewards for adding randomness to Terrand smart contracts

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}
ExecuteMsg
Example of use
Results
{
"drand":{
"round": u64,
"previous_signature": Binary,
"signature": Binary
}
}
  1. 1.
    Get randomness from drand round, signature ,and previous_signature
  2. 2.
    Convert [ HEX ] signature's to [ BASE64 ] you can use https://conv.darkbyte.ru/โ€‹
// You need to convert the hash signature's to base64
{
"drand": {
"round": 570232,
"previous_signature": "j9GtATWs9bZ7By6qxQTkA+9AaD+YT2zaw1qPHghmBeRhhu9A3FRHdphT7aMF2WAdDGXmSqf6alA7n2P6GOXtRz6ctns3Kkq7jl2zzpzGSgguxvAli5rFMQqSK3iaBSJa",
"signature": "o/xvA7KrfsthQu6gOqnjiLRwCCUbYA6sDnhF2Vl+95Jh6XsPkZrx93wLn9ukNNyXGQPErcLqWbM8iR2MnZhMWeSuciJ1OvtDZA2ayLoAoOSjrI8ZV8ZP6ekVIIgXBRbK"
}
}
Trasaction error InvalidSignature Not a valid drand signature
Success transaction

Get the latest randomness

QueryMsg
Result
Response sample
{
"latest_drand": {}
}
{
"height": string,
"result": {
"round": u64,
"randomness": Binary,
"worker": HumanAddr
}
}
{
"height": "2439975",
"result": {
"round": 573531,
"randomness": "yTBW2ubloeFa+ZRh08Jt+4jVQHHGMX4s3j8mTYKc3oQ=", // This is the randomness hash from drand
"worker": "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v" // Worker is the address of the account who added this random
}
}

Get a custom round

QueryMsg
Result
Response sample
{
"get_randomness": { "round": u64 }
}
{
"height": string,
"result": {
"randomness": Binary,
"worker": HumanAddr
}
}
{
"height": "2439975",
"result": {
"randomness": "yTBW2ubloeFa+ZRh08Jt+4jVQHHGMX4s3j8mTYKc3oQ=", // This is the randomness hash from drand
"worker": "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v" // Worker is the address of the account who added this random
}
}

Why Terrand ?

This oracle bring Drand randomness to Cosmos Hub! 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 that can be more efficient and (potentially) offer higher security against manipulation. A number of exciting 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 following number to come out of the generator.
  • Publicly verifiable: anyone can verify that a random number is legitimately random.
  • 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

Import the dependency https://crates.io/crates/terrandโ€‹
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
{
"public_key":"868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31",
"period":30,
"genesis_time":1595431050,
"hash":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce",
"groupHash":"176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a"
}
Perform this calculation to get the actual round or next round
CONST GENESIS_TIME: u64 = 1595431050;
CONST PERIOD: u64 = 30;
// CosmWasm 0.16
let timestamp_now = env.block.time.seconds();
โ€‹
// Get the current block time from genesis time
let from_genesis = timestamp_now - GENESIS_TIME;
โ€‹
// Get the current round
let current_round = from_genesis / PERIOD;
// Get the next round
let next_round = current_round + 3;

Evolution

Encrypt real-time data to be decrypted in a determined future randomness round.

Dapps using Terrand as an oracle

(Feel free to contact @0xantman on twitter to add your project on the list)
โ€‹LoTerra
๐ŸŒ
โ€‹
โ€‹Terra Vegas
๐Ÿƒ
โ€‹
โ€‹Curio NFT marketplace ๐ŸŽฎ
โ€‹Glow Yield
๐ŸŒ•
โ€‹

Showcase

List of known project using Terrand:
LoTerra
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
Curio | NFT marketplace
We are using Terrand on Curio candy machine! ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ
Terra Vegas
In terra.vegas casino, we are using the most decentralized and verifiable source of randomness available in the #Terra ecosystem: #Terrand. Glow link Glow is using a non official instance of Terrand contract โš ๏ธ Coinhall link OpenPlanet link
No official mention Protocols suspected to use Terrand.
MintDao
Hi! We are trying to use terrand in our projectโ€ฆ
RandomEarth
Starterra
Deviantโ€™s Factions
Hey, looking to use terrand in an NFT pack opener and for other randomness applications for Deviants.

Brand tool kit

You can use followed image for branding
โ€‹
PNG black text transparent background
โ€‹
PNG white text transparent background
Last modified 2mo ago