Questions tagged [encoding]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
49 views

RLP decoding on tezos

I have a code where a string "TEST" is encoded using RLP, https://smartpy.io/ide?cid=QmNVpo55Ss43aZiyrkdbEWcmmQEAsR2qHLKsPcLbqie7yu&k=8d516a673d972f3204f0 How do we decode the obtained ...
Kin's user avatar
  • 184
0 votes
1 answer
59 views

big endian order in smartpy

def tb(l): return b''.join(map(lambda x: x.to_bytes(1, 'big'), l)) The above function takes a list of number and is being converted into bytes, and the returned value is used this way, base58....
Kin's user avatar
  • 184
1 vote
1 answer
56 views

RLP encoding on tezos

How can we achieve rlp encoding on tezos ? Does smartpy or any other language supports rlp encoding on tezos ?
Kin's user avatar
  • 184
2 votes
1 answer
30 views

How to use the pytezos.crypto.encoding.base58_encode function?

i'm trying to use the pytezos.crypto.key library. But i miss something giving the Key object my public key as an argument. Here my code : encoded_key=pytezos.crypto.encoding.base58_encode(bytearray(b'...
achille1017's user avatar
2 votes
2 answers
87 views

encoding of addresses in optimized micheline representation

While examining the json rpc response I encountered a transaction inside of "internal_operation_results" which has parameters (its inside of a tokenToCash contract call). Addresses specified ...
DEVensiv's user avatar
2 votes
2 answers
174 views

How do you convert a string sent to an entrypoint into its byte representation?

I want to turn a string into the 0x byte format inside an entrypoint. If I try to use sp.pack() the actual value I want gets prepended with pack instructions as detailed here I'm looking for a runtime ...
0x10's user avatar
  • 359
2 votes
1 answer
99 views

Why does `sp.pack('some string')` prepend `0x05010000002e` before the actual bytes?

If I pass in the string QmbPAr5RcCZZDRsNKnf2p1t6GK3Qu7oDH39HCK3aewUq3w to the sp.pack method in an entrypoint and perform and sp.trace in smartpy I expect to get the following bytes: ...
0x10's user avatar
  • 359
7 votes
2 answers
486 views

How to convert bytes to an address

When reading operations from a block, implicit accounts and contracts are returned with a key bytes and in hexadecimal format. "parameters": { "entrypoint": "transfer"...
MCH's user avatar
  • 690
1 vote
0 answers
62 views

How to decode the contents of a block using `tezos-codec`

How do I extract the operations from a block using tezos-codec? I can decode the block header as follows below, but I'm interested in seeing the contents of the block. export BLOCK="...
Jev Björsell's user avatar
4 votes
1 answer
103 views

Documentation for Serializing Contract Call Data/Parameters

Is there any documentation available for how to serialize contract call parameters? I found good documentation for serialization of general operations and took a look at the tzips but neither seems ...
Felix Laufenberg's user avatar
5 votes
3 answers
649 views

How to decode raw transaction?

I am using @taquito to build and sign a transaction. But before I send it I want to decode it to check my destination address, amount etc like you would normally do for other blockchains. Not sure ...
coder123's user avatar
  • 157
5 votes
0 answers
38 views

How to encode a transaction offline? [duplicate]

I'm writing an offline signature program without rpc,i have to encode transaction into bytes and I want to know the encoding rules. What should the tag parameter fill in? Under what circumstances do ...
user11060058's user avatar
7 votes
3 answers
324 views

How do I base58 encode the chain ID using Python?

When Tezos needs to sign a baking or endorsement operation payload, byte 0 will be a 0x01 for a baking operation or 0x02 for an endorsement operation. Bytes 1-5 in the operation payload contain the ...
Luke Youngblood's user avatar
7 votes
3 answers
1k views

Format of public key, signature and key_hash literals

According to grammar present in Michelson specification, there are string constants for types signature, key, key_hash. What is the precise format of these strings? Specifically: Suppose I have a key ...
Ivan Gromakovskii's user avatar
4 votes
1 answer
530 views

Contract's address format specification

Is there a specification somewhere which explains how to compute a human-readable address of a contract? In order to originate a contract I need to provide its code, initial storage value and some ...
Ivan Gromakovskii's user avatar
8 votes
2 answers
622 views

Base58 encoding/decoding of addresses in Micheline

who know some javascript library for decoding optimized Micheline representation of an address value? 011cd5f135e80fd8ebb6e43335b24ca6116edeba6900 => KT1BDEn6wobs7tDReKkGheXAhoq278TGaNn5
Михаил Магомедов's user avatar