Uploaded by bolsheviks ren

HG-Protocol

advertisement
1. What is the HG Protocol
The HG Protocol is a ledger agreement based on BTC; It does not rely on UTXO, isolation
witnessing, or taproot; Even without the aforementioned items, we can still issue assets
or transfer them at BTC;
2. Why HG Protocol
2.1. why HG Protocol
We think that all we do is innovation, and of course we respect all our predecessors.
However, we need safer, simpler, and better asset protocols.
There is no doubt that HG Protocol is like this.
We will provide a comparison with various protocols next, which will help everyone
understand HG Protocol.
Mint Technique
Validation
Address
Rely
BRC-20
ARC-20
HGP
inscribe
bitwork
bitwork
normal
normal
Validation currently through
Validation currently
alidation currently
the indexing service "ord" -
through the indexing
through the indexing
in theory it's possible to
service "electrumx" - in
service "hgp-index" - in
validate 100% client-side.
theory it's possible to
theory it's possible to
validate 100%
validate 100%
client-side.
client-side.
P2TR (Taproot) addresses are
P2TR (Taproot)
All addresses except MS
required for all uses such as
addresses required for
mint and transfers
mint and updates.
taproot
taproot
witness
witness
pkscript
ordinals
Swaps
Balance
Partially Signed Bitcoin
Partially Signed Bitcoin
Partially Signed Bitcoin
Transactions (PBSTs)
Transactions (PBSTs)
Transactions (PBSTs)
Transferable
Balance
Balance
Available
Cheque
Transfer
2 step
1 step
1 step
3. HG Protocol Technical
Here we will introduce the basic implementation and concepts of the protocol
3.1. HG Protocol format
The protocol format of HG Protocol may not be the most concise, but it is very easy to
read, which is more conducive for users to read their own records from the block
explorer.
OP_RETURN
OP_PUSHBYTES_3 686770
#"hgp"
OP_PUSHBYTES_n ....
# input index
OP_PUSHBYTES_n ....
# output index
OP_PUSHBYTES_n ....
# opcode
OP_PUSHBYTES_3 ....
#token name 3 - 8 char
OP_PUSHBYTES param_0
....
PUSHBYTES param_n
The first is OP_RETURN and the protocol header.
Then, We need to determine from and to from inputs[input index] and outputs[output
index].
Determine user operations through opcode, asset name determines the asset of the
operation.
Finally, there are various parameters, which vary according to the change of opcode.
3.1.1. OPCODES
OPCODE
name
params
0
deploy
0
is need bitwork 0 or !0
1
per mint limit
2
total supply
3
mint start block
4
mint end block
5
bitwork(hex) prefix
0
mint amount
1
bitwork nonce
1
mint
2
transfer
0
transfer amount
3
cheque
0
cheque amount
4
cash
None
5
execute
None
3.2. Deploy
An asset deployment is deployed here, and the deployer is address_1.
3.2.1. normal
Ordinary asset issuance does not require bitwork. The starting and ending blocks are
both 0, and the total supply is specified. This kind of asset mintd ends when the total
supply is reached.
3.2.2. Specify start and end block
This asset can only be minted between block start and end, and is constrained by the
total supply, if the total supply is not 0.
3.2.3. bitwork
Bitwork's assets are defined and need to receive additional constraints from bitwork, that
is, mint's transaction hash prefix needs to meet the conditions.
3.3. Mint
1000 HGP is minted here to address_1.
address_1 hgp balance += 1000.
3.4. Transfer
1000hgp was transferred from address_0 to address_1.
address_0 hgp balance -= 1000
address_1 hgp balance += 1000
3.5. Cheque
address_1 received 1 check containing 1000HGP assets.
address_0 hgp balance -= 1000
address_0 hgp cheque_balance will not change
address_1 hgp balance will not change
address_1 hgp cheque_balance += 1000
3.6. Cash
First of all, let's assume that there is 1000HGP in this check, which can also be other
assets.
address_1 received a 1000 cash withdrawal from the check , input[0] must be avalid
check.
address_0 hgp balance will not change
address_0 hgp cheque_balance -= 1000
address_1 hgp balance += 1000
address_1 hgp cheque_balance will not change
3.7. Market
Marketis actually a cheque for exchange, which involves two steps
Step 1: Write yourself a cheque
Step 2: Withdraw the cheque to build a psbt , then other the other party uses BTC to pay
4. warning



At any time, do not point the output id to incorrect output, such as MS Script, as
this will cause your assets to burn out
Interestingly, if the length of the outputs is less than the output ID you specified,
your assets will not undergo any changes
When you make an incorrect operation on a check, your check will be refunded
to the balance
Download