Skip to main content
Share Your Experience: Take the 2024 Developer Survey
18 votes
Accepted

Why did the project settle on XDR for external data serialisation?

This was not an easy choice indeed. It sounded weird at first to use something like XDR but it ended up winning compared to others for a few reasons: there is an RFC and it's extremely simple. The ...
MonsieurNicolas's user avatar
6 votes
Accepted

Convert XDR to text

XDR is a binary encoding of structured data. It is represented as a base 64 encoded String in transaction responses. Some options: You can decode base 64 encoded XDR using the laboratory. The ...
Synesso's user avatar
  • 3,367
5 votes
Accepted

Extra 0 byte at end of MemoText String

I believe that is the extra padding bytes set so that the length is a multiple of 4. From the RFC 4506 (a.k.a. the XDR Spec): The standard defines a string of n (numbered 0 through n-1) ASCII bytes ...
Francesco's user avatar
  • 1,386
5 votes
Accepted

How can I convert the built 'transaction' in XDR format?

Given transaction is a Transaction object then this will give you base64 encoded XDR: transaction.toEnvelope().toXDR().toString("base64")
Bartek Nowotarski's user avatar
4 votes
Accepted

How can I decode Ed25519 addresses to the regular 56 letters format?

Start with 32 bytes Add a byte of 0x30 as prefix 'G' (now you have 33 bytes) Calculate the checksum (two bytes) Add the checksum as suffix (now you have 35 bytes) Convert them to base32 That's your ...
Kuyawa's user avatar
  • 1,328
3 votes
Accepted

How to rehydrate a transaction serialized in XDR to a transaction object that can be signed and submitted, with the JavaScript sdk?

You pass it directly in the constructor. This is described in the doc you linked to: Parameters: envelope string | xdr.TransactionEnvelope So do this: // `transactionXDR` is a string from the ...
ire_and_curses's user avatar
3 votes

How to get base64 envelope for transactions or operations?

I already found out, just needed to add 'base64' as a parameter: transaction.toEnvelope().toXDR('base64')
Kuyawa's user avatar
  • 1,328
3 votes
Accepted

How to serialize, send over network, deserialize a transaction envelope for multiple signatures?

The first serialization can be done via: const base64str = transaction.toEnvelope().toXDR().toString('base64') Then you have a base64 encoded string that can be safely transmitted over the network. ...
phra's user avatar
  • 161
3 votes
Accepted

How to Build transaction XDR before sign it

I'm just going to guess here, since I don't do golang, but if you look at what Sign does, can't you just copy that implementation yourself, and skip the signing part? I.e., func (b *...
Johan Stén's user avatar
  • 1,947
3 votes

How do I get the public keys from a transaction javascript

I'd let the SDK decode the XDR for you, and take it from there. const tx = new StellarSdk.Transaction(tx_xdr); From here on you have the source accounts in tx.source and tx.operations[i].source, for ...
Johan Stén's user avatar
  • 1,947
3 votes
Accepted

Error when including 2 deps that both have stellar-base as a subdependency

I know that you got the answer on github, but for anyone else looking I'll link it here: https://github.com/stellar/js-stellar-sdk/issues/191 This is fixed in: [email protected] [email protected] ...
umbrel's user avatar
  • 938
2 votes

Why Stellar has totalCoins in every ledger header?

Total number of all XLM is not a constant. Every week the built-in inflation mechanism distributes new lumens. You can find detailed information here.
Orbit Lens's user avatar
  • 6,886
2 votes
Accepted

How can I see actual transactions in the blockchain?

All the transactions are encoded into XDR format (External Data Representation). Horizon decodes it and displays all the transactions in a readable format (JSON). In order to inspect the Stellar ...
pantheon52's user avatar
2 votes
Accepted

Add and remove multiple signers in one transaction

You are looking at the SetOptionsOp, that's an operation contract. A transaction can include up to 100 operations (this constant may be changed in the future). Therefore you can atomically add up to ...
Orbit Lens's user avatar
  • 6,886
1 vote
Accepted

xdrlib.Error: value=-915689825 not in enum ClaimableBalanceIDType, when I try to claim the created balance

def get_balance_id(create_claimable_balance_resp): effects_link = create_claimable_balance_resp["_links"]["effects"]["href"].split("{")[0] resp = ...
tenshi's user avatar
  • 111
1 vote

How can I get the value of the Stellar Transaction?

At first, I recommend you read this article, which describes the composition of a transaction. Hope this example helps. from stellar_sdk import TransactionEnvelope, Network, TextMemo, IdMemo, ...
overcat's user avatar
  • 91
1 vote

How can I get the value of the Stellar Transaction?

A stellar transaction consists of one or more operations such as payment, createAccount, setOptions. I'm not familiar with python-sdk but I think like in other sdk's the transaction object should ...
sui's user avatar
  • 2,534
1 vote

How to decode sellingasset and buyingasset in python

get it! xdrstr='AAAAAVNMVAAAAAAAlA8rrxQ89pexgEv3wGm0Tu9RxisitWx4ONyNc5Xn7qg=' tx_result = Xdr.StellarXDRUnpacker(base64.b64decode(xdrstr)).unpack_Asset()
Brian Mo's user avatar
1 vote
Accepted

Do transactions store information on when they were created?

The transaction can optionally contain timebounds, placing a lower and upper bound on when it may be executed. However, if you want to know whether and exactly when the transaction was executed, you ...
user3188445's user avatar
  • 1,221
1 vote

How to extract transaction hash out of XDR using Java Script?

If it's a transaction you have, and not a transaction envelope, then the transaction hash is formed using the XDR directly. const envelopeType = StellarSdk.xdr.EnvelopeType.envelopeTypeTx().toXDR(); ...
Johan Stén's user avatar
  • 1,947
1 vote

Getting error "XDR Write Error: undefined is not a Hyper" when trying to create XDR for custom operation

You should debug the XDR serialisation stage. Something that should be a 64-bit integer is null. The one hint you get is that the field type is Hyper. This refers to 64-bit signed or unsigned integers ...
Synesso's user avatar
  • 3,367
1 vote
Accepted

How to decode stellar XDR

var txe xdr.Transaction err = xdr.SafeUnmarshalBase64(TDP.XDR, &txe) if err != nil { fmt.Println(err) } You can use above code to Unmarshal Base64 XDR. And using &txe you can retrieve ...
Sharmilan's user avatar
  • 421
1 vote

How to Build transaction XDR before sign it

I have some examples for that in my kotlin library that wraps the java sdk. data class PreparedTransaction(val transactionHash: String, val transactionEnvelopeXdr: String) fun ...
Jilles van Gurp's user avatar
1 vote

How does Java parse XDR information?

I have just written a patch for the Java SDK to deserialize TransactionEnvelope XDR. https://github.com/stellar/java-stellar-sdk/pull/117 If you can wait, hopefully it will be approved and merged. ...
Synesso's user avatar
  • 3,367
1 vote

How does Java parse XDR information?

To get the last transactions you can make a request to an Horizon server, if you don't have one you can use public horizon server (horizon.stellar.org) but its limited. For query transactions you ...
AndreaBorio's user avatar
1 vote
Accepted

Why does the first ledgers xdr file contains only 63 ledgers?

Answer from official doc: Checkpoints are made once every 64 ledgers, at ledger sequence numbers that are one-less-than a multiple of 64. Checkpoints are where a new ledger-headers file is born, ...
cesarm's user avatar
  • 1,527
1 vote
Accepted

ELI5: The XDR format

Option 1 is correct. There is a serialisation layer used to pack the data into a strict format before base 64 encoding. The XDR serde libraries used by the core SDKs are generated by running this ...
Synesso's user avatar
  • 3,367
1 vote

How to serialize, send over network, deserialize a transaction envelope for multiple signatures?

Encoding: You can serialize the transaction by first converting to XDR (which is a binary format) and then converting to a base64 string so it can be sent over the wire. // sign with empty signature ...
nikhils's user avatar
  • 1,080
1 vote
Accepted

Are the stellar history (XDR) files available in other regions or on other cloud providers

We don't have any other official history archived besides history.stellar.org, although we do plan to add more at some point in the future. We're also hoping others will step up and host history ...
Scott Fleckenstein's user avatar

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