Address feedback

This commit is contained in:
Andrea Maria Piana 2020-05-15 10:28:10 +02:00
parent 237ad01f8f
commit 130f9790e5
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
1 changed files with 50 additions and 7 deletions

View File

@ -1,21 +1,29 @@
--- ---
permalink: /spec/9 permalink: /spec/9
parent: Raw specs parent: Stable specs
title: 9/BLOCKCHAIN-USAGE title: 9/ETHEREUM-USAGE
--- ---
# 3/BLOCKCHAIN-USAGE # 9/ETHEREUM-USAGE
> Version: 0.1 > Version: 0.1
> >
> Status: Raw > Status: Stable
> >
> Authors: Andrea Maria Piana <andreap@status.im> > Authors: Andrea Maria Piana <andreap@status.im>
# Status interactions with the blockchain # Status interactions with the Ethereum blockchain
In this document is document all the interactions that the Status client has In this document we document all the interactions that the Status client has
with the blockchain. with the [Ethereum](https://ethereum.org/developers/) blockchain.
All the interactions are made through [JSON-RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC).
Currently [Infura](https://infura.io/) is used. The client assumes high-availability, otherwise
it will not be able to interact with the Ethereum blockchain.
We rely on these nodes to validate the integrity of the transaction and report a
consistent history.
Key handling is described [here](./2-account.md)
1. [Wallet](#Wallet) 1. [Wallet](#Wallet)
2. [ENS](#ENS) 2. [ENS](#ENS)
@ -98,6 +106,11 @@ https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d4
### Fetching balance ### Fetching balance
We currently fetch the current and historical [ECR20] (https://eips.ethereum.org/EIPS/eip-20) and ETH balance for the user wallet address.
Collectibles following the [ECR-721](https://eips.ethereum.org/EIPS/eip-721) are also fetched if enabled.
We support by default the following [tokens](https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/tokens.cljs). Custom tokens can be added by specifying the `address`, `symbol` and `decimals`.
#### BlockByHash #### BlockByHash
`BlockByHash` returns the given full block. `BlockByHash` returns the given full block.
@ -184,3 +197,33 @@ https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d4
## ENS ## ENS
All the interactions with `ENS` are made through the [ENS contract](https://github.com/ensdomains/ens) All the interactions with `ENS` are made through the [ENS contract](https://github.com/ensdomains/ens)
For the `stateofus.eth` username, one can be registered through these [contracts](https://github.com/status-im/ens-usernames)
### Registering, releasing and updating
- [Registering a username](https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L113)
- [Releasing a username](https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L131)
- [Updating a username] (https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L174)
### Slashing
Usernames MUST be in a specific format, otherwise they MAY be slashed:
- They MUST only contain alphanumeric characters
- They MUST NOT be in the form `0x[0-9a-f]{5}.*` and have more than 12 characters
- They MUST NOT be in the [reserved list] (https://github.com/status-im/ens-usernames/blob/47c4c6c2058be0d80b7d678e611e166659414a3b/config/ens-usernames/reservedNames.js)
- They MUST NOT be too short, this is dinamically set in the contract and can be checked against the [contract](https://github.com/status-im/ens-usernames/blob/master/contracts/registry/UsernameRegistrar.sol#L26)
- [Slash a reserved username](https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L237)
- [Slash an invalid username] (https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L261)
- [Slash a username too similar to an address](https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L215)
- [Slash a username that is too short](https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L200)
ENS names are propagated through `ChatMessage` and `ContactUpdate` [payload](./6-payloads.md).
A client SHOULD verify ens names against the public key of the sender on receiving the message against the [ENS contract](https://github.com/ensdomains/ens)
## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).