Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - abit

Pages: 1 ... 18 19 20 21 22 23 24 [25] 26
361
中文 (Chinese) / BTS系统里的第三方担保转账/付款(escrow)
« on: March 02, 2015, 06:10:35 am »
BTS系统里的第三方担保转账/付款(escrow)

1. 什么是escrow
普通的转账,比如A转100CNY给B,转账指令发出之后,相应转账金额就直接从A的账户扣减,进入B的账户了。
第三方担保转账,比如A转100CNY给B,指定一个中间人C,转账指令发出后,金额从A的账户扣减,但是不进入B的账户,而是进入一个特别账户X,C可以决定最终转多少金额给B,以及退回多少金额给A。(C如何进行决定这里暂不讨论)
在传统第三方支付系统里,一般来说特别账户X是C有权控制的账户,可能会由银行D来进行监管,或者没有监管。
在BTS系统里,特别账户X由系统生成,C对特别账户的权限只有确认转账给B或者退回给A,无法挪用,不需要监管。

2. BTS系统里的escrow
v0.6.x的标准客户端(重钱包)里支持第三方托管转账(escrow)。
转账分两步完成:
第一步,发起转账
第二步,确认付款/退款

2.1 发起转账
发起转账的命令是 wallet_transfer_from_with_escrow ,格式是
Code: [Select]
wallet_transfer_from_with_escrow <金额> <币种> <实际付款人> <显示付款人> <收款人> <第三方> [可选协议hash值] [可选留言] [可选投票方式]
注:
 1) 带尖括号的是必要参数,带方括号的是可选参数。
 2) 实际付款人和显示付款人可以相同,也可以不同,具体用途待研究
 3) 可选协议hash值,是指A可以将A和B之间达成的协议(属于系统外数据)通过一个hash算法比如sha256计算出一个值,记录在这个交易中,
    以备争议产生时可以用来仲裁。A和B都可以用原始协议及hash算法来验证该hash值是否正确。
    默认为空。
    (这个参数必须是一个hash,只接受只包含0-9/a-f的字符串,需要在系统外生成后在这里使用,比如用sha256sum来生成)。
 4) 可选留言默认为空
 5) 投票是指对受托人投票,与一般转账时的投票相同,默认是按自己选择的受托人的推荐名单投票

比如,abit想要转5CNY给wildpig,指定中间人是alt,留言"hello",协议内容为"buy 1000 BTS"(经过sha256sum计算后结果为 3b6675e1acde42ba912f6d37a0fdf3967c4b6f8cf2b8f86f47f3adfc9ce419c5),则相应转账命令为:
Code: [Select]
wallet_transfer_from_with_escrow 5 CNY abit abit wildpig alt "3b6675e1acde42ba912f6d37a0fdf3967c4b6f8cf2b8f86f47f3adfc9ce419c5" "hello"

如果这个命令执行成功,会返回交易信息

2.2 查询转账状态
任何时候,可以使用 wallet_escrow_summary 命令(可缩写为 escrow )查看指定账户的转账状态,格式是
Code: [Select]
escrow [账户名]
注:
 账户名是可选参数,如果输入则显示指定账户的转账状态,如果为空则显示块链上所有账户的escrow转账状态。
 指定账户查询时,目前只能按付款人或者收款人来查,不能按照中间人来查询。
 钱包里必须有付款人或者收款人的私钥,结果里才能显示出实际账户名,否则会显示成地址或者UNKNOWN(未知)。

命令返回结果示例
Code: [Select]
>> escrow abit

[{
    "creating_transaction_id": "1ab26c3e36fe3cf81a12f416aafe0e3c2f9e6d09",
    "balance_id": "BTS3bEvmFzmfoziof1XMHm4CXunmHswi2sWM",
    "balance": {
      "amount": 50000,
      "asset_id": 14
    },
    "sender_account_name": "abit",
    "receiver_account_name": "wildpig",
    "escrow_agent_account_name": "alt",
    "agreement_digest": "3b6675e1acde42ba912f6d37a0fdf3967c4b6f8cf2b8f86f47f3adfc9ce419c5"
  }
]
其中:
 1) creating_transaction_id 是发起转账的交易id
 2) balance_id 是转账余额ID,后面命令中会用到
 3) amount 是当前转账交易的剩余金额,要除以币种对应的小数位数,才是实际金额。CNY的小数是4位,所以例子里的50000实际上是5CNY
 4) asset_id 是币种ID,CNY对应的ID是14
 5) sender_account_name 是付款人
 6) receiver_account_name 是收款人
 7) escrow_agent_account_name 是中间人
 8 ) agreement_digest 是前面输入的协议hash

2.3 确认付款/退款
进行确认付款、退款操作时,使用 wallet_release_escrow 命令,可简写为 release ,格式如下:
Code: [Select]
release <支付手续费的账户> <转账ID> <确认人> [退款金额] [确认付款金额]
注:
 1) 带尖括号的是必要参数,带方括号的是可选参数。
 2) 第一个参数是指付手续费的账号。因为这也是一个交易,需要向网络支付手续费,不能使用当前escrow交易内的资金支付,必须从钱包另外支付
 3) 转账ID是指用 escrow 命令查到的 balance_id ,即“转账余额ID”
 4) 确认人必须是 sender, receiver, agent 这三种之一,分别对应付款人、收款人、中间人,钱包拥有相应账号的私钥才能操作
 5) 退款金额指将多少金额退回给付款人,默认为0
 6) 确认付款金额指将多少金额确认发送给收款人,默认为0
 7) 付款人可以用这个命令来部分或者全部确认付款,但是不可以用来退款
    收款人可以用这个命令来部分或者全部退款,但是不可以用来确认付款
    中间人(第三方)可以用这个命令来全部退款,或者全部确认付款,或者部分退款/部分确认付款

比如 abit 想将上一笔转账中的1CNY确认发送给 wildpig,则可以使用命令
Code: [Select]
release abit BTS3bEvmFzmfoziof1XMHm4CXunmHswi2sWM sender 0 1

再比如 wildpig 想将上述转账中的1.5CNY退款给 abit,则可以使用命令
Code: [Select]
release wildpig BTS3bEvmFzmfoziof1XMHm4CXunmHswi2sWM receiver 1.5 0

还比如 alt 想将上述转账中的1.3CNY退款给 abit,其余部分(还剩2.2CNY)确认发送给wildpig
Code: [Select]
release alt BTS3bEvmFzmfoziof1XMHm4CXunmHswi2sWM agent 1.3 2.2

3. 总结
抛砖引玉,欢迎大家拍砖。

362
中文 (Chinese) / 又一个类似shapeshift的站
« on: March 01, 2015, 05:10:52 am »

364
中文 (Chinese) / 轻量级客户端(轻钱包)下载
« on: February 28, 2015, 02:02:02 am »
3I官方出的轻钱包测试版,参见 https://bitsharestalk.org/index.php?topic=14323.0
可以从Github下载源代码自己编译。

Mac版最新下载地址是 https://nathanhourt.com/BitSharesLightWallet-Beta3.dmg

Windows版目前最新的下载地址是 https://dl.dropboxusercontent.com/u/15663627/bts_light_wallet_win1.0beta3.zip ,参见 https://bitsharestalk.org/index.php?topic=14323.msg190807#msg190807 ,是受托人cgafeng用官方github上的代码编译的,放在dropbox提供下载,能翻墙的朋友可以试试,或者搞下来分流一下。

(鉴于一些人的建议,以后尽量避免用“钱包”一词)

365
中文 (Chinese) / 谁帮忙把这个翻译一下?
« on: February 01, 2015, 07:33:52 am »

366
中文 (Chinese) / bts投票统计数据
« on: January 28, 2015, 04:58:43 am »
toast发了个帖子:

https://bitsharestalk.org/index.php?topic=13793.msg179433#msg179433

投票超过1000票(也就是1000bts)的账号总数大约是750个;
投票超过1万票的账号有500多个;
投票超过10万票的账号有200多个;
投票超过100万的有70个;
投票超过500万的有16个;
投票超过1千万的有7个;

投票最多的账号有7千万票;
第2名约4千万
第3名约3千万
第4名约2800万
5-7名是1千多万

@sudo

367
中文 (Chinese) / 关于short规则的新改动(强制平仓相关)
« on: January 28, 2015, 02:41:51 am »
BM今天发了个新帖
https://bitsharestalk.org/index.php?topic=13782.0

大意是说,正在做一个功能,可以设置一个自动平仓价(高于强制平仓价),当市场价格跌到这个价就自动平仓(止损)以避免强制平仓,这样可以避免5%的罚金。

野猪们,有时间详细翻译一下吗?

368
Steps:
1. submit an ask order which matches the highest bid order in the market, but have a volume greater than the bid order
2. wait for one block, so that the ask order list in the market and appear in GUI as cancel-able
3. try to cancel the ask order
4. wait for one block, the 'cancel' expire, the ask order executes
5. open transaction history page, or type 'wallet_account_transaction_history' in the console
5.1 balance column in the 'cancel' line shows N/A
5.2 balance column in the 'fill ask' line shows a (incorrect) value which equals to a value if the 'cancel' succeeded (in BTS)
5.3 balance column in the 'ask proceeds' line shows a corrent value (in BitAsset)
6. do other transactions, then check the history again, will see the following balances be messed up

Maybe an API issue.

BTW the 'balance' command returns a correct value.

369
General Discussion / Invictus Domain Names Abandoned?
« on: January 25, 2015, 05:21:04 am »
invictus-innovations.com
   Expiration Date: 03-jul-2015

Website Expired

invictus.io
Status : pendingDelete
Expiry : 2014-12-15

Isn't it better to renew them and link to bitshares.org?

370
中文 (Chinese) / 【注意】关于钱包私钥导出的注意事项
« on: January 23, 2015, 02:22:33 pm »
可能很多人习惯了用导出私钥的方式来备份钱包,像下面这样,在控制台执行命令(将下面test.abit替换成自己的账号):
Code: [Select]
>> wallet_dump_private_key test.abit
"5HtWgbu1vcPe7trStHaVKoRjjPaMaGPzxJgavLHLw1tvPwuCPCx"

但是请注意,这种方法可能会导致账号异常,因为备份出来的私钥可能不完整。

要想查看自己的备份是否存在问题,首先请按下面的命令检查一下要备份的账号(将参数abit或test.abit替换成你的账号)
Code: [Select]
>> wallet_get_account abit
{
...
  "owner_key": "BTS7NLcZJzqq3mvKfcqoN52ainajDckyMp5SYRgzicfbHD6u587ib",
  "active_key_history": [[
      "2014-07-27T10:02:50",
      "BTS7NLcZJzqq3mvKfcqoN52ainajDckyMp5SYRgzicfbHD6u587ib"
    ]
  ],
...
}
Code: [Select]
>> wallet_get_account test.abit
{
...
  "owner_key": "BTS5R1G2iBqAoKAKZCRfJgZA7us7N7xkvSaMwStnY1hkK52s42A56",
  "active_key_history": [[
      "2015-01-07T13:40:53",
      "BTS5j2xL7jKjFprETK1suWfxGEux8gQcuheyaL9nytW9AHtzRDuUz"
    ]
  ],
...
}
可以看到,上面两个账号中,abit的owner_key和active_key是相同的,而test.abit的两个key不同。
原因是创建账号的钱包版本不一样。老版本钱包使用的两个key是相同的,但是从某个版本开始,创建账号时会使用两个不同的key。
(具体这两个key的用途,记得有人发帖说过,我回头找到了再补充)

如果账号的两个key是一样的,以账号名为参数备份私钥的方式就没问题。
如果账号的owner_key和active_key不同,则需要针对两个key分别进行备份,如下:
Code: [Select]
>> wallet_dump_private_key BTS5j2xL7jKjFprETK1suWfxGEux8gQcuheyaL9nytW9AHtzRDuUz
"5HtWgbu1vcPe7trStHaVKoRjjPaMaGPzxJgavLHLw1tvPwuCPCx"
Code: [Select]
>> wallet_dump_private_key BTS5R1G2iBqAoKAKZCRfJgZA7us7N7xkvSaMwStnY1hkK52s42A56
"5JYu4swx6bhpMxJBNU1hCAxPE21eFWt24VphkexexdmVZKutfzg"
可以看到,用active_key导出的私钥,和账号名导出的私钥是相同的。而owner_key导出的私钥不同。实际上owner_key更重要。
将这两个私钥都保存下来就可以了。

导入私钥恢复账号时,需要将两个私钥都导入一遍。

写在最后:
1.下一个版本的钱包,将不再支持用账号名作为参数来导出私钥,只能用key作为参数
2.官方更推荐用导出json的方式来备份钱包

