Hot answers tagged

3 votes
Accepted

How are sets serialized in Tezos?

Sets are serialized by first ordering the elements, and then packing them as a sequence which is also how lists are represented when PACK is called. This means that these two expressions evaluate to ...
2 votes

How to call PACK in JavaScript

Taquito has this functionality: the packData method in the RPC client package.
1 vote
Accepted

Why does unpacking a record that has a key containing bounded data fail with `to_value sp.TBounded` in smartpy?

It is unsafe without a dynamic check. We need to determine what the most natural and/or appropriate decision is (very possibly: continue forbidding it).
  • 3,240
1 vote
Accepted

Packing and signing a payload in Taquito

The layout is probably wrong. Make sure you use the same record layout in both locations. toSign = sp.set_type_expr( sp.record( chain = sp.chain_id, contract = sp....
1 vote
Accepted

How are pairs serialized in Tezos?

Here is a break down: 05: all michelson values are tagged with the prefix 0x05 (ref). 07: the first tag denotes the micheline constructor. Pair 1 2 is a primitive application with 2 arguments and no ...
  • 2,378
1 vote
Accepted

How are strings serialized in Tezos?

Strings are serialized as follows: 01 to indicate type string Four bytes (eight hex chars) to indicate length of string: 0000000c=0x0c=12 in your case The string represented by its ASCII values: ...
1 vote
Accepted

How are integers serialized in Tezos?

The 05 prefix indicates that this serialization comes from the PACK assembly instruction, and the next byte 00 in case of integers (nat, int, and tez) indicates that the type is integer. So the ...

Only top scored, non community-wiki answers of a minimum length are eligible