last update: Oct 12th 2023 Main_Menu



Example Transaction Serialization Comparison of an Evrmore P2PKH Asset Transfer versus a Bitcoin Legacy P2PKH Transaction


Bitcoin 2-Input & 2-Output Legacy Transaction

Evrmore 2-Input (EVR + Asset) & 2-Output (EVR + Asset Transfer) Transaction

Transaction Description
Input
From_Addr
50 mBTC
A
50 mBTC
B


Output
To_Addr
48 mBTC
C
50 mBTC
D


Transaction Description
Input
From_Addr
50 EVR
A
1 Asset named HANS
B


Output
To_Addr
48 EVR
C
1 Asset named HANS
D


Transaction Serialization
version 02 00 00 00
input count 02
input #0 previous output hash
(reversed)
32-byte reversed Transaction ID of the UTXO
previous output index 00 00 00 00
script length
scriptSig script containing signature
sequence ff ff ff ff
input #1 previous output hash
(reversed)
32-byte reversed Transaction ID of the UTXO
previous output index 00 00 00 00
script length
scriptSig script containing signature
sequence ff ff ff ff
output count 02
output #0 value (reversed) 00 3e 49 00 00 00 00 00
script length
scriptPubKey unlocking script
output #1 value (reversed) 40 4b 4c 00 00 00 00 00
script length
scriptPubKey unlocking script
block lock time 00 00 00 00


Transaction Serialization
version 02 00 00 00
input count 02
input #0 previous output hash
(reversed)
32-byte reversed Transaction ID of the UTXO
previous output index 00 00 00 00
script length
scriptSig script containing signature
sequence ff ff ff ff
input #1 previous output hash
(reversed)
32-byte reversed Transaction ID of the UTXO
previous output index 00 00 00 00
script length
scriptSig script containing signature
sequence ff ff ff ff
output count 02
output #0 value (reversed) 00 3e 49 00 00 00 00 00
script length
scriptPubKey unlocking script
output #1 value (reversed) 00 00 00 00 00 00 00 00
script length
scriptPubKey
unlocking script
asset operation script
block lock time 00 00 00 00

Note that nothing changed except the scriptPubKey in output #1

Serialization of Bitcoin Output #1:

Unlocking Script: Description Length Hex Value Example
OP_DUP 1 byte
76
OP_HASH160 1 byte a9
PUSHDATA 14 1 byte 14
public key hash 20 bytes
c8 e9 09 96 c7 c6 08 0e e0 62 84 60 0c 68 4e d9 04 d1 4c 5c
OP_EQUALVERIFY 1 byte
88
OP_CHECKSIG 1 byte
ac


For Bitcoin at the transaction level, (Sum of BTC input amounts)-(Sum of BTC output amounts)=(The transaction fee paid to the miner)




The additional Asset script is attached to the UTXO in Evrmore after the unlocking script as shown to the right ===>>>

Serialization of Evrmore Asset Transfer Output #1:

Unlocking Script: Description Length Hex Value Example
OP_DUP 1 byte
76
OP_HASH160 1 byte a9
PUSHDATA 14 1 byte 14
public key hash 20 bytes
c8 e9 09 96 c7 c6 08 0e e0 62 84 60 0c 68 4e d9 04 d1 4c 5c
OP_EQUALVERIFY 1 byte
88
OP_CHECKSIG 1 byte
ac
Asset Script: Description  Length 
Hex Value Example
OP_EVR_ASSET 1 byte
c0
Either:
a) The number (#) of bytes below not counting OP_DROP (if #<=75)
or
b) 0x4c followed by the number (#) of bytes below not counting OP_DROP (if #>75)
1 or 2 bytes
4F
Asset_type Header("evr" in ASCII) 3 bytes
657672
Asset operation type: transfer(t)=74 1 byte
74
Bytelength of Asset_Name 1 byte
04
Asset_Name:
root_asset, root_asset!, root/subasset, root#unique, $restricted_asset, #qualifier, #qualifier/#subqualifier
>=3 and <=30 bytes not including the owner asset ! 48 41 4e 53
8 Bytes of Little Endian hex: Amount of assets in satoshis 8 bytes
00 e1 f5 05 00 00 00 00
userdata Type (usually 0x12 or 0x54)
1 byte
userdata Length (usually 0x20)
1 byte
userdata; usually:
   IPFS_base58_converted_to_hex (type=0x12)
or Transaction_Hash_ID (type=0x54)
32 bytes max
optional;
variable (max 34 bytes)
1220c9ae8712366f46a43e
7403e50d1967f2f068d6f42c
c65f742edc0cc1706c109f

  (equivalent to Qmbuw1XZV8i4uFucmKSSYH7
gGhD5B1B1NPMseh9tp5hgea)
userdata Expiry Time (UTC Unix timestamp format)
optional;
8 bytes
00000000625a168a
OP_DROP 1 byte
75


For Evrmore at the transaction level, (Sum of EVR input amounts)-(Sum of EVR output amounts)=(The transaction fee paid to the miner)
AND
Evrmore requires by consensus that (Sum of Asset input amounts for each Asset by name)= (Sum of Asset output amounts for each Asset by name) except in asset creation/reissue transactions.






For additional Asset protocol information please check HERE and HERE




Copyright 2023 by Hans Schmidt