Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v1 state

Back to all declarations

MaxKeySize

untyped bigint

Value

(65536 <untyped> bigint)

MaxKeyTypeSize

untyped bigint

Value

(64 <untyped> bigint)

commit

type

commit is everything the registry knows about one account.

Value

v1.commit

latestKept

untyped bigint

latestKept is the number of accounts the home page lists.

Value

(10 <untyped> bigint)

commits

v0.Tree

// address -> \*commit

Open
OID
01e997…7c65:4
commits details

Inspect ref

bound

int

// number of accounts with a bound key

Value

1

Register

func(rootSHA256 string, rootKeccak256 string, height int)

Register stores the Quantum Recovery Commit of the calling account: the roots of its SHA-256 and Keccak-256 trees, hex encoded, and their height. An account registers once. Its usual key has no say over the commit afterwards; only the one-time keys can replace it, through Rotate. A registration can never be corrected or withdrawn, and nothing here checks that the roots are a SHA-256 tree and a Keccak-256 tree of the given height: derive both roots and the height from the kit, in this order, and check them before sending. The caller must be the account itself, in a direct call or in a script it runs; a session key is refused.

Open
OID
01e997…7c65:7
Register details

Inspect func

Bind

func(account .uverse.address, leaf int, keyType string, key []uint8, proofSHA256 []uint8, proofKeccak256 []uint8)

Bind registers key as the new public key of account, under the free label keyType (for instance "ML-DSA-65"). key holds 1 to MaxKeySize bytes; a scheme with a longer public key can bind a digest of it, under a label that says so. The request must be signed with one-time key number leaf of both trees of the account: proofSHA256 and proofKeccak256 are the proofs of qrc.BindMessage for these arguments, with the account written as the chain writes it (lower case), whatever spelling the account argument uses. The leaf is spent. A signed request stays valid until its leaf is spent or the account rotates, and whoever holds it may send it at any time: requests take effect in the order they land, not the order they were signed. To replace a key while an earlier Bind for another key may still be pending, rotate first, bind in the new generation, then check Key. After a failure, send the same signed request again rather than sign for another key. Anyone may send the transaction. Whoever sends it pays the storage deposit of the bytes it adds and receives the refund of the bytes it frees. In a transaction, the three byte arguments are written in base64, which the chain decodes before the call.

Open
OID
01e997…7c65:9
Bind details

Inspect func

Rotate

func(account .uverse.address, leaf int, rootSHA256 string, rootKeccak256 string, height int, proofSHA256 []uint8, proofKeccak256 []uint8)

Rotate replaces the commit of account by a new one: two new roots, hex encoded, and their height. The public key bound to the account stays. Nothing checks the new roots any more than Register checks the first ones. The request must be signed with one-time key number leaf of both current trees: the proofs are those of qrc.RotateMessage for these arguments, with the account written as the chain writes it (lower case). Proofs against the replaced trees are refused afterwards. The registry cannot see inside new roots: new trees must not reuse the old keys. The Rotated event reports the new generation; its leaf belongs to the one before. A signed rotation stays valid until its leaf is spent or the account rotates: only another rotation can cancel it. Anyone may send the transaction. Whoever sends it pays the storage deposit of the bytes it adds and receives the refund of the bytes it frees. In a transaction, the two proofs are written in base64, which the chain decodes before the call.

Open
OID
01e997…7c65:10
Rotate details

Inspect func

Authorize

func(account .uverse.address, leaf int, payload []uint8, proofSHA256 []uint8, proofKeccak256 []uint8)

Authorize spends one-time key number leaf of account on payload, on behalf of the calling realm. It returns only if both proofs are valid signatures of qrc.AuthorizeMessage for the caller's package path and payload, and panics otherwise. account must be written as the chain writes it, in lower-case bech32, so that the calling realm holds exactly the account whose keys signed. It lets a realm act for an account on the sole strength of its recovery keys. A proof made for one realm is useless to any other, and what the payload means is entirely up to the caller. An approval stays valid until its leaf is spent or the account rotates: the registry gives it no deadline and no nonce, so an app must put both in the payload and check them. The approval names a package path, not code: check what runs at that path before signing. The calling realm sees the proofs before its transaction ends and may still make it fail, which leaves the leaf unspent here although its signature is public. A wallet must treat a leaf as spent as soon as a signature made with it leaves the wallet, and never sign anything else with it.

Open
OID
01e997…7c65:11
Authorize details

Inspect func

spend

func(c *v1.commit, leaf int, msg []uint8, proofSHA256 []uint8, proofKeccak256 []uint8)

spend checks that msg is signed with one-time key number leaf of both trees of c, then marks the leaf as used. It panics, leaving c as it was, if the leaf was used before or if either proof fails.

Open
OID
01e997…7c65:12
spend details

Inspect func

commitID

func(account .uverse.address, c *v1.commit) v1.ID

commitID returns the ID that messages signed for the current commit of account must carry.

Open
OID
01e997…7c65:13
commitID details

Inspect func

canonical

func(account .uverse.address) .uverse.address
Open
OID
01e997…7c65:14
canonical details

Inspect func

get

func(account .uverse.address) *v1.commit

get returns the commit of account, or nil if it has none. The account must be in its canonical form.

Open
OID
01e997…7c65:15
get details

Inspect func

mustGet

func(account .uverse.address) *v1.commit
Open
OID
01e997…7c65:16
mustGet details

Inspect func

checkTrees

func(rootSHA256 [32]uint8, rootKeccak256 [32]uint8, height int)
Open
OID
01e997…7c65:18
checkTrees details

