diff --git a/_data/sidebar.yml b/_data/sidebar.yml index 8c54f7d..1c2b577 100644 --- a/_data/sidebar.yml +++ b/_data/sidebar.yml @@ -72,13 +72,6 @@ - url: /docs/bitcoin/outbound-revoke/ title: Outbound Bitcoin Revoke -- title: Privacy Transactions - nodes: - - url: /docs/privacy/overview/ - title: Overview of Privacy Transactions - - url: /docs/privacy/transaction/ - title: Make a Privacy Transaction - - title: Create your first Wanchain application nodes: - url: /docs/create-application/introduction/ diff --git a/docs/create-application/introduction.md b/docs/create-application/introduction.md index 693f28e..82f3d42 100644 --- a/docs/create-application/introduction.md +++ b/docs/create-application/introduction.md @@ -8,7 +8,7 @@ title: Introduction Since Wanchain runs on the EVM as well its smart to familiarize yourself with the EVM first. There are some pretty good reads on EVM already you could start with: - https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial -Once you are familiar with the EVM, you should read the [Using WanMask](/create-application/using-wanmask) page to get an idea of how you can create a dApp that interacts with WanMask. If you want to run blockchain interactions from your backend, you should read the information on smartcontracts, privacy transactions and crosschain as well. +Once you are familiar with the EVM, you should read the [Using WanMask](/create-application/using-wanmask) page to get an idea of how you can create a dApp that interacts with WanMask. If you want to run blockchain interactions from your backend, you should read the information on smartcontracts, crosschain as well. Tutorials - https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial diff --git a/docs/create-application/using-wanmask.md b/docs/create-application/using-wanmask.md index f27eeaa..3aac309 100644 --- a/docs/create-application/using-wanmask.md +++ b/docs/create-application/using-wanmask.md @@ -11,7 +11,7 @@ One of the fastest ways to start building your own dApp is using WanMask. WanMas The most important aspect of WanMask is that it allows you to interact with smart contracts which gives you as a Wanchain Developer the opportunity to have them interact with your dApp in their browser without having the burden of loading a complete wallet. -WanMask includes a safe signing process where users are asked to confirm transactions first. It was ported from MetaMask and has the same options that MetaMask has. In the future also privacy transactions and cross-chain functionality will be added to it to further enhance the possibilities you have with your dApp. +WanMask includes a safe signing process where users are asked to confirm transactions first. It was ported from MetaMask and has the same options that MetaMask has. In the future also cross-chain functionality will be added to it to further enhance the possibilities you have with your dApp. ### Getting WanMask diff --git a/docs/difference-between-wanchain-and-ethereum.md b/docs/difference-between-wanchain-and-ethereum.md index d9aaa96..4224d6c 100644 --- a/docs/difference-between-wanchain-and-ethereum.md +++ b/docs/difference-between-wanchain-and-ethereum.md @@ -19,7 +19,6 @@ consideration when building Dapps. To facilitate privacy transactions a new field has been inserted in the transaction format called `Txtype`. This field can currently contain two values: * 0x01 for normal transactions -* 0x06 for privacy transactions This change, although quite small, has a big impact on libraries that create transations. @@ -142,4 +141,4 @@ The wallet file for Wanchain is different from an Ethereum wallet. } ``` -As you can see above there is another object called `crypto2` as well as a `waddress` entry. The `waddress` is your private address and the `crypto2` object contains the second private key needed to create the one-time addresses associated with the privacy transactions. The wallet is backwards compatible with Ethereum though, so you could use a Wanchain wallet on both Ethereum and Wanchain. +As you can see above there is another object called `crypto2` as well as a `waddress` entry. The `waddress` is your private address and the `crypto2` object contains the second private key needed to create the one-time addresses. The wallet is backwards compatible with Ethereum though, so you could use a Wanchain wallet on both Ethereum and Wanchain. diff --git a/docs/index.md b/docs/index.md index 49959d1..8885999 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,7 +11,6 @@ title: Introduction - Compile a contract - Deploy a contract - Integrate cross chain in a Dapp -- Integrate privacy in a Dapp ## Solidity Experience diff --git a/docs/privacy/overview.md b/docs/privacy/overview.md deleted file mode 100644 index d59a28f..0000000 --- a/docs/privacy/overview.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -layout: page -title: Overview of Privacy Transactions ---- - -Privacy transactions on Wanchain are a way for a user to send WAN to another -user without specifying who is the recipient. With a privacy transaction the -world can see that a user made a transaction, and upon a deeper inspection of -the transaction can see how much WAN was sent in the transaction, but the world -cannot see who the recipient will be. The world, however, may be able to make -an educated guess at who is the recipient, depending on some factors that we’ll -discuss below. - -Privacy transactions are carried out on Wanchain by way of a smart contract -built into the protocol. The smart contract resides at the following hard-coded -address, and has the following ABI. - -**Privacy Contract Address** -``` -0x0000000000000000000000000000000000000064 -``` - -**Privacy Contract ABI** -``` -[{"constant":false,"type":"function","stateMutability":"nonpayable","inputs":[{"name":"OtaAddr","type":"string"},{"name":"Value","type":"uint256"}],"name":"buyCoinNote","outputs":[{"name":"OtaAddr","type":"string"},{"name":"Value","type":"uint256"}]},{"constant":false,"type":"function","inputs":[{"name":"RingSignedData","type":"string"},{"name":"Value","type":"uint256"}],"name":"refundCoin","outputs":[{"name":"RingSignedData","type":"string"},{"name":"Value","type":"uint256"}]},{"constant":false,"inputs":[],"name":"getCoins","outputs":[{"name":"Value","type":"uint256"}]}] -``` - -### Transaction Workflow - -Unlike a regular transaction, which involves a single transaction on the -blockchain that transfers the account balance, a privacy transaction consists -of two underlying transactions: a lock (`buyCoinNote`) transaction made by the -sender, which locks the WAN with the privacy smart contract, and a redeem -(`refundCoin`) transaction made by the recipient, which transfers the WAN from -the smart contract to the recipient. - -![Privacy Transaction](/img/privacy_transaction.png) - -When a user locks WAN in the privacy smart contract, it is not possible to see -who the intended recipient is. This is because the lock transaction does not -contain the recipient’s address within the transaction call data, but instead -only contains ring signature data from the recipient’s one-time address. Thus, -while we can see transactions that lock funds into the privacy contract, and -other transactions that redeem funds from the privacy contract, we cannot link -any lock and redeem transactions by anything other than value. - -### Allowed Transaction Amounts - -Hypothetically, if a user were to lock 427 WAN into the privacy smart contract, -and then soon after another user were to redeem 427 WAN from the contract, it -would be fairly obvious that the two transactions were linked. Transaction -values accordingly can reveal connections between senders and recipients. For -this reason, the privacy contract was made to only allow certain values to be -locked for a given privacy transaction. - -Allowed amounts: -- 10 WAN -- 20 -- 50 -- 100 -- 200 -- 500 -- 1000 -- 5000 -- 50000 - -When locking funds into the privacy contract, a user can thus only lock an -amount in the list above. Likewise, a user cannot redeem partial amounts, but -must redeem the full amount that was locked to the one-time address. diff --git a/docs/privacy/transaction.md b/docs/privacy/transaction.md deleted file mode 100644 index 45b2d03..0000000 --- a/docs/privacy/transaction.md +++ /dev/null @@ -1,211 +0,0 @@ ---- -layout: page -author: jgoyette -title: Make a Privacy Transaction ---- - -Privacy transactions on Wanchain require a two-step process, where WAN coin is -first locked in the built-in privacy contract, and then is later redeemed from -the contract. Generally, the redeem should not be made right after the lock is -made, otherwise the obscurity provided by the privacy mechanism is lost, in -that an outsider would be able to associate the redeem to the particular lock. -For this reason, the following examples have the two steps divided into -separate scripts. - -### Set up - -The following code example sends WAN to another account, and thus to run the -examples on your own you will need to have two separate Wanchain accounts, both -with a positive WAN balance so as to be able to pay for the gas for contract -calls. - -If you do not already have a second Wanchain account, go ahead and create -one now. You can use the same process that you used to create the first -account, or any of the methods mentioned -[here](/docs/create-wanchain-account/). After creating the second account, go -ahead and send a small amount of WAN to the new account. About 1 WAN should -suffice. - -With the two accounts in place, create a new directory where we'll add the -example scripts. - -```bash -$ mkdir wanchain-privacy -$ cd !$ -``` - -Now go ahead and create a new file and add the privacy contract ABI and -address. - - -```bash -$ vi contract.js -``` - -**contract.js** -```js -const privacyABI = [{"constant":false,"type":"function","stateMutability":"nonpayable","inputs":[{"name":"OtaAddr","type":"string"},{"name":"Value","type":"uint256"}],"name":"buyCoinNote","outputs":[{"name":"OtaAddr","type":"string"},{"name":"Value","type":"uint256"}]},{"constant":false,"type":"function","inputs":[{"name":"RingSignedData","type":"string"},{"name":"Value","type":"uint256"}],"name":"refundCoin","outputs":[{"name":"RingSignedData","type":"string"},{"name":"Value","type":"uint256"}]},{"constant":false,"inputs":[],"name":"getCoins","outputs":[{"name":"Value","type":"uint256"}]}]; - -const privacyAddress = '0x0000000000000000000000000000000000000064'; - -module.exports = { - privacyABI, - privacyAddress, -}; -``` - -### Lock the coin - -Create a new file called `lock.js`, which will be the script that locks coins -in the privacy contract, and add code to initialize a new `wan3` object and -privacy contract object, as well as the sender and recipient addresses, and the -amount to be sent (in Wan). - -```bash -$ vi lock.js -``` - -**lock.js** -```js - -const Wan3 = require('wan3'); -const { - privacyABI, - privacyAddress, -} = require('./contract.js'); - -const wan3 = new Wan3(new Wan3.providers.HttpProvider('http://localhost:8545')); -const privacyContract = new wan3.eth.Contract(privacyABI, privacyAddress); - -const sender = '0xa6d72746a4bb19f46c99bf19b6592828435540b0'; -const recipient = '0xb1e2de3ca64046eea0d0d2bdd7aff1355838b9b4'; - -const amount = wan3.utils.toWei('10'); -``` - -Note that the amount should be one of the allowed values listed in the -[overview of privacy transactions](/docs/privacy/overview/). - -Also notice that we are using `wan3` instead of `web3`. We will need to call -certain Wanchain endpoints, and those endpoints are not registered in `web3`. - -Now let's set up the function that will lock the coin, which we'll define as -`lockCoin`. - -```js -Promise.resolve([]) - .then(lockCoin) - .catch(err => { - console.log('Error:', err); - }); - -async function lockCoin() { - - // generate OTA from recipient account - const wanAddr = await wan3.wan.getWanAddress(recipient); - const ota = await wan3.wan.generateOneTimeAddress(wanAddr); - - // generate transaction data for contract call - const buyData = privacyContract.methods.buyCoinNote(ota, amount).encodeABI(); - - console.log('wanAddr:', wanAddr); - console.log('ota:', ota); - console.log('buyData:', buyData); - - // submit transaction - const buyResult = await wan3.eth.sendTransaction({ - from: sender, - to: privacyAddress, - value: amount, - data: buyData, - gas: 1000000, - }); - - console.log('buyResult:', buyResult); - - return ota; -} -``` - -The `lockCoin` function gets the `WanAddress` for the recipient address, and -then uses that to generate a one-time address (OTA). Then, with the OTA, it -constructs the transaction data for the call to the privacy contract, and then -submits the transaction. - -
- Make sure to hang on the OTA, as it is needed to redeem the coin. If the - recipient account is owned by another person, instead of generating the OTA - yourself from the recipient address, you should request that the recipient - provide you with an OTA. Otherwise, if you generate the OTA, you will need to - pass along the generated OTA to the recipient after you lock the coin so that - the coin eventually can be redeemed. -
- -With all that in place you should now be able to run the script. - -```bash -$ node lock.js -``` - -### Redeem the coin - -Now that we have some coins locked, let's create another script to redeem the -coins. Start by creating a new file called `redeem.js`. - -```bash -$ vi redeem.js -``` - -The redeem script will have the same variables defined as the lock script, so -go ahead and copy over those variables. The only thing we need to add is the -OTA that was generated by the lock script. - -```js -const ota = '0x0207f3bb30e812f04d7f1bb98623471aaafc111...'; -``` - -With that added, let's add the function to make the redeem call on the privacy -contract. - -```js -Promise.resolve([]) - .then(redeemCoin) - .catch(err => { - console.log('Error:', err); - }); - -async function redeemCoin() { - - // generate a new mixset from the OTA (5 indicates the number of keys to mix with) - const mixWanAddresses = await web3.wan.getOTAMixSet(ota, 5); - - // get the OTA private key - const keyPairs = await web3.wan.computeOTAPPKeys(recipient, ota); - const privateKey = keyPairs.split('+')[0]; - - // generate transaction data for contract call - const ringSignData = await web3.wan.genRingSignData(recipient, privateKey, mixWanAddresses.join("+")); - const refundData = privacyContract.methods.refundCoin(ringSignData, amount).encodeABI(); - - const refundResult = await web3.eth.sendTransaction({ - from: recipient, - to: privacyAddress, - value: 0, - data: refundData, - gas: 2000000, - }); - - console.log('refundResult:', refundResult); -} -``` - -The `redeemCoin` function generates a new mixset from the given OTA with the -given number of keys, and then generates the ring signature data from the -mixset and the private key of the OTA. Finally, it constucts the transaction -data for the contract call and submits the transaction to the network. - -Now, go ahead and run the script. - -```bash -$ node redeem.js -``` diff --git a/docs/set-up-wanchain-private-testnet.md b/docs/set-up-wanchain-private-testnet.md index a77704c..7fd7256 100644 --- a/docs/set-up-wanchain-private-testnet.md +++ b/docs/set-up-wanchain-private-testnet.md @@ -96,17 +96,3 @@ To let WanWalletGui use your node you need to enable the IPCPATH parameter in th ```# IPCPATH=[fill in your IPC path here to use wanwalletgui with your node]``` -### Initializing OTAs - -Lastly to make privacy tx work you need to create a few OTAs first. you can use the initializeota script for that. - -```js -loadScript("./loadScript/initializeota.js") -``` - -This will initialize 9 OTAs for each allowed privacy tx value: - -``` -var tranValues = [ 10, 20, 50, 100, 200, 500, 1000, 5000, 50000 ]; - -``` diff --git a/docs/smartcontracts/create-token.md b/docs/smartcontracts/create-token.md index d29f552..d262677 100644 --- a/docs/smartcontracts/create-token.md +++ b/docs/smartcontracts/create-token.md @@ -19,11 +19,6 @@ The standard token contract can be quite complex. But in essence a very basic to -
- Note: - * Privacy transaction function is "otatransfer" in the ERC20 Protocol, the contract with privacy transaction need to implement ERC20 Protocol - * Privacy balance is stored in the map privacyBalance, function otabalanceOf can get this balance -
### How To Compile And Deploy @@ -55,144 +50,3 @@ Steps: You can locate a demo WANCHAIN token contract and involved scripts under contracts/demo/ directory - -### How To Invoke Privacy Transfer - -After deployed above token contract on WANCHAIN,in the WANCHAIN console,you can invoke token privacy transaction according to following process: - -Suppose there are at lease 3 accounts in your WANCHAIN node - -1. Define asset function and variable - - ```js - var initPriBalance = 10000; - var priTranValue = 888; - var wanBalance = function (addr) { - return web3.fromWin(web3.eth.getBalance(addr)); - } - var wanUnlock = function (addr) { - return personal.unlockAccount(addr, "wanglu", 99999); - } - var sendWanFromUnlock = function (From, To, V) { - eth.sendTransaction({ from: From, to: To, value: web3.toWin(V) }); - } - var wait = function (conditionFunc) { - var loopLimit = 130; - var loopTimes = 0; - while (!conditionFunc()) { - admin.sleep(2); - loopTimes++; - if (loopTimes >= loopLimit) { - throw Error("wait timeout! conditionFunc:" + conditionFunc) - } - } - } - wanUnlock(eth.accounts[1]) - wanUnlock(eth.accounts[2]) - stampBalance = 0.09; - ``` - -2. buy stamp for token privacy transaction - - ```js - abiDefStamp = [{ "constant": false, "type": "function", "stateMutability": "nonpayable", "inputs": [{ "name": "OtaAddr", "type": "string" }, { "name": "Value", "type": "uint256" }], "name": "buyStamp", "outputs": [{ "name": "OtaAddr", "type": "string" }, { "name": "Value", "type": "uint256" }] }, { "constant": false, "type": "function", "inputs": [{ "name": "RingSignedData", "type": "string" }, { "name": "Value", "type": "uint256" }], "name": "refundCoin", "outputs": [{ "name": "RingSignedData", "type": "string" }, { "name": "Value", "type": "uint256" }] }, { "constant": false, "type": "function", "stateMutability": "nonpayable", "inputs": [], "name": "getCoins", "outputs": [{ "name": "Value", "type": "uint256" }] }]; - contractDef = eth.contract(abiDefStamp); - stampContractAddr = "0x00000000000000000000000000000000000000c8"; - stampContract = contractDef.at(stampContractAddr); - var wanAddr = wan.getWanAddress(eth.accounts[1]); - var otaAddrStamp = wan.generateOneTimeAddress(wanAddr); - txBuyData = stampContract.buyStamp.getData(otaAddrStamp, web3.toWin(stampBalance)); - sendTx = eth.sendTransaction({ from: eth.accounts[1], to: stampContractAddr, value: web3.toWin(stampBalance), data: txBuyData, gas: 1000000 }); - wait(function () { return eth.getTransaction(sendTx).blockNumber != null; }); - - keyPairs = wan.computeOTAPPKeys(eth.accounts[1], otaAddrStamp).split('+'); - privateKeyStamp = keyPairs[0]; - ``` - -3. get stamp mix set for ring sign - - ```js - var mixStampAddresses = wan.getOTAMixSet(otaAddrStamp, 2); - var mixSetWith0x = [] - for (i = 0; i < mixStampAddresses.length; i++) { - mixSetWith0x.push(mixStampAddresses[i]) - } - ``` - -4. define token contract ABI - - ```js - var erc20simple_contract = web3.eth.contract([{ "constant": true, "inputs": [], "name": "name", "outputs": [{ "name": "", "type": "string" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "approve", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_to", "type": "address" }, { "name": "_toKey", "type": "bytes" }, { "name": "_value", "type": "uint256" }], "name": "otatransfer", "outputs": [{ "name": "", "type": "string" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "decimals", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "address" }], "name": "privacyBalance", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_owner", "type": "address" }], "name": "balanceOf", "outputs": [{ "name": "balance", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "symbol", "outputs": [{ "name": "", "type": "string" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "initialBase", "type": "address" }, { "name": "baseKeyBytes", "type": "bytes" }, { "name": "value", "type": "uint256" }], "name": "initPrivacyAsset", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "transfer", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [{ "name": "_owner", "type": "address" }], "name": "otabalanceOf", "outputs": [{ "name": "balance", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_owner", "type": "address" }, { "name": "_spender", "type": "address" }], "name": "allowance", "outputs": [{ "name": "remaining", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "address" }], "name": "otaKey", "outputs": [{ "name": "", "type": "bytes" }], "payable": false, "stateMutability": "view", "type": "function" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "_from", "type": "address" }, { "indexed": true, "name": "_to", "type": "address" }, { "indexed": false, "name": "_value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "_owner", "type": "address" }, { "indexed": true, "name": "_spender", "type": "address" }, { "indexed": false, "name": "_value", "type": "uint256" }], "name": "Approval", "type": "event" }]); - - contractAddr = '0xa2e526a3632d225f15aa0592e00bed31a48c953d'; - // this address should changed according to your contract deploy - erc20simple = erc20simple_contract.at(contractAddr) - ``` - -5. create one time address for account1 - - ```js - var wanAddr = wan.getWanAddress(eth.accounts[1]); - var otaAddrTokenHolder = wan.generateOneTimeAddress(wanAddr); - keyPairs = wan.computeOTAPPKeys(eth.accounts[1], otaAddrTokenHolder).split('+'); - privateKeyTokenHolder = keyPairs[0]; - addrTokenHolder = keyPairs[2]; - sendTx = erc20simple.initPrivacyAsset.sendTransaction(addrTokenHolder, otaAddrTokenHolder, '0x' + initPriBalance.toString(16), { from: eth.accounts[1], gas: 1000000 }); - wait(function () { return eth.getTransaction(sendTx).blockNumber != null; }); - - ota1Balance = erc20simple.privacyBalance(addrTokenHolder) - if (ota1Balance != initPriBalance) { - throw Error('ota1 balance wrong! balance:' + ota1Balance + ', except:' + initPriBalance) - } - ``` - -6. generate ring sign data - - ```js - var hashMsg = addrTokenHolder - var ringSignData = personal.genRingSignData(hashMsg, privateKeyStamp, mixSetWith0x.join("+")) - ``` - -7. create one time address for account2 - - ```js - var wanAddr = wan.getWanAddress(eth.accounts[2]); - var otaAddr4Account2 = wan.generateOneTimeAddress(wanAddr); - keyPairs = wan.computeOTAPPKeys(eth.accounts[2], otaAddr4Account2).split('+'); - privateKeyOtaAcc2 = keyPairs[0]; - addrOTAAcc2 = keyPairs[2]; - ``` - -8. generate token privacy transfer data - - ```js - cxtInterfaceCallData = erc20simple.otatransfer.getData(addrOTAAcc2, otaAddr4Account2, priTranValue); - ``` - -9. generate call token privacy transfer data - - ```js - glueContractDef = eth.contract([{ "constant": false, "type": "function", "inputs": [{ "name": "RingSignedData", "type": "string" }, { "name": "CxtCallParams", "type": "bytes" }], "name": "combine", "outputs": [{ "name": "RingSignedData", "type": "string" }, { "name": "CxtCallParams", "type": "bytes" }] }]); - glueContract = glueContractDef.at("0x0000000000000000000000000000000000000000") - combinedData = glueContract.combine.getData(ringSignData, cxtInterfaceCallData) - ``` - -10. send privacy transaction - - ```js - sendTx = personal.sendPrivacyCxtTransaction({from:addrTokenHolder, to:contractAddr, value:0, data: combinedData, gasprice:'0x' + (200000000000).toString(16)}, privateKeyTokenHolder) - wait(function(){return eth.getTransaction(sendTx).blockNumber != null;}); - ``` - -11. check balance - - ```js - ota2Balance = erc20simple.privacyBalance(addrOTAAcc2); - if (ota2Balance != priTranValue) { - throw Error("ota2 balance wrong. balance:" + ota2Balance + ", expect:" + priTranValue); - } - ota1Balance = erc20simple.privacyBalance(addrTokenHolder) - if (ota1Balance != initPriBalance - priTranValue) { - throw Error("ota2 balance wrong. balance:" + ota1Balance + ", expect:" + (initPriBalance - priTranValue)); - } - ``` diff --git a/docs/wanchain-overview.md b/docs/wanchain-overview.md index a0d6972..9ce66d9 100644 --- a/docs/wanchain-overview.md +++ b/docs/wanchain-overview.md @@ -9,7 +9,7 @@ title: Overview Bitcoin was launched in 2009 by an anonymous individual named Satoshi Nakamoto. In his whitepaper Satoshi outlined his vision for "A peer to peer electronic cash system". As time went by, Bitcoin started getting traction and was increasingly used in commerce. Ethereum was launched in 2015 with the intent of creating a network for "programmable money" which could one day become the backbone of a new decentralized financial system. -Time went by, and many new blockchains started to appear each one for a different use case privacy, scalability, governance... These protocols all had a different vision, roadmap and community. +Time went by, and many new blockchains started to appear each one for a different use case scalability, governance... These protocols all had a different vision, roadmap and community. It became obvious that the future of this industry would depend on many heterogenous blockchains which would each have its own set of rules and governance processes. These blockchains would each be in their own bubble, siloed and closed to the outside. @@ -35,11 +35,8 @@ Wanchain is its own chain, established as a fork from the Ethereum project, and Being a fork of Ethereum, Wanchain provides much of the same framework, such as an EVM that runs Solidity-based contract code. As a consequence, practically all the project builts on Ethereum could be deployed to Wanchain with no or only minimal changes, and utility packages built for Ethereum (like Truffle, Web3, etc.) can be used on Wanchain as well. -In addition to the feature set inherited from Ethereum, Wanchain also adds two new features: privacy transactions, and cross-chain transactions. +In addition to the feature set inherited from Ethereum, Wanchain also adds two new features: cross-chain transactions. -#### Privacy Transactions - -Wanchain provides a privacy smart contract built into the protocol that uses ring signatures to mask the intended recipient of a transaction. The contract allows users to "lock" a particular amount of WAN into the contract, which then can later be retrieved by the recipient. #### Cross-chain Transactions diff --git a/faqs.md b/faqs.md index 3ce943f..fdb0d47 100644 --- a/faqs.md +++ b/faqs.md @@ -6,10 +6,8 @@ permalink: /faqs/ # List of FAQs * What is Wanchain -* How to make a privacy transaction * How to make a crosschain transaction * How does crosschain work -* How does a privacy transaction work * [How to set up a Wanchain node](/faqs/how-to-setup-wanchain-node.html) * [How to set up a Bitcoin node](/faqs/how-to-setup-bitcoin-node.html) * [How to set up an Ethereum node](/faqs/how-to-setup-ethereum-node.html)