Skip to content

Commit

Permalink
change ether to expanse
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfranko committed Jul 28, 2016
1 parent 3a42a74 commit 59e9e2c
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 89 deletions.
6 changes: 3 additions & 3 deletions source/account-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Accounts
Accounts play a central role in Expanse. There are two types of accounts: *externally owned accounts* (EOAs) and *contract accounts*. Here we focus on externally owned accounts, which will be referred to simply as *accounts*. Contract accounts will be referred to as *contracts* and are :ref:`discussed in detail in Contracts <Contracts>`. This generic notion of account subsuming both externally owned accounts and contracts is justified in that these entities are so called *state objects*. These entities have a state: accounts have balance and contracts have both balance and contract storage. The state of all accounts is the state of the Expanse network which is updated with every block and which the network really needs to reach a consensus about.
Account are essential for users to interact with the Expanse blockchain via transactions.

If we restrict Expanse to only externally owned accounts and allow only transactions between them, we arrive at an "altcoin" system that is less powerful than bitcoin itself and can only be used to transfer ether.
If we restrict Expanse to only externally owned accounts and allow only transactions between them, we arrive at an "altcoin" system that is less powerful than bitcoin itself and can only be used to transfer expanse.

Accounts represent identities of external agents (e.g., human personas, mining nodes or automated agents). Accounts use public key cryptography to sign transaction so that the EVM can securely validate the identity of a transaction sender.

Expand All @@ -37,7 +37,7 @@ It is safe to transfer the entire directory or any individual keyfile between Ex
Creating an account
================================================================================

.. Warning:: **Remember your passwords and `backup your keyfiles <backup-and-restore-accounts>`_.** In order to send transactions from an account, including sending ether, you must have BOTH the keyfile and the password. Be absolutely sure to have a copy of your keyfile AND remember the password for that keyfile, and store them both as securely as possible. There are no escape routes here; lose the keyfile or forget your password and all your ether is gone. It is NOT possible to access your account without a password and there is no *forgot my password* option here. Do not forget it.
.. Warning:: **Remember your passwords and `backup your keyfiles <backup-and-restore-accounts>`_.** In order to send transactions from an account, including sending expanse, you must have BOTH the keyfile and the password. Be absolutely sure to have a copy of your keyfile AND remember the password for that keyfile, and store them both as securely as possible. There are no escape routes here; lose the keyfile or forget your password and all your expanse is gone. It is NOT possible to access your account without a password and there is no *forgot my password* option here. Do not forget it.

Using ``gexp account new``
--------------------------------------------------------------------------------
Expand Down Expand Up @@ -181,7 +181,7 @@ You will be entering the full addresses of all the accounts you are attaching to

We are now ready to create the multisig wallet. Under 'Wallet Contracts', select 'Add Wallet Contract'. Give it a name, select the primary account owner, and choose 'Multisignature Wallet Contract'. You will see something like this appear:

"This is a joint account controlled by X owners. You can send up to X ether per day. Any transaction over that daily limit requires the confirmation of X owners."
"This is a joint account controlled by X owners. You can send up to X expanse per day. Any transaction over that daily limit requires the confirmation of X owners."

Set whatever amount of owners (accounts) you are attaching to this multisig wallet, whatever you want for a daily withdrawal limit (that only requires one account to withdrawal that amount), and how many owners (accounts) are required to approve any withdrawal amount over the daily limit.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ We will go through the different steps to deploy the following contract using on
}
The first thing to do is make sure the HTTP RPC interface is enabled. This means for gexp we supply the ``--rpc`` flag on startup and for eth the ``-j``
flag. In this example we use the gexp node on a private development chain. Using this approach we don't need ether on the real network.
flag. In this example we use the gexp node on a private development chain. Using this approach we don't need expanse on the real network.

.. code:: bash
Expand All @@ -68,10 +68,10 @@ Ether as a number we can use web3 from the gexp console.

.. code:: js
> web3.fromWei("0x1639e49bba16280000", "ether")
> web3.fromWei("0x1639e49bba16280000", "expanse")
"410"
Now that we have some ether on our private development chain we can deploy the contract. The first step is to verify that the solidity compiler is
Now that we have some expanse on our private development chain we can deploy the contract. The first step is to verify that the solidity compiler is
available. We can retrieve available compilers using the ``eth_getCompilers`` RPC method.

.. code:: bash
Expand Down Expand Up @@ -262,7 +262,7 @@ Hosted blockchain explorers
--------------------------------------------------------------------------------

- `EtherChain <https://www.etherchain.org/>`_
- `EtherCamp <https://live.ether.camp/>`_
- `EtherCamp <https://live.expanse.camp/>`_
- `EtherScan <http://etherscan.io/>`_ (and for `Testnet <http://testnet.etherscan.io>`_)

Other Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Externally owned accounts (EOAs)
An externally controlled account

- has an Ether balance,
- can send transactions (ether transfer or trigger contract code),
- can send transactions (expanse transfer or trigger contract code),
- is controlled by private keys,
- has no associated code.

Expand All @@ -44,7 +44,7 @@ The blocks on the blockchain represent units of time, the blockchain itself is a

All Ether balances and values are denominated in units of wei: 1 Ether is 1e18 wei.

.. note:: "Contracts" in Expanse should not be seen as something that should be "fulfilled" or "complied with"; rather, they are more like "autonomous agents" that live inside of the Expanse execution environment, always executing a specific piece of code when "poked" by a message or transaction, and having direct control over their own ether balance and their own key/value store to store their permanent state.
.. note:: "Contracts" in Expanse should not be seen as something that should be "fulfilled" or "complied with"; rather, they are more like "autonomous agents" that live inside of the Expanse execution environment, always executing a specific piece of code when "poked" by a message or transaction, and having direct control over their own expanse balance and their own key/value store to store their permanent state.

What is a transaction?
================================================================================
Expand Down Expand Up @@ -83,18 +83,18 @@ When you are running a decentralized application (dapp), it interacts with the b

When a contract is executed as a result of being triggered by a message or transaction, every instruction is executed on every node of the network. This has a cost: for every executed operation there is a specified cost, expressed in a number of gas units.

Gas is the name for the execution fee that senders of transactions need to pay for every operation made on an Expanse blockchain. The name gas is inspired by the view that this fee acts as cryptofuel, driving the motion of smart contracts. Gas is purchased for ether from the miners that execute the code. Gas and ether are decoupled deliberately since units of gas align with computation units having a natural cost, while the price of ether generally fluctuates as a result of market forces. The two are mediated by a free market: the price of gas is actually decided by the miners, who can refuse to process a transaction with a lower gas price than their minimum limit. To get gas you simply need to add ether to your account. The Expanse clients automatically purchase gas for your Ether in the amount you specify as your maximum expenditure for the transaction.
Gas is the name for the execution fee that senders of transactions need to pay for every operation made on an Expanse blockchain. The name gas is inspired by the view that this fee acts as cryptofuel, driving the motion of smart contracts. Gas is purchased for expanse from the miners that execute the code. Gas and expanse are decoupled deliberately since units of gas align with computation units having a natural cost, while the price of expanse generally fluctuates as a result of market forces. The two are mediated by a free market: the price of gas is actually decided by the miners, who can refuse to process a transaction with a lower gas price than their minimum limit. To get gas you simply need to add expanse to your account. The Expanse clients automatically purchase gas for your Ether in the amount you specify as your maximum expenditure for the transaction.

The Expanse protocol charges a fee per computational step that is executed in a contract or transaction to prevent deliberate attacks and abuse on the Expanse network. Every transaction is required to include a gas limit and a fee that it is willing to pay per gas. Miners have the choice of including the transaction and collecting the fee or not. If the total amount of gas used by the computational steps spawned by the transaction, including the original message and any sub-messages that may be triggered, is less than or equal to the gas limit, then the transaction is processed. If the total gas exceeds the gas limit, then all changes are reverted, except that the transaction is still valid and the fee can still be collected by the miner. All excess gas not used by the transaction execution is reimbursed to the sender as Ether. You do not need to worry about overspending, since you are only charged for the gas you consume. This means that it is useful as well as safe to send transactions with a gas limit well above the estimates.

Estimating transaction costs
================================================================================

The total ether cost of a transaction is based on 2 factors:
The total expanse cost of a transaction is based on 2 factors:

``gasUsed`` is the total gas that is consumed by the transaction

``gasPrice`` price (in ether) of one unit of gas specified in the transaction
``gasPrice`` price (in expanse) of one unit of gas specified in the transaction

**Total cost = gasUsed * gasPrice**

Expand Down Expand Up @@ -124,8 +124,8 @@ Since 1 Ether is 1e18 wei, the total cost would be 0.00000015 Ether.
This is a simplification since it ignores some costs, such as the cost of passing the 2 numbers to contract, before they can even be added.

* `question <http://expanse.stackexchange.com/q/324/42>`_
* `gas fees <http://ether.fund/tool/gas-fees>`_
* `gas cost calculator <http://ether.fund/tool/calculator>`_
* `gas fees <http://expanse.fund/tool/gas-fees>`_
* `gas cost calculator <http://expanse.fund/tool/calculator>`_
* `Expanse Gas Prices <https://docs.google.com/spreadsheets/d/1m89CVujrQe5LAFJ8-YAUCcNK950dUzMQPMJBxRtGCqs>`_

================= ========= =============================
Expand All @@ -151,10 +151,10 @@ Account interactions example - betting contract

As previously mentioned, there are two types of accounts:

* **Externally owned account (EOAs)**: an account controlled by a private key, and if you own the private key associated with the EOA you have the ability to send ether and messages from it.
* **Externally owned account (EOAs)**: an account controlled by a private key, and if you own the private key associated with the EOA you have the ability to send expanse and messages from it.
* **Contract**: an account that has its own code, and is controlled by code.

By default, the Expanse execution environment is lifeless; nothing happens and the state of every account remains the same. However, any user can trigger an action by sending a transaction from an externally owned account, setting Expanse's wheels in motion. If the destination of the transaction is another EOA, then the transaction may transfer some ether but otherwise does nothing. However, if the destination is a contract, then the contract in turn activates, and automatically runs its code.
By default, the Expanse execution environment is lifeless; nothing happens and the state of every account remains the same. However, any user can trigger an action by sending a transaction from an externally owned account, setting Expanse's wheels in motion. If the destination of the transaction is another EOA, then the transaction may transfer some expanse but otherwise does nothing. However, if the destination is a contract, then the contract in turn activates, and automatically runs its code.

The code has the ability to read/write to its own internal storage (a database mapping 32-byte keys to 32-byte values), read the storage of the received message, and send messages to other contracts, triggering their execution in turn. Once execution stops, and all sub-executions triggered by a message sent by a contract stop (this all happens in a deterministic and synchronous order, ie. a sub-call completes fully before the parent call goes any further), the execution environment halts once again, until woken by the next transaction.

Expand All @@ -165,7 +165,7 @@ Contracts generally serve four purposes:
* Manage an ongoing contract or relationship between multiple users. Examples of this include a financial contract, an escrow with some particular set of mediators, or some kind of insurance. One can also have an open contract that one party leaves open for any other party to engage with at any time; one example of this is a contract that automatically pays a bounty to whoever submits a valid solution to some mathematical problem, or proves that it is providing some computational resource.
* Provide functions to other contracts, essentially serving as a software library.

Contracts interact with each other through an activity that is alternately called either "calling" or "sending messages". A "message" is an object containing some quantity of ether, a byte-array of data of any size, the addresses of a sender and a recipient. When a contract receives a message, it has the option of returning some data, which the original sender of the message can then immediately use. In this way, sending a message is exactly like calling a function.
Contracts interact with each other through an activity that is alternately called either "calling" or "sending messages". A "message" is an object containing some quantity of expanse, a byte-array of data of any size, the addresses of a sender and a recipient. When a contract receives a message, it has the option of returning some data, which the original sender of the message can then immediately use. In this way, sending a message is exactly like calling a function.

Because contracts can play such different roles, we expect that contracts will be interacting with each other. As an example, consider a situation where Alice and Bob are betting 100 GavCoin that the temperature in San Francisco will not exceed 35ºC at any point in the next year. However, Alice is very security-conscious, and as her primary account uses a forwarding contract which only sends messages with the approval of two out of three private keys. Bob is paranoid about quantum cryptography, so he uses a forwarding contract which passes along only messages that have been signed with Lamport signatures alongside traditional ECDSA (but because he's old fashioned, he prefers to use a version of Lamport sigs based on SHA256, which is not supported in Expanse directly).

Expand Down
12 changes: 6 additions & 6 deletions source/contracts-and-transactions/contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ in one of two ways.
21
When called using ``sendTransaction`` the function call is executed via sending
a transaction. This will cost ether to send and the call will be recorded
a transaction. This will cost expanse to send and the call will be recorded
forever on the blockchain. The return value of calls made in this manner is
the hash of the stransaction.
When called using ``call`` the function is executed locally in the EVM and the
return value of the function is returned with the function. Calls made in this
manner are not recorded on the blockchain and thus, cannot modify the internal
state of the contract. This manner of call is referred to as a **constant**
function call. Calls made in this manner do not cost any ether.
function call. Calls made in this manner do not cost any expanse.
You should use ``call`` if you are interested only in the return value and use
Expand Down Expand Up @@ -461,23 +461,23 @@ chain. See :ref:`test-networks`.
personal.newAccount();
// name your primary account, will often use it
primary = exp.accounts[0];
// check your balance (denominated in ether)
balance = web3.fromWei(exp.getBalance(primary), "ether");
// check your balance (denominated in expanse)
balance = web3.fromWei(exp.getBalance(primary), "expanse");
.. code:: js
// assume an existing unlocked primary account
primary = exp.accounts[0];
// mine 10 blocks to generate ether
// mine 10 blocks to generate expanse
// starting miner
miner.start(4);
// sleep for 10 blocks (this can take quite some time).
admin.sleepBlocks(10);
// then stop mining (just not to burn heat in vain)
miner.stop();
balance = web3.fromWei(exp.getBalance(primary), "ether");
balance = web3.fromWei(exp.getBalance(primary), "expanse");
After you create transactions, you can force process them with the following lines:
Expand Down
4 changes: 2 additions & 2 deletions source/contracts-and-transactions/developer-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ Tutorials
* `Dapps for beginners tutorial series <https://dappsforbeginners.wordpress.com/>`_
* `Eris' Solidity Tutorial Series <https://docs.erisindustries.com/tutorials/solidity/>`_
* `Tutorials on advanced Solidity <https://github.com/androlo/solidity-workshop>`_
* http://ethereumj.io/blog/2015/09/09/friendly-ether-bot/
* https://github.com/ConsenSys/ether-pudding
* http://ethereumj.io/blog/2015/09/09/friendly-expanse-bot/
* https://github.com/ConsenSys/expanse-pudding


Mix-IDE
Expand Down
2 changes: 1 addition & 1 deletion source/contracts-and-transactions/mix/dapp-deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ execute transactions.
specify a different value.

“Deployment cost”: depending on the value of the gas price that you want
to use and the selected scenario. this will display the amount ether
to use and the selected scenario. this will display the amount expanse
that the deployment need.

“Deployed Contract”: before any deployment this part is empty. This will
Expand Down
12 changes: 6 additions & 6 deletions source/contracts-and-transactions/mix/scenario-editor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ Creating and setting up a new scenario
When you launch Mix for the first time, an empty scenario, i.e. not
containing any transactions, will be created.
Add an account named “MyAccount” and set it’s initial balance to 1
ether. Click OK.
expanse. Click OK.
Rename the scenario to “Deploy”.


Modifying initial ether balance of an account
Modifying initial expanse balance of an account
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Actually, we want to do a lot of tests
Edit the Genesis block parameters and set your initial account balance
to 1000 ether.
to 1000 expanse.
Rebuild the scenario for the change to become effective.


Expand All @@ -51,10 +51,10 @@ may also need to be reset (this is not done automatically be Mix).
Creating a transaction
~~~~~~~~~~~~~~~~~~~~~~

Let’s get some ether sent to Bob.
Create another account named “Bob” with zero ether balance.
Let’s get some expanse sent to Bob.
Create another account named “Bob” with zero expanse balance.
Create a new transaction in the scenario pane. Click “Add Tx…” and
send 300 ether to Bob.
send 300 expanse to Bob.
Add a block.


Expand Down

0 comments on commit 59e9e2c

Please sign in to comment.