Inspect func

checkKeyType

func(keyType string)
Open
OID
01e997…7c65:19
checkKeyType details

Inspect func

decodeRoot

func(s string) [32]uint8
Open
OID
01e997…7c65:20
decodeRoot details

Inspect func

Has

func(account .uverse.address) bool

Has reports whether account has a commit.

Open
OID
01e997…7c65:21
Has details

Inspect func

Count

func() (accounts int, withKey int)

Count returns the number of accounts that hold a commit and, among them, the number that bound a new public key.

Open
OID
01e997…7c65:23
Count details

Inspect func

IsUsed

func(account .uverse.address, leaf int) bool

IsUsed reports whether one-time key number leaf of account was spent. It is false for an account without commit and for a leaf out of range. It only knows of keys spent by a transaction that succeeded: a signature made public in a failed one leaves its leaf unspent here, yet no wallet should sign with that leaf again.

Open
OID
01e997…7c65:24
IsUsed details

Inspect func

Key

func(account .uverse.address) (keyType string, key []uint8, ok bool)

Key returns a copy of the public key last bound to account, with its label. ok is false if the account has no commit or never bound a key.

Open
OID
01e997…7c65:25
Key details

Inspect func

KeyBase64

func(account .uverse.address) string

KeyBase64 returns the public key last bound to account, base64 encoded, or an empty string if there is none.

Open
OID
01e997…7c65:26
KeyBase64 details

Inspect func

Lookup

func(account .uverse.address) string

Lookup returns what the registry holds about account as a JSON object, or the JSON value null if the account has no commit. It leaves out the roots of earlier generations. registeredAt, rotatedAt and keyAt are block heights, rotatedAt being 0 before any rotation; registeredTime is in Unix seconds. "used" is the bitmap of the one-time keys spent in the current trees, in hexadecimal: key number n is spent when bit n%8, counting from the least significant, of byte n/8 is set. The key fields are only present once a key was bound; keyLeaf is a leaf of generation keyGeneration, which a later rotation retires. The key itself is served by KeyBase64.

Open
OID
01e997…7c65:27
Lookup details

Inspect func

Latest

func() string

Latest returns the accounts that registered last, newest first, at most latestKept of them, as a JSON array of objects. Each object holds the account, its rank, the height of its trees, the number of one-time keys spent in its current trees, its generation and, once a key was bound, the label of that key. The rest of what the registry holds about an account is served by Lookup.

Open
OID
01e997…7c65:28
Latest details

Inspect func

Render

func(path string) string

Render shows the registry: its home page for an empty path, the page of an account for "\<address>" or "account?address=\<address>".

Open
OID
01e997…7c65:29
Render details

Inspect func

renderAccount

func(input string) string
Open
OID
01e997…7c65:31
renderAccount details

Inspect func

keySummary

func(c *v1.commit) string

keySummary describes the key bound to c. The label is whatever the account chose, so it goes in a code span: nothing in it can then turn into a link or into formatting on a page that other people read.

Open
OID
01e997…7c65:32
keySummary details

Inspect func

plural

func(n int, one string, many string) string
Open
OID
01e997…7c65:33
plural details

Inspect func

queryValue

func(query string, name string) string

queryValue returns the raw value of the first parameter called name in a URL query string, or "". Values are not unescaped: the only one read here is an address, which needs no escaping. A space typed around it arrives as '+', which the caller trims.

Open
OID
01e997…7c65:34
queryValue details

Inspect func
MaxKeySize : untyped bigint =(65536 <untyped> bigint)
MaxKeyTypeSize : untyped bigint =(64 <untyped> bigint)
commit : type =v1.commit
latestKept : untyped bigint =(10 <untyped> bigint)
commits : v0.Tree Inspect
bound : int =1
latest : []string (len=1) Inspect
Register : func(rootSHA256 string, rootKeccak256 string, height int) Inspect
Bind : func(account .uverse.address, leaf int, keyType string, key []uint8, proofSHA256 []uint8, proofKeccak256 []uint8) Inspect
Rotate : func(account .uverse.address, leaf int, rootSHA256 string, rootKeccak256 string, height int, proofSHA256 []uint8, proofKeccak256 []uint8) Inspect
Authorize : func(account .uverse.address, leaf int, payload []uint8, proofSHA256 []uint8, proofKeccak256 []uint8) Inspect
spend : func(c *v1.commit, leaf int, msg []uint8, proofSHA256 []uint8, proofKeccak256 []uint8) Inspect
commitID : func(account .uverse.address, c *v1.commit) v1.ID Inspect
canonical : func(account .uverse.address) .uverse.address Inspect
get : func(account .uverse.address) *v1.commit Inspect
mustGet : func(account .uverse.address) *v1.commit Inspect
hashHex : func(b []uint8) string Inspect
checkTrees : func(rootSHA256 [32]uint8, rootKeccak256 [32]uint8, height int) Inspect
checkKeyType : func(keyType string) Inspect
decodeRoot : func(s string) [32]uint8 Inspect
Has : func(account .uverse.address) bool Inspect
Count : func() (accounts int, withKey int) Inspect
IsUsed : func(account .uverse.address, leaf int) bool Inspect
Key : func(account .uverse.address) (keyType string, key []uint8, ok bool) Inspect
KeyBase64 : func(account .uverse.address) string Inspect
Lookup : func(account .uverse.address) string Inspect
Latest : func() string Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderAccount : func(input string) string Inspect
keySummary : func(c *v1.commit) string Inspect
plural : func(n int, one string, many string) string Inspect
queryValue : func(query string, name string) string Inspect