371
General Discussion / Possible log in to this forum with BTS id?
« on: January 14, 2015, 02:02:24 pm »
Just an idea, don't know whether others asked yet.

372
Technical Support / try to start http rpc server from GUI wallet
« on: January 10, 2015, 03:02:39 pm »
While trying to start http rpc server from the console of GUI wallet, the server started actually, but a 'undefined' message returned in the console:
Code: [Select]

>> http_start_server 12345

undefined


After that, many other commands return 'undefined' as well, and the GUI is getting unusable (many buttons/links don't response).

Any idea?

373
Technical Support / blockchain_get_block_signee issue
« on: January 10, 2015, 10:15:29 am »
Code: [Select]
(wallet closed) >>> blockchain_get_block_signee 1303717
10 assert_exception: Assert Exception
!(c.data[1] & 0x80): signature is not canonical
    {}
    th_a  elliptic.cpp:496 fc::ecc::public_key::public_key

    {}
    th_a  common_api_client.cpp:2323 bts::rpc_stubs::common_api_client::blockchain_get_block_signee

    {"command":"blockchain_get_block_signee"}
    th_a  cli.cpp:579 bts::cli::detail::cli_impl::execute_command

Anybody else get this as well?
Exception raises while querying block 1303717,1303906,1303982 and more, the biggest block number with this issue is 1319180.

After re-downloaded the whole block chain the exception remains still.

I'm running v0.4.27.1@Ubuntu 64bit and v0.4.27.2@Win7 64bit.

374
Here is a complaint about fund lost caused by covering a short order.
https://bitsharestalk.org/index.php?topic=13042.0

Please check this block:
http://bitsharesblocks.com/blocks/block?id=1465854

Looks strange.
Code: [Select]
>>> blockchain_get_block_transactions 1465854
...
      "deposits": [[
          22,{
            "amount": 5504026,
            "asset_id": 22
          }
        ]
      ],
      "withdraws": [[
          0,{
            "amount": 9900337696,
            "asset_id": 0
          }
        ],[
          22,{
            "amount": 5504026,
            "asset_id": 22
          }
        ]
      ],
...

375
受托人运行过程中,可能遇到服务器重启后,需要自动启动钱包。官方wiki上有说明:
http://wiki.bitshares.org/index.php/Bitshares-x-delegate-how-to#Starting_the_client_after_a_reboot_or_crash

第一步,启动钱包
Code: [Select]
gdb ./bitshares_client --server --httpport 9989 --rpcuser user --rpcpassword pass
第二步,钱包启动后,在钱包的控制台输入下面的命令
Code: [Select]
open mywallet
 unlock 999999
 <enter password>
 wallet_delegate_set_block_production user123 true
 network_set_advanced_node_parameters {"desired_number_of_connections":100, "maximum_number_of_connections":200}

但是实际上,如果是服务器异常重启,是没有机会人工输入上述命令的,这样就会导致丢块。

为了解决这个问题,alt实现了一个用expect脚本来自动输入上述命令的方法,代码见 https://github.com/bitsuperlab/operation_tools/tree/master/restart
其他受托人也有各自的做法。

这里介绍的是另外一种方法:直接使用钱包程序的启动参数和配置文件,来实现启动时自动加载命令执行。
第一步,创建一个文件,比如命名为 startup.input ,内容如下
Code: [Select]
>>> open mywallet
>>> unlock 99999999 <password>
>>> wallet_delegate_set_block_production user123 true
>>> network_set_advanced_node_parameters {"desired_number_of_connections":100, "maximum_number_of_connections":200}
注意,每行以“>>> ”开头,也就是3个大于号加一个空格,后面跟要执行的命令。
命令里的参数,包括钱包名,密码,受托人账号等等,请根据自己情况修改。
至于密码写在文件里怎么让别人看不到,这里不详细讨论,有经验的请补充。

第二步,修改启动钱包的命令,在后面添加一个参数
Code: [Select]
gdb ./bitshares_client --server --httpport 9989 --rpcuser user --rpcpassword pass --input-log startup.input
这样,钱包启动时,就会自动加载 startup.input 里的命令了。

结束。

欢迎打赏或者拍砖 :D


Pages: 1 ... 18 19 20 21 22 23 24 [25] 26