Bitcoin Forum
May 06, 2024, 07:06:39 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin transaction and Open Asset Protocol  (Read 115 times)
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
March 30, 2018, 09:15:06 AM
Merited by ABCbits (1)
 #1

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 ?

I HATE TABLES I HATE TABLES I HA(╯°□°)╯︵ ┻━┻ TABLES I HATE TABLES I HATE TABLES
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
March 30, 2018, 09:30:58 AM
Last edit: March 30, 2018, 09:43:34 AM by starmyc
Merited by ABCbits (2)
 #2

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.

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
March 30, 2018, 09: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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!