Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change tokens to coins where appropriate #498

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AENS.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ the name's length. It is decreasing function: for shorter names have higher init
fee.

Also bidding by claim transaction is constrained by price progression.
Each next bid has to be higher by `X` tokens, determined by percent of the price
Each next bid has to be higher by `X` coins, determined by percent of the price
defined in governance.

All, functions, base fee, free length value and price progression may be subject
Expand Down
6 changes: 3 additions & 3 deletions channels/OFF-CHAIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ In order to deposit more funds into the channel, one party can initiate
a `deposit_created` request. It consists of a single-authenticated
`channel_deposit_tx` transaction as well as a list of updates. The transaction
includes the state hash and round of the next off-chain state, after applying
the updates on top of latest state.
the updates on top of latest state.

Note that it is possible to deposit a zero amount, essentially making the
operation an on-chain snapshot.
Expand Down Expand Up @@ -991,7 +991,7 @@ A channel can be closed under three circumstances:
1. Both parties agree to the close and authenticate the closing transaction
together, which then gets broadcasted and included in the blockchain.
2. One party wants to close the channel: the other party might had been missing
for some time or had been trying to cheat. In this case either side can publish
for some time or had been trying to cheat. In this case either side can publish
the latest state authenticated by both parties and claim their balance after
the negotiated timeout.
3. A malicious party tries to publish an outdated state, which it prefers over a
Expand Down Expand Up @@ -1150,7 +1150,7 @@ call is considered to be executed. Its results can be extracted from the calls
tree in the state tree.
Part of the call is the `amount` a participants commits to the contract. This
is not to be confused with [gas consumption](#gas-consumption) - `amount` are
the tokens moved from the caller's off-chain balance to the off-chain balance
hanssv marked this conversation as resolved.
Show resolved Hide resolved
the coins moved from the caller's off-chain balance to the off-chain balance
of the contract been called.

### Contracts referring to on-chain data
Expand Down
4 changes: 2 additions & 2 deletions consensus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ Available from the Fortuna consensus protocol version.
The peer-to-peer network is not part of the consensus and will be described in
a separate document.

### Coins and tokens
### Coins

#### æternity tokens
#### æternity coins

We use the following denominations:

Expand Down
4 changes: 2 additions & 2 deletions consensus/locking.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Coins locking

We want a predictable inflation so there MUST not be any token burning. In order
We want a predictable inflation so there MUST not be any coin burning. In order
to achieve this whenever there is a need for coins burning, we are locking
those excess coins. This leads to a deterministic total amount of coins and
thus - to a predictable inflation. This works as sending all to be locked
coins to a predifined address that nobody has a private key for. Those tokens
coins to a predifined address that nobody has a private key for. Those coins
are unspendable at this point.
9 changes: 4 additions & 5 deletions contracts/aevm.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ Interaction with the first class objects of the æternity chain (e.g.
oracles, names, and state channels) is done through calls to a
built-in contract at address 0.


The value in the call indicates the tokens that the primop can use from the contract account.
Unused tokens stay on the contract account.
The value in the call indicates the coins that the primop can use from the
contract account. Unused coins stay on the contract account.

The first argument in the call specifies which primop to call.
The following arguments are encoded as Sophia data.
Expand Down Expand Up @@ -100,7 +99,7 @@ The byte code contains meta data for the contract.
- byte_code - the actual byte code

The layout of the encoding can be found
[here](https://github.com/aeternity/protocol/blob/master/serializations.md#sophia-byte-code).
[here](https://github.com/aeternity/protocol/blob/master/serializations.md#sophia-byte-code).
The encoding is tagged with the compiler version.

#### Type information
Expand Down Expand Up @@ -294,7 +293,7 @@ The `CALL` instruction for calling another contract works differently for
Sophia contracts than in the EVM. It expects on the stack (top to bottom):
- `Gas` - the amount of gas to allocate to the call
- `Address` - the address of the contract to call (or 0 for primops)
- `Amount` - the amount of tokens to transfer with the call
- `Amount` - the amount of coins to transfer with the call
- `Calldata` - the calldata value (pair of function hash and arguments)
- `TypeHash` - the function hash of primops that have dynamic types
(e.g., oracles). Otherwise unused.
Expand Down
2 changes: 1 addition & 1 deletion contracts/contract_state_tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ See [Contract Serialization](../serializations.md#contract) for the serializatio
The contract also has a nonce and a balance recorded in an account state tree.

A call to a contract can execute chain transactions and these transactions are allowed to spend
tokens from the balance of the contract.
coins from the balance of the contract.

#### The contract definition

Expand Down
2 changes: 1 addition & 1 deletion contracts/fate.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ Writing to the accumulator pushes a value to the stack.
| `LOG2` | Arg0 Arg1 Arg2 | Create a log message with two topics in the call object. | {integer,integer,string} | none |
| `LOG3` | Arg0 Arg1 Arg2 Arg3 | Create a log message with three topics in the call object. | {integer,integer,integer,string} | none |
| `LOG4` | Arg0 Arg1 Arg2 Arg3 Arg4 | Create a log message with four topics in the call object. | {integer,integer,integer,integer,string} | none |
| `SPEND` | Arg0 Arg1 | Transfer Arg1 tokens to account Arg0. (If the contract account has at least that many tokens. | {address,integer} | none |
| `SPEND` | Arg0 Arg1 | Transfer Arg1 coins to account Arg0. (If the contract account has at least that many coins. | {address,integer} | none |
| `ORACLE_REGISTER` | Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Arg6 | Arg0 := New oracle with address Arg2, query fee Arg3, TTL Arg4, query type Arg5 and response type Arg6. Arg0 contains delegation signature. | {signature,address,integer,variant,typerep,typerep} | oracle |
| `ORACLE_QUERY` | Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Arg6 Arg7 | Arg0 := New oracle query for oracle Arg1, question in Arg2, query fee in Arg3, query TTL in Arg4, response TTL in Arg5. Typereps for checking oracle type is in Arg6 and Arg7. | {oracle,any,integer,variant,variant,typerep,typerep} | oracle_query |
| `ORACLE_RESPOND` | Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 | Respond as oracle Arg1 to query in Arg2 with response Arg3. Arg0 contains delegation signature. Typereps for checking oracle type is in Arg4 and Arg5. | {signature,oracle,oracle_query,any,typerep,typerep} | none |
Expand Down
22 changes: 11 additions & 11 deletions node/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The æternity node exposes the following APIs:

* [Encoding scheme for API identifiers](./api_encoding.md)
* [Account management user API usage](./account_api_usage.md)
* [Spending tokens using user API](./spend_api_usage.md)
* [Spending coins using user API](./spend_api_usage.md)
* [Oracle user API usage](./oracle_api_usage.md)
* [Naming system API usage](./naming_system_api_usage.md)
* [Contract API usage](./contract_api_usage.md)
Expand All @@ -58,16 +58,16 @@ for managing state channels over WebSocket connections. The 'legacy' protocol wa

### Description

Channels provide means for off-chain transactions with functionality of on-chain dispute resolution.
Channels require persisted connections to æternity nodes. Each participant in
a channel uses one's own trusted node. For persistence of this connection, WebSockets
are used.
Channels have on-chain state that persists who the participants are and the
total amout of tokens put into the channel.
Each channel also has an off-chain state representing the latest distribution of the balance of the
channel. It can be updated - each new state is co-signed by both parties and only then it becomes the latest valid state of the
channel. At any point in time channel can be closed either unilaterally or
through mutual agreement.
Channels provide means for off-chain transactions with functionality of
on-chain dispute resolution. Channels require persisted connections to
æternity nodes. Each participant in a channel uses one's own trusted node. For
persistence of this connection, WebSockets are used. Channels have on-chain
state that persists who the participants are and the total amout of coins put
into the channel. Each channel also has an off-chain state representing the
latest distribution of the balance of the channel. It can be updated - each new
state is co-signed by both parties and only then it becomes the latest valid
state of the channel. At any point in time channel can be closed either
unilaterally or through mutual agreement.

### Connection

Expand Down
2 changes: 1 addition & 1 deletion node/api/account_api_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You shall read output like the following...
```
{"balance":80, "id":"ak_N1WLMewMQPUyQBdEhXRSYee84RQNKJrECwbbseMkNsZhv1X", "nonce":0}
```
... or - if you do not have tokens yet e.g. because you have not yet mined a block successfully - the following:
... or - if you do not have any coins yet e.g. because you have not yet mined a block successfully - the following:
```
{"reason":"Account not found"}
```
40 changes: 20 additions & 20 deletions node/api/channel_ws_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Roles:

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| from | string | Participant's account to take tokens from | Yes |
| to | string | Participant's account to add tokens to | Yes |
| amount | integer | Amount of tokens to transfer | Yes |
| from | string | Participant's account to take coins from | Yes |
| to | string | Participant's account to add coins to | Yes |
| amount | integer | Amount of coins to transfer | Yes |
| block_hash | string | The on-chain block hash to pin the off-chain environment | No |
| meta | array of strings | Meta information about the update | No |

Expand Down Expand Up @@ -253,7 +253,7 @@ Roles:

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| amount | integer | Amount of tokens to deposit in the channel | Yes |
| amount | integer | Amount of coins to deposit in the channel | Yes |
| block_hash | string | The on-chain block hash to pin the off-chain environment | No |
| fee | integer | The on-chain transaction fee to be used. If not provided the FSM picks a value for the client | No |
| gas_price | integer | the gas_price to be used for the fee computation | No |
Expand Down Expand Up @@ -402,7 +402,7 @@ Roles:

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| amount | integer | Amount of tokens to withdraw form the channel | Yes |
| amount | integer | Amount of coins to withdraw form the channel | Yes |
| block_hash | string | The on-chain block hash to pin the off-chain environment | No |
| fee | integer | The on-chain transaction fee to be used. If not provided the FSM picks a value for the client | No |
| gas_price | integer | the gas_price to be used for the fee computation | No |
Expand Down Expand Up @@ -602,7 +602,7 @@ Roles:
| contract_id | contract id | contract to call | Yes |
| call\_data | call data | call data | Yes |
| abi\_version | integer | call abi version | Yes |
| amount | integer | amount of tokens to transfer to contract | Yes |
| amount | integer | amount of coins to transfer to contract | Yes |
| block_hash | string | The on-chain block hash to pin the off-chain environment | No |
| meta | array of strings | Meta information about the update | No |

Expand Down Expand Up @@ -945,7 +945,7 @@ Roles:
| contract_id | contract id | contract to call | Yes |
| call\_data | call data | call data | Yes |
| abi\_version | integer | call abi version | Yes |
| amount | integer | amount of tokens to transfer to contract | Yes |
| amount | integer | amount of coins to transfer to contract | Yes |
| gas\_price | integer | the gas\_price to be used for the fee computation and the update execution | Yes |
| gas | integer | gas limit, if not provided `1000000` is the default value | No |
| nonce | integer | the nonce to be used in the transaction | No |
Expand All @@ -955,7 +955,7 @@ Roles:
{
"jsonrpc": "2.0",
"method": "channels.force_progress",
"params": {
"params": {
"abi_version":1,
"amount":10,
"call_data":"cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCzVg5SHSPanMS8lSeSX8SFfJMeAfEkyR6oKfQhD6XCTgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5gCcXw==",
Expand Down Expand Up @@ -986,7 +986,7 @@ Roles:

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| amount | integer | the tokens amount given to the off-chain contract | Yes |
| amount | integer | the coins amount given to the off-chain contract | Yes |
| abi\_version | integer | abi version | Yes |
| call\_data | integer | contract execution call data | Yes |
| call\_stack | list | contract execution call stack | Yes |
Expand All @@ -999,19 +999,19 @@ Roles:

#### Example
```javascript
{
{
"jsonrpc":"2.0",
"method":"channels.sign.force_progress_tx",
"params":{
"params":{
"channel_id":"ch_2FdiLKkRUdPw4oTRbB6i3M6pquogzWLABQjU373hizDbnD8gGC",
"data":{
"data":{
"signed_tx":"tx_+Qi9CwHAuQi3+Qi0ggIJAaEGpOwMCfoYc3a/I2vKzIEkYklqkIO6LDpXh4sHPnU2IZOhAUGdEqxeUDVR0dMSvrn5kgnI7MCgbE412qfo/e6zcbfpuNT40gsB+IS4QDztVfzqw4CHrPqY1EMb3OI5pu8D1iIcRa+8K7yetgfwsTy04V+3ZPqYKX34MWRRcu3oz2J+o77d60iLodZejQ+4QM8zP15Bb+brrqv4VxHKWb8eJdovI1XXBqceMzjp57xB2XDhvo3Z8p4a4q1QIlrLwIbQwa6WvwWDEicP291KeQ+4SPhGOQKhBqTsDAn6GHN2vyNrysyBJGJJapCDuiw6V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MD6tzkOy4sMpRXsRPFCn4i3ImAlLeDZ2V0AbhgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////////uEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+Ougs1YOUh0j2pzEvJUnkl/EhXyTHgHxJMkeqCn0IQ+lwk6EdGljawG4YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////7hgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////////uQFBYgAAj2IAAMKRgICAUX9J7EkHbAIDcSakMwPq3OQ7LiwylFexE8UKfiLciYCUtxRiAAE2V1CAgFF/4iMdbN/JORbeTLOphXv2XPQPwlb0oUmLP358mAwZk0QUYgAA0VdQgFF/s1YOUh0j2pzEvJUnkl/EhXyTHgHxJMkeqCn0IQ+lwk4UYgABG1dQYAEZUQBbYAAZWWAgAZCBUmAgkANgAFmQgVKBUllgIAGQgVJgIJADYAOBUpBZYABRWVJgAFJgAPNbYACAUmAA81tgAFFRkFZbYCABUVGQUIOSUICRUFCAWZCBUllgIAGQgVJgIJADYAAZWWAgAZCBUmAgkANgAFmQgVKBUllgIAGQgVJgIJADYAOBUoFSkFCQVltQWVBQYABRYAFgAFFRAVmQgVKQUGAAUlmQVltQUFlQUGIAAMpWh3Vua25vd24AgAHACrjJ+MeCAm4BuMH4vz8B+Lu4ufi3QAG4QAk/K00P/64rJh6AN7FdhCCeaFuDwHK/U6ykDlVuchqTa2GTqNrr2nMd48MdKc8JN9Nwp9TqcnYf75jTlsHbOUK4cfhvKQKhARWTe3J86e4I2ONhtRn6CWKhmvE45Tiks+kwMjCU4PXXCgqhBQk/K00P/64rJh6AN7FdhCCeaFuDwHK/U6ykDlVuchqTAYIBfKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFwDAismCAm8BhMM/AcCKyYICcAGEwz8BwIrJggJxAYTDPwHAuJv4mYICcgG4k/iRPwH4jbDvQAGgQZ0SrF5QNVHR0xK+ufmSCcjswKBsTjXap+j97rNxt+mLygoBAIY/qiUiX/Ww70ABoBWTe3J86e4I2ONhtRn6CWKhmvE45Tiks+kwMjCU4PXXi8oKAQCGJGE5yoABqulAAaAJPytND/+uKyYegDexXYQgnmhbg8Byv1OspA5VbnIak4XECgEACgCHAcHasWYYAAJu5C+M",
"updates":[
{
"updates":[
{
"abi_version":1,
"amount":10,
"call_data":"cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCzVg5SHSPanMS8lSeSX8SFfJMeAfEkyR6oKfQhD6XCTgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5gCcXw==",
"call_stack":[
"call_stack":[

],
"caller_id":"ak_Vu1cGq2d3Dpo9gP7pVJc8KMubXr8PjuX51b4yyJmFDcXgTZxT",
Expand Down Expand Up @@ -1057,7 +1057,7 @@ Roles:
| contract_id | contract id | contract to call | Yes |
| call\_data | call data | call data | Yes |
| abi\_version | integer | call abi version | Yes |
| amount | integer | amount of tokens to transfer to contract | Yes |
| amount | integer | amount of coins to transfer to contract | Yes |
| block_hash | string | The on-chain block hash to pin the off-chain environment | No |
| meta | array of strings | Meta information about the update | No |

Expand Down Expand Up @@ -1095,7 +1095,7 @@ Roles:
| type | transaction type | Yes |

The `info` values could be:

* `"funding_signed"` - reported by the `initiator`, indicating that a `channel_create_tx` has been
singly authenticated by the `initiator` client, and sent to the `responder` for co-signing.
* `"funding_created"` - reported by the `responder`, indicating that a `channel_create_tx` has been
Expand Down Expand Up @@ -1783,12 +1783,12 @@ If the abort of the update is successful, the client that aborted receives a
message for it:

```javascript
{
{
"jsonrpc":"2.0",
"method":"channels.info",
"params":{
"params":{
"channel_id":"ch_95YaTDZAysRu3GkmW2yKkCK1H4fGtcttoj2qwFDfUSduTpCPf",
"data":{
"data":{
"event":"aborted_update"
}
},
Expand Down
Loading