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

BMIP-0010 #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

only4sim
Copy link

This BMIP describes a specification that how to use arrays in contracts.

@MartinBTM
Copy link
Contributor

Think about where we can use this BMIP

@only4sim
Copy link
Author

Think about where we can use this BMIP
Bytom aims to be an interactive protocol of multiple byte assets, which can benefit bonds, notes, contracts, and decentralized exchanges. However, current contracts do not support array type, which means that even the same type of data cannot be batch processed within a contract. For example, even for a bond, each investor needs to generate a new contract. This standard will allow arrays in a smart contract. Through a standard type, the contract will be able to use mutable sequences. This standard will simplify the implementation of contracts, and help achieve Turing complet of the equity.

ps: update motivations and add application.

@@ -0,0 +1,57 @@
<pre>
BMIP:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BMIP: 10

Add BMIP number and modify some statements.
@zruijie
Copy link

zruijie commented Mar 18, 2019

Please rename BMIP-only4sim-arrays.mediawiki to BMIP-0010.mediawiki

@only4sim only4sim changed the title Bmip only4sim arrays BMIP-0010 Mar 18, 2019
@zruijie zruijie self-requested a review March 18, 2019 08:35
@oysheng
Copy link

oysheng commented Mar 18, 2019

Think about where we can use this BMIP
Bytom aims to be an interactive protocol of multiple byte assets, which can benefit bonds, notes, contracts, and decentralized exchanges. However, current contracts do not support array type, which means that even the same type of data cannot be batch processed within a contract. For example, even for a bond, each investor needs to generate a new contract. This standard will allow arrays in a smart contract. Through a standard type, the contract will be able to use mutable sequences. This standard will simplify the implementation of contracts, and help achieve Turing complet of the equity.

ps: update motivations and add application.

I understand what you mean is that it's impossible to batch processed in a contract without the array type, however I think it would be better to implement this function without necessarily. Of course, the contract code looked redundant when it not support the array type. besides, about your statement with "even for a bond, each investor needs to generate a new contract." a bond contract requires multiple investors to participate in it, we assume that the project can be completed and each investor is unrelated. It's very easy to implement in the blockchain with account model, because the chain store the user state. at the same time, it can be implemented in bytom with UTXO model, but the UTXO model is stateless, it requires the contracts to call itself to save state, therefore, every investor can only to invest after the previous user has been completed, therefore, adding the array type won't meet your needs. I expect you to think about it.

@only4sim
Copy link
Author

Think about where we can use this BMIP
Bytom aims to be an interactive protocol of multiple byte assets, which can benefit bonds, notes, contracts, and decentralized exchanges. However, current contracts do not support array type, which means that even the same type of data cannot be batch processed within a contract. For example, even for a bond, each investor needs to generate a new contract. This standard will allow arrays in a smart contract. Through a standard type, the contract will be able to use mutable sequences. This standard will simplify the implementation of contracts, and help achieve Turing complet of the equity.

ps: update motivations and add application.

I understand what you mean is that it's impossible to batch processed in a contract without the array type, however I think it would be better to implement this function without necessarily. Of course, the contract code looked redundant when it not support the array type. besides, about your statement with "even for a bond, each investor needs to generate a new contract." a bond contract requires multiple investors to participate in it, we assume that the project can be completed and each investor is unrelated. It's very easy to implement in the blockchain with account model, because the chain store the user state. at the same time, it can be implemented in bytom with UTXO model, but the UTXO model is stateless, it requires the contracts to call itself to save state, therefore, every investor can only to invest after the previous user has been completed, therefore, adding the array type won't meet your needs. I expect you to think about it.

Thanks for your reply! It is flexible and convenient for each investor to hold a contract, but it is not conducive to a higher-level organization such as a creditor group. Through BMIP 10, investors can make various decisions with their own signatures, and only need one state transfer if there is a relay of the service provider. In addition, in bond issuance, it is not often to sell one bond by one time, but all bonds are allocated once after locking in sufficient investment. The BMIP 10 will facilitate the issuance of bonds in bulk.

@oysheng
Copy link

oysheng commented Mar 19, 2019

Think about where we can use this BMIP
Bytom aims to be an interactive protocol of multiple byte assets, which can benefit bonds, notes, contracts, and decentralized exchanges. However, current contracts do not support array type, which means that even the same type of data cannot be batch processed within a contract. For example, even for a bond, each investor needs to generate a new contract. This standard will allow arrays in a smart contract. Through a standard type, the contract will be able to use mutable sequences. This standard will simplify the implementation of contracts, and help achieve Turing complet of the equity.

ps: update motivations and add application.

I understand what you mean is that it's impossible to batch processed in a contract without the array type, however I think it would be better to implement this function without necessarily. Of course, the contract code looked redundant when it not support the array type. besides, about your statement with "even for a bond, each investor needs to generate a new contract." a bond contract requires multiple investors to participate in it, we assume that the project can be completed and each investor is unrelated. It's very easy to implement in the blockchain with account model, because the chain store the user state. at the same time, it can be implemented in bytom with UTXO model, but the UTXO model is stateless, it requires the contracts to call itself to save state, therefore, every investor can only to invest after the previous user has been completed, therefore, adding the array type won't meet your needs. I expect you to think about it.

Thanks for your reply! It is flexible and convenient for each investor to hold a contract, but it is not conducive to a higher-level organization such as a creditor group. Through BMIP 10, investors can make various decisions with their own signatures, and only need one state transfer if there is a relay of the service provider. In addition, in bond issuance, it is not often to sell one bond by one time, but all bonds are allocated once after locking in sufficient investment. The BMIP 10 will facilitate the issuance of bonds in bulk.

Thank you for replying! I agree that it is flexible and convenient by adding the array types. According to the example given by BMIP10, I have some doubts, and I hope you can answer them.

  1. "investors can make various decisions with their own signatures", I understand that it is a multi-signature?

  2. "only need one state transfer if there is a relay of the service provider", I think that you want to express state transition, can you give me an example of pseudocode for equity?

  3. " in bond issuance, it is not often to sell one bond by one time, but all bonds are allocated once after locking in sufficient investment", I hope that you can describe it, it would be better if you give the pseudo code or source code.

I look forward to your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants