Author

Topic: Bitcoin transaction and Open Asset Protocol (Read 132 times)

jr. member
Activity: 113
Merit: 5
March 30, 2018, 04:55:19 AM
#3
Please take a look at the Open assets spec. You have all headers & footer fields described. Also, please note that the asset quantity list is a LEB128 encoded field. LEB128 is a compression algorithm to store a large number of small integers.

Please also note the OP_RETURN now accepts up to 83 bytes: https://github.com/bitcoin/bitcoin/blob/master/src/script/standard.h#L34.

Now OP_RETURN accepts up to 83 bytes, thank you very much for the link.

I refer to  Open assets spec.

OAP marker is 2 bytes,
version number is 2 bytes,
Asset quantity count (varint) minimum 1 byte.

It looks like we can fit 35 assets into one Open Asset transaction, it each asset quantity field takes up one byte. (for OP_RETURN limit of 40 bytes
full member
Activity: 198
Merit: 130
Some random software engineer
According to https://en.bitcoin.it/wiki/Colored_Coins#Open_Assets, it is a slightly more complex than this. The "6 bytes header" is not a 6 bytes header because the asset quantity count is a varint (a varint can have a size of 1, 3, 5 or 9). Also, you have a dynamically sized footer with another varint.

Please take a look at the Open assets spec. You have all headers & footer fields described. Also, please note that the asset quantity list is a LEB128 encoded field. LEB128 is a compression algorithm to store a large number of small integers.

Please also note the OP_RETURN now accepts up to 83 bytes: https://github.com/bitcoin/bitcoin/blob/master/src/script/standard.h#L34.
jr. member
Activity: 113
Merit: 5
In Bitcoin transaction, it can have multiple vin and vout. In vout, it contains bitcoin script. In bitcoin script, the OP_RETURN contains payload, the payload is used to store Open Asset asset id and quantity (see https://en.bitcoin.it/wiki/Colored_Coins#Open_Assets). The encoding is based on LEB128.

OP_RETURN has 40 byte limit. There is a request to increase the size limit to 80 bytes.

"Previously, a single transaction could send assets to up to 34 distinct recipients. After the change, it will be able to send assets to up to 74 recipients". (see http://blog.coinprism.com/2015/02/11/80-bytes-op-return/)

Is the limit of 34 distinct recipient because the header of Open Asset is 6 bytes, so 40-6 = 34 ?

Jump to: